Skip to content

increment_workfile

IncrementWorkfileVersion

Bases: ContextPlugin

Increment current workfile version.

Source code in client/ayon_substancedesigner/plugins/publish/increment_workfile.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class IncrementWorkfileVersion(pyblish.api.ContextPlugin):
    """Increment current workfile version."""

    order = pyblish.api.IntegratorOrder + 1
    label = "Increment Workfile Version"
    optional = True
    hosts = ["substancedesigner"]

    def process(self, context):

        assert all(result["success"] for result in context.data["results"]), (
            "Publishing not successful so version is not increased.")

        host = registered_host()
        path = context.data["currentFile"]
        self.log.info(f"Incrementing current workfile to: {path}")
        host.save_workfile(version_up(path))