SkinningTools.Maya.api

Maya stub of imports used in the UI library.

The idea is to make this file as short as possible while leaving room for other packages to implement features.

Module Contents

Classes

_EventFilter

eventfilter class to allow extra functionality to be added to the current maya qt eventfilters

Functions

_cleanEventFilter()

_eventFilterTargets()

We must return all widgets that receive strong focus that we want to tap into

connectSelectionChangedCallback(callback)

connect a callback to a selection changed event

convertlistToOpenMayaArray(inList, arrayType)

convert given list to an openmaya arraytype

dccInstallEventFilter()

dec_loadPlugin(input)

forwarded decorator function to load plugins

disconnectCallback(handle)

disconnect a callback present in the scene

displayToolTips()

force display tool tips in maya as these are turned off by default

getApiDir()

get the path to the current file

getIds(inList)

forwarded function to conevert components to indices

getMayaVersion()

get the current general mayaversion in which this tool is launched

getPlugin()

get the smoothbrush plugin based on information gathered on how maya is run

getPluginSuffix()

get the current plugin suffix based on the os that we are running

getSingleVertexWeight(skinClusterHandle, vertexHandle, influenceHandle)

given a skin, a vertex and a joint, return the weight

getSingleVertexWeights(skinClusterHandle, vertexHandle)

given a skin and a vertex, return the weight

getSkinWeights(geometry)

forwarded function to get the skinning data of a mesh

get_maya_window()

get the current maya window as a qt widget

selectVertices(meshVertexPairs)

select vertices based on given vertex pairs

selectedObjectVertexList(includeObjects=False)

get the current object/component selection

selectedSkinnedShapes()

get the shapes of skinned objects

setSkinWeights(geometry, skinCluster, weights, influenceIndices=None)

forwarded function to set the skinning data on a mesh

skinClusterInfluences(skinCluster)

forwarded function to get joint information from skincluster

textProgressBar(progress, message='')

set the current progress of a function using test only

SkinningTools.Maya.api._DEBUG
SkinningTools.Maya.api.addCleanJoint
SkinningTools.Maya.api.dec_undo
SkinningTools.Maya.api.meshVertexList
SkinningTools.Maya.api.skinClusterForObject
SkinningTools.Maya.api.skinClusterForObjectHeadless
SkinningTools.Maya.api.skinPercent
class SkinningTools.Maya.api._EventFilter

eventfilter class to allow extra functionality to be added to the current maya qt eventfilters

_singleton
eventFilter(self, obj, event)
static singleton()

singleton of the current class for ease of identifying

Returns

the current object singleton

Return type

cls

SkinningTools.Maya.api._cleanEventFilter()
SkinningTools.Maya.api._eventFilterTargets()

We must return all widgets that receive strong focus that we want to tap into such as the main window or 3D viewports that are not simple Qt widgets.

Returns

the maya window and the active 3d viewport

Return type

list

SkinningTools.Maya.api.connectSelectionChangedCallback(callback)

connect a callback to a selection changed event

Parameters

callback (function) – the callback to connect

Returns

scriptjob that holds the callback

Return type

string

SkinningTools.Maya.api.convertlistToOpenMayaArray(inList, arrayType)

convert given list to an openmaya arraytype

Parameters
  • inList (list) – list of objects to be added to arraytype

  • arrayType (OpenMaya.<array>) – any openmaya array type

Returns

the array filled with data

Return type

OpenMaya.<array>

SkinningTools.Maya.api.dccInstallEventFilter()
SkinningTools.Maya.api.dec_loadPlugin(input)

forwarded decorator function to load plugins

Note

maybe remove this? too many similar functions? combine them all together

Parameters

input (string) – name of the (python)plugin to load

SkinningTools.Maya.api.disconnectCallback(handle)

disconnect a callback present in the scene

Parameters

handle (string) – the name of the scriptjob to remove

SkinningTools.Maya.api.displayToolTips()

force display tool tips in maya as these are turned off by default

SkinningTools.Maya.api.getApiDir()

get the path to the current file

Returns

path of the api file

Return type

string

SkinningTools.Maya.api.getIds(inList)

forwarded function to conevert components to indices

Parameters

inlist (list) – list of maya components

Returns

list of indices

Return type

list

SkinningTools.Maya.api.getMayaVersion()

get the current general mayaversion in which this tool is launched

Returns

maya version number as string

Return type

string

SkinningTools.Maya.api.getPlugin()

get the smoothbrush plugin based on information gathered on how maya is run

Returns

the path of the plugin to load

Return type

string

SkinningTools.Maya.api.getPluginSuffix()

get the current plugin suffix based on the os that we are running

Returns

suffix for plugin files specific to a particular os

Return type

string

SkinningTools.Maya.api.getSingleVertexWeight(skinClusterHandle, vertexHandle, influenceHandle)

given a skin, a vertex and a joint, return the weight skin cluster can be obtained with skinClusterForObject mvertex can be obtained with selectedObjectVertexList(True), joint can be obtained with skinClusterInfluences

Parameters
  • skinClusterHandle (string) – name of the current skincluster

  • vertexHandle (string) – name of current vertex

  • influenceHandle (string) – name of bone to get data from

Returns

list of influences

Return type

list

SkinningTools.Maya.api.getSingleVertexWeights(skinClusterHandle, vertexHandle)

given a skin and a vertex, return the weight skin cluster can be obtained with skinClusterForObject vertex can be obtained with selectedObjectVertexList(True)

Parameters
  • skinClusterHandle (string) – name of the current skincluster

  • vertexHandle (string) – name of current vertex

Returns

list of influences

Return type

list

SkinningTools.Maya.api.getSkinWeights(geometry)

forwarded function to get the skinning data of a mesh

Parameters

geometry (string) – mesh to get data from

Returns

list of all weights on the mesh

Return type

list

SkinningTools.Maya.api.get_maya_window()

get the current maya window as a qt widget

Returns

the widget or none

Return type

QWidget

SkinningTools.Maya.api.selectVertices(meshVertexPairs)

select vertices based on given vertex pairs

Parameters

meshVertexPairs (list) – list of objects that hold a list of which the second element is a vertex

SkinningTools.Maya.api.selectedObjectVertexList(includeObjects=False)

get the current object/component selection

Parameters

includeObjects (bool) – if True will return the name of the object from which the vertex comes from, if False will only return the vertices

Returns

list of vertices

Return type

list

SkinningTools.Maya.api.selectedSkinnedShapes()

get the shapes of skinned objects

Returns

list of shapes

Return type

list

SkinningTools.Maya.api.setSkinWeights(geometry, skinCluster, weights, influenceIndices=None)

forwarded function to set the skinning data on a mesh

Parameters
  • geometry (string) – mesh to set data to

  • skinCluster (string) – skincluster attached to the current geometry

  • weights (list) – list of weights to set

  • influenceIndices (list) – list of joints

SkinningTools.Maya.api.skinClusterInfluences(skinCluster)

forwarded function to get joint information from skincluster

Parameters

skinCluster (string) – skincluster to gather data from

Returns

list of all joints(fullpath) connected to the skincluster

Return type

list

SkinningTools.Maya.api.textProgressBar(progress, message='')

set the current progress of a function using test only

Parameters
  • progress (float) – percentage of progress

  • message (string) – the message to be displayed