ART_Chain

Author: Jeremy Ernst

File Attributes

  • icon: This is the image file (125x75 .png) that gets used in the RigCreatorUI
  • hoverIcon: When you hover over the module in the module list, it will swap to this icon (background changes to orange). There are .psd template files for these.
  • search: These are search terms that are accepted when searching the list of modules in the RigCreatorUI
  • class name: The name of the class.
  • jointMover: The relative path to the joint mover file. Relative to the ARTv2 root directory.
  • baseName: The default name the module will get created with. Users can then add a prefix and/or suffix to the base name.
  • rigs: This is a simple list of what rigs this module can build. This feature isn’t implemented yet, but the plan is to query this list and present these options to the user for them to select what rigs they want to build for the module. Right now, it will build all rigs.
  • fbxImport: This is a list that will show the options for the module in the import mocap interface. Normally, this list will have at least None and FK.
  • matchData: This is a list of options that will be presented for the module in a comboBox in the match over frame range interface. First argument is a bool as to whether the module can or can’t match. The second arg is a list of strings to display for the match options. For example: matchData = [True, [“Match FK to IK”, “Match IK to FK”]]

Class

class RigModules.ART_Chain.ART_Chain(rigUiInst, moduleUserName)[source]

Bases: RigModules.Base.ART_RigModule.ART_RigModule

This class creates the chain module, which can have a minimum of 2 joints and a maximum of 99.

__init__(rigUiInst, moduleUserName)[source]

Initiate the class, taking in the instance to the interface and the user specified name.

Parameters:
  • rigUiInst – This is the rig creator interface instance being passed in.
  • moduleUserName – This is the name specified by the user on module creation.
Instantiate the following class variables as well:
  • self.rigUiInst: take the passed in interface instance and make it a class var
  • self.moduleUserName: take the passed in moduleUserName and make it a class var
  • self.outlinerWidget: an empty list that will hold all of the widgets added to the outliner

Also, read the QSettings to find out where needed paths are.

addAttributes()[source]

Add custom attributes this module needs to the network node.

Always calls on base class function first, then extends with any attributes unique to the class.

addChainSegment(setupScale=False)[source]

Adds a new joint mover segment onto the chain module. Called when the number of joints in the chain has increased.

Parameters:setupScale – Whether or not to setup the global scale attributes (so that scaling works with the root)
addJointMoverToOutliner()[source]

Add the joint movers for this module to the outliner.

Depending on the module settings, different joint movers may or may not be added. Also, each “joint” usually has three movers: global, offset, and geo. However, not all joints do, so this method is also used to specify which joint movers for each joint are added to the outliner.

../../_images/outliner.png
aimMode_Setup(state)[source]

This functions sets up or removes the setup for aim mode, which is a setting in the joint mover phase. Aim mode makes sure that the parent continues to aim at the child, and does so by setting up aim constraints between the movers.

If the passed in state is False, it will remove the aimConstraints, making the parents no longer aim at their children.

Parameters:state – Whether or not to setup or remove the aim mode setup.
applyModuleChanges(moduleInst)[source]

Update the scene after the settings are changed in the skeleton settings UI. In the case of the chain, this usually means an increase or decrease in the number of joints in the chain.

This means also updating the created_bones attr, updating the joint mover if needed, running self.updateNeck, updating the outliner, and updating the bone count.

Parameters:moduleInst – self (usually, but there are cases like templates where an inst on disc is passed in.)
buildFkRig(textEdit, uiInst, builtRigs, networkNode)[source]

Builds the FK rig for the chain.

Parameters:
  • textEdit – The textEdit widget to post status updates to
  • uiInst – The Rig Creator ui instance
  • builtRigs – How many rigs have been built so far
  • networkNode – The network node of the module
Returns:

Returns the top-level FK node to be parented into the rig.

buildIkRig(textEdit, uiInst, builtRigs, networkNode)[source]

Builds the IK Ribbon Rig for the chain module.

Parameters:
  • textEdit – The textEdit widget to post status updates to
  • uiInst – The Rig Creator ui instance
  • builtRigs – How many rigs have been built so far

:param networkNode:The network node of the module

Returns:Returns the top-level IK node(s) to be parented into the rig.
buildRigCustom(textEdit, uiInst)[source]

Boiler-plate function for kicking off the various rigs that need to be built for this module. Also hooks up rig switching/blending and parents the top level nodes of the built rigs into the main hierarchy.

Parameters:
  • textEdit – The textEdit widget to post status updates to
  • uiInst – The Rig Creator ui instance
changeControlShape(*args)[source]

This method is unique to this module. It allows the user to change the shape of the control object of the joint mover, which also gets used as the control object for the rig.

See also

ART_Chain.skeletonSettings_UI()

changeProxyGeo(*args)[source]

This method is unique to this module and allows the user to change the geometry of the proxy geo. This is purely for aesthetic purposes.

See also

ART_Chain.skeletonSettings_UI()

createMirrorModule_custom()[source]

This function can be run after a mirror of this module has been created. Some modules utilize it, others don’t. In this case of the chain module, it simply applies module changes again to get the proxy and control shape changes applied.

getCurrentNumberOfSegments()[source]

Finds the number of chain segments in the scene by finding the highest number in the joint mover hierarchy.

Returns:the highest number found in the chain joint mover hierarchy.
hideLastGeo()[source]

Hides the last joint-in-the-chain’s proxy geo to avoid confusion with regards to chain segments.

hookUpMoverGlobalScale(movers)[source]

