View Full Version : Selected vertex on mesh using python
06-21-2012, 10:08 PM
I just need to know how to get the vertex information which has been selected on a mesh.
06-22-2012, 01:29 AM
import pymel as pm
EDIT: Thanks, I changed mc to pm.
06-22-2012, 06:35 AM
You should replace "mc" with "pm" and it should work.
You didnt say what vertex info you were interested in.
zoharl demonstrated how to get some position info, but that would only be its preTransform position, meaning not taking into account the transforms that may be on the mesh or its heirarchy.
Anyway, here's a more general answer.
Use the nice pymel method for getting the selected vert
v = pm.selected()
Then use dir() to get a list of methods you can use to extract vertex info
You can use help() to see what parameters may be available
Then you could get various info...
06-22-2012, 02:27 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.