ART_Leaf

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_Leaf.ART_Leaf(rigUiInst, moduleUserName)[source]

Bases: RigModules.Base.ART_RigModule.ART_RigModule

This class create a single joint with an FK rig and an optional dynamics rig.

__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.

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
applyModuleChanges(moduleInst, *args)[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.)
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
changeButtonColor(animUI, button, border, control, color=None)[source]

Leaf joints give the user the option to change the button’s color. This function will remove the existing scriptJob, set the new button color, and create a new scriptJob with that information.

Parameters:
  • animUI – The animation UI instance
  • button – The button whose color we wish to set.
  • border – The border item of the button that holds the scriptJob number to kill
  • control – The control this button selects.
changeControlShape(*args)[source]

Changes the control shape of the joint movers. Since the control shapes are used for the rig controls, this is to pick a contrrol shape that better fits the object.

changeProxyGeo(*args)[source]

Changes the proxy geo of the leaf module joint mover. There are a few default shapes to choose from so that the proxy geo more resembles what it is standing in for.

customAttr_UI()[source]

A UI that allows users to create custom attributes in the skeleton settings UI for the leaf joint module. These custom attrs could then drive or be driven by other things in a post-script. :return:

customAttr_UI_Accept()[source]

Adds the custom attribute to the module’s metaData so it will be created during the rig build.

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.

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
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.
removeCustomAttr()[source]

Removes any custom attributes that were added via skeletonSettingsUI.

selectSettings(namespace)[source]

selects the rig settings node for the leaf module. :param namespace: namespace of the asset.

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.

updateSettingsUI()[source]

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