Hooks up the alias attr for global scale on any newly created chain segments.

Parameters:movers – List of movers to setup the alias attr on.
importFBX(importMethod, character)[source]

Import FBX motion onto this module’s rig controls.

Parameters:
  • importMethod – The import method to be used (options defined in the file attributes)
  • character – the namespace of the character

Each module has to define what import methods it offers (at the very top of the module file) and then define how motion is imported using those methods.

jointMover_Build(path)[source]

Import the joint mover file with the given path.

After importing the module’s joint mover file, rename imported nodes to use module name. Then, assign existing matching materials to joint mover proxy geometry, deleting the imported materials if they were duplicates. Then parent into the main JointMover group. Lastly, hook up global scaling on the joint movers.

Override of base class, so that the chain ‘links’ can be added as needed.

Parameters:path – Path of joint mover file to import
mirrorTransformations()[source]

This method mirrors transformations for the module’s mirror module.

mirrorTransformations_Custom()[source]

This method is run after the base class mirrorTransformations method and is used to do anything specific that a module might need that differs from all the base functionality. In the case of the chain, it needs to change some of the values to be negative or positive due to the local rotation axis of the joint movers.

pasteSettings()[source]

Paste the settings from the temp file on disk to the module’s network node.

This function is used in the right-click menu of the module on the skeleton settings interface. Occasionally, it is called outside of the menu. For example, when creating a mirror of the module, the settings are copied for the source module to then be later pasted on the mirror.

After settings are pasted, applyModuleChanges is called to update the joint mover in the scene with the latest values. updateSettingsUI is also called to update the outliner.

pickerUI(center, animUI, networkNode, namespace)[source]

Build the animation picker for the module. This particular picker is very unique compared to previous modules.

Parameters:
  • center – the center of the QGraphicsScene
  • animUI – the instance of the AnimationUI
  • networkNode – the module’s network node
  • namespace – the namespace of the character
picker_createContextMenu()[source]

Create the right-click context menu for the chain’s animation picker widget. This context menu has options for quickly selecting controls, zeroing out controls, and switching rig modes.

Returns:Returns the menu widget that was created
picker_createContextMenu_FK()[source]

Create the right-click context menu for the chain’s animation picker widget. This context menu has options for quickly selecting controls, zeroing out controls, and switching rig modes.

Returns:Returns the menu widget that was created
picker_listWidget_select(listWidget, *args)[source]

Gets the selected items from the passed in listWidget and selects the associated controls/

Parameters:listWidget – List widget to get selected items from.
pinModule(state)[source]

Pins the module in place in 3D space so that the parent module can no longer affect its position. It does this by constraining it to a locator that gets created in the same spot as the top level group of the module.

Parameters:state – Whether or not to setup pinning or remove pinning.
removeChainSegment()[source]

Removes a segment from the chain module. Called when the number of joints in the chain has been decreased.

resetRigControls(resetAll)[source]

This method zeroes out control attributes. If resetAll is true, then it will zero out all rig controls for the module. Otherwise, it will only zero out the selected controls of the module.

Parameters:resetAll – Whether or not to reset only the selected controls or all controls of the module.
resetSettings()[source]

(Override from base class) Reset the settings of the module’s network node.

This function is used in the right-click menu of the module on the skeleton settings interface.

selectRigControls(mode)[source]

This method calls on getControls to return a list of the controls and the selects them.

Parameters:mode – Which controls to select (FK, IK, or all)
selectionScriptJob_animUI(fk_list, ik_list)[source]

This method is called from a scriptjob anytime a selection is changed. It’s sole purpose it to update the list widget selection to reflect if controls are selected or not.

Parameters:
  • fk_list – The list widget that holds the fk controls
  • ik_list – The list widget that holds the ik controls
setupPickWalking()[source]

Sets up pickwalking between the controls in the module. These are just defaults and the pickwalking relationships can be changed using the pickwalking tool.

skeletonSettings_UI(name)[source]

This is the UI for the module that has all of the configuration settings.

Parameters:
  • name – user given name of module (prefix + base_name + suffix)
  • width – width of the skeleton settings groupBox. 335 usually
  • height – height of the skeleton settings groupBox.
  • checkable – Whether or not the groupBox can be collapsed.

Build the groupBox that contains all of the settings for this module. Parent the groupBox into the main skeletonSettingsUI layout. Lastly, call on updateSettingsUI to populate the UI based off of the network node values.

../../_images/skeletonSettings.png
skinProxyGeo()[source]

Boiler-plate function that skins this modules’ proxy geo.

switchMode(mode, checkBox, frameRange=False)[source]

This method switches between rig modes, matching the positions between rigs if the checkBox arg value is true. It also supports matching and switching over a frame range.

Parameters:
  • mode – Which mode we are switching to
  • checkBox – Whether or not we are matching when switching
  • frameRange – Whether or not we are matching/switching over a frame range.
switchMode_slider(slider, args)[source]

This method updates the module’s mode (0 - 1) based on the slider on the picker widget.

Parameters:
  • slider – The slider widget whose value to query
  • args – the current value of the slider (0 - 100)
toggleButtonState()[source]

Toggles the state (enabled or disabled) of the Apply Changes button. Gets called when some element of the skeleton settings UI has changed.

updateOutliner(oldNumber)[source]

Whenever changes are made to the module settings, update the outliner to show the new or removed movers

Parameters:oldNumber – The original number of joints in the chain, so it can be compared to the new number.
updateSettingsUI()[source]

Update the skeleton settings UI based on the network node values for this module.