LumaPictures / pymel

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

Wrong result from attr.source() #430

Open zewt opened 4 years ago

zewt commented 4 years ago

attr.source() returns incorrect attributes:

print pm.PyNode('initialShadingGroup').surfaceShader.source()
initialShadingGroup.outColor

It's attaching the attribute to the wrong node (it should be lambert1.outColor, not initialShadingGroup.outColor).

zewt commented 3 years ago

Not sure if anyone's reading, but it looks like Attribute.source gets the right result from _f.getProxyResult, but then _f.ApiArgUtil._castResult moves it to the wrong node.

I'm not sure what the intended fix would be. _MPlugOut is being passed a node and an MPlug on a different node. Maybe if _MPlugOut's "x" argument is an MPlug, it should ignore self and just create an Attribute directly from the MPlug. That way the boilerplate _f.ApiArgUtil._castResult calls don't need special cases, and it seems like any time those arguments aren't on the same node, the MPlug argument should be the correct one.