mgear.synoptic.utils

class mgear.synoptic.utils.AbstractAnimationTransfer

Abstract animation transfer class

bakeAnimation(*args, **kwargs)
createUI(parent=None)
create_connections()
create_controls()
create_layout()
doItByUI()
getHostName()
getWorldMatrices(start, end, val_src_nodes)

returns matrice List[frame][controller number].

populateRange(timeSlider=False)
setComboBoxItemsFormComboObj(combo)
setComboBoxItemsFormList(comboList)
setComboObj(combo)
setGroupBoxTitle()
setModel(model)
setSwitchedAttrShortName(attr)
setUiHost(uihost)
staticMetaObject = <PySide2.QtCore.QMetaObject object>
transfer(startFrame, endFrame, onlyKeyframes, *args, **kwargs)
valueChanged = <PySide2.QtCore.Signal object>
class mgear.synoptic.utils.IkFkTransfer
changeAttrToBoundValue()
doItByUI()
static execute(model, ikfk_attr, uihost, fks, ik, upv, ikRot=None, startFrame=None, endFrame=None, onlyKeyframes=None, switchTo=None)

transfer without displaying UI

getChangeAttrName()
getChangeRollAttrName()
getValueFromUI()
setCtrls(fks, ik, upv, ikRot)

gather core PyNode represented each controllers

setGroupBoxTitle()
static showUI(model, ikfk_attr, uihost, fks, ik, upv, ikRot, *args)
staticMetaObject = <PySide2.QtCore.QMetaObject object>
static toFK(model, ikfk_attr, uihost, fks, ik, upv, ikRot, **kwargs)
static toIK(model, ikfk_attr, uihost, fks, ik, upv, ikRot, **kwargs)
transfer(startFrame, endFrame, onlyKeyframes, ikRot, switchTo=None, *args, **kargs)
class mgear.synoptic.utils.ParentSpaceTransfer
changeAttrToBoundValue()
getChangeAttrName()
getValue()
setCtrls(srcName)
setGroupBoxTitle()
static showUI(combo, model, uihost, switchedAttrShortName, ctrl_name, *args)
staticMetaObject = <PySide2.QtCore.QMetaObject object>
transfer(startFrame, endFrame, onlyKeyframes, *args, **kwargs)
class mgear.synoptic.utils.SpineIkFkTransfer
bakeAnimation(*args, **kwargs)

bake animation to desired destination. More adding animtion than ik/fk transfer

Parameters:
  • fkControls (list) – of fk controls
  • ikControls (list) – of ik controls
  • startFrame (float) – start frame
  • endFrame (float) – end frame
  • bakeToIk (bool, optional) – True, bake animation to ik, fk is false
  • onlyKeyframes (bool, optional) – transfer animation on other
  • if false, bake every frame (keyframes,) –
doItByUI()

Gather UI settings to execute transfer

setCtrls(fkControls, ikControls)

make provided controls accessible to the class, with namespaces

Parameters:
  • fkControls (list) – of fk controls
  • ikControls (list) – of ik controls
static showUI(topNode, uihost, fkControls, ikControls, *args)

Called from the synaptic qpushbutton, with the spine control names

Parameters:
  • topNode (string) – top node of the rig
  • uihost (TYPE) – Description
  • fkControls (list) – of fkControls
  • ikControls (list) – of ikControls
  • *args – additional signal args, n/a
staticMetaObject = <PySide2.QtCore.QMetaObject object>
mgear.synoptic.utils.applyMirror(nameSpace, mirrorEntry)

Apply mirro pose

Parameters:
  • nameSpace (str) – Namespace
  • mirrorEntry (list) – List witht the mirror entry template
mgear.synoptic.utils.bakeSprings(*args, **kwargs)

Bake the automatic spring animation to animation curves

Parameters:model (dagNode) – The rig top node
mgear.synoptic.utils.bindPose(model)

Restore the reset position of the rig

Parameters:model (TYPE) – Description
mgear.synoptic.utils.calculateMirrorData(srcNode, targetNode, flip=False)

Calculate the mirror data

