Skip to content

increment_workfile_version

IncrementWorkfileVersion

Bases: ContextPlugin

Increment current workfile version.

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

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

    settings_category = "tvpaint"

    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"]
        host.save_workfile(version_up(path))
        self.log.info('Incrementing workfile version')