mgear.rigbits.tweaks

Rigbits tweaks rig module

mgear.rigbits.tweaks.createJntTweak(mesh, jntParent, ctlParent)

Create a joint tweak

Parameters:
  • mesh (mesh) – The object to deform with the tweak
  • jntParent (dagNode) – The parent for the new joint
  • ctlParent (dagNode) – The parent for the control.
mgear.rigbits.tweaks.createMirrorRivetTweak(mesh, edgePair, name, parent=None, ctlParent=None, jntParent=None, color=[0, 0, 0], size=0.04, defSet=None, ctlSet=None, side=None, gearMulMatrix=True)

Create a tweak joint attached to the mesh using a rivet. The edge pair will be used to find the mirror position on the mesh

Parameters:
  • mesh (mesh) – The object to add the tweak
  • edgePair (pari list) – The edge pairt to create the rivet
  • name (str) – The name for the tweak
  • parent (None or dagNode, optional) – The parent for the tweak
  • ctlParent (None or dagNode, optional) – The parent for the tweak control
  • jntParent (None or dagNode, optional) – The parent for the joints
  • color (list, optional) – The color for the control
  • size (float, optional) – Size of the control
  • defSet (None or set, optional) – Deformer set to add the joints
  • ctlSet (None or set, optional) – the set to add the controls
  • side (None, str) – String to set the side. Valid values are L, R or C. If the side is not set or the value is not valid, the side will be set automatically based on the world position
  • gearMulMatrix (bool, optional) – If False will use Maya default multiply matrix node
Returns:

The tweak control

Return type:

PyNode

mgear.rigbits.tweaks.createRivetTweak(mesh, edgePair, name, parent=None, ctlParent=None, jntParent=None, color=[0, 0, 0], size=0.04, defSet=None, ctlSet=None, side=None, gearMulMatrix=True)

Create a tweak joint attached to the mesh using a rivet

Parameters:
  • mesh (mesh) – The object to add the tweak
  • edgePair (pari list) – The edge pairt to create the rivet
  • name (str) – The name for the tweak
  • parent (None or dagNode, optional) – The parent for the tweak
  • jntParent (None or dagNode, optional) – The parent for the joints
  • ctlParent (None or dagNode, optional) – The parent for the tweak control
  • color (list, optional) – The color for the control
  • size (float, optional) – Size of the control
  • defSet (None or set, optional) – Deformer set to add the joints
  • ctlSet (None or set, optional) – the set to add the controls
  • side (None, str) – String to set the side. Valid values are L, R or C. If the side is not set or the value is not valid, the side will be set automatically based on the world position
  • gearMulMatrix (bool, optional) – If False will use Maya default multiply matrix node
Returns:

The tweak control

Return type:

PyNode

mgear.rigbits.tweaks.createRivetTweakFromList(mesh, edgePairList, name, parent=None, ctlParent=None, jntParent=None, color=[0, 0, 0], size=0.04, defSet=None, ctlSet=None, side=None, mirror=False, mParent=None, mCtlParent=None, mjntParent=None, mColor=None, gearMulMatrix=True)

Create multiple rivet tweaks from a list of edge pairs

Parameters:
  • mesh (mesh) – The object to add the tweak
  • edgePairList (list of list) – The edge pair list of list
  • name (str) – The name for the tweak
  • parent (None or dagNode, optional) – The parent for the tweak
  • ctlParent (None or dagNode, optional) – The parent for the tweak control
  • jntParent (None or dagNode, optional) – The parent for the joints
  • color (list, optional) – The color for the control
  • size (float, optional) – Size of the control
  • defSet (None or set, optional) – Deformer set to add the joints
  • ctlSet (None or set, optional) – the set to add the controls
  • side (None, str) – String to set the side. Valid values are L, R or C. If the side is not set or the value is not valid, the side will be set automatically based on the world position
  • mirror (bool, optional) – Create the mirror tweak on X axis symmetry
  • mParent (None, optional) – Mirror tweak parent, if None will use parent arg
  • mjntParent (None, optional) – Mirror parent joint, if None will use jntParent arg
  • mCtlParent (None, optional) – Mirror ctl parent, if None will use ctlParent arg
  • mColor (None, optional) – Mirror controls color, if None will color arg
  • gearMulMatrix (bool, optional) – If False will use Maya default multiply matrix node
Returns:

Description

Return type:

TYPE

mgear.rigbits.tweaks.createRivetTweakLayer(layerMesh, bst, edgePairList, name, parent=None, ctlParent=None, jntParent=None, color=[0, 0, 0], size=0.04, defSet=None, ctlSet=None, side=None, mirror=False, mParent=None, mCtlParent=None, mjntParent=None, mColor=None, gearMulMatrix=True, static_jnt=None)

Create a rivet tweak layer setup

Parameters:
  • layerMesh (mesh) – The tweak layer mesh
  • bst (mesh) – The mesh blendshape target
  • edgePairList (list of list) – The edge pair list of list
  • name (str) – The name for the tweak
  • parent (None or dagNode, optional) – The parent for the tweak
  • jntParent (None or dagNode, optional) – The parent for the joints
  • ctlParent (None or dagNode, optional) – The parent for the tweak control
  • color (list, optional) – The color for the control
  • size (float, optional) – Size of the control
  • defSet (None or set, optional) – Deformer set to add the joints
  • ctlSet (None or set, optional) – the set to add the controls
  • side (None, str) – String to set the side. Valid values are L, R or C. If the side is not set or the value is not valid, the side will be set automatically based on the world position
  • mirror (bool, optional) – Create the mirror tweak on X axis symmetry
  • mParent (None, optional) – Mirror tweak parent, if None will use parent arg
  • mjntParent (None, optional) – Mirror parent joint, if None will use jntParent arg
  • mCtlParent (None, optional) – Mirror ctl parent, if None will use ctlParent arg
  • mColor (None, optional) – Mirror controls color, if None will color arg
  • gearMulMatrix (bool, optional) – If False will use Maya default multiply matrix node
  • static_jnt (dagNode, optional) – Static joint for the setup
mgear.rigbits.tweaks.edgePairList(log=True)

Print and return a list of edge pairs to be use with createRivetTweakLayer and createRivetTweakFromList

Returns:list of edge pairs
Return type:list
mgear.rigbits.tweaks.negateTransformConnection(in_rot, out_rot, neg_axis=[-1, -1, 1])
mgear.rigbits.tweaks.pre_bind_matrix_connect(mesh, joint, jointBase)

Connect the pre bind matrix of the skin cluseter to the joint parent. This create the offset in the deformation to avoid double transformation

Parameters:
  • mesh (PyNode) – Mesh object with the tweak skin cluster
  • joint (PyNode) – Tweak joint
  • jointBase (PyNode) – Tweak joint parent
mgear.rigbits.tweaks.resetJntLocalSRT(jnt)

Reset the local SRT and jointOrient of a joint

Parameters:jnt (joint) – The joint to reset the local SRT