Joint Mover

Code author: Jeremy Ernst

class JointMover(path, metanode)[source]

Class for creating and working with a joint mover rig, which is a simplified rig used to aid in the creation and placement of a skeleton, keeping it clean and consistent. The JointMover is instantiated by a component and is passed that component’s network_node.

add_joint_mover()[source]

Adds the joint mover maya ascii file to the maya scene.

bake_offsets()[source]

Ensures that the global movers are aligned with the offset movers, so that the offsets are once again zeroed out. This function runs twice to account for aim mode, which changes the orientation of an offset mover (on a group above) when a global mover is moved. The second run cleans up the orientation offsets that were added due to this.

copy_transforms(template=False)[source]

Copies the translate, rotate, and scale values of the joint mover control and stores them to a file on disk.

create_joint_mover_controls(root_joint)[source]

Creates the joint mover controls on the joints that come in from the ascii file.

Parameters:root_joint – Root joint of the hierarchy from the joint mover ascii file.
get_containers()[source]

Get and return the containers that our joint mover controls and utility nodes are contained in.

Returns:PyNodes of containers that our joint mover controls and utility nodes reside in.
get_created_joints()[source]

Finds and returns the joints created by this JointMover.

Returns:string array of joint names
get_driven_joints()[source]

Return the joint mover joints currently driven by the movers (these are not the same as the created joints).

Returns:List of PyNodes representing the joint mover joints.
get_movers()[source]

Finds and returns the joint mover control objects created by the JointMover.

Returns:Dictionary of joint movers with the keys: global and offset.
mirror_transforms()[source]

Mirrors joint mover transforms to the owning component’s mirror (if it has one).

example usage:
asset = rig_asset.ART_RigAsset()
leg = leg.BipedLeg(prefix="l")
mirror = leg.create_mirror(prefix="r", suffix="", parent="root")
leg.joint_mover.mirror_transforms()
paste_transforms(mirror=False, template=False, data=None)[source]

Opens the file on disk that has clipboard data for copied transforms, and sets any applicable data on the joint mover controls.

Parameters:
  • mirror – Whether to mirror the values when pasting.
  • template – Whether this is being called from loading a template.
  • data – (optional) data of transforms to paste rather than using clipboard.
remove_movers()[source]

Remove the generated joint mover controls from the driven joints (as well as any associated containers, nodes).

rename_movers(old_prefix, old_suffix)[source]

Renames joint movers with the new component prefix and/or suffix.

Parameters:
  • old_prefix (str) – The old prefix to search/replace
  • old_suffix (str) – The old suffix to search/replace
reset_movers(mover_type)[source]

Resets the joint movers to their default transform values.

Parameters:mover_type (str) – Valid options are “all”, “offset”, “global”.
return_top_mover_grp()[source]

Finds the top-most global mover group and returns it.

Returns:string name of the top-most global mover group.
select_top_mover()[source]

Selects the top-most joint mover control for this component.

set_mover_parent(parent)[source]

Parents the top-most group in the joint mover file under the given parent joint’s global mover.

Parameters:parent (str) – Name of parent joint.
static set_mover_values(value_data)[source]

Sets values on the joint mover controls.

Parameters:value_data – The values to set on the controls. It should be formatted like the dictionary generated by the get_mover_values method.
toggle_build_joint(joint, mover, build=True)[source]

Toggles the visibility of the given joint and associated movers, as well as setting the build state.

Parameters:
  • joint – The guide joint (PyNode) to toggle visiblity on.
  • mover – The offset mover (PyNode) to set the build state on and toggle visibility on.
  • build – The boolean value of whether to build the joint or not.
toggle_global_visibility(state)[source]

Toggles the visibility of the global movers’ shape nodes whose joints are set to be built.

Parameters:state – The visibility value to set on the global mover shapes.
toggle_offset_visibility(state)[source]

Toggles the visibility of the offset movers’ shape nodes whose joints are set to be built.

Parameters:state – The visibility value to set on the offset mover shapes.
toggle_pin_component()[source]

Toggles whether the component is pinned, meaning if pinned, the component is unaffected by any transforms of its parent.

toggle_visibility(state)[source]

Toggles visibility of joint mover nodes.

metanode

This property holds the metanode that is passed in from our component using the joint mover.

Returns:Returns the metanode from our component as a pynode.

Properties

metanode

This property holds a reference to the owning component’s network node (the component that created this joint mover.