dependency mesh.polygons.vertices and uv map layer????

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
anders211
Posts: 0
Joined: Tue May 07, 2013 10:18 pm

dependency mesh.polygons.vertices and uv map layer????

Post by anders211 » Sat Jul 20, 2013 5:54 pm

I have cube which has 3 uv layer maps. There are vertices which participate in only one uv layer map, 2 or even all 3. I pinned my uv map vertices.
When I execute the below code I get output:

Code: Select all

  LayerAmount = []
            LayerCurrentNr = []
            for index in range(len(Mesh.vertices)):
                LayerAmount.append(0)
                LayerCurrentNr.append(0)
                for uvlayer in Mesh.uv_layers:
                    if uvlayer.data[index].pin_uv == True:
                        LayerAmount[index] += 1
                print("Layer uv amount for vertex ", index, " is equal to ", LayerAmount[index])
output:
Layer uv amount for vertex 0 is equal to 1
Layer uv amount for vertex 1 is equal to 1
Layer uv amount for vertex 2 is equal to 1
Layer uv amount for vertex 3 is equal to 1
Layer uv amount for vertex 4 is equal to 1
Layer uv amount for vertex 5 is equal to 1
Layer uv amount for vertex 6 is equal to 1
Layer uv amount for vertex 7 is equal to 1

And I don't understand why there is such strange output.
If vertex 'N' is located and pinned in x uv maps, then I should get:
Layer uv amount for vertex N is equal to X

So I completely don't understand the horrible logic which creators of blender implemented. I am implementing directx exporter and how can I get to know in which ub map layers 'mesh.polygons.vertices' instance occurs???

Post Reply