With OpenMaya
selectionList = OpenMaya.MSelectionList()
selectionList.add('pSphere')
oNode = OpenMaya.MObject()
selectionList.getDependNode(0, oNode)
fnNode = OpenMaya.MFnDependencyNode(oNode)
plug = fnNode.findPlug('myAttribute')
value = plug.asInt() (or asDouble, or asBool, or whatever)
On Tue, Oct 21, 2008 at 11:34 AM, Ali Poursamadi <[EMAIL PROTECTED]>wrote:
>
> # Have you tried something like this ?
>
> import maya.cmds as cmds
>
> targetObject = 'pSphere'
> targetAttr = 'translateX'
>
> attrValue = cmds.getAttr ( targetObject + "." +targetAttr )
>
> # you can replace translateX with any attribute on that object
>
>
> On Tue, Oct 21, 2008 at 9:36 PM, Doug Brooks <[EMAIL PROTECTED]> wrote:
>
>>
>> Hi Everyone,
>>
>> I've been diving into the the python api with limited success. It
>> would be a huge help if someone could give me a pointer on how to find
>> the value of an attr on an object called pSphere (by name not by
>> currently selection) with openMaya. I'm missing something that's
>> probably simple.
>>
>> thanks!!!!
>> Doug Brooks
>>
>>
>
> >
>
--
www.chadvernon.com
--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---