mgear.shifter.guide

class mgear.shifter.guide.CustomStepTab(parent=None)
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class mgear.shifter.guide.GuideSettings(parent=None)
addCustomStep(pre=True, *args)

Add a new custom step

Parameters:
  • pre (bool, optional) – If true adds the steps to the pre step list
  • *args – Maya’s Dummy
Returns:

None

Return type:

None

create_connections()

Create the slots connections to the controls functions

create_controls()

Create the controls for the component base

create_layout()

Create the layout for the component base settings

duplicateCustomStep(pre=True, *args)

Duplicate the selected step

Parameters:
  • pre (bool, optional) – If true adds the steps to the pre step list
  • *args – Maya’s Dummy
Returns:

None

Return type:

None

eventFilter(sender, event)
exportCustomStep(pre=True, *args)

Export custom steps to a json file

Parameters:
  • pre (bool, optional) – If true takes the steps from the pre step list
  • *args – Maya’s Dummy
Returns:

None

Return type:

None

getAllItems(cs_listWidget)
greenBrush = <PySide2.QtGui.QBrush(QColor(ARGB 1, 0.0901961, 0.619608, 0.513725),NoBrush) >
importCustomStep(pre=True, *args)

Import custom steps from a json file

Parameters:
  • pre (bool, optional) – If true import to pre steps list
  • *args – Maya’s Dummy
Returns:

None

Return type:

None

newCustomStep(pre=True, *args)

Creates a new custom step

Parameters:
  • pre (bool, optional) – If true adds the steps to the pre step list
  • *args – Maya’s Dummy
Returns:

None

Return type:

None

orangeBrush = <PySide2.QtGui.QBrush(QColor(ARGB 1, 0.901961, 0.494118, 0.133333),NoBrush) >
populateAvailableSynopticTabs()
populate_controls()

Populate the controls values from the custom attributes of the component.

postCustomStepMenu(QPos)
postHighlightSearch()
preCustomStepMenu(QPos)
preHighlightSearch()
redBrush = <PySide2.QtGui.QBrush(QColor(ARGB 1, 0.607843, 0.176471, 0.133333),NoBrush) >
refreshStatusColor(cs_listWidget)
setStatusColor(item)
setStatusCustomStep(cs_listWidget, stepAttr, status=True, selected=True)
setup_SettingWindow()
skinLoad(*args)
staticMetaObject = <PySide2.QtCore.QMetaObject object>
toggleStatusCustomStep(cs_listWidget, stepAttr)
whiteBrush = <PySide2.QtGui.QBrush(QColor(ARGB 1, 1, 1, 1),NoBrush) >
whiteDownBrush = <PySide2.QtGui.QBrush(QColor(ARGB 1, 0.886275, 0.886275, 0.886275),NoBrush) >
class mgear.shifter.guide.GuideSettingsTab(parent=None)
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class mgear.shifter.guide.HelperSlots
addItem2listWidget(listWidget, targetAttr=None)
close_settings()
copyFromListWidget(sourceListWidget, targetListWidget, targetAttr=None)
editFile(widgetList)
classmethod get_steps_dict(itemsList)
moveFromListWidget2ListWidget(sourceListWidget, targetListWidget, targetAttrListWidget, targetAttr=None)
populateCheck(targetWidget, sourceAttr, *args)
removeSelectedFromListWidget(listWidget, targetAttr=None)
runManualStep(widgetList)
classmethod runStep(stepPath, customStepDic)
setProfile()
updateCheck(sourceWidget, targetAttr, *args)
updateComboBox(sourceWidget, targetAttr, *args)
updateComponentName()
updateConnector(sourceWidget, itemsList, *args)
updateControlShape(sourceWidget, ctlList, targetAttr, *args)
updateHostUI(lEdit, targetAttr)
updateLineEdit(lEdit, targetAttr)
updateListAttr(sourceListWidget, targetAttr)

Update the string attribute with values separated by commas

updateSlider(sourceWidget, targetAttr, *args)
updateSpinBox(sourceWidget, targetAttr, *args)
class mgear.shifter.guide.Main

The main guide class

Provide the methods to add parameters, set parameter values, create property…

paramNames

list – List of parameter name cause it’s actually important

to keep them sorted.
paramDefs

dict – Dictionary of parameter definition.

values

dict – Dictionary of options values.

valid

bool – We will check a few things and make sure the guide we are loading is up to date. If parameters or object are missing a warning message will be display and the guide should be updated.

addColorParam(scriptName, value=False)

Add color paramenter to the paramenter definition Dictionary.

Parameters:
  • scriptName (str) – The name of the color parameter.
  • value (Variant) – The default color value.
Returns:

The newly create paramenter definition.

Return type:

paramDef

addEnumParam(scriptName, enum, value=False)

Add FCurve paramenter to the paramenter definition Dictionary.

Parameters:
  • scriptName (str) – Attribute fullName
  • enum (list of str) – The list of elements in the enumerate control.
  • value (int) – The default value.
Returns:

The newly create paramenter definition.

Return type:

paramDef

addFCurveParam(scriptName, keys, interpolation=0)

Add FCurve paramenter to the paramenter definition Dictionary.

Parameters:
  • scriptName (str) – Attribute fullName.
  • keys (list) – The keyframes to define the function curve.
  • interpolation (int) – the curve interpolation.
Returns:

The newly create paramenter definition.

Return type:

paramDef

addParam(scriptName, valueType, value, minimum=None, maximum=None, keyable=False, readable=True, storable=True, writable=True, niceName=None, shortName=None)

Add paramenter to the paramenter definition Dictionary.

