Randomly rotate the UV islands and pack them.
Randomly rotate the UV islands and pack them
1
2import coat
3
4
6
9
10for i in range(n_islands):
12
13 center = island_mesh.getBounds().GetCenter()
15
18
mat4 RotationAt(vec2 Orig, float Angle)
Definition coat.py:574
float Rand(float Lo, float Hi)
Definition coat.py:1217
toRoom(str name, bool Force=False)
switch to the room
Definition coat.py:3284
int islandsCount(int uv_set)
get the islands count over the current uv-set
Definition coat.py:3971
meshToIsland(Mesh mesh, int uv_set, int island_index)
use the mesh (that was previously got by islandToMesh) to replace the island in the current uv-set
Definition coat.py:4024
pack(int uv_set, bool rotate, bool shuffle)
pack the islands in the current uv-set
Definition coat.py:4030
int currentUvSet()
get the current uv-set index
Definition coat.py:3966
Mesh islandToMesh(int uv_set, int island_index)
get the mesh that contains the island, xy of each point is the UV coordinate.
Definition coat.py:3977