Thank you Eric!

Sorry about getPosition, my bad, I actually mean getTranslation.


On Wednesday, March 11, 2015 at 12:02:20 PM UTC+7, AK Eric wrote:
>
> Nearly everything you need can be accessed by importing pymel.core
> When running this:
>
> myname = "loop_anim_v001:master_ctrl"
> pmc.objExists(myname)
> # True
>
> You're passing the string name to the PyMel command.  Note most of their 
> commands take either strings, or PyNodes.
> The reason your getPosition method is failing is that myname is a string, 
> not a PyNode.
> Do this to convert to a PyNode from string:
>
> mynode = pmc.PyNode(myname)
>
> However, I'm not sure what the "getPosition" function\method your calling 
> lives.  You could do something like:
>
> restPos = mynode.getRestPosition()
>
> Since that's a method of a PyNode Transform (presuming myname was a 
> transform).
>
> The reason this works: (and I added the pmc, I presume you left that off)
>
> myobj = pmc.polySphere()
>
> Is that PyMel returns PyNodes when nodes are created, rather than strings, 
> so all the methods are available.
>
>
>
>

-- 
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/4e64741b-1a88-4834-a295-9a4dfac7f708%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to