[Closed] How to pick a vertex?
Anyone knows hoy to pick a vertex of any object in a viewport?, I mean, if you use pickbutton you can get an object, but I want the user to pick two vertex on two different objects for getting the distance betwen those two vertex.
Thank you in advance.
Anyone??..
The only solution I found so far is to select the vertex before running the script and then work on the selection… anyone found something diferent?
Have you looked at the pickPoint() function?
It seems to do what you want and you can snap to 3D space.
With a bit of tinkering I think you can get it to snap to vertices
This works on editable meshes:
fn pickAVert = (
vertPos = pickPoint snap:#3d
for i = 1 to getNumVerts $ do (
if (getVert $ i) == vertPos then (
setVertSelection $ #(i)
return i
)
)
return undefined
)