🐛 handle empty materials list

This commit is contained in:
Ondřej Samohel 2023-11-16 18:29:31 +01:00
parent 19f0a77966
commit c0926104d5

View file

@ -367,7 +367,11 @@ class CollectLook(pyblish.api.InstancePlugin):
self.log.debug("Found the following sets:\n{}".format(look_sets))
# Get the entire node chain of the look sets
# history = cmds.listHistory(look_sets, allConnections=True)
history = cmds.listHistory(materials, allConnections=True)
# if materials list is empty, listHistory() will crash with
# RuntimeError
history = []
if materials:
history = cmds.listHistory(materials, allConnections=True)
# Since we retrieved history only of the connected materials
# connected to the look sets above we now add direct history