cmds.aliasAttr ('alfred', remap + '.value[0].value_Position')
print cmds.aliasAttr(remap, q=1)
So far so good. Now, using the api, and starting with just the alias name, I want to be able to get an MPlug for the plug it points to. Unfortunately, I haven't found a way to do this. The obvious way - using MFnDependencyNode.findAlias - only gives me a plug for the base attribute, not the specific index / child the alias actually refers to:
import maya.OpenMaya as om
sel = om.MSelectionList()
sel.add(remap)
obj = om.MObject()
sel.getDependNode(0, obj)
mfn = om.MFnDependencyNode(obj)
attr = om.MObject()
mfn.findAlias('alfred', attr)
plug = om.MPlug(obj, attr)
print plug.partialName(True, True, True, False, True, True)
However, what we end up with is remapValue1.value, not remapValue1.value[0].value_Position
Should I just be using getAliasList, and then feeding the text string into an MSelectionList? If so, what's the point of findAlias?
- Paul
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
import maya.OpenMaya as om
list = om.MSelectionList()
node = om.MObject()
list.add("blendShape1")
list.getDependNode(0, node)
dgNode = om.MFnDependencyNode(node)
aliasList = []
dgNode.getAliasList(aliasList)
# Result: [u'pSphere2', u'weight[0]', u'pSphere3', u'weight[1]'] #
I don't understand the MSelectionList combo, could you explain it please?
Thank you Paul.