diff --git a/openpype/plugins/publish/collect_scene_version.py b/openpype/plugins/publish/collect_scene_version.py index 8ed6e25e66..917647c61a 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,19 @@ 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 ( + 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 + assert context.data.get('currentFile'), "Cannot get current file" filename = os.path.basename(context.data.get('currentFile')) diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index 9c032a9cd6..9c0c6f6958 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, 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`