mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 22:02:15 +01:00
fix(nukestudio): fixing hierarchy tasks
This commit is contained in:
parent
56bd87c253
commit
41a0b85594
1 changed files with 30 additions and 6 deletions
|
|
@ -37,6 +37,10 @@ class CollectHierarchyInstance(pyblish.api.InstancePlugin):
|
|||
clip = instance.data["item"]
|
||||
asset = instance.data.get("asset")
|
||||
|
||||
# create asset_names conversion table
|
||||
if not context.data.get("assetsSharedHierarchy"):
|
||||
context.data["assetsSharedHierarchy"] = dict()
|
||||
|
||||
# build data for inner nukestudio project property
|
||||
data = {
|
||||
"sequence": context.data['activeSequence'].name().replace(' ', '_'),
|
||||
|
|
@ -122,12 +126,17 @@ class CollectHierarchyInstance(pyblish.api.InstancePlugin):
|
|||
assert not hd, "Only one Hierarchy Tag is \
|
||||
allowed. Clip: `{}`".format(asset)
|
||||
|
||||
assetsSharedHierarchy = {
|
||||
asset: {
|
||||
"asset": instance.data["asset"],
|
||||
"hierarchy": hierarchy,
|
||||
"parents": parents
|
||||
}}
|
||||
# add formated hierarchy path into instance data
|
||||
instance.data["hierarchy"] = hierarchy
|
||||
instance.data["parents"] = parents
|
||||
self.log.debug("__ hierarchy.format: {}".format(hierarchy))
|
||||
self.log.debug("__ parents: {}".format(parents))
|
||||
self.log.debug("__ d_metadata: {}".format(d_metadata))
|
||||
context.data["assetsSharedHierarchy"].update(
|
||||
assetsSharedHierarchy)
|
||||
|
||||
|
||||
class CollectHierarchyContext(pyblish.api.ContextPlugin):
|
||||
|
|
@ -143,21 +152,36 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin):
|
|||
if key in new_dict and isinstance(ex_dict[key], dict):
|
||||
new_dict[key] = self.update_dict(ex_dict[key], new_dict[key])
|
||||
else:
|
||||
new_dict[key] = ex_dict[key]
|
||||
if ex_dict.get(key) and new_dict.get(key):
|
||||
continue
|
||||
else:
|
||||
new_dict[key] = ex_dict[key]
|
||||
|
||||
return new_dict
|
||||
|
||||
def process(self, context):
|
||||
instances = context[:]
|
||||
# create hierarchyContext attr if context has none
|
||||
self.log.debug("__ instances: {}".format(context[:]))
|
||||
|
||||
temp_context = {}
|
||||
for instance in instances:
|
||||
if 'projectfile' in instance.data.get('family', ''):
|
||||
continue
|
||||
|
||||
in_info = {}
|
||||
name = instance.data["asset"]
|
||||
|
||||
# inject assetsSharedHierarchy to other plates types
|
||||
assets_shared = context.data.get("assetsSharedHierarchy")
|
||||
|
||||
if assets_shared:
|
||||
s_asset_data = assets_shared.get(name)
|
||||
if s_asset_data:
|
||||
name = instance.data["asset"] = s_asset_data["asset"]
|
||||
instance.data["parents"] = s_asset_data["parents"]
|
||||
instance.data["hierarchy"] = s_asset_data["hierarchy"]
|
||||
|
||||
|
||||
in_info = {}
|
||||
# suppose that all instances are Shots
|
||||
in_info['entity_type'] = 'Shot'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue