retargetBlendshape.utils module

retargetBlendshape.utils.asComponent(index, t=<sphinx.ext.autodoc._MockObject object>)

index -> OpenMaya.MFn.kComponent Based on the input type it will create a component type for this tool the following components are being used.

  • OpenMaya.MFn.kMeshVertComponent
  • OpenMaya.MFn.kMeshEdgeComponent
Parameters:
  • index (int/OpenMaya.MIntArray) – indices to create component for
  • t (OpenMaya.MFn.kComponent) – can be all of OpenMaya component types.
Returns:

Initialized components

Return type:

OpenMaya.MFnSingleIndexedComponent

retargetBlendshape.utils.asMDagPath(obj)

OpenMaya.MObject -> OpenMaya.MDagPath

Parameters:obj (OpenMaya.MObject) –
Return type:OpenMaya.MDagPath
retargetBlendshape.utils.asMFnMesh(dag)

OpenMaya.MDagPath -> OpenMaya.MfnMesh

Parameters:dag (OpenMaya.MDagPath) –
Return type:OpenMaya.MfnMesh
retargetBlendshape.utils.asMIntArray(index)

index -> OpenMaya.MIntArray

Parameters:index (int/OpenMaya.MIntArray) – indices
Returns:Array of indices
Return type:OpenMaya.MIntArray
retargetBlendshape.utils.asMObject(path)

str -> OpenMaya.MObject

Parameters:path (str) – Path to Maya object
Return type:OpenMaya.MObject
retargetBlendshape.utils.getAverageLength(dag, component, space)

Get average length of connected edges.

Parameters:
  • dag (OpenMaya.MDagPath) –
  • component (OpenMaya.MFnSingleIndexedComponent) –
  • space (OpenMaya.MSpace) –
Returns:

Average length of the connected edges

Return type:

float

retargetBlendshape.utils.getAveragePosition(dag, component, space)

Get average position of connected vertices.

Parameters:
  • dag (OpenMaya.MDagPath) –
  • component (OpenMaya.MFnSingleIndexedComponent) –
  • space (OpenMaya.MSpace) –
Returns:

Average length of the connected edges

Return type:

OpenMaya.MPoint

retargetBlendshape.utils.getBasename(name)

Strip the parent and namespace data of the provided string.

Parameters:name (str) –
Returns:Base name of parsed object
Return type:str
retargetBlendshape.utils.getSelectedMeshes()

Get all selected meshes, the current selection will be looped and checked if any of the selected transforms contain a mesh node. If this is the case the transform will be added to the selection list.

Returns:Parents nodes of all selected meshes
Return type:list
retargetBlendshape.utils.setLaplacianSmooth(dag, index, space, sourceL, targetL, blendshapeL, smooth)

Laplacian smoothing algorithm, where the average of the neighbouring points are used to smooth the target vertices, based on the factor between the average length of both the source and the target mesh.

Parameters:
  • dag (OpenMaya.MDagPath) –
  • index (int) – Component index
  • space (OpenMaya.MSpace) –
  • sourceL (float) –
  • targetL (float) –
  • blendshapeL (float) –
  • smooth (float) –