mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Fix Version follow up from Workfile set by hosts.
This commit is contained in:
parent
283465bbb7
commit
d25c4701d1
2 changed files with 20 additions and 2 deletions
|
|
@ -858,13 +858,24 @@ class Creator(BaseCreator):
|
|||
["CollectAnatomyInstanceData"]
|
||||
["follow_workfile_version"]
|
||||
)
|
||||
follow_version_hosts = (
|
||||
publish_settings
|
||||
["CollectSceneVersion"]
|
||||
["hosts"]
|
||||
)
|
||||
|
||||
current_host = create_ctx.host.name
|
||||
follow_workfile_version = (
|
||||
follow_workfile_version and
|
||||
current_host in follow_version_hosts
|
||||
)
|
||||
|
||||
# Gather version number provided from the instance.
|
||||
current_workfile = create_ctx.get_current_workfile_path()
|
||||
version = instance.get("version")
|
||||
|
||||
# If follow workfile, gather version from workfile path.
|
||||
if version is None and follow_workfile_version:
|
||||
current_workfile = self.create_context.get_current_workfile_path()
|
||||
if version is None and follow_workfile_version and current_workfile:
|
||||
workfile_version = get_version_from_path(current_workfile)
|
||||
version = int(workfile_version)
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,13 @@ class CollectSceneVersion(pyblish.api.ContextPlugin):
|
|||
self.log.debug("Skipping for headless publishing")
|
||||
return
|
||||
|
||||
if context.data["hostName"] not in self.hosts:
|
||||
self.log.debug(
|
||||
f"Host {context.data['hostName']} is"
|
||||
" not setup for following version."
|
||||
)
|
||||
return
|
||||
|
||||
if not context.data.get('currentFile'):
|
||||
self.log.error("Cannot get current workfile path. "
|
||||
"Make sure your scene is saved.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue