mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
fixed templates enum entity
This commit is contained in:
parent
a06ab7e0ef
commit
59cff86ce4
1 changed files with 29 additions and 3 deletions
|
|
@ -521,10 +521,36 @@ class AnatomyTemplatesEnumEntity(BaseEnumEntity):
|
|||
valid_keys = set()
|
||||
enum_items_list = []
|
||||
|
||||
for key, value in templates_entity.items():
|
||||
enum_items_list.append(
|
||||
{key: key})
|
||||
others_entity = None
|
||||
for key, entity in templates_entity.items():
|
||||
# Skip defaults key
|
||||
if key == "defaults":
|
||||
continue
|
||||
|
||||
if key == "others":
|
||||
others_entity = entity
|
||||
continue
|
||||
|
||||
label = key
|
||||
if hasattr(entity, "label"):
|
||||
label = entity.label or label
|
||||
|
||||
enum_items_list.append({key: label})
|
||||
valid_keys.add(key)
|
||||
|
||||
if others_entity is not None:
|
||||
print(others_entity)
|
||||
get_child_label_func = getattr(
|
||||
others_entity, "get_child_label", None
|
||||
)
|
||||
for key, child_entity in others_entity.items():
|
||||
label = key
|
||||
if callable(get_child_label_func):
|
||||
label = get_child_label_func(child_entity) or label
|
||||
|
||||
enum_items_list.append({key: label})
|
||||
valid_keys.add(key)
|
||||
|
||||
return enum_items_list, valid_keys
|
||||
|
||||
def set_override_state(self, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue