uv_textures and uv_layers

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

damix
Posts: 21
Joined: Wed Dec 07, 2011 4:42 pm

uv_textures and uv_layers

Postby damix » Fri May 25, 2012 10:07 pm

Hi everybody, I can't really understant the relationship between these two collections, uv_textures and uv_layers. It seems that they always have the same length, equal to the number of entries of the "UV Maps" section of the "Object Data" menu.

uv_layers is a collection of objects, each one containing a collection of UV coordinate pairs (member data).

uv_textures is a collection of objects, each one containing a name (member name) and a collection of objects (member data), each one containing a single image.

I would like to know:

1) Why these two collections are kept separate, if they are always synchronized with a single element of the UI, namely the "UV Maps" section of the "Object Data" menu.
2) Why the data member of the texture object has exactly one entry for each face of the object? This suggests that there can be a different texture for each face of an object.

Are you aware of a good explanation of these two collections? Thank you in advance.

Dario

damix
Posts: 21
Joined: Wed Dec 07, 2011 4:42 pm

Re: uv_textures and uv_layers

Postby damix » Sat May 26, 2012 1:24 am

I think I realized something regarding the second question:

2) Why the data member of the texture object has exactly one entry for each face of the object? This suggests that there can be a different texture for each face of an object.


When you open an image on the UV Editor, it gets associated only to the current selected faces. So in principle there is a different image for each face. Also, the name member of the objects in the uv_textures collection is really the one you set in the "UV Maps" section of the "Object Data" menu.


Return to “Python”

Who is online

Users browsing this forum: No registered users and 0 guests