SkinningTools.Maya.tools.joints

Module Contents

Functions

BoneMove(joint1, joint2, skin, progressBar=None)

move joint influences from 1 joint to another

BoneSwitch(joint1, joint2, skin, progressBar=None)

switch the weight information of 2 given joints

ShowInfluencedVerts(inMesh, jnts, progressBar=None)

show the vertices that have any weight information from current given joints (weight information above 0.0)

addCleanJoint(jnts, inMesh, progressBar=None)

add a new joint to the skincluster

autoLabelJoints(inputLeft='L_*', inputRight='R_*', progressBar=None)

joint labeling function

comparejointInfluences(skinObjects, query=False, progressBar=None)

compare the list of influences between several skinned objects

convertClusterToJoint(inCluster, jointName=None, progressBar=None)

convert cluster deformer to a joint using the same influences and pivot position

convertVerticesToJoint(inComponents, jointName=None, progressBar=None)

convert (soft) selection to a joint based on center of selection

deleteJointSmart(jointsToRemove, progressBar=None)

delete joints from the current chain no matter where they are placed or how they are parented

drawStyle(inSelection, style=False, progressBar=None)

freezeRotate(inJnts, progressBar=None)

force clean joint rotations per joint

freezeScale(inJnts, progressBar=None)

force clean joint scales per joint

freezeSkinnedJoints(jnts, rotate=1, scale=1, progressBar=None)

clean joint rotations and scales even if they are skinned

getInfluencingJoints(inObject)

get all joints that are influencing the given mesh

getMeshesInfluencedByJoint(currentJoints, progressBar=None)

get all meshes that are influenced by current selection of joints

jointLookat(point, pointAt, normal=None, space=enumerators.Space.Global, primaryAxis=enumerators.AxisEnumerator.PosAxisX, secondaryAxis=enumerators.AxisEnumerator.PosAxisY, progressBar=None)

localRotateAxis(inSelection, showAxis=False, progressBar=None)

mirrorJoints(inSelection, mirrorAxis='X', behaviour=True, searchReplace=('L_', 'R_'), progressBar=None)

removeBindPoses(progressBar=None)

remove bindpose nodes from the scene so the prebindmatrices in the skinclusters can do their work, this also makes it easier to add new joints to the skinclusters

removeJointBySkinPercent(skinObject, jointsToRemove, sc, progressBar=None)

remove joints influences by setting them to 0.0

removeJoints(skinObjects, jointsToRemove, useParent=True, delete=True, fast=False, progressBar=None)

delete joints from the scene/ or just the skincluster in a way that it does not break the skinweigths

removeUnusedInfluences(inObject, progressBar=None)

remove the joints that are attached to the skincluster but are not assigned any weights.

resetSkinnedJoints(inJoints=None, inSkinCluster=None, progressBar=None)

force recalculate the prebindmatrices in the skinclsuter based on current joint positions

resetToBindPoseobject(inObject, progressBar=None)

set joints back into their bindpose using the prebind matrix of the skincluster, only works when joints are not connected (rigged)

segmentScale(inSelectio, compensate=False, progressBar=None)

toggleMoveSkinnedJoints(inMesh, inPose=False, progressBar=None)

toggle joint bind position manipulation on or off

SkinningTools.Maya.tools.joints.BoneMove(joint1, joint2, skin, progressBar=None)

move joint influences from 1 joint to another

Parameters
  • joint1 (string) – joint to get the weight information from

  • joint2 (string) – joint to set the weigth information to

  • skin (string) – the skincluster on which the weight information is based

  • 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

SkinningTools.Maya.tools.joints.BoneSwitch(joint1, joint2, skin, progressBar=None)

switch the weight information of 2 given joints it reconnects the indices of the joints that are used on the given skincluster

Parameters
  • joint1 (string) – joint to switch the weight information from

  • joint2 (string) – joint to switch the weigth information from

  • skin (string) – the skincluster on which the weight information is based

  • 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

