From d81da109a799cd002b31d79b1408ef94ffdab92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Mon, 7 Mar 2022 17:59:50 +0100 Subject: [PATCH] add containers to hierarchy --- openpype/hosts/maya/plugins/load/load_reference.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_reference.py b/openpype/hosts/maya/plugins/load/load_reference.py index 0a0ce4536f..3d18a48a93 100644 --- a/openpype/hosts/maya/plugins/load/load_reference.py +++ b/openpype/hosts/maya/plugins/load/load_reference.py @@ -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)