From 021454dc9bc72e9d09c0e4447f3d37647ad79669 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Sat, 11 Mar 2023 06:59:43 +0100 Subject: [PATCH 1/3] Fix #4044: Don't rely on containers, but just get ids from the nodes --- openpype/tools/mayalookassigner/commands.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/openpype/tools/mayalookassigner/commands.py b/openpype/tools/mayalookassigner/commands.py index 2e7a51efde..6955dda97f 100644 --- a/openpype/tools/mayalookassigner/commands.py +++ b/openpype/tools/mayalookassigner/commands.py @@ -80,21 +80,9 @@ def get_all_asset_nodes(): Returns: list: list of dictionaries """ - - host = registered_host() - - nodes = [] - for container in host.ls(): - # We are not interested in looks but assets! - if container["loader"] == "LookLoader": - continue - - # Gather all information - container_name = container["objectName"] - nodes += lib.get_container_members(container_name) - - nodes = list(set(nodes)) - return nodes + nodes = cmds.ls(dag=True, noIntermediate=True, long=True) + items = commands.create_items_from_nodes(nodes) + return items def create_asset_id_hash(nodes): From b44b0b8fb063aeef51761a2b179cd9e074a9a5f8 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Sat, 11 Mar 2023 07:57:20 +0100 Subject: [PATCH 2/3] Remove `commands.` prefix since function is local --- openpype/tools/mayalookassigner/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/tools/mayalookassigner/commands.py b/openpype/tools/mayalookassigner/commands.py index 6955dda97f..0135eb4f49 100644 --- a/openpype/tools/mayalookassigner/commands.py +++ b/openpype/tools/mayalookassigner/commands.py @@ -81,7 +81,7 @@ def get_all_asset_nodes(): list: list of dictionaries """ nodes = cmds.ls(dag=True, noIntermediate=True, long=True) - items = commands.create_items_from_nodes(nodes) + items = create_items_from_nodes(nodes) return items From f1c490b21cf69294b7c1ab7e03a8115557c552de Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 20 Mar 2023 10:57:16 +0100 Subject: [PATCH 3/3] Fix `get_all_asset_nodes` --- openpype/hosts/maya/tools/mayalookassigner/commands.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openpype/hosts/maya/tools/mayalookassigner/commands.py b/openpype/hosts/maya/tools/mayalookassigner/commands.py index 0135eb4f49..3d9746511d 100644 --- a/openpype/hosts/maya/tools/mayalookassigner/commands.py +++ b/openpype/hosts/maya/tools/mayalookassigner/commands.py @@ -80,9 +80,7 @@ def get_all_asset_nodes(): Returns: list: list of dictionaries """ - nodes = cmds.ls(dag=True, noIntermediate=True, long=True) - items = create_items_from_nodes(nodes) - return items + return cmds.ls(dag=True, noIntermediate=True, long=True) def create_asset_id_hash(nodes):