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)