Hey
if your mean is find world position of some selected component (vertex here)
you should use an script like this:

import maya.cmds as cmds

selVerts = cmds.ls(sl=True)
clst = cmds.cluster()
pos = cmds.xform(clst[1], q=True, ws=True, rp=True)
loc = cmds.spaceLocator()
cmds.move(pos[0], pos[1], pos[2])
cmds.delete(clst[1])

Now you have a locator that show you center of your selection.you can use
pos variable for finding the location of center.

Good luck
​

On Tue, Sep 16, 2014 at 7:35 PM, Matteo Di Lena <[email protected]>
wrote:

> Hi guys,
>
> I'm having troubles trying to find the center of a component selection
> (vertex, in this case) with
> python. I tried looking into commands reference, but I could't find
> anything useful.
>
> Is this possible with maya cmds or do I need some API?
>
> Thanks a lot for any help.
> -Matteo
>
> --
> 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/f43d48da-903b-4905-83e1-189228765579%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/f43d48da-903b-4905-83e1-189228765579%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Bests,
madoodia

-- 
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/CADvbQwKTGKEr04vFz4w_rbiUVS%3DpJXfCKnsyVn9%2Bv_7SeP80eQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to