Parameters:
  • scriptName (str) – Parameter scriptname.
  • valueType (str) – The Attribute Type. Exp: ‘string’, ‘bool’, ‘long’, etc..
  • value (float or int) – Default parameter value.
  • niceName (str) – Parameter niceName.
  • shortName (str) – Parameter shortName.
  • minimum (float or int) – mininum value.
  • maximum (float or int) – maximum value.
  • keyable (boo) – If true is keyable
  • readable (boo) – If true is readable
  • storable (boo) – If true is storable
  • writable (boo) – If true is writable
Returns:

The newly create paramenter definition.

Return type:

paramDef

addPropertyParamenters(parent)

Add attributes from the parameter definition list

Parameters:parent (dagNode) – The object to add the attributes.
Returns:parent with the attributes.
Return type:dagNode
get_param_values()
setParamDefValue(scriptName, value)

Set the value of parameter with matching scriptname.

Parameters:
  • scriptName (str) – Scriptname of the parameter to edit.
  • value (variant) – New value.
Returns:

False if the parameter wasn’t found.

Return type:

bool

setParamDefValuesFromDict(values_dict)
setParamDefValuesFromProperty(node)

Set the parameter definition values from the attributes of an object

Parameters:node (dagNode) – The object with the attributes.
mgear.shifter.guide.MainGuide

alias of Main

class mgear.shifter.guide.Rig

Rig guide class.

This is the class for complete rig guide definition.

  • It contains the component guide in correct hierarchy order and the
    options to generate the rig.
  • Provide the methods to add more component, import/export guide.
paramNames

list – List of parameter name cause it’s actually important to keep them sorted.

paramDefs

dict – Dictionary of parameter definition.

values

dict – Dictionary of options values.

valid

bool – We will check a few things and make sure the guide we are loading is up to date. If parameters or object are missing a warning message will be display and the guide should be updated.

controllers

dict – Dictionary of controllers.

components

dict – Dictionary of component. Keys are the component fullname (ie. ‘arm_L0’)

componentsIndex

list – List of component name sorted by order creation (hierarchy order)

parents

list – List of the parent of each component, in same order as self.components

addOptionsValues()

Gather or change some options values according to some others.

Note

For the moment only gets the rig size to adapt size of object to the scale of the character

addParameters()

Parameters for rig options.

Add more parameter to the parameter definition list.

drawNewComponent(parent, comp_type, showUI=True)

Add a new component to the guide.

Parameters:
  • parent (dagNode) – Parent of this new component guide.
  • compType (str) – Type of component to add.
drawUpdate(oldRoot, parent=None)
draw_guide(*args, **kwargs)

Draw a new guide from the guide object. Usually the information of the guide have been set from a configuration Dictionary

Parameters:
  • partial (str or list of str, optional) – If Partial starting component is defined, will try to add the guide to a selected guide part of an existing guide.
  • initParent (dagNode, optional) – Initial parent. If None, will create a new initial heirarchy

Example

shifter.log_window() rig = shifter.Rig() rig.guide.set_from_dict(conf_dict) # draw complete guide rig.guide.draw_guide() # add to existing guide # rig.guide.draw_guide(None, pm.selected()[0]) # draw partial guide # rig.guide.draw_guide([“arm_R0”, “leg_L0”]) # draw partial guide adding to existing guide # rig.guide.draw_guide([“arm_R0”, “leg_L0”], pm.selected()[0])

Returns:Description
Return type:TYPE
duplicate(root, symmetrize=False)

Duplicate the guide hierarchy

Note

Indeed this method is not duplicating. What it is doing is parse the compoment guide, and creating an new one base on the current selection.

Warning

Don’t use the default Maya’s duplicate tool to duplicate a Shifter’s guide.

Parameters:
  • root (dagNode) – The guide root to duplicate.
  • symmetrize (bool) – If True, duplicate symmetrical in X axis.
  • guide have to be "Left" or "Right". (The) –
findComponentRecursive(node, branch=True)

Finds components by recursive search.

Parameters:
  • node (dagNode) – Object frome where start the search.
  • branch (bool) – If True search recursive all the children.
getComponentGuide(comp_type)

Get the componet guide python object

ie. Finds the guide.py of the component.

Parameters:comp_type (str) – The component type.
Returns:The component guide instance class.
get_guide_template_dict(meta=None)

Get the guide temaplate configuration dictionary

Parameters:
  • meta (dict, optional) – Arbitraty metadata dictionary. This can
  • use to store any custom information in a dictionary format. (be) –
Returns:

guide configuration dictionary

Return type:

dict

initialHierarchy()

Create the initial rig guide hierarchy (model, options…)

setFromHierarchy(root, branch=True)

Set the guide from given hierarchy.

Parameters:
  • root (dagNode) – The root of the hierarchy to parse.
  • branch (bool) – True to parse children components.
setFromSelection()

Set the guide hierarchy from selection.

set_from_dict(guide_template_dict)
update(sel, force=False)

Update the guide if a parameter is missing

updateProperties(root, newName, newSide, newIndex)

Update the Properties of the component.

Parameters:
  • root (dagNode) – Root of the component.
  • newName (str) – New name of the component
  • newSide (str) – New side of the component
  • newIndex (str) – New index of the component
mgear.shifter.guide.RigGuide

alias of Rig

mgear.shifter.guide.customStepTab

alias of CustomStepTab

mgear.shifter.guide.guideSettings

alias of GuideSettings

mgear.shifter.guide.guideSettingsTab

alias of GuideSettingsTab

mgear.shifter.guide.helperSlots

alias of HelperSlots