3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
coat.uv Class Reference

Public Member Functions

int uvSetsCount ()
 get the UV-sets count.
 
 setUnwrapIslandsDistance (distance=float)
 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 (uv_set=int)
 get the islands count over the current uv-set
 
Mesh islandToMesh (uv_set=int, island_index=int)
 get the mesh that contains the island, xy of each point is the UV coordinate.
 
Mesh islandToMeshInSpace (uv_set=int, island_index=int)
 get the mesh that contains the island, each point is the coordinate in space (not the uv coordinate!).
 
list getIslandVertexMapping (uv_set=int, island_index=int)
 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 (uv_set=int, island_index=int)
 get unsorted list of edges on the border of the island
 
list getBorderBetweenIslands (uv_set1=int, island_index1=int, uv_set2=int, island_index2=int)
 get the border between two islands
 
vec2 getIslandVertexUv (uv_set=int, island_index=int, vertex_index=int)
 get the uv coordinate of the positional vertex in the island
 
Mesh flattenSingleIsland (mesh=Mesh, method=int, optimize_rotation=bool, scale_to_geometry=bool)
 Flatten the mesh that consists of the single island.
 
 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
 
 pack (uv_set=int, rotate=bool, shuffle=bool)
 pack the islands in the current uv-set
 
 unwrap (uv_set=int)
 unwrap the current uv-set
 
 toAbf (uv_set=int, island_index=int)
 unwrap the island using the ABF approach
 
 toLscm (uv_set=int, island_index=int)
 unwrap the island using the LSCM approach
 
 toGu (uv_set=int, island_index=int)
 unwrap the island using the GU (Globally Uniform) approach
 
 toPlanar (uv_set=int, island_index=int)
 unwrap the island using the Planar approach
 
 toStripe (uv_set=int, island_index=int)
 try to uwrap the island as the regular stripe
 
 toUvSet (uv_set=int, island_index=int, destination_uv_set=int)
 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 (start_vertex_index=Any, end_vertex_index=int)
 add the seam to the mesh
 
 removeSeam (start_vertex_index=int, end_vertex_index=int)
 remove the seam from the mesh
 
list getSharpEdges ()
 get the sharp edges across the mesh
 
 addSharpEdge (start_vertex_index=int, end_vertex_index=int)
 add the sharp edge to the mesh
 
 removeSharpEdge (start_vertex_index=int, end_vertex_index=int)
 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 (   start_vertex_index = Any,
  end_vertex_index = int 
)

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 (   start_vertex_index = int,
  end_vertex_index = int 
)

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 ( )

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

◆ currentUvSet()

int coat.uv.currentUvSet ( )

get the current uv-set index

Returns
the index

◆ flattenSingleIsland()

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

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 (   uv_set1 = int,
  island_index1 = int,
  uv_set2 = int,
  island_index2 = int 
)

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 (   uv_set = int,
  island_index = int 
)

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 (   uv_set = int,
  island_index = int 
)

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 (   uv_set = int,
  island_index = int,
  vertex_index = int 
)

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 ( )

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 ( )

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 ( )

get the border around the islands when we pack it

Returns
the border size in percents

◆ getWholeMesh()

Mesh coat.uv.getWholeMesh ( )

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 (   uv_set = int)

get the islands count over the current uv-set

Parameters
uv_setthe uv-set index
Returns
teh islands count

◆ islandToMesh()

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

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 (   uv_set = int,
  island_index = int 
)

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
mesh the 3D mesh

◆ meshToIsland()

coat.uv.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

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 (   uv_set = int,
  rotate = bool,
  shuffle = bool 
)

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 (   start_vertex_index = int,
  end_vertex_index = int 
)

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 (   start_vertex_index = int,
  end_vertex_index = int 
)

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 ( )

get the selected faces as the Mesh object

Returns
the Mesh

◆ setUnwrapIslandsDistance()

coat.uv.setUnwrapIslandsDistance (   distance = float)

set the border around the islands when we pack it

Parameters
distancethe border size in percents

◆ toAbf()

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

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 (   uv_set = int,
  island_index = int 
)

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 (   uv_set = int,
  island_index = int 
)

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 (   uv_set = int,
  island_index = int 
)

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 (   uv_set = int,
  island_index = int 
)

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 (   uv_set = int,
  island_index = int,
  destination_uv_set = int 
)

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 (   uv_set = int)

unwrap the current uv-set

Parameters
uv_setthe uv set index

◆ unwrapUnassigned()

coat.uv.unwrapUnassigned ( )

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 ( )

get the UV-sets count.

Returns
the amount

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