SkinningTools.Maya.tools.joints.ShowInfluencedVerts(inMesh, jnts, progressBar=None)

show the vertices that have any weight information from current given joints (weight information above 0.0)

Parameters
  • inMesh (string) – mesh object that is influences by a skincluster and joints that are in the given selection

  • jtns (list) – joints that influence the current given mesh

  • 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

SkinningTools.Maya.tools.joints.addCleanJoint(jnts, inMesh, progressBar=None)

add a new joint to the skincluster

Parameters
  • jnts (list) – list of joints that need to be added to the current skinCluster

  • rotate (string) – name of the mesh the joint should be added to

  • 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

SkinningTools.Maya.tools.joints.autoLabelJoints(inputLeft='L_*', inputRight='R_*', progressBar=None)

joint labeling function

Parameters
  • inputLeft (string) – search function that allocates which joints are part of the left side of the rig “*” used as a wildcard to replace part of the string

  • inputRight (string) – search function that allocates which joints are part of the right side of the rig “*” used as a wildcard to replace part of the string

  • 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

SkinningTools.Maya.tools.joints.comparejointInfluences(skinObjects, query=False, progressBar=None)

compare the list of influences between several skinned objects

Parameters
  • skinObjects (list) – skinned objects to compary influence lists

  • query (bool) – it True return the joints that are not present in all of the given objects, if False will make sure that all joints are present in all given objects

  • 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, list of joints in query mode, None if there are no joints to be found in query

Return type

bool, list

SkinningTools.Maya.tools.joints.convertClusterToJoint(inCluster, jointName=None, progressBar=None)

convert cluster deformer to a joint using the same influences and pivot position

Parameters
  • inCluster (string) – the cluster object that is deforming a mesh

  • jointName (string) – name to give the joint, if None will create a default name

  • 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

SkinningTools.Maya.tools.joints.convertVerticesToJoint(inComponents, jointName=None, progressBar=None)

convert (soft) selection to a joint based on center of selection

Parameters
  • inComponents (list) – mesh component selection to assign to the joint

  • jointName (string) – name to give the joint, if None will create a default name

  • 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

SkinningTools.Maya.tools.joints.deleteJointSmart(jointsToRemove, progressBar=None)

delete joints from the current chain no matter where they are placed or how they are parented

Parameters
  • jointsToRemove (list) – list of joints to remove from current skincluster

  • 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

SkinningTools.Maya.tools.joints.drawStyle(inSelection, style=False, progressBar=None)
SkinningTools.Maya.tools.joints.freezeRotate(inJnts, progressBar=None)

force clean joint rotations per joint

Parameters
  • inJnts (list) – list of joints that need their rotations to be nulified (0,0,0)

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

Returns

list of joints that are cleaned

Return type

list

SkinningTools.Maya.tools.joints.freezeScale(inJnts, progressBar=None)

force clean joint scales per joint

Parameters
  • inJnts (list) – list of joints that need their scales to be set to uniform (1,1,1)

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

Returns

list of joints that are cleaned

Return type

list

SkinningTools.Maya.tools.joints.freezeSkinnedJoints(jnts, rotate=1, scale=1, progressBar=None)

clean joint rotations and scales even if they are skinned

Note

this will not work when joints are connected through ik-handle!

Parameters
  • jnts (list) – list of joints that need their rotations and scales to be cleaned

  • rotate (bool) – if True will clean rotations, if False will skip them

  • scale (bool) – if True will clean scales, if False will skip them

  • 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

SkinningTools.Maya.tools.joints.getInfluencingJoints(inObject)

get all joints that are influencing the given mesh

Parameters
  • inObject (string) – the object which is influenced by a skincluster

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

Returns

list of all the joints that are currently driving the given mesh

Return type

list

SkinningTools.Maya.tools.joints.getMeshesInfluencedByJoint(currentJoints, progressBar=None)

get all meshes that are influenced by current selection of joints

