Merge pull request #301 from BigRoy/maya/validate_look_shading_engine

Maya: Validate Look Shading Group ignore if no material
This commit is contained in:
Toke Jepsen 2024-04-01 08:42:43 +01:00 committed by GitHub
commit 170bd5d27d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,10 +47,18 @@ class ValidateShadingEngine(pyblish.api.InstancePlugin,
shape, destination=True, type="shadingEngine"
) or []
for shading_engine in shading_engines:
name = (
cmds.listConnections(shading_engine + ".surfaceShader")[0]
+ "SG"
materials = cmds.listConnections(
shading_engine + ".surfaceShader",
source=True, destination=False
)
if not materials:
cls.log.warning(
"Shading engine '{}' has no material connected to its "
".surfaceShader attribute.".format(shading_engine))
continue
material = materials[0] # there should only ever be one input
name = material + "SG"
if shading_engine != name:
invalid.append(shading_engine)