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

Public Member Functions

 __init__ (self)
 
 __init__ (self, source=Model)
 
 __init__ (self, source=Mesh)
 
Model __assign__ (self, source=Model)
 
Model __assign__ (self, source=Mesh)
 
Model __iadd__ (self, source=Model)
 
Model __iadd__ (self, source=Mesh)
 
Model transform (self, m=mat4)
 transform the whole Model with the matrix
 
Model MakeCopy (self)
 make a copy of the source mesh.
 
 __init__ (self)
 
Model fromRetopo ()
 get the reference to the mesh in the retopo room
 
Model fromModeling ()
 get the reference to the mesh in the modeling room, currently it is the same mesh as in the retopo room
 
Model fromUv ()
 get the reference to the mesh in the uv room, pay attention that topology changes to that mesh may lead to instability!
 
 displayOptions (self, showWireframe=bool, showColored=bool, showSeams=bool, showSharpEdges=bool, smoothView=bool)
 Set the display options for the retopo/modeling/uv meshes.
 
int getObjectsCount (self)
 get the retopo groups count
 
int getCurrentObject (self)
 get the index of the current group
 
 setCurrentObject (self, index=int)
 set the current group index
 
str getObjectName (self, group_index=int)
 get the retopo group name
 
 removeObject (self, group_index=int)
 remove the group by index
 
 setObjectName (self, index=int, name=str)
 rename the group by index
 
 setObjectVisibility (self, index=int, visible=bool)
 set the group visibility
 
bool getObjectVisibility (self, index=int)
 get the group visibility
 
int addObject (self, name=str)
 add new retopo group
 
int addMaterial (self, name=str)
 add the new UV set/Material
 
 removeUnusedMaterials (self)
 remove all unused UV sets (not referred within the mesh)
 
vec4 getObjectReferenceColor (self, group_index=int)
 get the group reference color
 
 setObjectReferenceColor (self, group_index=int, color=vec4)
 set the group reference color
 
 selectedToObject (self, group_index=int)
 move the selected faces to the group
 
Mesh getWholeMesh (self)
 get the whole mesh from the retopo room
 
Mesh selectedToMesh (self)
 get the selected faces as the Mesh object
 
Mesh visibleToMesh (self)
 get the visible faces as the Mesh object
 
 addTransformed (self, mesh=Mesh, Transform=mat4, b=BoolOpType, select=bool, snap_to_existing=bool)
 insert the mesh to the retopo/modeling room, each object of the mesh treated as the new retopo layer
 
Mesh getObjectMesh (self, group_index=int)
 get the mesh from some retopo group
 
 setObjectMesh (self, group_index=int, mesh=Mesh, transform=mat4)
 replace the retopo layer with mesh
 
int duplicateObject (self, group_index=int, name=str, transform=mat4, select=bool)
 duplicate the object (retopo group)
 
str generateName (self, base=str)
 generate unique name for the object, it will start as the string in base base
 
 clearObjectMesh (self, group_index=int)
 remove all faces from the group
 
 clear (self)
 clear the whole mesh
 
 dropUndo (self)
 Drop the whole mesh to the undo queue, it is important if you want allow the user to undo your mesh changes, call it before your changes.
 
list getSelectedFaces (self)
 get the list of selected faces
 
 setSelectedFaces (self, faces=list)
 set the selected faces list
 
 selectFace (self, face=int)
 select the face by index
 
 selectObject (self, group_index=int, add_to_selected=bool)
 select all feces in the group
 
list getObjectFaces (self, group_index=int)
 get the list of faces in the group
 
bool isFaceSelected (self, face=int)
 check if the face selected
 
 unselectAllFaces (self)
 unselect all faces
 
 expandSelection (self)
 expand the faces/vertices/edges selection to the connected geometry
 
 contractSelection (self)
 contract the faces/vertices/edges selection to the connected geometry
 
 selectedToEdges (self)
 convert faces/vertices selection to edges selection
 
 selectedToFaces (self)
 convert edges/vertices selection to faces selection
 
 selectedToVertices (self)
 convert faces/edges selection to vertices selection
 
list getSelectedEdges (self)
 returns even amount of vertex indices, pairs os start and end vertices of the selected edges
 
 setSelectedEdges (self, edges=list)
 set the selected edges list
 
 selectEdge (self, vertex1=int, vertex2=int)
 select the edge by vertex indices (add to selection)
 
bool isEdgeSelected (self, vertex1=int, vertex2=int)
 check if the edge is selected, order of vertices has no matter
 
 unselectAllEdges (self)
 unselect all edges
 
list getSelectedVertices (self)
 get the list of selected vertices
 
