From 47052f7445316e49dff631c91c5967ea7a60b486 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 23 Mar 2023 11:15:51 +0800 Subject: [PATCH] incrment workfile version --- .../publish/increment_workfile_version.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 openpype/hosts/max/plugins/publish/increment_workfile_version.py diff --git a/openpype/hosts/max/plugins/publish/increment_workfile_version.py b/openpype/hosts/max/plugins/publish/increment_workfile_version.py new file mode 100644 index 0000000000..eda8cd7677 --- /dev/null +++ b/openpype/hosts/max/plugins/publish/increment_workfile_version.py @@ -0,0 +1,20 @@ +import pyblish.api +from openpype.lib import version_up +from pymxs import runtime as rt + + +class IncrementWorkfileVersion(pyblish.api.ContextPlugin): + """Increment current workfile version.""" + + order = pyblish.api.IntegratorOrder + 0.9 + label = "Increment Workfile Version" + optional = True + hosts = ["max"] + families = ["workfile"] + + def process(self, context): + path = context.data["currentFile"] + filepath = version_up(path) + + rt.saveMaxFile(filepath) + self.log.info('Incrementing file version')