From cf1453029f14dde78a18d8560ee55e69871bfe46 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 11 Mar 2022 17:13:26 +0100 Subject: [PATCH] remove obsolete code and set cast --- openpype/hosts/maya/api/plugin.py | 6 +----- .../maya/plugins/publish/extract_maya_scene_raw.py | 12 ++++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/openpype/hosts/maya/api/plugin.py b/openpype/hosts/maya/api/plugin.py index 1f90b3ffbd..48d7c465ec 100644 --- a/openpype/hosts/maya/api/plugin.py +++ b/openpype/hosts/maya/api/plugin.py @@ -247,10 +247,7 @@ 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"]) + self._organize_containers(content, container["objectName"]) # Reapply alembic settings. if representation["name"] == "abc" and alembic_data: @@ -289,7 +286,6 @@ class ReferenceLoader(Loader): to remove from scene. """ - from maya import cmds node = container["objectName"] 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 9d73bea7d2..389995d30c 100644 --- a/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py +++ b/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py @@ -94,13 +94,13 @@ class ExtractMayaSceneRaw(openpype.api.Extractor): @staticmethod def _get_loaded_containers(members): # type: (list) -> list - refs_to_include = [ - cmds.referenceQuery(ref, referenceNode=True) - for ref in members - if cmds.referenceQuery(ref, isNodeReferenced=True) - ] + refs_to_include = { + cmds.referenceQuery(node, referenceNode=True) + for node in members + if cmds.referenceQuery(node, isNodeReferenced=True) + } - members_with_refs = set(refs_to_include).union(members) + members_with_refs = refs_to_include.union(members) obj_sets = cmds.ls("*.id", long=True, type="objectSet", recursive=True, objectsOnly=True)