View Full Version : prblm with vertex index versus vertexcolor index

10 October 2009, 02:59 PM

I've got a problem with vertex colors.

- I know the position for vertex 1 in a mesh using $.GetVertex 1
- I know the color for vertex 1 in channel 0 using polyop.getMapVert $ 0 1

But as the index for vertex color can be (will be) greater than the total amount of vertices in the editable_poly, I can't find any way to remap these colors or determine whether it's the right vertex or not. Say I'd like to pair vertices from different meshes by position then remap the vertex color accordingly. As the index are different and arbitrary, my remap function is f***ked (sob).

Bottom line, I lack the position info for each vc:0 in the map channel.
Am I doing something wrong (both editable_mesh and Editable_polys methods seem to behave the same way)? Any ideas?


10 October 2009, 03:06 PM
vertex indices dont match 99% of the time
face indices do

to get a match you get vertex and vertex color from a face
eq vetex 1 of face 3, will match vertexcolor 1 of vertex-color face 3

polyop.getMapVert $ 0 1 is correct, the 1st vert-color of face 0
$.GetVertex 1, thats just the 1st vertex in a vertex list, NOT the 1st vertex of face 0


10 October 2009, 03:38 PM
It makes a lot of sense! ^^

So, if I understand well:

polyop.getFaceVerts $ 1 -- Returns the vertices for face 1 - ex: #(3, 1, 7, 8)
polyop.getMapFace $ 0 1 -- Returns the VC for face 1 channel 0 - ex: #(1, 2, 3, 4)

And both arrays match and will pair.
Gotta go modify my scripts right now.

Thanks a bunch.

CGTalk Moderation
10 October 2009, 03:38 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.