hierarchy is set to empty string if no parents

This commit is contained in:
Jakub Trllo 2019-02-06 19:59:00 +01:00
parent d679756360
commit f43b1d8cde
5 changed files with 23 additions and 13 deletions

View file

@ -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,

View file

@ -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,