Help me ))
I need to get the right name of attribute but Maya gives me wrong (((
import maya.OpenMaya as om
# add in selection
selList = om.MSelectionList()
selList.add("blendShape1")
# get MObject
selObj = om.MObject()
selList.getDependNode(0,selObj)
# attach to dependency Fn set
fnDepend = om.MFnDependencyNode(selObj)
totalAttrs = fnDepend.attributeCount()
for i in range(0,totalAttrs):
attrObj = fnDepend.attribute(i)
fnAttr = om.MFnAttribute(attrObj)
if fnAttr.isStorable() and fnAttr.isWritable():
plug = fnDepend.findPlug(attrObj)
print plug.partialName(True, True, True, False, True, True)
....
blendShape1.inputTarget[-1].normalizationGroup[-1].normalizationUseWeights
....
I need name like
"blendShape1.inputTarget[0].normalizationGroup[0].normalizationUseWeights"
. It is how Connection Editor shows given attribute name.
In which way I can get the right indexes?
I would be very appreciated for any help
Sergiy,
Best
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/52c5d426-679e-4b79-bfe9-9df27544ccec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.