Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f089bea
Add Tags enum to integrator, and add tags to version entity on integr…
MustafaJafar May 20, 2026
de1995b
Make Ruff Happy
MustafaJafar May 20, 2026
3d85c26
Move tags enum into a separate plugin and make it optional.
MustafaJafar May 21, 2026
2d29773
remove debug line
MustafaJafar May 21, 2026
c3e7e8e
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar May 21, 2026
b6f8bc0
use instance.data instead of version data
MustafaJafar May 21, 2026
045c223
Merge branch 'enhancement/1673-yn-0458-set-version-tags-on-publish' o…
MustafaJafar May 21, 2026
1734ede
make ruff happy
MustafaJafar May 21, 2026
f2fb865
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar May 21, 2026
74550fb
CollectVersionTags: deal with tags as a set
MustafaJafar May 22, 2026
ba4d836
Tweak `tags` type, raise error if not iteratable or a list of strings…
MustafaJafar May 22, 2026
da27016
CollectVersionTags: skip doing anything if no version tags have been …
MustafaJafar May 22, 2026
8fa69de
CollectVersionTags: optimize get_attr_defs_for_instance
MustafaJafar May 22, 2026
979d328
Make ruff happy
MustafaJafar May 22, 2026
81953e5
CollectVersionTags: refactor `tags` key -> `versionTags`
MustafaJafar May 22, 2026
7a8c2bc
CollectVersionTags: optimize items in get_attr_defs_for_instance
MustafaJafar May 22, 2026
6012cc3
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar May 22, 2026
f114911
IntegrateAsset: fix typo in variable name
MustafaJafar May 22, 2026
26bbd1d
Merge branch 'enhancement/1673-yn-0458-set-version-tags-on-publish' o…
MustafaJafar May 22, 2026
e6a343c
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar May 26, 2026
a6f13fc
Optimizations from code review
MustafaJafar May 26, 2026
115cf21
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
moonyuet Jun 17, 2026
63a1342
IntegrateAsset: better log message
MustafaJafar Jun 17, 2026
1002db7
Use `KnownPublishError` instead of `PublishError`
MustafaJafar Jun 17, 2026
7f68230
Remove the type hint
MustafaJafar Jun 17, 2026
d0dad9e
get the right instance data item `versionTags`
MustafaJafar Jun 17, 2026
cd38c86
Update client/ayon_core/plugins/publish/integrate.py
BigRoy Jun 30, 2026
2b75ed1
Fix a typo
MustafaJafar Jul 6, 2026
a57741c
Revert 1002db7baf22076a5927926a2a92329bc8c9ade9: use `Publish Error`
MustafaJafar Jul 6, 2026
3871191
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar Jul 6, 2026
0a56346
Apply suggestion from @BigRoy
BigRoy Jul 6, 2026
dd0cf2e
remove the fallback when getting the `versionTags`
MustafaJafar Jul 6, 2026
59cf2bf
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar Jul 6, 2026
3fdda57
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
MustafaJafar Jul 6, 2026
f328751
Merge branch 'develop' into enhancement/1673-yn-0458-set-version-tags…
iLLiCiTiT Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions client/ayon_core/plugins/publish/collect_version_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import pyblish.api

from ayon_core.lib import EnumDef
from ayon_core.pipeline.publish import AYONPyblishPluginMixin


class CollectVersionTags(
pyblish.api.InstancePlugin,
AYONPyblishPluginMixin
):
"""Collect Version Tags

Provides a selectable list of tags for the user. Selected tags are stored
in the instance metadata and applied to the Version Entity during
integration.
"""

order = pyblish.api.CollectorOrder + 0.499
label = "Collect Version Tags"
settings_category = "core"

enabled = False

def process(self, instance):

attr_values = self.get_attr_values_from_data(instance.data)
version_tags = attr_values.get("version_tags", [])

if not version_tags:
return

