PDA

View Full Version : uvwVertices (editablePoly)


prettyPixel
02-11-2005, 05:56 PM
Hello

Is it possible to find the index of a vertex from a uvwVertex ?
I do not find good method...

Can anyone help?

Bobo
02-11-2005, 06:29 PM
Hello

Is it possible to find the index of a vertex from a uvwVertex ?
I do not find good method...

Can anyone help?

fn getVertsUsingMapVert theObj theMapChannel theIndex =
(
correspondingVertices = #{} --init. a bitarray
numFaces = polyOp.getNumMapFaces theObj theMapChannel --get the number of map faces
for f = 1 to numFaces do --go through all of them
(
theMapFace = polyOp.getMapFace theObj theMapChannel f --get the list of vertices defining the map face
checkForVertex = findItem theMapFace theIndex --see if the searched one is there
if checkForVertex > 0 then --if it is,
(
polyFace = polyOp.getFaceVerts theObj f --get the list of vertices in the poly face
append correspondingVertices polyFace[checkForVertex] --add to the bitarray
)
)
correspondingVertices --return the result
)



Typically, you will get a single mesh vertex, but it is technically possible to have more than one mesh vertex poiting at the same map vertex...

prettyPixel
02-12-2005, 12:37 AM
Thank you very much for this function and your help !
I see that there is a relation of the order of MapVert/Vert in the same face(*).

It is going to allow me to improve the program on which I work.
It is a script which creates mapping coordinates automatically on an irregular object.
For example, if the object is a "S" the mapping will follow the "S"; if the object is a "U", the mapping will also follow it.

(*)I have another question: Do you think that it is impossible to create an object which does not respect this rule? When I create mapping coordinates in my script, I'm not sure that I respect this order...

Bobo
02-12-2005, 01:49 AM
Thank you very much for this function and your help !
I see that there is a relation of the order of MapVert/Vert in the same face(*).

It is going to allow me to improve the program on which I work.
It is a script which creates mapping coordinates automatically on an irregular object.
For example, if the object is a "S" the mapping will follow the "S"; if the object is a "U", the mapping will also follow it.

(*)I have another question: Do you think that it is impossible to create an object which does not respect this rule? When I create mapping coordinates in my script, I'm not sure that I respect this order...

The key to understanding Mapping coordinates is to realize that the number of faces in the mesh and in the map channel is always identical and the indices within these faces also correspond to each other, so the 3rd vertex of a mesh face has a relationship with the 3rd vertex of a map face.

I am not sure what exactly you are doing, but I wish you luck!
I think it is always possible to create an object that is completely FUBAR and would fail any script, but I cannot say for sure ;)

CGTalk Moderation
02-12-2006, 02:00 AM
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.