list getSelectedVerticesWeights (self)
 get the soft selection weights of the selected vertices, 1 is maximum value
 
 setSelectedVertices (self, vertices=list, weights=list)
 set the selected vertices list
 
 selectVertex (self, vertex=int, weight=float)
 add the vertex to the selection
 
bool isVertexSelected (self, vertex=int)
 check if the vertex is selected
 
 unselectAllVertices (self)
 unselect all vertices
 
int facesCount (self)
 get the faces count
 
int vertsCount (self)
 get the positional vertices count
 
int vertsUvCount (self)
 get the uv vertices count
 
 removeFace (self, face=int)
 remove the face by index
 
int createNewFace (self, Group=int, UVSet=int)
 create empty face, you need to call setFaceVertices to set the vertices, setFaceUVVerts to set the UV vertices
 
int getFaceVertsCount (self, face=int)
 get the vertices count over the face
 
int getFaceVertex (self, face=int, vertex_index=int)
 get the vertex index over the face
 
list getFaceVerts (self, face=int)
 get the list of UV vertex indices over the face, pay attention UV vertices are not same as position vertices
 
 setFaceVerts (self, face=int, vertices=list)
 set the list of positional vertex indices over the face
 
bool getFaceVisibility (self, face=int)
 get the face visibility
 
 setFaceVisibility (self, face=int, visibility=bool)
 set the face visibility
 
float getFaceSquare (self, face=int)
 get the face square
 
float getFaceUVSquare (self, face=int)
 get the face square in UV space
 
vec3 getFaceNormal (self, face=int)
 get the face normal
 
int getFaceObject (self, face=int)
 get the group index of the face
 
 setFaceObject (self, face=int, group=int)
 set the group index of the face
 
int getFaceMaterial (self, face=int)
 get the UV set index for the face
 
 setFaceMaterial (self, face=int, uv_set=int)
 set the UV set for the face
 
int getFaceUvVertsCount (self, face=int)
 get the amount of UV vertices over the face
 
int getFaceUvVertex (self, face=int, vertex_index=int)
 get the UV vertex index over the face
 
list getFaceUvVerts (self, face=int)
 get the list of UV vertices indices over the face
 
 setFaceUvVerts (self, face=int, vertices=list)
 set the UV vertices for the face
 
vec3 getVertex (self, vertex=int)
 get the vertex position in space
 
 setVertex (self, vertex=int, position=vec3)
 set the vertex position in space
 
int createNewVertex (self, position=vec3)
 create the positional vertex
 
vec2 getVertexUV (self, uv_vertex=int)
 get the UV coordinates of the UV vertex
 
 setVertexUV (self, uv_vertex=int, uv=vec2)
 set the UV for the UV vertex
 
int createNewUvVertex (self, uv=vec2)
 create new UV vertex to be used for faces
 
vec3 getVertexNormal (self, vertex=int)
 get vertex normal, calculated as average of adjacent faces normals
 
 updateNormals (self, for_snapping=bool)
 update the vertex normals
 
 updateTopology (self)
 update the connectivity information, it should be called sometimes if you feel that the connectivity information lost due to some heavy operations
 
 cleanup (self)
 complete cleanul from non-manifolds or other problems, some faces may be removed
 
list getVertsNearVertex (self, vertex=int)
 get the list of vertices that are adjacent to the vertex
 
list getFacesNearVertex (self, vertex=int)
 get the list of faces that are adjacent to the vertex
 
list getFaceNeighbors (self, face=int)
 get the list of faces that are adjacent to the face
 
list getFacesNearEdge (self, vertex1=int, vertex2=int)
 get the list of faces that are adjacent to the edge
 
bool isOpenEdge (self, vertex1=int, vertex2=int)
 check if the edge is open
 
bool isSharpEdge (self, vertex1=int, vertex2=int)
 check if the edge is sharp
 
 setEdgeSharpness (self, vertex1=int, vertex2=int, sharp=bool)
 set the sharpness state for the edge
 
bool isSeam (self, vertex1=int, vertex2=int)
 check if edge is seam
 
 setEdgeSeam (self, vertex1=int, vertex2=int, seam=bool)
 set or clear the seam state for the edge
 
 collapseEdge (self, vertex1=int, vertex2=int)
 collapse the edge to the middle of the edge
 
int islandsCount (self, uv_set=int)
 get the islands count over the current uv-set
 
Mesh islandToMesh (self, uv_set=int, island_index=int)
 get the mesh that contains the island, xy of each point is the UV coordinate.
 
