raise PublishXmlValidationError in validate start frame

This commit is contained in:
iLLiCiTiT 2021-12-22 13:33:11 +01:00
parent f99036eb1d
commit df9e30eb7f
2 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<error id="main">
<title>First frame</title>
<description>## MarkIn is not set to 0
MarkIn in your scene must start from 0 fram index but MarkIn is set to {current_start_frame}.
### How to repair?
You can modify MarkIn manually or hit the "Repair" button on the right which will change MarkIn to 0 (does not change MarkOut).
</description>
</error>
</root>

View file

@ -1,5 +1,6 @@
import pyblish.api
from avalon.tvpaint import lib
from openpype.pipeline import PublishXmlValidationError
class RepairStartFrame(pyblish.api.Action):
@ -24,4 +25,13 @@ class ValidateStartFrame(pyblish.api.ContextPlugin):
def process(self, context):
start_frame = lib.execute_george("tv_startframe")
assert int(start_frame) == 0, "Start frame has to be frame 0."
if start_frame == 0:
return
raise PublishXmlValidationError(
self,
"Start frame has to be frame 0.",
formatting_data={
"current_start_frame": start_frame
}
)