Skip to content

validate_start_frame

RepairStartFrame

Bases: Action

Repair start frame.

Source code in client/ayon_tvpaint/plugins/publish/validate_start_frame.py
 9
10
11
12
13
14
15
16
17
class RepairStartFrame(pyblish.api.Action):
    """Repair start frame."""

    label = "Repair"
    icon = "wrench"
    on = "failed"

    def process(self, context, plugin):
        execute_george("tv_startframe 0")

ValidateStartFrame

Bases: OptionalPyblishPluginMixin, ContextPlugin

Validate start frame being at frame 0.

Source code in client/ayon_tvpaint/plugins/publish/validate_start_frame.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class ValidateStartFrame(
    OptionalPyblishPluginMixin,
    pyblish.api.ContextPlugin
):
    """Validate start frame being at frame 0."""

    label = "Validate Start Frame"
    order = pyblish.api.ValidatorOrder
    hosts = ["tvpaint"]
    actions = [RepairStartFrame]

    settings_category = "tvpaint"
    optional = True

    def process(self, context):
        if not self.is_active(context.data):
            return

        start_frame = execute_george("tv_startframe")
        if start_frame == 0:
            return

        raise PublishXmlValidationError(
            self,
            "Start frame has to be frame 0.",
            formatting_data={
                "current_start_frame": start_frame
            }
        )