PDA

View Full Version : Get Vert Position by UV


soulburn3d
09-27-2009, 12:16 AM
Say you're interrogating a unwrap UVW modifier. You can say something like this...

selection[1].modifiers[1].getVertexPosition 1 1

That will get you the U and V values of the first UV on your object.

But how can you get the World xyz position of the UV's corresponding vertex? Or at the very least the Index of that vertex? Or are the vertex indexes and uv indexes identical?

- Neil

Piflik
09-27-2009, 12:42 AM
I am pretty sure that they are not identical, since one geometry Vertex can be split into multiple UV Vertices.

But I think the selected geometry Vertex in the Unwrap editor is updated, whenever you select a UV Vertex. So it should be possible to extract that info by selecting the specified UV Vertex and the getting the selected geometry Vertex...

selection[1].modifiers[1].selectVertices #{1}
SelectedVerts = selection[1].modifiers[1].getSelectedGeomVerts()
VertPos = SelectedVerts[1].pos


Just an idea...

soulburn3d
09-27-2009, 05:01 PM
I am pretty sure that they are not identical, since one geometry Vertex can be split into multiple UV Vertices.

Ya, that's what I was thinking, but I doubted myself for a second since it seemed so odd to me that there wasn't a direct way to access one from the other.

But I think the selected geometry Vertex in the Unwrap editor is updated, whenever you select a UV Vertex. So it should be possible to extract that info by selecting the specified UV Vertex and the getting the selected geometry Vertex...

Ah cool, that makes sense, use selection to link the two bits of info together. Kinda roundabout, but it works. Thanks.

- Neil

CGTalk Moderation
09-27-2009, 05:01 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.