Notifications
Clear all

[Closed] Get local vertex position in edit poly modifier

I’m trying to get the local coordinates for vertices in an edit poly modifier.


$.modifiers[#Edit_Poly].getVertex 1

This returns the world coordinates of vertex 1.
in coordsys #local doesn’t return the local coordinates either.

The only way I can get the local coordinates if I manually set the coordsys mode.


toolMode.coordsys #local
$.modifiers[#Edit_Poly].getVertex 1

But I’m sure there must be a better way. I hope there is.

3 Replies
 lo1

you don’t need the # in front of local. The syntax of the context is

in coordsys local

nevertheless, I don’t know if this is the solution to your problem.

 eek

Just take away the vertex position from the objects pivot position.

($.verts[1].pos – $.transform.pos)

localPos = worldPos * (inverse obj.transform)
or
localPos = getVert obj.mesh 1