Parameters:
  • srcNode (str) – The source Node
  • targetNode ([dict[str]]) – Target node
  • flip (bool, optional) – flip option
Returns:

node, “attr”: at, “val”: flipVal}]

Return type:

[{“target”

mgear.synoptic.utils.changeSpace(model, object_name, combo_attr, cnsIndex, ctl_name)

Change the space of a control

i.e: A control with ik reference array

Parameters:
  • model (PyNode) – Rig top node
  • object_name (str) – Object Name
  • combo_attr (str) – Combo attribute name
  • cnsIndex (int) – Combo index to change
  • ctl_name (str) – Control name
mgear.synoptic.utils.clearSprings(*args, **kwargs)

Delete baked animation from spring

Parameters:model (dagNode) – The rig top node
mgear.synoptic.utils.gatherMirrorData(nameSpace, node, flip)

Get the data to mirror

Parameters:
  • nameSpace (str) – Namespace
  • node (PyNode) – No
  • flip (TYPE) – flip option
Returns:

The mirror data

Return type:

[dict[str]

mgear.synoptic.utils.getClosestNode(node, nodesToQuery)

return the closest node, based on distance, from the list provided

Parameters:
  • node (string) – name of node
  • nodesToQuery (list) – of nodes to query
Returns:

name of the closest node

Return type:

string

mgear.synoptic.utils.getComboIndex(model, object_name, combo_attr)

Get the index from a combo attribute

Parameters:
  • model (PyNode) – Rig top node
  • object_name (str) – Control name
  • combo_attr (str) – Combo attribute name
Returns:

Current index in the combo attribute

Return type:

int

mgear.synoptic.utils.getComboKeys(model, object_name, combo_attr)

Get the keys from a combo attribute

Parameters:
  • model (PyNode) – Rig top node
  • object_name (str) – Control name
  • combo_attr (str) – Combo attribute name
Returns:

Keys names from the combo attribute.

Return type:

list

mgear.synoptic.utils.getControlers(model, gSuffix=’_controllers_grp’)

Get thr controlers from the set

Parameters:
  • model (PyNode) – Rig root
  • gSuffix (str, optional) – set suffix
Returns:

The members of the group

Return type:

list

mgear.synoptic.utils.getInvertCheckButtonAttrName(str)

Get the invert check butto attribute name

Parameters:str (str) – The attribute name
Returns:The checked attribute name
Return type:str
mgear.synoptic.utils.getModel(widget)

Get the model Name

Parameters:widget (QWidget) – Synoptic widget
Returns:The rig model name
Return type:PyNode
mgear.synoptic.utils.getNamespace(modelName)

Get the name space from rig root

Parameters:modelName (str) – Rig top node name
Returns:Namespace
Return type:str
mgear.synoptic.utils.getNode(nodeName)

Get a PyNode from the string name

Parameters:nodeName (str) – Node name
Returns:The node. or None if the object can’t be found
Return type:PyNode or None
mgear.synoptic.utils.getSynopticWidget(widget, max_iter=20)

Return the widget where the synoptic panel is attach

Parameters:
  • widget (QWidget) – The widget to get the parent
  • max_iter (int, optional) – Iteration limit to find the paretn widget
Returns:

The Parent widget

Return type:

widget

mgear.synoptic.utils.ikFkMatch(model, ikfk_attr, uiHost_name, fks, ik, upv, ikRot=None)

Switch IK/FK with matching functionality

This function is meant to work with 2 joint limbs. i.e: human legs or arms

Parameters:
  • model (PyNode) – Rig top transform node
  • ikfk_attr (str) – Blend ik fk attribute name
  • uiHost_name (str) – Ui host name
  • fks ([str]) – List of fk controls names
  • ik (str) – Ik control name
  • upv (str) – Up vector control name
  • ikRot (None, str) – optional. Name of the Ik Rotation control
mgear.synoptic.utils.isSideElement(name)

Returns is name(str) side element?

Parameters:name (str) – Description
Returns:bool
Deleted Parameters:
node: str
mgear.synoptic.utils.keyAll(model)

Keyframe all the controls inside the controls group

Note: We use the workd “group” to refer to a set in Maya

Parameters:model (PyNode) – Rig top node
mgear.synoptic.utils.keyGroup(model, groupSuffix)

Keyframe all the members of a given group

Parameters:
  • model (PyNode) – Rig top node
  • groupSuffix (str) – The group preffix
mgear.synoptic.utils.keyObj(model, object_names)

Set the keyframe in the controls pass by a list in obj_names variable

Parameters:
  • model (Str) – Name of the namespace that will define de the model
  • object_names (Str) – names of the controls, without the name space
Returns:

None

mgear.synoptic.utils.keySel()

Key selected controls

mgear.synoptic.utils.listAttrForMirror(node)

List attributes to invert the value for mirror posing

Parameters:node (PyNode) – The Node with the attributes to invert
Returns:Attributes to invert
Return type:list
mgear.synoptic.utils.mirrorPose(flip=False, nodes=None)

Summary

Parameters:
  • flip (bool, optiona) – Set the function behaviout to flip
  • nodes (None, [PyNode]) – Controls to mirro/flip the pose
mgear.synoptic.utils.mirrorPoseOld(flip=False, nodes=False)

Deprecated: Mirror pose

Parameters:
  • flip (bool, optional) – if True will flip the pose
  • nodes (bool, optional) – Nodes to mirror or flip transformation
mgear.synoptic.utils.quickSel(model, channel, mouse_button)

Select the object stored on the quick selection attributes

Parameters:
  • model (PyNode) – The rig top node
  • channel (str) – The quick selection channel name
  • mouse_button (QtSignal) – Clicked mouse button
Returns:

None

mgear.synoptic.utils.recordNodesMatrices(nodes, desiredTime)

get the matrices of the nodes provided and return a dict of node:matrix

Parameters:nodes (list) – of nodes
Returns:node:node matrix
Return type:dict
mgear.synoptic.utils.resetSelTrans()

Reset the transfom values (SRT) for the selected objects

mgear.synoptic.utils.selAll(model)

Select all controlers

Parameters:model (PyNode) – Rig top node
mgear.synoptic.utils.selGroup(model, groupSuffix)

Select the members of a given set

Parameters:
  • model (PyNode) – Rig top node
  • groupSuffix (str) – Set suffix name
mgear.synoptic.utils.selectObj(model, object_names, mouse_button, key_modifier)

Select an object

Parameters:
  • model (PyNode) – The rig top node
  • object_names (list) – The names of the objects to select
  • mouse_button (QtSignal) – Clicked mouse button signal
  • key_modifier (QtSignal) – Modifier button signal
Returns:

None

mgear.synoptic.utils.spine_FKToIK(fkControls, ikControls, matchMatrix_dict=None)

Match the IK controls to the FK. Known limitations: Does not compensate for stretching. Does not support zig-zag, or complex fk to ik transfers. Supports component: spine_S_shape_01, spine_ik_02

Parameters:
  • fkControls (list) – of of nodes, IN THE ORDER OF HIERARCHY
  • ikControls (list) – of of nodes
mgear.synoptic.utils.spine_IKToFK(fkControls, ikControls, matchMatrix_dict=None)

position the IK controls to match, as best they can, the fk controls. Supports component: spine_S_shape_01, spine_ik_02

Parameters:
  • fkControls (list) – list of fk controls, IN THE ORDER OF HIERARCHY,
  • .., .., "spine_C0_fk6_ctl"] (["spine_C0_fk0_ctl",) –
  • ikControls (list) – all ik controls
mgear.synoptic.utils.stripNamespace(nodeName)

Strip all the namespaces from a given name

Parameters:nodeName (str) – Node name to strip the namespaces
Returns:Node name without namespace
Return type:str
mgear.synoptic.utils.swapSideLabel(name)

Returns fliped name

Returns fliped name that replaced side label left to right or right to left

Parameters:name (str) – Name to swap the side
Returns:str
mgear.synoptic.utils.toggleAttr(model, object_name, attr_name)

Toggle a boolean attribute

Parameters:
  • model (PyNode) – Rig top node
  • object_name (str) – The name of the control containing the attribute to toggle
  • attr_name (str) – The attribute to toggle