Mesh islandToMeshInSpace (self, 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 (self, 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 (self, uv_set=int, island_index=int)
 get unsorted list of edges on the border of the island
 
list getBorderBetweenIslands (self, uv_set1=int, island_index1=int, uv_set2=int, island_index2=int)
 get the border between two islands
 
vec2 getIslandVertexUv (self, 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 (self, 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 (self, uv_set=int, rotate=bool, shuffle=bool)
 pack the islands in the current uv-set
 
 unwrap (self, uv_set=int)
 unwrap the current uv-set
 
 toAbf (self, uv_set=int, island_index=int)
 unwrap the island using the ABF approach
 
 toLscm (self, uv_set=int, island_index=int)
 unwrap the island using the LSCM approach
 
 toGu (self, uv_set=int, island_index=int)
 unwrap the island using the GU (Globally Uniform) approach
 
 toPlanar (self, uv_set=int, island_index=int)
 unwrap the island using the Planar approach
 
 toStripe (self, uv_set=int, island_index=int)
 try to uwrap the island as the regular stripe
 
 extrudeSelected (self)
 Extrude the selected edges or selected faces without the actual moving of the extruded elements.
 
 moveSelectedFacesAlongFacesNormals (self, displacement=float)
 move selected faces along the faces normals, trying to keep faces parallel to the original direction
 
 moveSelectedFacesAlongVertexNormals (self, displacement=float)
 move selected faces along the vertex normals, each vertex displace on the same distance
 
 subdivideSelectedFaces (self, apply_catmull_clark=bool)
 subdivide the selected faces
 
 subdivide (self, apply_catmull_clark=bool)
 subdivide the whole mesh
 
 transformSelected (self, transform=mat4, apply_symmetry=bool)
 apply the transformation to the selected elements
 
 scaleSelectedFacesClusters (self, scale=float, method=ClusterScale)
 scale each selection cluster separately, to own center mass
 
 bevelOverSelectedVertices (self, size=float)
 perform the bevel over the selected vertices.
 
 bevelOverSelectedEdges (self, size=float, segments=int, OldVariant=bool)
 perform the bevel over the selected edges.
 
int splitEdge (self, vertex1=int, vertex2=int, position=float)
 split existing edge somewhere between vertices.
 
bool connect (self, vertex1=int, vertex2=int)
 split existing edge somewhere between vertices.
 
bool checkConnectivity (self, vertex1=int, vertex2=int)
 check if connecting the two vertices is possible
 
 connectSelectedVerts (self)
 connect selected vertices in smart way
 
 invertSelectedFacesTopoplogically (self)
 invert selected faces only within the connective area, if some objects has no selected faces, the selection there will not change
 
 inset (self, distance=float)
 perform the inset over the selected faces
 
 shell (self)
 perform the shell operation over the selected faces.
 
 intrude (self)
 perform the intrude operation over the selected faces.
 
 relaxSelected (self)
 relax selected vergtices
 
 selectPath (self, vertex1=int, vertex2=int)
 select all edges on the path from vertex1 to vertex2 (add to existing edges selection)
 
list getPath (self, vertex1=int, vertex2=int)
 get all vertices on the path from vertex1 to vertex2
 

Constructor & Destructor Documentation

◆ __init__() [1/4]

coat.Model.__init__ (   self)

◆ __init__() [2/4]

coat.Model.__init__ (   self,
  source = Model 
)

◆ __init__() [3/4]

coat.Model.__init__ (   self,
  source = Mesh 
)

◆ __init__() [4/4]

coat.Model.__init__ (   self)

Member Function Documentation

◆ __assign__() [1/2]

Model coat.Model.__assign__ (   self,
  source = Mesh 
)

◆ __assign__() [2/2]

Model coat.Model.__assign__ (   self,
  source = Model 
)

◆ __iadd__() [1/2]

Model coat.Model.__iadd__ (   self,
  source = Mesh 
)

◆ __iadd__() [2/2]

Model coat.Model.__iadd__ (   self,
  source = Model 
)

◆ addMaterial()

int coat.Model.addMaterial (   self,
  name = str 
)

add the new UV set/Material

Parameters
namethe name
Returns
the new UV set/Material index

◆ addObject()

int coat.Model.addObject (   self,
  name = str 
)

add new retopo group

Parameters
namethe group name
Returns
the index of new group

◆ addTransformed()

coat.Model.addTransformed (   self,
  mesh = Mesh,
  Transform = mat4,
  b = BoolOpType,
  select = bool,
  snap_to_existing = bool 
)

insert the mesh to the retopo/modeling room, each object of the mesh treated as the new retopo layer

Parameters
meshthe Mesh object
Transformthe transformation matrix
bthe boolean operation type
selectthe flag that indicates if we need to select faces of the the inserted mesh, used only if b is BOOL_MERGE
snap_to_existingthe flag that indicates if we need to snap the mesh to the existing sculpt/paint objects

◆ bevelOverSelectedEdges()

coat.Model.bevelOverSelectedEdges (   self,
  size = float,
  segments = int,
  OldVariant = bool 
)

perform the bevel over the selected edges.

Parameters
sizethe bevel width
OldVariantif true the older variant of the bevel (splits edges in strightforward way), in some cases it works more stable.

◆ bevelOverSelectedVertices()

coat.Model.bevelOverSelectedVertices (   self,
  size = float 
)

perform the bevel over the selected vertices.

As result, new faces will be selected

Parameters
sizethe bevel size

◆ checkConnectivity()

bool coat.Model.checkConnectivity (   self,
  vertex1 = int,
  vertex2 = int 
)

check if connecting the two vertices is possible

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
Returns
true if connection is possible

◆ cleanup()

coat.Model.cleanup (   self)

complete cleanul from non-manifolds or other problems, some faces may be removed

◆ clear()

coat.Model.clear (   self)

clear the whole mesh

◆ clearObjectMesh()

coat.Model.clearObjectMesh (   self,
  group_index = int 
)

remove all faces from the group

Parameters
group_indexthe group index

◆ collapseEdge()

coat.Model.collapseEdge (   self,
  vertex1 = int,
  vertex2 = int 
)

collapse the edge to the middle of the edge

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)

◆ connect()

bool coat.Model.connect (   self,
  vertex1 = int,
  vertex2 = int 
)

split existing edge somewhere between vertices.

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
Returns
true if succeeed to connect

◆ connectSelectedVerts()

coat.Model.connectSelectedVerts (   self)

connect selected vertices in smart way

◆ contractSelection()

coat.Model.contractSelection (   self)

contract the faces/vertices/edges selection to the connected geometry

◆ createNewFace()

int coat.Model.createNewFace (   self,
  Group = int,
  UVSet = int 
)

create empty face, you need to call setFaceVertices to set the vertices, setFaceUVVerts to set the UV vertices

Parameters
Groupthe face group index
UVSetthe UV set index
Returns
the new face index

◆ createNewUvVertex()

int coat.Model.createNewUvVertex (   self,
  uv = vec2 
)

create new UV vertex to be used for faces

Parameters
uvthe texture coordinates
Returns
the index

◆ createNewVertex()

int coat.Model.createNewVertex (   self,
  position = vec3 
)

create the positional vertex

Parameters
positionthe position
Returns
the positional vertex index

◆ displayOptions()

coat.Model.displayOptions (   self,
  showWireframe = bool,
  showColored = bool,
  showSeams = bool,
  showSharpEdges = bool,
  smoothView = bool 
)

Set the display options for the retopo/modeling/uv meshes.

Parameters
showWireframeshow the wireframe
showColoredshow colored clusters
showSeamsshow seams
showSharpEdgesshow sharp edges
smoothViewsmooth view

◆ dropUndo()

coat.Model.dropUndo (   self)

Drop the whole mesh to the undo queue, it is important if you want allow the user to undo your mesh changes, call it before your changes.

It works for UV room too.

◆ duplicateObject()

int coat.Model.duplicateObject (   self,
  group_index = int,
  name = str,
  transform = mat4,
  select = bool 
)

duplicate the object (retopo group)

Parameters
group_indexthe object/group index
namethe new name, if not passed the name will be generated automatically
transformthe additional transformation matrix
selectthe flag that indicates if we need to select the new object's faces (in addition to existing selection)
Returns
the new object index

◆ expandSelection()

coat.Model.expandSelection (   self)

expand the faces/vertices/edges selection to the connected geometry

◆ extrudeSelected()

coat.Model.extrudeSelected (   self)

Extrude the selected edges or selected faces without the actual moving of the extruded elements.

They stay selected, so you amy apply some transform to the selected elements

◆ facesCount()

int coat.Model.facesCount (   self)

get the faces count

Returns
the faces count

◆ flattenSingleIsland()

Mesh coat.Model.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

◆ fromModeling()

Model coat.Model.fromModeling ( )

get the reference to the mesh in the modeling room, currently it is the same mesh as in the retopo room

Returns
the reference to the mesh

◆ fromRetopo()

Model coat.Model.fromRetopo ( )

get the reference to the mesh in the retopo room

Returns
the reference to the mesh

◆ fromUv()

Model coat.Model.fromUv ( )

get the reference to the mesh in the uv room, pay attention that topology changes to that mesh may lead to instability!

Returns
the reference to the mesh

◆ generateName()

str coat.Model.generateName (   self,
  base = str 
)

generate unique name for the object, it will start as the string in base base

Parameters
basethe base name
Returns
the unique name

◆ getBorderBetweenIslands()

list coat.Model.getBorderBetweenIslands (   self,
  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

◆ getCurrentObject()

int coat.Model.getCurrentObject (   self)

get the index of the current group

Returns
the index

◆ getFaceMaterial()

int coat.Model.getFaceMaterial (   self,
  face = int 
)

get the UV set index for the face

Parameters
facethe face index
Returns
the UV set index, -1 if out of range

◆ getFaceNeighbors()

list coat.Model.getFaceNeighbors (   self,
  face = int 
)

get the list of faces that are adjacent to the face

Parameters
facethe face index
Returns
the list of adjacent faces

◆ getFaceNormal()

vec3 coat.Model.getFaceNormal (   self,
  face = int 
)

get the face normal

Parameters
facethe face index
Returns
the face normal

◆ getFaceObject()

int coat.Model.getFaceObject (   self,
  face = int 
)

get the group index of the face

Parameters
facethe face index
Returns
the group index

◆ getFacesNearEdge()

list coat.Model.getFacesNearEdge (   self,
  vertex1 = int,
  vertex2 = int 
)

get the list of faces that are adjacent to the edge

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
Returns
the list of adjacent faces

◆ getFacesNearVertex()

list coat.Model.getFacesNearVertex (   self,
  vertex = int 
)

get the list of faces that are adjacent to the vertex

Parameters
vertexthe vertex index
Returns
the list of adjacent faces

◆ getFaceSquare()

float coat.Model.getFaceSquare (   self,
  face = int 
)

get the face square

Parameters
facethe face index
Returns
the square

◆ getFaceUVSquare()

float coat.Model.getFaceUVSquare (   self,
  face = int 
)

get the face square in UV space

Parameters
facethe face index
Returns
the square

◆ getFaceUvVertex()

int coat.Model.getFaceUvVertex (   self,
  face = int,
  vertex_index = int 
)

get the UV vertex index over the face

Parameters
facethe face index
vertex_indexthe vertex index over the face
Returns
the UV vertex index, -1 if the vertex/face index is out of range

◆ getFaceUvVerts()

list coat.Model.getFaceUvVerts (   self,
  face = int 
)

get the list of UV vertices indices over the face

Parameters
facethe face index
Returns
the list of UV vertices indices

◆ getFaceUvVertsCount()

int coat.Model.getFaceUvVertsCount (   self,
  face = int 
)

get the amount of UV vertices over the face

Parameters
facethe face index
Returns
amount of vertices over the face, 0 if UV-s not assigned

◆ getFaceVertex()

int coat.Model.getFaceVertex (   self,
  face = int,
  vertex_index = int 
)

get the vertex index over the face

Parameters
facethe face index
vertex_indexthe vertex index over the face
Returns
the vertex index, -1 if the vertex/face index is out of range

◆ getFaceVerts()

list coat.Model.getFaceVerts (   self,
  face = int 
)

get the list of UV vertex indices over the face, pay attention UV vertices are not same as position vertices

Parameters
facethe face index
Returns
the list of vertex indices

◆ getFaceVertsCount()

int coat.Model.getFaceVertsCount (   self,
  face = int 
)

get the vertices count over the face

Parameters
facethe face index
Returns
the vertices count

◆ getFaceVisibility()

bool coat.Model.getFaceVisibility (   self,
  face = int 
)

get the face visibility

Parameters
facethe face index
Returns
the visibility state

◆ getIslandBorder()

list coat.Model.getIslandBorder (   self,
  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.Model.getIslandVertexMapping (   self,
  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.Model.getIslandVertexUv (   self,
  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

◆ getObjectFaces()

list coat.Model.getObjectFaces (   self,
  group_index = int 
)

get the list of faces in the group

Parameters
group_indexthe group index
Returns
the list of faces

◆ getObjectMesh()

Mesh coat.Model.getObjectMesh (   self,
  group_index = int 
)

get the mesh from some retopo group

Parameters
group_indexthe group index
Returns
the Mesh object

◆ getObjectName()

str coat.Model.getObjectName (   self,
  group_index = int 
)

get the retopo group name

Parameters
group_indexthe group index
Returns
the name

◆ getObjectReferenceColor()

vec4 coat.Model.getObjectReferenceColor (   self,
  group_index = int 
)

get the group reference color

Parameters
group_indexthe group index
Returns
the (r,g,b,a) vector, 0..255

◆ getObjectsCount()

int coat.Model.getObjectsCount (   self)

get the retopo groups count

Returns
the amount

◆ getObjectVisibility()

bool coat.Model.getObjectVisibility (   self,
  index = int 
)

get the group visibility

Parameters
indexthe group index
Returns
the visibility state

◆ getPath()

list coat.Model.getPath (   self,
  vertex1 = int,
  vertex2 = int 
)

get all vertices on the path from vertex1 to vertex2

Parameters
vertex1the first vertex
vertex2the second vertex

◆ getSelectedEdges()

list coat.Model.getSelectedEdges (   self)

returns even amount of vertex indices, pairs os start and end vertices of the selected edges

Returns
the list of vertex indices (pairs)

◆ getSelectedFaces()

list coat.Model.getSelectedFaces (   self)

get the list of selected faces

Returns
the list of selected faces

◆ getSelectedVertices()

list coat.Model.getSelectedVertices (   self)

get the list of selected vertices

Returns
the list of selected vertices

◆ getSelectedVerticesWeights()

list coat.Model.getSelectedVerticesWeights (   self)

get the soft selection weights of the selected vertices, 1 is maximum value

Returns
the list of weights, the size of the list is equal to the size of the selected vertices list

◆ getVertex()

vec3 coat.Model.getVertex (   self,
  vertex = int 
)

get the vertex position in space

Parameters
vertexthe vertex index
Returns
the position

◆ getVertexNormal()

vec3 coat.Model.getVertexNormal (   self,
  vertex = int 
)

get vertex normal, calculated as average of adjacent faces normals

Parameters
vertexthe vertex index
Returns
the normal

◆ getVertexUV()

vec2 coat.Model.getVertexUV (   self,
  uv_vertex = int 
)

get the UV coordinates of the UV vertex

Parameters
uv_vertexthe uv vertex index
Returns
teh UV coordinates

◆ getVertsNearVertex()

list coat.Model.getVertsNearVertex (   self,
  vertex = int 
)

get the list of vertices that are adjacent to the vertex

Parameters
vertexthe vertex index
Returns
the list of adjacent vertices

◆ getWholeMesh()

Mesh coat.Model.getWholeMesh (   self)

get the whole mesh from the retopo room

Returns
the Mesh object

◆ inset()

coat.Model.inset (   self,
  distance = float 
)

perform the inset over the selected faces

◆ intrude()

coat.Model.intrude (   self)

perform the intrude operation over the selected faces.

After calling the intrude() you should call the moveSelectedFacesAlongFacesNormals or moveSelectedFacesAlongVertexNormals to give some thickness to the resulting figure

◆ invertSelectedFacesTopoplogically()

coat.Model.invertSelectedFacesTopoplogically (   self)

invert selected faces only within the connective area, if some objects has no selected faces, the selection there will not change

◆ isEdgeSelected()

bool coat.Model.isEdgeSelected (   self,
  vertex1 = int,
  vertex2 = int 
)

check if the edge is selected, order of vertices has no matter

Parameters
vertex1the first vertex index
vertex2the second vertex index
Returns
true if the edge is selected

◆ isFaceSelected()

bool coat.Model.isFaceSelected (   self,
  face = int 
)

check if the face selected

Parameters
facethe face index
Returns
the selection state

◆ islandsCount()

int coat.Model.islandsCount (   self,
  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.Model.islandToMesh (   self,
  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.Model.islandToMeshInSpace (   self,
  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

◆ isOpenEdge()

bool coat.Model.isOpenEdge (   self,
  vertex1 = int,
  vertex2 = int 
)

check if the edge is open

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
Returns
true if open

◆ isSeam()

bool coat.Model.isSeam (   self,
  vertex1 = int,
  vertex2 = int 
)

check if edge is seam

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
Returns
true if seam

◆ isSharpEdge()

bool coat.Model.isSharpEdge (   self,
  vertex1 = int,
  vertex2 = int 
)

check if the edge is sharp

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
Returns
true if sharp

◆ isVertexSelected()

bool coat.Model.isVertexSelected (   self,
  vertex = int 
)

check if the vertex is selected

Parameters
vertexthe vertex index
Returns
true if the vertex is selected

◆ MakeCopy()

Model coat.Model.MakeCopy (   self)

make a copy of the source mesh.

Pay attention, if you taken it from the retopo/uv context, it will no longer refer to the retopo/uv mesh, it will be independent copy

◆ meshToIsland()

coat.Model.meshToIsland (   self,
  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

◆ moveSelectedFacesAlongFacesNormals()

coat.Model.moveSelectedFacesAlongFacesNormals (   self,
  displacement = float 
)

move selected faces along the faces normals, trying to keep faces parallel to the original direction

Parameters
displacementthe displacement value

◆ moveSelectedFacesAlongVertexNormals()

coat.Model.moveSelectedFacesAlongVertexNormals (   self,
  displacement = float 
)

move selected faces along the vertex normals, each vertex displace on the same distance

Parameters
displacementthe displacement value

◆ pack()

coat.Model.pack (   self,
  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

◆ relaxSelected()

coat.Model.relaxSelected (   self)

relax selected vergtices

◆ removeFace()

coat.Model.removeFace (   self,
  face = int 
)

remove the face by index

Parameters
facethe face index

◆ removeObject()

coat.Model.removeObject (   self,
  group_index = int 
)

remove the group by index

◆ removeUnusedMaterials()

coat.Model.removeUnusedMaterials (   self)

remove all unused UV sets (not referred within the mesh)

◆ scaleSelectedFacesClusters()

coat.Model.scaleSelectedFacesClusters (   self,
  scale = float,
  method = ClusterScale 
)

scale each selection cluster separately, to own center mass

Parameters
scalethe scale coefficient

◆ selectEdge()

coat.Model.selectEdge (   self,
  vertex1 = int,
  vertex2 = int 
)

select the edge by vertex indices (add to selection)

Parameters
vertex1the first vertex index
vertex2the second vertex index

◆ selectedToEdges()

coat.Model.selectedToEdges (   self)

convert faces/vertices selection to edges selection

◆ selectedToFaces()

coat.Model.selectedToFaces (   self)

convert edges/vertices selection to faces selection

◆ selectedToMesh()

Mesh coat.Model.selectedToMesh (   self)

get the selected faces as the Mesh object

Returns
the Mesh

◆ selectedToObject()

coat.Model.selectedToObject (   self,
  group_index = int 
)

move the selected faces to the group

Parameters
group_indexthe group index

◆ selectedToVertices()

coat.Model.selectedToVertices (   self)

convert faces/edges selection to vertices selection

◆ selectFace()

coat.Model.selectFace (   self,
  face = int 
)

select the face by index

Parameters
facethe face index

◆ selectObject()

coat.Model.selectObject (   self,
  group_index = int,
  add_to_selected = bool 
)

select all feces in the group

Parameters
group_indexthe group index

◆ selectPath()

coat.Model.selectPath (   self,
  vertex1 = int,
  vertex2 = int 
)

select all edges on the path from vertex1 to vertex2 (add to existing edges selection)

Parameters
vertex1the first vertex
vertex2the second vertex

◆ selectVertex()

coat.Model.selectVertex (   self,
  vertex = int,
  weight = float 
)

add the vertex to the selection

Parameters
vertexthe vertex index
weightthe soft selection weight, 1 is maximum value

◆ setCurrentObject()

coat.Model.setCurrentObject (   self,
  index = int 
)

set the current group index

Parameters
indexthe index

◆ setEdgeSeam()

coat.Model.setEdgeSeam (   self,
  vertex1 = int,
  vertex2 = int,
  seam = bool 
)

set or clear the seam state for the edge

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
seamthe seam state

◆ setEdgeSharpness()

coat.Model.setEdgeSharpness (   self,
  vertex1 = int,
  vertex2 = int,
  sharp = bool 
)

set the sharpness state for the edge

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
sharpthe sharpness state

◆ setFaceMaterial()

coat.Model.setFaceMaterial (   self,
  face = int,
  uv_set = int 
)

set the UV set for the face

Parameters
facethe face index
uv_setthe UV set index

◆ setFaceObject()

coat.Model.setFaceObject (   self,
  face = int,
  group = int 
)

set the group index of the face

Parameters
facethe face index
groupthe group index

◆ setFaceUvVerts()

coat.Model.setFaceUvVerts (   self,
  face = int,
  vertices = list 
)

set the UV vertices for the face

Parameters
facethe face index
verticesthe UV vertices list

◆ setFaceVerts()

coat.Model.setFaceVerts (   self,
  face = int,
  vertices = list 
)

set the list of positional vertex indices over the face

Parameters
facethe face index
verticesthe list of vertex indices

◆ setFaceVisibility()

coat.Model.setFaceVisibility (   self,
  face = int,
  visibility = bool 
)

set the face visibility

Parameters
facethe face index
visibilitythe visibility state

◆ setObjectMesh()

coat.Model.setObjectMesh (   self,
  group_index = int,
  mesh = Mesh,
  transform = mat4 
)

replace the retopo layer with mesh

Parameters
group_indexthe group index
meshthe Mesh object to insert
transformthe transformation matrix

◆ setObjectName()

coat.Model.setObjectName (   self,
  index = int,
  name = str 
)

rename the group by index

Parameters
indexthe group index to rename
namethe new name

◆ setObjectReferenceColor()

coat.Model.setObjectReferenceColor (   self,
  group_index = int,
  color = vec4 
)

set the group reference color

Parameters
group_indexthe group index
colorthe (r,g,b,a) vector, 0..255

◆ setObjectVisibility()

coat.Model.setObjectVisibility (   self,
  index = int,
  visible = bool 
)

set the group visibility

Parameters
indexthe group index
visiblethe visibility state

◆ setSelectedEdges()

coat.Model.setSelectedEdges (   self,
  edges = list 
)

set the selected edges list

Parameters
edgesthe edges indices list (should be even amount of indices)

◆ setSelectedFaces()

coat.Model.setSelectedFaces (   self,
  faces = list 
)

set the selected faces list

Parameters
facesthe faces indices list

◆ setSelectedVertices()

coat.Model.setSelectedVertices (   self,
  vertices = list,
  weights = list 
)

set the selected vertices list

Parameters
verticesthe list of vertices indices
weightsthe list of soft selection weights, the size of the list should be zero or equal to the size of the vertices list. If it is empty, the vertices will be selected with the maximal weight

◆ setVertex()

coat.Model.setVertex (   self,
  vertex = int,
  position = vec3 
)

set the vertex position in space

Parameters
vertexthe vertex index
positionthe position

◆ setVertexUV()

coat.Model.setVertexUV (   self,
  uv_vertex = int,
  uv = vec2 
)

set the UV for the UV vertex

Parameters
uv_vertexthe uv vertex index
uvthe UV coordinates

◆ shell()

coat.Model.shell (   self)

perform the shell operation over the selected faces.

After calling the shell() you should call the moveSelectedFacesAlongFacesNormals or moveSelectedFacesAlongVertexNormals to give some thickness to the resulting figure

◆ splitEdge()

int coat.Model.splitEdge (   self,
  vertex1 = int,
  vertex2 = int,
  position = float 
)

split existing edge somewhere between vertices.

Parameters
vertex1the positional vertex index (1)
vertex2the positional vertex index (2)
positionthe position to split the edge, [0..1], 0 - near the vertex1, 1 - near the vertex2
Returns
the new vertex index

◆ subdivide()

coat.Model.subdivide (   self,
  apply_catmull_clark = bool 
)

subdivide the whole mesh

Parameters
apply_catmull_clarkapply the catmull-clark subdivision

◆ subdivideSelectedFaces()

coat.Model.subdivideSelectedFaces (   self,
  apply_catmull_clark = bool 
)

subdivide the selected faces

Parameters
apply_catmull_clarkapply the catmull-clark subdivision

◆ toAbf()

coat.Model.toAbf (   self,
  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.Model.toGu (   self,
  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.Model.toLscm (   self,
  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.Model.toPlanar (   self,
  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.Model.toStripe (   self,
  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

◆ transform()

Model coat.Model.transform (   self,
  m = mat4 
)

transform the whole Model with the matrix

Parameters
mthe transformation matrix
Returns
the reference to the Model

◆ transformSelected()

coat.Model.transformSelected (   self,
  transform = mat4,
  apply_symmetry = bool 
)

apply the transformation to the selected elements

Parameters
transformthe transformation matrix
apply_symmetryapply the global symmetry

◆ unselectAllEdges()

coat.Model.unselectAllEdges (   self)

unselect all edges

◆ unselectAllFaces()

coat.Model.unselectAllFaces (   self)

unselect all faces

◆ unselectAllVertices()

coat.Model.unselectAllVertices (   self)

unselect all vertices

◆ unwrap()

coat.Model.unwrap (   self,
  uv_set = int 
)

unwrap the current uv-set

Parameters
uv_setthe uv set index

◆ updateNormals()

coat.Model.updateNormals (   self,
  for_snapping = bool 
)

update the vertex normals

Parameters
for_snappingif true, the normals will lay in the middle of faces, ne respecting the faces square.

◆ updateTopology()

coat.Model.updateTopology (   self)

update the connectivity information, it should be called sometimes if you feel that the connectivity information lost due to some heavy operations

◆ vertsCount()

int coat.Model.vertsCount (   self)

get the positional vertices count

Returns
the vertices count

◆ vertsUvCount()

int coat.Model.vertsUvCount (   self)

get the uv vertices count

Returns
the uv vertices count

◆ visibleToMesh()

Mesh coat.Model.visibleToMesh (   self)

get the visible faces as the Mesh object

Returns
teh Mesh

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