Skip to content

integrate_version_up_workfile

IntegrateVersionUpWorkfile

Bases: ContextPlugin, OptionalPyblishPluginMixin

Save as new workfile version

Source code in client/ayon_hiero/plugins/publish/integrate_version_up_workfile.py
 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 IntegrateVersionUpWorkfile(api.ContextPlugin,
                                 OptionalPyblishPluginMixin):
    """Save as new workfile version"""

    order = api.IntegratorOrder + 10.1
    label = "Version-up Workfile"
    hosts = ["hiero"]

    optional = True
    active = True

    def process(self, context):
        if not self.is_active(context.data):
            self.log.debug("Project workfile version up was skipped")
            return

        project = context.data["activeProject"]
        path = context.data.get("currentFile")
        new_path = version_up(path)

        if project:
            project.saveAs(new_path)

        self.log.info("Project workfile was versioned up")