From 47052f7445316e49dff631c91c5967ea7a60b486 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 23 Mar 2023 11:15:51 +0800 Subject: [PATCH 1/3] 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') From 2130f3d826dbb4e156f02acc680596091a1b4ce8 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 23 Mar 2023 11:19:46 +0800 Subject: [PATCH 2/3] remove optional --- openpype/hosts/max/plugins/publish/increment_workfile_version.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/max/plugins/publish/increment_workfile_version.py b/openpype/hosts/max/plugins/publish/increment_workfile_version.py index eda8cd7677..7b4f4e238d 100644 --- a/openpype/hosts/max/plugins/publish/increment_workfile_version.py +++ b/openpype/hosts/max/plugins/publish/increment_workfile_version.py @@ -8,7 +8,6 @@ class IncrementWorkfileVersion(pyblish.api.ContextPlugin): order = pyblish.api.IntegratorOrder + 0.9 label = "Increment Workfile Version" - optional = True hosts = ["max"] families = ["workfile"] From 81b659e933591e3fbabc9ea1b57ce99a25ef5396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 23 Mar 2023 12:06:01 +0100 Subject: [PATCH 3/3] Update openpype/hosts/max/plugins/publish/increment_workfile_version.py --- .../hosts/max/plugins/publish/increment_workfile_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/max/plugins/publish/increment_workfile_version.py b/openpype/hosts/max/plugins/publish/increment_workfile_version.py index 7b4f4e238d..3dec214f77 100644 --- a/openpype/hosts/max/plugins/publish/increment_workfile_version.py +++ b/openpype/hosts/max/plugins/publish/increment_workfile_version.py @@ -16,4 +16,4 @@ class IncrementWorkfileVersion(pyblish.api.ContextPlugin): filepath = version_up(path) rt.saveMaxFile(filepath) - self.log.info('Incrementing file version') + self.log.info("Incrementing file version")