self.log.debug(f"Adding tags: {version_tags}")
tags = instance.data.get("versionTags")
if tags is None:
tags = set()
elif not isinstance(tags, set):
tags = set(tags)

tags.update(version_tags)
instance.data["versionTags"] = tags
self.log.debug(f"Collected version tags: {tags}")
Comment thread
MustafaJafar marked this conversation as resolved.

@classmethod
def get_attr_defs_for_instance(cls, create_context, instance):
Comment thread
BigRoy marked this conversation as resolved.
project_entity = create_context.get_current_project_entity()
items = [tag["name"] for tag in project_entity["tags"]]
if not items:
plugin_attributes = instance.publish_attributes.get(cls.__name__)
if plugin_attributes is not None:
plugin_attributes.pop("version_tags", None)
return []
Comment thread
MustafaJafar marked this conversation as resolved.

return [
EnumDef(
"version_tags",
label="Version Tags",
multiselection=True,
items=items,
tooltip="Set these tags to versions",
)
]
18 changes: 18 additions & 0 deletions client/ayon_core/plugins/publish/integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,23 @@ def prepare_version(
host_name = instance.context.data["hostName"]
version_data["host_name"] = host_name

tags = instance.data.get("versionTags")
if tags is not None:
# Check if tags is an iterable.
if not isinstance(tags, (list, tuple, set)):
raise PublishError(
"Tags must be an iterable."
f" Instead got type {type(tags)}"
)
# Error if not all are string.
if not all(isinstance(tag, str) for tag in tags):
raise PublishError(
"Version tags must be an iterable of strings. "
f"Got: {type(tags)}"
)
# Force the type to be list for the new_version_entity call.
tags = list(tags)

version_entity = new_version_entity(
version_number,
product_entity["id"],
Expand All @@ -506,6 +523,7 @@ def prepare_version(
data=version_data,
attribs=version_attributes,
entity_id=version_id,
tags=tags,
)

if existing_version:
Expand Down
7 changes: 7 additions & 0 deletions client/ayon_core/plugins/publish/integrate_hero_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,20 @@ def integrate_instance(
if old_version:
entity_id = old_version["id"]

tags = instance.data.get("versionTags")
if tags is not None:
# Tags contents are checked at earlier step "IntegrateAsset"
# Force the type to be list for the new_version_entity call.
tags = list(tags)

new_hero_version = new_version_entity(
- src_version_entity["version"],
src_version_entity["productId"],
task_id=src_version_entity.get("taskId"),
data=copy.deepcopy(src_version_entity["data"]),
attribs=copy.deepcopy(src_version_entity["attrib"]),
entity_id=entity_id,
tags=tags,
)

if old_version:
Expand Down
14 changes: 14 additions & 0 deletions server/settings/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class CollectFramesFixDefModel(BaseSettingsModel):
)


class CollectVersionTagsModel(BaseSettingsModel):
enabled: bool = SettingsField(False)


def usd_contribution_layer_types():
return [
{"value": "asset", "label": "Asset"},
Expand Down Expand Up @@ -1432,6 +1436,13 @@ class PublishPuginsModel(BaseSettingsModel):
default_factory=CollectHierarchyModel,
title="Collect Hierarchy"
)
CollectVersionTags: CollectVersionTagsModel = SettingsField(
title="Collect Version Tags",
description=(
"Provides a selectable list of tags for the user in the"
" publisher."
)
)
ValidateEditorialAssetName: ValidateBaseModel = SettingsField(
default_factory=ValidateBaseModel,
title="Validate Editorial Asset Name"
Expand Down Expand Up @@ -1660,6 +1671,9 @@ class PublishPuginsModel(BaseSettingsModel):
"CollectHierarchy": {
"edit_shot_attributes_on_update": True,
},
"CollectVersionTags": {
"enabled": False
},
"ValidateEditorialAssetName": {
"enabled": True,
"optional": False,
Expand Down
Loading