Skip to content

Commit

Permalink
Merge pull request #1114 from BigRoy/enhancement/optional_mixin_allow…
Browse files Browse the repository at this point in the history
…_optional_tooltip_attribute

Add support for `optional_tooltip` attribute on `OptionalPyblishPluginMixin`
  • Loading branch information
BigRoy authored Jan 31, 2025
2 parents 34fbf68 + e1438ed commit d903243
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion client/ayon_core/pipeline/publish/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ def process(self, instance):
```
"""

# Allow exposing tooltip from class with `optional_tooltip` attribute
optional_tooltip: Optional[str] = None

@classmethod
def get_attribute_defs(cls):
"""Attribute definitions based on plugin's optional attribute."""
Expand All @@ -304,8 +307,14 @@ def get_attribute_defs(cls):
active = getattr(cls, "active", True)
# Return boolean stored under 'active' key with label of the class name
label = cls.label or cls.__name__

return [
BoolDef("active", default=active, label=label)
BoolDef(
"active",
default=active,
label=label,
tooltip=cls.optional_tooltip,
)
]

def is_active(self, data):
Expand Down

0 comments on commit d903243

Please sign in to comment.