mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
raise PublishXmlValidationError in validate start frame
This commit is contained in:
parent
f99036eb1d
commit
df9e30eb7f
2 changed files with 25 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
@ -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
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue