mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
add containers to hierarchy
This commit is contained in:
parent
3697fba453
commit
d81da109a7
1 changed files with 5 additions and 5 deletions
|
|
@ -128,9 +128,9 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
|
|||
return new_nodes
|
||||
|
||||
def load(self, context, name=None, namespace=None, options=None):
|
||||
super(ReferenceLoader, self).load(context, name, namespace, options)
|
||||
container = super(ReferenceLoader, self).load(context, name, namespace, options)
|
||||
# clean containers if present to AVALON_CONTAINERS
|
||||
self._organize_containers(self[:])
|
||||
self._organize_containers(self[:], container[0])
|
||||
|
||||
def switch(self, container, representation):
|
||||
self.update(container, representation)
|
||||
|
|
@ -167,11 +167,11 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
|
|||
)
|
||||
|
||||
@staticmethod
|
||||
def _organize_containers(nodes):
|
||||
# type: (list) -> None
|
||||
def _organize_containers(nodes, container):
|
||||
# type: (list, str) -> None
|
||||
for node in nodes:
|
||||
id_attr = "{}.id".format(node)
|
||||
if not cmds.attributeQuery("id", node=node, exists=True):
|
||||
continue
|
||||
if cmds.getAttr(id_attr) == AVALON_CONTAINER_ID:
|
||||
cmds.sets(node, forceElement=AVALON_CONTAINERS)
|
||||
cmds.sets(node, forceElement=container)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue