mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Ensure fullpath (=bugfix) + query relatives once + avoid duplicates
This commit is contained in:
parent
b538efdcdd
commit
c0a9536f52
1 changed files with 8 additions and 6 deletions
|
|
@ -127,12 +127,14 @@ class LookLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
|
|||
"""
|
||||
import maya.cmds as cmds
|
||||
|
||||
nodes_list = []
|
||||
for shader in shader_nodes:
|
||||
connections = cmds.listConnections(cmds.listHistory(shader, f=1),
|
||||
future = cmds.listHistory(shader, future=True)
|
||||
connections = cmds.listConnections(future,
|
||||
type='mesh')
|
||||
if connections:
|
||||
for connection in connections:
|
||||
nodes_list.extend(cmds.listRelatives(connection,
|
||||
shapes=True))
|
||||
return nodes_list
|
||||
# Ensure unique entries only to optimize query and results
|
||||
connections = list(set(connections))
|
||||
return cmds.listRelatives(connections,
|
||||
shapes=True,
|
||||
fullPath=True) or []
|
||||
return []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue