Skip to content

Commit

Permalink
Merge pull request #1111 from ynput/bugfix/AY-7063_disable_version_fo…
Browse files Browse the repository at this point in the history
…llowup_per_host

AY-7063 Fix Version follow up from Workfile set by hosts.
  • Loading branch information
robin-ynput authored Feb 3, 2025
2 parents d903243 + 3dc04d1 commit 7ef1b52
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
20 changes: 16 additions & 4 deletions client/ayon_core/pipeline/create/creator_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,18 +858,30 @@ def get_staging_dir(self, instance) -> Optional[StagingDir]:
["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)
if workfile_version is not None:
version = int(workfile_version)

# Fill-up version with next version available.
elif version is None:
if version is None:
versions = self.get_next_versions_for_instances(
[instance]
)
Expand Down
6 changes: 6 additions & 0 deletions client/ayon_core/pipeline/publish/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ class method 'def apply_settings(cls, project_settings)'
if getattr(plugin, "enabled", True) is False:
plugins.remove(plugin)

# Pyblish already operated a filter based on host.
# But applying settings might have changed "hosts"
# value in plugin so re-filter.
elif not pyblish.plugin.host_is_compatible(plugin):
plugins.remove(plugin)


def get_errored_instances_from_context(context, plugin=None):
"""Collect failed instances from pyblish context.
Expand Down
18 changes: 1 addition & 17 deletions client/ayon_core/plugins/publish/collect_scene_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,7 @@ class CollectSceneVersion(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder
label = 'Collect Scene Version'
# configurable in Settings
hosts = [
"aftereffects",
"blender",
"celaction",
"fusion",
"harmony",
"hiero",
"houdini",
"maya",
"max",
"nuke",
"photoshop",
"resolve",
"tvpaint",
"motionbuilder",
"substancepainter"
]
hosts = ["*"]

# in some cases of headless publishing (for example webpublisher using PS)
# you want to ignore version from name and let integrate use next version
Expand Down

0 comments on commit 7ef1b52

Please sign in to comment.