[Closed] Vertex Picking, not to be confused with vertex selection
I need a way for a user of a script to pick vertices (like you would pick an object with pickObject() ) but I can’t find anything…
Best I can figure is that you use pickPoint() with vertex snap on, loop through all the vertices in the object and if the point and vertex position match exactly (or within a tolerance) we have a winner.
OR
Loop through all the vertices. Project them into screen space. Find the mouse pointer position. Compare the values. Voila.
But I don’t think that either of these methods will be very fast.:sad:
I assume that the object is in vertex subobject mode and you are worried about losing the vert selection.
Try this if it works –
- Save current vertex selection in some variable.
- Promt the user for selection of a verts.
- Get that vert.
- Reselect the old verts again.
No, I want the user to be able to pick vertices that the script will “capture”, the script will then perform a function on the selected verts. I can’t rely on vertex selections because they don’t retain the order in which they were selected.