3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
coat.uv Class Reference

Static Public Member Functions

int uvSetsCount ()
 get the UV-sets count.
 
 setUnwrapIslandsDistance (float distance)
 set the border around the islands when we pack it
 
float getUnwrapIslandsDistance ()
 get the border around the islands when we pack it
 
int currentUvSet ()
 get the current uv-set index
 
int islandsCount (int uv_set)
 get the islands count over the current uv-set
 
Mesh islandToMesh (int uv_set, int island_index)
 get the mesh that contains the island, xy of each point is the UV coordinate.
 
Mesh islandToMeshInSpace (int uv_set, int island_index)
 get the mesh that contains the island, each point is the coordinate in space (not the uv coordinate!).
 
list getIslandVertexMapping (int uv_set, int island_index)
 get the mapping from the vertex index in the mesh that was got by islandToMesh to the vertex index in the original mesh
 
list getIslandBorder (int uv_set, int island_index)
 get unsorted list of edges on the border of the island
 
list getBorderBetweenIslands (int uv_set1, int island_index1, int uv_set2, int island_index2)
 get the border between two islands
 
vec2 getIslandVertexUv (int uv_set, int island_index, int vertex_index)
 get the uv coordinate of the positional vertex in the island
 
Mesh flattenSingleIsland (Mesh mesh, int method, bool optimize_rotation=True, bool scale_to_geometry=True)
 Flatten the mesh that consists of the single island.
 
 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
 
 pack (int uv_set, bool rotate, bool shuffle)
 pack the islands in the current uv-set
 
 unwrap (int uv_set)
 unwrap the current uv-set
 
 toAbf (int uv_set, int island_index)
 unwrap the island using the ABF approach
 
 toLscm (int uv_set, int island_index)
 unwrap the island using the LSCM approach
 
 toGu (int uv_set, int island_index)
 unwrap the island using the GU (Globally Uniform) approach
 
 toPlanar (int uv_set, int island_index)
 unwrap the island using the Planar approach
 
 toStripe (int uv_set, int island_index)
 try to uwrap the island as the regular stripe
 
 toUvSet (int uv_set, int island_index, int destination_uv_set)
 move the island from one uv-set to another one
 
Mesh getWholeMesh ()
 get the whole mesh from the paint/UV/Retopo room - in dependence on current room
 
Mesh selectedToMesh ()
 get the selected faces as the Mesh object
 
list getSeams ()
 get all seams across the mesh
 
 addSeam (any start_vertex_index, int end_vertex_index)
 add the seam to the mesh
 
 removeSeam (int start_vertex_index, int end_vertex_index)
 remove the seam from the mesh
 
list getSharpEdges ()
 get the sharp edges across the mesh
 
 addSharpEdge (int start_vertex_index, int end_vertex_index)
 add the sharp edge to the mesh
 
 removeSharpEdge (int start_vertex_index, int end_vertex_index)
 remove the sharp edge from the mesh
 
 unwrapUnassigned ()
 re-wrap/extend islands in correspondence to the changed seams and inserted faces.
 
 applyUVSet ()
 apply uv changes to the paint room mesh (if we use uv/paint context)
 

Member Function Documentation

◆ addSeam()

coat.uv.addSeam ( any start_vertex_index,
int end_vertex_index )
static

add the seam to the mesh

Parameters
start_vertex_indexthe start positional vertex index
end_vertex_indexthe end positional vertex index

◆ addSharpEdge()

coat.uv.addSharpEdge ( int start_vertex_index,
int end_vertex_index )
static

add the sharp edge to the mesh

Parameters
start_vertex_indexthe start positional vertex index
end_vertex_indexthe end positional vertex index

◆ applyUVSet()

coat.uv.applyUVSet ( )
static

apply uv changes to the paint room mesh (if we use uv/paint context)

◆ currentUvSet()

int coat.uv.currentUvSet ( )
static

get the current uv-set index

Returns
the index

◆ flattenSingleIsland()

Mesh coat.uv.flattenSingleIsland ( Mesh mesh,
int method,
bool optimize_rotation = True,
bool scale_to_geometry = True )
static

Flatten the mesh that consists of the single island.

Parameters
meshthe mesh that consists of the single island
methodthe flattening method. 0 - flatten to the plane, 1 - LSCM, 2 - ABF, 3 - GU, 4 - Stripe (if possible)
optimize_rotationoptimize the rotation of the island, place it approximately horizontally or vertically
scale_to_geometryscale the island to keep average edge length equal to the average edge length of the original mesh
Returns
the flat mesh

◆ getBorderBetweenIslands()

list coat.uv.getBorderBetweenIslands ( int uv_set1,
int island_index1,
int uv_set2,
int island_index2 )
static

get the border between two islands

Parameters
uv_set1the uv set index of the first island
island_index1the island index within the uv set of the first island
uv_set2the uv set index of the second island
island_index2the island index within the uv set of the second island
Returns
the list of edges that are common for both islands, even amount of elements, each pair of elements is the positional vertex indices of the original mesh

◆ getIslandBorder()

list coat.uv.getIslandBorder ( int uv_set,
int island_index )
static

get unsorted list of edges on the border of the island

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set
Returns
the list of edges, even amount of elements, each pair of elements is the positional vertex indices of the original mesh

