mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
hierarchy is set to empty string if no parents
This commit is contained in:
parent
d679756360
commit
f43b1d8cde
5 changed files with 23 additions and 13 deletions
|
|
@ -406,7 +406,9 @@ def get_data(entity, session, custom_attributes):
|
|||
{'type': 'asset', 'name': parName}
|
||||
)['_id']
|
||||
|
||||
hierarchy = os.path.sep.join(folderStruct)
|
||||
hierarchy = ""
|
||||
if len(folderStruct) > 0:
|
||||
hierarchy = os.path.sep.join(folderStruct)
|
||||
|
||||
data['visualParent'] = parentId
|
||||
data['parents'] = folderStruct
|
||||
|
|
|
|||
|
|
@ -180,13 +180,14 @@ class AppAction(BaseHandler):
|
|||
os.environ["AVALON_APP_NAME"] = self.identifier
|
||||
|
||||
anatomy = pype.Anatomy
|
||||
hierarchy = database[project_name].find_one({
|
||||
hierarchy = ""
|
||||
parents = database[project_name].find_one({
|
||||
"type": 'asset',
|
||||
"name": entity['parent']['name']
|
||||
})['data']['parents']
|
||||
|
||||
if hierarchy:
|
||||
hierarchy = os.path.join(*hierarchy)
|
||||
if parents:
|
||||
hierarchy = os.path.join(*parents)
|
||||
|
||||
data = {"project": {"name": entity['project']['full_name'],
|
||||
"code": entity['project']['name']},
|
||||
|
|
|
|||
|
|
@ -141,10 +141,14 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
|||
# \|________|
|
||||
#
|
||||
root = api.registered_root()
|
||||
hierarchy = io.find_one({"type": 'asset', "name": ASSET})['data']['parents']
|
||||
if hierarchy:
|
||||
hierarchy = ""
|
||||
parents = io.find_one({
|
||||
"type": 'asset',
|
||||
"name": ASSET
|
||||
})['data']['parents']
|
||||
if parents and len(parents) > 0:
|
||||
# hierarchy = os.path.sep.join(hierarchy)
|
||||
hierarchy = os.path.join(*hierarchy)
|
||||
hierarchy = os.path.join(*parents)
|
||||
|
||||
template_data = {"root": root,
|
||||
"project": {"name": PROJECT,
|
||||
|
|
|
|||
|
|
@ -139,11 +139,12 @@ class IntegrateFrames(pyblish.api.InstancePlugin):
|
|||
# \|________|
|
||||
#
|
||||
root = api.registered_root()
|
||||
hierarchy = io.find_one({"type": 'asset', "name": ASSET})[
|
||||
hierarchy = ""
|
||||
parents = io.find_one({"type": 'asset', "name": ASSET})[
|
||||
'data']['parents']
|
||||
if hierarchy:
|
||||
if parents and len(parents) > 0:
|
||||
# hierarchy = os.path.sep.join(hierarchy)
|
||||
hierarchy = os.path.join(*hierarchy)
|
||||
hierarchy = os.path.join(*parents)
|
||||
|
||||
template_data = {"root": root,
|
||||
"project": {"name": PROJECT,
|
||||
|
|
|
|||
|
|
@ -167,14 +167,16 @@ def get_hierarchy():
|
|||
string: asset hierarchy path
|
||||
|
||||
"""
|
||||
hierarchy = io.find_one({
|
||||
parents = io.find_one({
|
||||
"type": 'asset',
|
||||
"name": get_asset()}
|
||||
)['data']['parents']
|
||||
|
||||
if hierarchy:
|
||||
hierarchy = ""
|
||||
if parents and len(parents) > 0:
|
||||
# hierarchy = os.path.sep.join(hierarchy)
|
||||
return os.path.join(*hierarchy).replace("\\", "/")
|
||||
hierarchy = os.path.join(*parents).replace("\\", "/")
|
||||
return hierarchy
|
||||
|
||||
|
||||
def set_hierarchy(hierarchy):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue