mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merged in feature/PYPE-124_hierarchical_attributes (pull request #42)
added hierarchical check for custom attrbiutes Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
commit
09c38da4e3
1 changed files with 12 additions and 5 deletions
|
|
@ -39,13 +39,20 @@ def get_data(parent, entity, session, custom_attributes):
|
|||
|
||||
for cust_attr in custom_attributes:
|
||||
key = cust_attr['key']
|
||||
if cust_attr['entity_type'].lower() in ['asset']:
|
||||
if (
|
||||
cust_attr['is_hierarchical'] is True or
|
||||
cust_attr['entity_type'].lower() in ['asset'] or
|
||||
(
|
||||
cust_attr['entity_type'].lower() in ['show'] and
|
||||
entity_type.lower() == 'project'
|
||||
)
|
||||
):
|
||||
data[key] = entity['custom_attributes'][key]
|
||||
|
||||
elif cust_attr['entity_type'].lower() in ['show'] and entity_type.lower() == 'project':
|
||||
data[key] = entity['custom_attributes'][key]
|
||||
|
||||
elif cust_attr['entity_type'].lower() in ['task'] and entity_type.lower() != 'project':
|
||||
elif (
|
||||
cust_attr['entity_type'].lower() in ['task'] and
|
||||
entity_type.lower() != 'project'
|
||||
):
|
||||
# Put space between capitals (e.g. 'AssetBuild' -> 'Asset Build')
|
||||
entity_type_full = re.sub(r"(\w)([A-Z])", r"\1 \2", entity_type)
|
||||
# Get object id of entity type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue