mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
added validator for checking start frame
This commit is contained in:
parent
f079508c20
commit
2b38639f9e
1 changed files with 27 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
import pyblish.api
|
||||
from avalon.tvpaint import lib
|
||||
|
||||
|
||||
class RepairStartFrame(pyblish.api.Action):
|
||||
"""Repair start frame."""
|
||||
|
||||
label = "Repair"
|
||||
icon = "wrench"
|
||||
on = "failed"
|
||||
|
||||
def process(self, context, plugin):
|
||||
lib.execute_george("tv_startframe 0")
|
||||
|
||||
|
||||
class ValidateStartFrame(pyblish.api.ContextPlugin):
|
||||
"""Validate start frame being at frame 0."""
|
||||
|
||||
label = "Validate Start Frame"
|
||||
order = pyblish.api.ValidatorOrder
|
||||
hosts = ["tvpaint"]
|
||||
actions = [RepairStartFrame]
|
||||
optional = True
|
||||
|
||||
def process(self, context):
|
||||
start_frame = lib.execute_george("tv_startframe")
|
||||
assert int(start_frame) == 0, "Start frame has to be frame 0."
|
||||
Loading…
Add table
Add a link
Reference in a new issue