Skip to content

validate_timeline

ValidateSegments

Bases: OptionalPyblishPluginMixin, ContextPlugin

Validate timeline segments attributes.

Source code in client/ayon_flame/plugins/publish/validate_timeline.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class ValidateSegments(
    OptionalPyblishPluginMixin,
    pyblish.api.ContextPlugin
):
    """Validate timeline segments attributes."""

    label = "Validate Timeline Segments"
    order = pyblish.api.ValidatorOrder
    settings_category = "flame"

    optional = True
    active = False

    actions = [ShowSegmentsRed, HideSegments]

    def process(self, context):
        failed_segments = context.data.get("failedSegments")
        if not failed_segments:
            return

        msg = "Timeline Clips failing validation:"
        msg_html = self.get_description()
        for segment in failed_segments:
            shot_name = segment.shot_name.get_value()
            segment_name = segment.name.get_value()
            clip_msg = (
                f"Clip name: '{segment_name}' with shot name: '{shot_name}'")
            msg += f"\n{clip_msg}"

            msg_html += f"<br/> - {clip_msg}"

        raise PublishValidationError(
            title="Missing correct segments attributes",
            message=msg,
            description=msg_html
        )

    def get_description(self):
        return inspect.cleandoc("""
            ## Following clips are failing validation:
            <br/>
            Make sure your clips on timeline are not converted to BatchFX
            or are not Hard Committed. This way they will lose their link to
            the original Media source file path and we are not able
            to publish them anymore.
            <br/><br/>
            <b>Following clips are failing validation:</b>
        """)