mgear.shifter

Shifters Rig Main class.

class mgear.shifter.Rig

The main rig class.

guide

guide.Rig() initialization.

groups

dic – Rig groups (Maya sets)

components

dic – Dictionary for the rig components. Keys are the component fullname (ie. ‘arm_L0’)

componentsIndex

list – Components index list.

addCtl(parent, name, m, color, iconShape, **kwargs)

Create the control and apply the shape, if this is alrealdy stored in the guide controllers grp.

Parameters:
  • parent (dagNode) – The control parent
  • name (str) – The control name.
  • m (matrix) – The transfromation matrix for the control.
  • color (int or list of float) – The color for the control in index or RGB.
  • iconShape (str) – The controls default shape.
  • kwargs (variant) – Other arguments for the iconShape type variations
Returns:

The Control.

Return type:

dagNode

addToGroup(objects, names=['hidden'])

Add the object in a collection for later group creation.

Parameters:
  • objects (dagNode or list of dagNode) – Object to put in the group.
  • names (str or list of str) – Names of the groups to create.
addToSubGroup(subGroups, parentGroups=['hidden'])

Add the object in a collection for later SubGroup creation.

Parameters:
  • subGroups (dagNode or list of dagNode) – Groups (core set) to add as a Subgroup.
  • namparentGroupses (str or list of str) – Names of the parent groups to create.
add_controller_tag(ctl, tagParent)
build()

Build the rig.

buildFromDict(conf_dict)
buildFromSelection()

Build the rig from selected guides.

customStep(customSteps=None)
finalize()

Finalize the rig.

findComponent(guideName)

Return the component from a guide Name.

Parameters:guideName (str) – Name of the guide object.
Returns:The component
Return type:transform
findControlRelative(guideName)

Return the control objects in the rig matching the guide object.

Parameters:guideName (str) – Name of the guide object.
Returns:The relative control object
Return type:transform
findRelative(guideName)

Return the objects in the rig matching the guide object.

Parameters:guideName (str) – Name of the guide object.
Returns:The relative object
Return type:transform
findUIHost(guideName)

Return the UI host of the compoent

Parameters:guideName (str) – Name of the guide object.
Returns:The relative object
Return type:transform
from_dict_custom_step(conf_dict, pre=True)
getComponentName(guideName, local=True)

This function return the component name

ie. “arm_C0_root” return “arm_C0”
Parameters:guideName (str) – The guide name.
Returns:The compnent Name
Return type:str
getLocalName(guideName)

This function return the local name, cutting the Maya fullname and taking the latest part.

ie. “parentA|parentB|arm_C0_root” will return “arm_C0_root”
Parameters:guideName (str) – The guide name.
Returns:The local Name
Return type:str
getRelativeName(guideName)

This function return the name of the relative in the guide

ie. “arm_C0_root” return “root”
Parameters:guideName (str) – The guide name.
Returns:The relative Name
Return type:str
initialHierarchy()

Build the initial hierarchy of the rig.

Create the rig model, the main properties, and a couple of base organisation nulls. Get the global size of the rig.

postCustomStep()
preCustomStep(selection)
processComponents()

Process the components of the rig, following the creation steps.

stepsList(checker, attr)
mgear.shifter.getComponentDirectories()

Get the components directory

mgear.shifter.importComponent(comp_type)

Import the Component

mgear.shifter.importComponentGuide(comp_type)

Import the Component guide

mgear.shifter.log_window()
mgear.shifter.reloadComponents(*args)

Reload all componets

Parameters:*args – Dummy