From c033eaad65afcb43752f9c5da85b94bab31bffb6 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 11 Mar 2022 15:13:43 +0100 Subject: [PATCH] fix update --- openpype/hosts/maya/api/plugin.py | 5 +++++ openpype/hosts/maya/plugins/load/load_reference.py | 2 -- .../hosts/maya/plugins/publish/extract_maya_scene_raw.py | 7 +++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/maya/api/plugin.py b/openpype/hosts/maya/api/plugin.py index feaceacebc..1f90b3ffbd 100644 --- a/openpype/hosts/maya/api/plugin.py +++ b/openpype/hosts/maya/api/plugin.py @@ -247,6 +247,11 @@ class ReferenceLoader(Loader): self.log.warning("Ignoring file read error:\n%s", exc) + shapes = cmds.ls(content, shapes=True, long=True) + new_nodes = (list(set(content) - set(shapes))) + + self._organize_containers(new_nodes, container["objectName"]) + # Reapply alembic settings. if representation["name"] == "abc" and alembic_data: alembic_nodes = cmds.ls( diff --git a/openpype/hosts/maya/plugins/load/load_reference.py b/openpype/hosts/maya/plugins/load/load_reference.py index d358c62724..04a25f6493 100644 --- a/openpype/hosts/maya/plugins/load/load_reference.py +++ b/openpype/hosts/maya/plugins/load/load_reference.py @@ -123,8 +123,6 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader): else: if "translate" in options: cmds.setAttr(group_name + ".t", *options["translate"]) - - print(new_nodes) return new_nodes def switch(self, container, representation): diff --git a/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py b/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py index 2e1260c374..9d73bea7d2 100644 --- a/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py +++ b/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py @@ -60,10 +60,9 @@ class ExtractMayaSceneRaw(openpype.api.Extractor): selection = members if set(self.add_for_families).intersection( - set(instance.data.get("families"))) or \ + set(instance.data.get("families", []))) or \ instance.data.get("family") in self.add_for_families: - selection += self._add_loaded_containers(members) - self.log.info(selection) + selection += self._get_loaded_containers(members) # Perform extraction self.log.info("Performing extraction ...") @@ -93,7 +92,7 @@ class ExtractMayaSceneRaw(openpype.api.Extractor): self.log.info("Extracted instance '%s' to: %s" % (instance.name, path)) @staticmethod - def _add_loaded_containers(members): + def _get_loaded_containers(members): # type: (list) -> list refs_to_include = [ cmds.referenceQuery(ref, referenceNode=True)