Added possibility to skip version collecting

Useful for headless publishing via webpublisher. Currently applicable only for Photoshop studio processing.
This commit is contained in:
Petr Kalis 2022-01-25 15:15:57 +01:00
parent d6be6b0182
commit 676dce041a

View file

@ -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'))