mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
aport collect intances update, filter out "clip" family from global plugins, fix extract_post_json, adding some supporting functions to pype.lib and templates and api
This commit is contained in:
parent
5693f8a4d7
commit
95c9c2bc9b
15 changed files with 219 additions and 59 deletions
19
pype/lib.py
19
pype/lib.py
|
|
@ -378,16 +378,31 @@ def get_asset_data(asset=None):
|
|||
Returns:
|
||||
dict
|
||||
"""
|
||||
|
||||
asset_name = asset or avalon.api.Session["AVALON_ASSET"]
|
||||
document = io.find_one({"name": asset_name,
|
||||
"type": "asset"})
|
||||
|
||||
data = document.get("data", {})
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def get_data_hierarchical_attr(entity, attr_name):
|
||||
vp_attr = 'visualParent'
|
||||
data = entity['data']
|
||||
value = data.get(attr_name, None)
|
||||
if value is not None:
|
||||
return value
|
||||
elif vp_attr in data:
|
||||
if data[vp_attr] is None:
|
||||
parent_id = entity['parent']
|
||||
else:
|
||||
parent_id = data[vp_attr]
|
||||
parent = io.find_one({"_id": parent_id})
|
||||
return get_data_hierarchical_attr(parent, attr_name)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def get_avalon_project_config_schema():
|
||||
schema = 'avalon-core:config-1.0'
|
||||
return schema
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue