From d6be6b0182f84fe746ae00d09e697db937ab6796 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 25 Jan 2022 15:14:21 +0100 Subject: [PATCH 1/5] Added CollectSceneVersion to Settings --- .../defaults/project_settings/global.json | 18 ++++++++++++++++ .../schemas/schema_global_publish.json | 21 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index cff1259c98..3b5bb06267 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -3,6 +3,24 @@ "CollectAnatomyInstanceData": { "follow_workfile_version": false }, + "CollectSceneVersion": { + "hosts": [ + "aftereffects", + "blender", + "celaction", + "fusion", + "harmony", + "hiero", + "houdini", + "maya", + "nuke", + "photoshop", + "resolve", + "tvpaint" + ], + "skip_hosts_headless_publish": [ + ] + }, "ValidateEditorialAssetName": { "enabled": true, "optional": false diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json index d146f3cf15..3f9776bcd6 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json @@ -18,6 +18,27 @@ } ] }, + { + "type": "dict", + "collapsible": true, + "key": "CollectSceneVersion", + "label": "Collect Version from Workfile", + "is_group": true, + "children": [ + { + "key": "hosts", + "label": "Host names", + "type": "hosts-enum", + "multiselection": true + }, + { + "key": "skip_hosts_headless_publish", + "label": "Skip for host if headless publish", + "type": "hosts-enum", + "multiselection": true + } + ] + }, { "type": "dict", "collapsible": true, From 676dce041abe1335bdbe2fdd94147c949e2f426a Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 25 Jan 2022 15:15:57 +0100 Subject: [PATCH 2/5] Added possibility to skip version collecting Useful for headless publishing via webpublisher. Currently applicable only for Photoshop studio processing. --- openpype/plugins/publish/collect_scene_version.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openpype/plugins/publish/collect_scene_version.py b/openpype/plugins/publish/collect_scene_version.py index 8ed6e25e66..56a6e3fb46 100644 --- a/openpype/plugins/publish/collect_scene_version.py +++ b/openpype/plugins/publish/collect_scene_version.py @@ -11,6 +11,7 @@ class CollectSceneVersion(pyblish.api.ContextPlugin): order = pyblish.api.CollectorOrder label = 'Collect Scene Version' + # configurable in Settings hosts = [ "aftereffects", "blender", @@ -26,7 +27,20 @@ class CollectSceneVersion(pyblish.api.ContextPlugin): "tvpaint" ] + # in some cases of headless publishing (for example webpublisher using PS) + # you want to ignore version from name and let integrate use next version + skip_hosts_headless_publish = [ + + ] + def process(self, context): + # tests should be close to regular publish as possible + if (context.data["hostName"] in self.skip_hosts_headless_publish + and os.environ.get("HEADLESS_PUBLISH") + and not os.environ.get("IS_TEST")): + self.log.debug("Skipping for headless publishing") + return + assert context.data.get('currentFile'), "Cannot get current file" filename = os.path.basename(context.data.get('currentFile')) From 4c695d9ebc2ad26fde6257be7931f517cfb7d818 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 25 Jan 2022 15:24:52 +0100 Subject: [PATCH 3/5] Added mentioning HEADLESS_PUBLISH in readme for integration tests --- tests/integration/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration/README.md b/tests/integration/README.md index 0b6a1804ae..eef8141127 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -5,6 +5,9 @@ Contains end-to-end tests for automatic testing of OP. Should run headless publish on all hosts to check basic publish use cases automatically to limit regression issues. +Uses env var `HEADLESS_PUBLISH` (set in test data zip files) to differentiate between regular publish +and "automated" one. + How to run ---------- - activate `{OPENPYPE_ROOT}/.venv` From 69bfcd6a305f976b3f4ee5f3f36c9e1ed2acbadb Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 31 Jan 2022 10:45:18 +0100 Subject: [PATCH 4/5] Update openpype/plugins/publish/collect_scene_version.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/plugins/publish/collect_scene_version.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openpype/plugins/publish/collect_scene_version.py b/openpype/plugins/publish/collect_scene_version.py index 56a6e3fb46..a81e85c1f5 100644 --- a/openpype/plugins/publish/collect_scene_version.py +++ b/openpype/plugins/publish/collect_scene_version.py @@ -35,9 +35,10 @@ class CollectSceneVersion(pyblish.api.ContextPlugin): def process(self, context): # tests should be close to regular publish as possible - if (context.data["hostName"] in self.skip_hosts_headless_publish - and os.environ.get("HEADLESS_PUBLISH") - and not os.environ.get("IS_TEST")): + if ( + os.environ.get("HEADLESS_PUBLISH") + and not os.environ.get("IS_TEST") + and context.data["hostName"] in self.skip_hosts_headless_publish): self.log.debug("Skipping for headless publishing") return From 336585bbc92001ae3d942cfd3092839a095195c0 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 31 Jan 2022 10:48:11 +0100 Subject: [PATCH 5/5] Update openpype/plugins/publish/collect_scene_version.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/plugins/publish/collect_scene_version.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openpype/plugins/publish/collect_scene_version.py b/openpype/plugins/publish/collect_scene_version.py index a81e85c1f5..917647c61a 100644 --- a/openpype/plugins/publish/collect_scene_version.py +++ b/openpype/plugins/publish/collect_scene_version.py @@ -29,9 +29,7 @@ class CollectSceneVersion(pyblish.api.ContextPlugin): # in some cases of headless publishing (for example webpublisher using PS) # you want to ignore version from name and let integrate use next version - skip_hosts_headless_publish = [ - - ] + skip_hosts_headless_publish = [] def process(self, context): # tests should be close to regular publish as possible