transformUV parameters uv_index and uv_index_from

Hi all!

-> transformUV has two optional parameters: uv_index and uv_index_from.

Does anybody know what exactly these parameters do? I read the description as "Take the uv coordinates from the UV-Map [uv_index_from] and copy them to the UV-Map [uv_index] and apply transformation. But this doesn’t seem to be what’s happening …


I never used this attribute. I guess following - the mesh can have up to two uv-maps (multi-texture). So the index is 0 for the first and 1 for the second UV map or -1 for both.

The matrix is applied for all UV-attributes of a UV map. But I have no idea how this is mixed with the “from” uv map. Maybe the “from” map is the source. The matrix is applied to the map and the result goes to the first UV map?

I really do not know.

I had some tests. somehow the “from” argument is not optional. If it is missing I get an error.
If both indices are equal I can apply a 4D transformation matrix (with 2D transformation). The result will be applied to the source/destination map. This is pretty nifty as you do not need to loop though the vertices :).

If I set use transformUV(-1, matrix 0,1) I always get a pink cube ;). This might be a laaaarge scale or just a mistake.
transformUV seems to do nothing.

Hi Monster,

this is what I would have expected, too. But it seems to do something … different. Meanwhile I had a look at the sources (use the source, Luke!) but they suggest the same … perhaps a bug. Or I’m to stupid to understand them. I wanted to do some debugging, but I failed completely compiling blender. (What a shame. This used to work before…) Luckily my code runs and this would only be an optimization.

I had problems with Blender build too. I took me weeks to get it build on Windows. On Linux it was a matter of some hours (but still not that fluent as I expected). Currently I do not do anything with it. So my investigation is more an observation on trial and error.