Did you solve this or anyone knows how to get the MPlug from the alias name
in a MFnDependencyNode?
Also I've tried with getAliasAttr but I don't know what to do with the
returned MObject.

Thank you!


On Mon, Jan 24, 2011 at 4:14 AM, Paul Molodowitch <[email protected]>wrote:

> Hey all - so, I have an alias which refers to an multi-compound attribute:
>
> import maya.cmds as cmds
>
> remap = cmds.createNode('remapValue')
>
> 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
>
>  --
> http://groups.google.com/group/python_inside_maya
>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to