SkinningTools.Maya.tools.mesh

Module Contents

Functions

componentPathFinding(selection, useDistance, diagonal=False, weightWindow=None)

use the component selection for pathfinding, to make sure that any skinnable mesh can be walked over

cutCharacterFromSkin(inObject, internal=False, maya2020=False, progressBar=None)

split the character into multiple meshes based on the skinning information

edgesToSmooth(inEdges)

use 2 edgeloops to find the relation of the vertices on opposite sides

extractFacesByVertices(vertices, internal=False)

use the given components to create a new mesh with the same skinning information

getRootPath(path)

getShellFaces(inMesh)

convert the selection of vertices to face group selections

polySkeleton(radius=5)

convert the current selected skeleton to a polygonal object

setOrigShapeColor(inShape, inColor=(0.8, 0.2, 0.2))

set a new vertex color to the given shape

shortestPathLattice(start, end)

get the shortest path walking over the edges between 2 selected points

shortestPathNurbsCurve(start, end)

get the shortest path walking over the edges between 2 selected control vertices

shortestPathNurbsSurface(start, end, diagonal=False)

get the shortest path walking over the edges between 2 selected control vertices

shortestPathVertex(start, end)

get the shortest path walking over the edges between 2 selected vertices

softSelection()

convert the soft selection in the scene to vertices and weights

toggleDisplayOrigShape(inMesh, inColor=(0.8, 0.2, 0.2), both=False, progressBar=None)

toggle the display of the mesh beteen the output and the input shape of the skincluster. the input shape will receive default lamber + vertex colors to make sure there is a big distinction between the 2

SkinningTools.Maya.tools.mesh.componentPathFinding(selection, useDistance, diagonal=False, weightWindow=None)

use the component selection for pathfinding, to make sure that any skinnable mesh can be walked over

Parameters
  • selection (list) – 2 component objects that indicate the start and end of a possible path

  • useDistance (bool) – if True will use the lenght of the path to define the weight , if False will use the amount of points as weight

  • diagonal (bool) – if True the shortest path can cross cv’s diagonally, if False it can only go straight

  • weightWindow (fallofCurveUI) – the window that has control over a bezier curveto define the fallof of weight

Returns

map of vertices in order and the weight applied to them

Return type

list

SkinningTools.Maya.tools.mesh.cutCharacterFromSkin(inObject, internal=False, maya2020=False, progressBar=None)

split the character into multiple meshes based on the skinning information

Parameters
  • inObject (string) – object to seperate in multiple meshes

  • internal (bool) – if True will only convert the the inner selection, if False will grow the selection once to cover more ground

  • maya2020 (bool) – if True will use the offsetparent matrix to connect the mesh to joints , if False will use a decompose matrix to connect the meshes

  • progressBar (QProgressBar) – progress bar instance to be used for progress display, if None it will print the progress instead

Returns

group object that holds all the meshes

Return type

string

SkinningTools.Maya.tools.mesh.edgesToSmooth(inEdges)

use 2 edgeloops to find the relation of the vertices on opposite sides

Parameters

inEdges (list) – list of 2 edgeloops

Returns

list of vertices that are closely connected together based on the edgeselection

Return type

list

SkinningTools.Maya.tools.mesh.extractFacesByVertices(vertices, internal=False)

use the given components to create a new mesh with the same skinning information

Parameters
  • vertices (list) – the components to use as information to generate the new mesh

  • internal (bool) – if True will only convert the the inner selection, if False will grow the selection once to cover more ground

Returns

new created mesh

Return type

string

SkinningTools.Maya.tools.mesh.getRootPath(path)
SkinningTools.Maya.tools.mesh.getShellFaces(inMesh)

convert the selection of vertices to face group selections

Parameters

inMesh (string) – object to evaluate

Returns

list of grouped faces

Return type

list

SkinningTools.Maya.tools.mesh.polySkeleton(radius=5)

convert the current selected skeleton to a polygonal object this can be beneficial to show how the skeleton looks in other dcc tools, like zbrush

Parameters

radius (float) – the radius to give each joint in the output

SkinningTools.Maya.tools.mesh.setOrigShapeColor(inShape, inColor=0.8, 0.2, 0.2)

set a new vertex color to the given shape

Parameters
  • inShape (string) – shape to add vertex colors to

  • inColor (tuple) – the color to give the object

SkinningTools.Maya.tools.mesh.shortestPathLattice(start, end)

get the shortest path walking over the edges between 2 selected points

Parameters
  • start (string) – points to start from

  • end (string) – points to end with

Returns

list of points to walk in order

Return type

list

SkinningTools.Maya.tools.mesh.shortestPathNurbsCurve(start, end)

get the shortest path walking over the edges between 2 selected control vertices

Parameters
  • start (string) – control vertex to start from

  • end (string) – control vertex to end with

Returns

list of control vertices to walk in order

Return type

list

SkinningTools.Maya.tools.mesh.shortestPathNurbsSurface(start, end, diagonal=False)

get the shortest path walking over the edges between 2 selected control vertices

Parameters
  • start (string) – control vertex to start from

  • end (string) – control vertex to end with

  • diagonal (bool) – if True the shortest path can cross cv’s diagonally, if False it can only go straight

Returns

list of control vertices to walk in order

Return type

list

SkinningTools.Maya.tools.mesh.shortestPathVertex(start, end)

get the shortest path walking over the edges between 2 selected vertices

Parameters
  • start (string) – vertex to start from

  • end (string) – vertex to end with

Returns

list of vertices to walk in order

Return type

list

SkinningTools.Maya.tools.mesh.softSelection()

convert the soft selection in the scene to vertices and weights

Returns

list of vertices in the soft selection range and the weight of that vertex

Return type

list, list

SkinningTools.Maya.tools.mesh.toggleDisplayOrigShape(inMesh, inColor=0.8, 0.2, 0.2, both=False, progressBar=None)

toggle the display of the mesh beteen the output and the input shape of the skincluster. the input shape will receive default lamber + vertex colors to make sure there is a big distinction between the 2 :todo: maybe instead of lambert shader we can use the original shader + red vertex color overlay to make sure the textures can still be viewed :todo: add an option that shows both shapes? so we can display 1 in movement and one in default pose

Parameters
  • inMesh (string) – the object that has a skincluster attached which we want to toggle

  • inColor (tuple/list) – the color in RGB values from 0to1 used as color value

  • progressBar (QProgressBar) – progress bar instance to be used for progress display, if None it will print the progress instead

Returns

True if the function is completed

Return type

bool