Parameters
  • currentJoints (list) – the joint to check if they are used in skinclusters

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

Returns

list of objects influences by the current selection of joints

Return type

list

SkinningTools.Maya.tools.joints.jointLookat(point, pointAt, normal=None, space=enumerators.Space.Global, primaryAxis=enumerators.AxisEnumerator.PosAxisX, secondaryAxis=enumerators.AxisEnumerator.PosAxisY, progressBar=None)
SkinningTools.Maya.tools.joints.localRotateAxis(inSelection, showAxis=False, progressBar=None)
SkinningTools.Maya.tools.joints.mirrorJoints(inSelection, mirrorAxis='X', behaviour=True, searchReplace='L_', 'R_', progressBar=None)
SkinningTools.Maya.tools.joints.removeBindPoses(progressBar=None)

remove bindpose nodes from the scene so the prebindmatrices in the skinclusters can do their work, this also makes it easier to add new joints to the skinclusters

Parameters

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

SkinningTools.Maya.tools.joints.removeJointBySkinPercent(skinObject, jointsToRemove, sc, progressBar=None)

remove joints influences by setting them to 0.0

Parameters
  • skinObject (string) – the mesh object from which to remove influences

  • jointsToRemove (list) – list of joints to remove from current skincluster

  • sc (string) – the skincluster attached to the mesh

  • 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

SkinningTools.Maya.tools.joints.removeJoints(skinObjects, jointsToRemove, useParent=True, delete=True, fast=False, progressBar=None)

delete joints from the scene/ or just the skincluster in a way that it does not break the skinweigths will search for surogate joints to take over the weight information of the joint that is to be deleted

Parameters
  • skinObjects (list) – objects from which the joint influences will be removed

  • jointsToRemove (list) – list of joints to remove from current skincluster

  • useParent (bool) – it True will give the current joints information to its direct parent.

  • delete (bool) – if True this will make sure that the joint is deleted in the end, if False only removes the weight information

  • fast (bool) – if True the fast option does not take into account other joints, it will just remove the weights of the given joint and normalize, if False it will look for better options

  • 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

SkinningTools.Maya.tools.joints.removeUnusedInfluences(inObject, progressBar=None)

remove the joints that are attached to the skincluster but are not assigned any weights.

Note

this will only remove the current connection with joints, check if we can remap the nodes index connections in weights, influenceColor, lockweights and matrix inputs

Parameters
  • inObject (string) – the object which is influenced by a skincluster

  • 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

SkinningTools.Maya.tools.joints.resetSkinnedJoints(inJoints=None, inSkinCluster=None, progressBar=None)

force recalculate the prebindmatrices in the skinclsuter based on current joint positions

Parameters
  • inJoints (list) – list of joints to recalculate

  • inSkinCluster (string) – the skincluster that will receive new prebind matrices

  • 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

SkinningTools.Maya.tools.joints.resetToBindPoseobject(inObject, progressBar=None)

set joints back into their bindpose using the prebind matrix of the skincluster, only works when joints are not connected (rigged)

Parameters
  • inObject (string) – mesh object that has a skincluster attached

  • 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

SkinningTools.Maya.tools.joints.segmentScale(inSelectio, compensate=False, progressBar=None)
SkinningTools.Maya.tools.joints.toggleMoveSkinnedJoints(inMesh, inPose=False, progressBar=None)

toggle joint bind position manipulation on or off :todo: visualise the mesh that is manipulated <- needs to come from mesh.toggleDisplayOrigShape :todo: make different objects positioned on the prebind position that manipulate the prebind matrices for the joints :param inMesh: mesh object manipulated through a skincluster :type inMesh: string :param inPose: if True will generate a skeleton to manipulate the bindpose, if False will use the skinned skeleton :type inPose: bool :param progressBar: progress bar instance to be used for progress display, if None it will print the progress instead :type progressBar: QProgressBar :return: True if the function is completed :rtype: bool