How to get coordinates of vertices in world space using node?
i tried pnts but it seems it is not in space, just coordinates.
anyone have a way?
pnts attribute stores vertices relative tweaks (offsets from initial positions).
vrts attribute stores initial positions of vertices.
So, if you add them together, you would get corresponding vertex position in local (object) space (don’t think there’s an actual single attribute that will spit that out).
In theory, adding them (using plusMinusAverage node, for example) by making direct connections of matching vrts-pnts pairs should work:
But, vrts attribute is marked by Maya as internal (mesh node), and shouldn’t/mustn’t/can’t be used in this way - it won’t give any meaningful values, when directly connected, just zeros.
Since this attribute generaly isn’t changed (unless operations, like merging, welding, changing mesh construction input parameters, etc., are executed, that force updates of vrts attribute), you could query its values (using getAttr will give you correct results), and set them manually as one input to the plusMinusAverage node, while other input is direction connection to pnts attribute at same index.
This will give you “live” value of vertex position (you need to do this for all vertices of interest):
Only thing left to do after that is to convert those positions to world space. Autodesk says matrices are post-multiplied in Maya (transform node), so you just post-multiply object-space points (positions) by world matrix (world matrix comes second in multiply matrix operation), to get world space coordinates:
how to display mesh Vrtx, i searched but cant find it like the picture you sent.
i use 2025 maya
Right-click on mesh node (shape node, not transform) => “Show All Attributes” - vrts attribute will be near the bottom.
Though, like I said, this attribute isn’t supposed to be manipulated by user, and connecting to it would be futile; if you want to read its values, you gotta do it through code, for example:
from maya import cmds
# there's mesh named "sphere" in the scene
cmds.getAttr("sphere.vrts[0]") # or any vertex index of interest