what does a negative element [-1] mean in mplugs?

37 views
Skip to first unread message

Rudi Hammad

unread,
Aug 27, 2020, 8:10:20 PM8/27/20
to Python Programming for Autodesk Maya

hi,
I noticed that if you create a cube for instance, and you try to find its shape's plug called "vertexAlpha" (which is an element of a mplug array),  with mplug = mFnDependencyNode(~).findPlug(" vertexAlpha") the name mplug.name() is pCubeShape1.vertexColor[-1].vertexAlpha.
what is interesting is that, if you go plug by plug starting from the top one until you get to "vertexAlpha" (so findPlug().child(~).elementByLogicalIndex(~).etc... ), the name is pCubeShape1.vertexColor[0].vertexAlpha.
Any idea what that  means?

Thanks,
R

Rudi Hammad

unread,
Aug 28, 2020, 6:41:43 AM8/28/20
to Python Programming for Autodesk Maya
hmmmm...another confusing thing is that if you connect the vertexAlpha plug to something, and do again  mplug = mFnDependencyNode(~).findPlug(" vertexAlpha")   then you don't get anymore pCubeShape1.vertexColor[-1].vertexAlpha, you get pCubeShape1.vertexColor[0].vertexAlpha....even if you break later te conections, the result remains  pCubeShape1.vertexColor[0].vertexAlpha.
I have absolutly no idea what is going on with the [-1]
Reply all
Reply to author
Forward
0 new messages