LumaPictures / pymel

Python in Maya Done Right
Other
478 stars 130 forks source link

pymel.core.shadingGroups() doesn't return shadingEngine node if .outAlpha is passed in a shading network #432

Open windxu88 opened 3 years ago

windxu88 commented 3 years ago

The problem happens when some Arnold nodes, for example the aiLayerRgba or the aiShuffle node. When any of them is in a shading network that is passing it's .outAlpha value down to the connections, it will block the command to retrieve the shadingEngine node.

Repro steps: 1) Load the attached scene 2) Run the following script: import pymel.core as pm node = pm.PyNode('aiImage1') result = node.shadingGroups() print(result)

Result: An empty list is returned: Expected result: [nt.ShadingEngine(u'aiStandardSurface1SG')] should be returned.

In the scene if connecting aiLayerRgba1.outColor (instead of outAlpha) to aiStandardSurface1.baseColor, the script will work as expected.

test_.ma.zip