Merge branch 'develop' into feature/909-define-basic-trait-type-using-dataclasses

This commit is contained in:
Ondřej Samohel 2025-02-03 10:27:43 +01:00 committed by GitHub
commit b6603ad479
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):