◆ getIslandVertexMapping()

list coat.uv.getIslandVertexMapping ( int uv_set,
int island_index )
static

get the mapping from the vertex index in the mesh that was got by islandToMesh to the vertex index in the original mesh

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set
Returns
the list of the positional vertex indices of the original mesh in same order as the vertices in the mesh that was got by islandToMesh

◆ getIslandVertexUv()

vec2 coat.uv.getIslandVertexUv ( int uv_set,
int island_index,
int vertex_index )
static

get the uv coordinate of the positional vertex in the island

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set
vertex_indexthe positional vertex index
Returns
the uv coordinate of the vertex, vec2(0,0) if the vertex is not in the island

◆ getSeams()

list coat.uv.getSeams ( )
static

get all seams across the mesh

Returns
the list of integer values, each value is the index of the vertex in the mesh, the even index is start of the seam, the odd index is the end of the seam

◆ getSharpEdges()

list coat.uv.getSharpEdges ( )
static

get the sharp edges across the mesh

Returns
the list of integer values, each value is the index of the vertex in the mesh, the even index is start of the edge, the odd index is the end of the edge

◆ getUnwrapIslandsDistance()

float coat.uv.getUnwrapIslandsDistance ( )
static

get the border around the islands when we pack it

Returns
the border size in percents

◆ getWholeMesh()

Mesh coat.uv.getWholeMesh ( )
static

get the whole mesh from the paint/UV/Retopo room - in dependence on current room

Returns
the whole paint or retopo mesh (in dependence on current room)

◆ islandsCount()

int coat.uv.islandsCount ( int uv_set)
static

get the islands count over the current uv-set

Parameters
uv_setthe uv-set index
Returns
teh islands count

◆ islandToMesh()

Mesh coat.uv.islandToMesh ( int uv_set,
int island_index )
static

get the mesh that contains the island, xy of each point is the UV coordinate.

The mesh contains only one island

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set
Returns
the flat mesh

◆ islandToMeshInSpace()

Mesh coat.uv.islandToMeshInSpace ( int uv_set,
int island_index )
static

get the mesh that contains the island, each point is the coordinate in space (not the uv coordinate!).

The mesh contains only one island. The faces correspond to the faces of the mesh that was got by islandToMesh

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set
Returns
s mesh the 3D mesh

◆ meshToIsland()

coat.uv.meshToIsland ( Mesh mesh,
int uv_set,
int island_index )
static

use the mesh (that was previously got by islandToMesh) to replace the island in the current uv-set

Parameters
meshthe mesh that was previously got by islandToMesh
uv_setthe uv set index
island_indexthe island index within the uv set

◆ pack()

coat.uv.pack ( int uv_set,
bool rotate,
bool shuffle )
static

pack the islands in the current uv-set

Parameters
uv_setthe uv set index
rotateallow rotation while packing
shuffleshuffle the identical islands to avoid the exact overlapping

◆ removeSeam()

coat.uv.removeSeam ( int start_vertex_index,
int end_vertex_index )
static

remove the seam from the mesh

Parameters
start_vertex_indexthe start positional vertex index
end_vertex_indexthe end positional vertex index

◆ removeSharpEdge()

coat.uv.removeSharpEdge ( int start_vertex_index,
int end_vertex_index )
static

remove the sharp edge from the mesh

Parameters
start_vertex_indexthe start positional vertex index
end_vertex_indexthe end positional vertex index

◆ selectedToMesh()

Mesh coat.uv.selectedToMesh ( )
static

get the selected faces as the Mesh object

Returns
the Mesh

◆ setUnwrapIslandsDistance()

coat.uv.setUnwrapIslandsDistance ( float distance)
static

set the border around the islands when we pack it

Parameters
distancethe border size in percents

◆ toAbf()

coat.uv.toAbf ( int uv_set,
int island_index )
static

unwrap the island using the ABF approach

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set

◆ toGu()

coat.uv.toGu ( int uv_set,
int island_index )
static

unwrap the island using the GU (Globally Uniform) approach

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set

◆ toLscm()

coat.uv.toLscm ( int uv_set,
int island_index )
static

unwrap the island using the LSCM approach

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set

◆ toPlanar()

coat.uv.toPlanar ( int uv_set,
int island_index )
static

unwrap the island using the Planar approach

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set

◆ toStripe()

coat.uv.toStripe ( int uv_set,
int island_index )
static

try to uwrap the island as the regular stripe

Parameters
uv_setthe uv set index
island_indexthe island index within the uv set

◆ toUvSet()

coat.uv.toUvSet ( int uv_set,
int island_index,
int destination_uv_set )
static

move the island from one uv-set to another one

Parameters
uv_setthe source uv set index
island_indexthe island index within the source uv set
destination_uv_setthe destination uv set index

◆ unwrap()

coat.uv.unwrap ( int uv_set)
static

unwrap the current uv-set

Parameters
uv_setthe uv set index

◆ unwrapUnassigned()

coat.uv.unwrapUnassigned ( )
static

re-wrap/extend islands in correspondence to the changed seams and inserted faces.

Pay attention, that it may lead to islands intersection.

◆ uvSetsCount()

int coat.uv.uvSetsCount ( )
static

get the UV-sets count.

Returns
the amount

The documentation for this class was generated from the following file: