layout_UVs
Pack UVs of meshes in a given tile space. They are packed in the [0,1] tile space by default. The UVs of each mesh are packed with respect to the UVs of the other meshes so that they do not overlap with each other.
Inputs
meshes
The meshes to layout.
faces_to_layout
The faces of each mesh to layout.
Several possible input types are supported:
- An
array<bool>is interpreted as face tag data, applied to each input mesh. - An
array<long>orarray<uint>is interpreted as face indices, applied to each input mesh. - A
longis interpreted as a single face index, applied to all meshes. - A
boolis interpreted as a constant value for all faces of all meshes. - A
stringis interpreted as the name of an existing tag or a tag expression that applies to all meshes. See the documentation forresolve_tag_expressionfor more details on the tag expression syntax. - An
array<string>is interpreted as the name of an existing tag or tag expression, one for each mesh. The array should be the same size as the array of input meshes. - An
array<array<long>>orarray<array<uint>>is interpreted as a 2d array of face indices, one for each mesh. The outer dimension should be the same size as the array of input meshes. The inner dimension is the array of face indices to layout for that particular mesh. - An
array<array<bool>>is interpreted as a 2d array of face tag data, one for each mesh. The outer dimension should be the same size as the array of input meshes. The inner dimension is the array of face tags to layout for that particular mesh.
Advanced Section
uv_number
Meshes can contain many UV sets. This port specifies which UV set to pack. See get_mesh_uvs for more details.
tile_coordinate
The tile to pack the UVs into. By default UVs will be placed in the traditional {0, 0} tile that covers the space from {0, 0} to {1, 1}. For example a value of {0, 1} will place the UVs into the space covered by {0, 1} to {1, 2}.
resolution
The target texture width and height that will be applied to the meshes.
padding
The minimum spacing between UV islands, in texels. Use larger values with textures that will be mipmapped to eliminate visible texture seams when the mesh is rendered.
keep_aspect_ratio
When true the UV islands' shape will be preserved. (i.e. no non-uniform scaling will be applied). When set to false, the UV islands will be non-uniformly scaled to fill the entire UV tile space. This will improve the coverage of UV space of the islands, but can distort the islands' shape.
allow_rotations
Allow the individual UV islands to be rotated independently. The packing efficiency can be higher when this option is enabled.
Outputs
first_out_mesh
The first output mesh. This is just a shortcut to get the first mesh returned from the out_meshes array. It is useful when only a single mesh is being laid out.
out_meshes
The meshes with their UVs updated.
utilization
The texel utilization rate of the generated UV layout. This number is in the range 0 to 1. Higher numbers represent more tightly packed UVs.
