ART_Leg_Standard

Author: Jeremy Ernst

Contents

Must Have Methods:
Optional Methods:
Module Specific Methods:
_ik_rig_setup
_ik_rig_foot_ctrl
_ik_rig_knee_display
_ik_rig_create_foot_joints
_ik_rig_create_foot_roll_rig
_ik_rig_setup_foot_roll_rig
_ik_rig_complete_foot_roll_rig
_ik_rig_setup_knee_twist
_ik_rig_setup_squash_stretch
_ik_rig_no_flip_knee
_getBallGeo
_getLegScale
_getMainLegJoints
_getLegTwistJoints

Interface Methods:
_toggleButtonState
_editMetaTarsals
_editJointMoverViaSpinBox
_editJointMoverTwistBones

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”]]

    ../../_images/selectRigControls.png

Class

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

Bases: RigModules.Base.ART_RigModule.ART_RigModule

# class that defines a common biped leg, with an FK and IK rig (where the IK rig is modeled after ARTv1’s style)

__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
addAttributes()[source]

Add custom attributes this module needs to the network node. (AKA metadata)

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

addJointMoverToOutliner()[source]

Add the joint movers for this module to the outliner. (called from ART_AddModuleUI)

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]

Sets up (or removes the setup) of aim mode for the joint mover rig. This ensures the parent always aims at the child mover.

Parameters:state – (bool). Whether to setup or tear down aim mode.
applyModuleChanges(moduleInst)[source]

Update the scene after the settings are changed in the skeleton settings UI.

This means also updating the created_bones attr, updating the joint mover if needed, 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.)
buildIkRig(numRigs, slot)[source]

Builds the IK rig for the leg module (similar to ARTv1 IK leg)

buildRigCustom(textEdit, uiInst)[source]

The base class gets a buildRig function called from the buildProgressUI. This function has some pre/post functionality that labels new nodes created by the buildRigCustom method. Each derived class will need to have a buildRigCustom implemented. This method should call on any rig building functions for that module.

-each module should have its own settings group : self.name + “_settings” -each module should have something similar to the builtRigs list, which is a list that holds what rigs have been built (NOT, which are going to BE built, but the ones that already have)

-this list looks something like this: [[“FK”, [nodesToHide]],[“IK”, [nodesToHide]]] -this is used when it’s time to setup the mode switching
buildToeRigs(joints)[source]

Builds FK rigs for the given toes.

Parameters:joints – which toe joints to build rigs for.
changeSide()[source]

Import the given joint mover file for the side requested (from network node). For the Leg, there are 2 joint mover files: Left and Right. This will change the movers to the opposite side.

coplanarMode()[source]

Co-planar mode is a tool for the joint mover rig that snaps the movers to a rotate plane so that the chain is built ideally for an IK setup.

ikKneeMatch(character, startJoint, middleJoint, endJoint)[source]

Matches the knee_twist attribute of the IK leg to the angle of the reference knee.

importFBX(importMethod, character)[source]

This method defines how mocap is imported onto the rig controls.

Parameters:
  • importMethod – Whether or not the FBX is getting imported as FK, IK, Both, or None
  • character – The namespace of the rig.
importFBX_post(importMethod, character)[source]

Some modules may require some post operations after importing fbx motion. In the case of the leg, It will go through and match the knee twist to properly align up with the imported motion.

Parameters:
  • importMethod – Whether the motion is being imported on FK, IK, or Both
  • character – the character namespace
includeBallJoint(apply, *args)[source]

Set visibility and parenting on the joint movers depending on whether the include ball joint checkbox is true or false.

mirrorTransformations_Custom()[source]

Some modules may require post mirror transform operations. This is run after the base class mirror transformations.

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

Build the animation picker for the module.

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
pinModule(state)[source]

Pins the module in place (joint movers), so that the parent module no longer affects it. :param state: (bool). Whether the module is pinned or not.

resetSettings()[source]

(OVERRIDE OF 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. Occasionally, it is called outside of the menu.

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

selectRigControls(mode)[source]

(BASE CLASS OVERRIDE!) This method calls on getControls to return a list of the controls and the selects them.

setupPickWalking()[source]

Sets up custom pickwalking between rig controls.

Note

Current limitations: twist controls can not currently be pick-walked to from IK controls.

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)

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]

Skin the proxy geo brought in by the module. Each module has to define how it wants to skin its proxy geo.

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

Switch the rig mode to FK or IK, matching the pose while switching if the checkbox is True.

Parameters:
  • mode – Which mode to switch to (FK, IK)
  • checkBox – The match checkbox (if True, match, then switch)
  • range – Whether to match/switch over range
updateOutliner()[source]

Whenever changes are made to the module settings, update the outliner (in the rig creator) to show the new or removed movers. Tied to skeletonSettingsUI

updateSettingsUI()[source]

Updates the skeleton settings UI based on the network node values for this module. Happens when the UI is launched and there are module metadata present