Merge pull request #1114 from BigRoy/enhancement/optional_mixin_allow_optional_tooltip_attribute

Add support for `optional_tooltip` attribute on `OptionalPyblishPluginMixin`
This commit is contained in:
Roy Nieterau 2025-01-31 23:30:25 +01:00 committed by GitHub
commit d90324313c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -292,6 +292,9 @@ class OptionalPyblishPluginMixin(AYONPyblishPluginMixin):
```
"""
# 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."""
@ -304,8 +307,14 @@ class OptionalPyblishPluginMixin(AYONPyblishPluginMixin):
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):