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(Orig=vec2, Angle=float)
Definition coat.py:612
float Rand(Lo=float, Hi=float)
Definition coat.py:1280
toRoom(name=str)
switch to the room
Definition coat.py:3251
Mesh islandToMesh(uv_set=int, island_index=int)
get the mesh that contains the island, xy of each point is the UV coordinate.
Definition coat.py:3991
meshToIsland(mesh=Mesh, uv_set=int, island_index=int)
use the mesh (that was previously got by islandToMesh) to replace the island in the current uv-set
Definition coat.py:4038
int islandsCount(uv_set=int)
get the islands count over the current uv-set
Definition coat.py:3985
int currentUvSet()
get the current uv-set index
Definition coat.py:3980
pack(uv_set=int, rotate=bool, shuffle=bool)
pack the islands in the current uv-set
Definition coat.py:4044