Skip to content

validate_comp_saved

ValidateFusionCompSaved

Bases: ContextPlugin

Ensure current comp is saved

Source code in client/ayon_fusion/plugins/publish/validate_comp_saved.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class ValidateFusionCompSaved(pyblish.api.ContextPlugin):
    """Ensure current comp is saved"""

    order = pyblish.api.ValidatorOrder
    label = "Validate Comp Saved"
    families = ["render", "image"]
    hosts = ["fusion"]

    def process(self, context):

        comp = context.data.get("currentComp")
        assert comp, "Must have Comp object"
        attrs = comp.GetAttrs()

        filename = attrs["COMPS_FileName"]
        if not filename:
            raise PublishValidationError("Comp is not saved.",
                                         title=self.label)

        if not os.path.exists(filename):
            raise PublishValidationError(
                "Comp file does not exist: %s" % filename, title=self.label)

        if attrs["COMPB_Modified"]:
            self.log.warning("Comp is modified. Save your comp to ensure your "
                             "changes propagate correctly.")