Notifications
Clear all

[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:

2 Replies

I assume that the object is in vertex subobject mode and you are worried about losing the vert selection.
Try this if it works –

  1. Save current vertex selection in some variable.
  2. Promt the user for selection of a verts.
  3. Get that vert.
  4. 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.