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
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f43d48da-903b-4905-83e1-189228765579%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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 <dilena...@gmail.com> 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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f43d48da-903b-4905-83e1-189228765579%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Bests,madoodia