SparseLocalRig

vtool.maya_lib.rigs.SparseLocalRig(description) A sparse rig that does that connects controls locally.
class SparseLocalRig(description, side=None)

A sparse rig that does that connects controls locally. This is important for cases where the controls when parented need to move serparetly from the rig. For example if the setup deformation blendshapes in before a skin cluster.

set_local_constraint(bool_value)
set_local_parent(local_parent)
set_connect_local_xform(bool_value)
create()
delete_setup()
get_control_entries(title)

Get entries for every control. For example, title could be “xform”. It would return all the xform nodes.

get_sub_control_entries(title)

Get entries for every sub control. For example, title could be “xform”. It would return all the xform nodes.

set_attach_joints(bool_value)

Turn off/on joint attaching.

Parameters:bool_value (bool) – Wether to attach joints.
set_auto_switch_visibility(bool_value)

When attaching more than one joint chain. This will attach the control group visibility to the switch attribute on the first joint.

set_control_color(color)

Set the color of the control based on an integer value.

set_control_compensate(bool_value)

This feeds the translation of the control into a group above using a negative offset. Good if the control is attached to a mesh that it affects usings a rivet.

set_control_offset_axis(axis_letter)

This sets the axis that the control curve cvs will offset to. This happens by rotating the control in 90 degrees on the axi. This is good for lining up the control cvs to a different axis than its default.

Parameters:axis_letter (str) – The letter of the axis to offste the control cvs around. ‘x’, ‘y’ or ‘z’
set_control_parent(parent_transform)

Sets the parent of the control group for this rig. This usually should get run after create.

set_control_shape(shape_name)

Sets the look of the controls, based on predifined names.

set_control_size(float_value)

Sets the default size of the control curve.

set_control_to_pivot(bool_value)

This will build the control at the pivot point of the joint or transform supplied with set_joints()

set_follow_parent(bool_value)
set_joints(joints)

Set the joints that the rig should work on.

Parameters:joints (list) – Joints by name.
set_match_scale(bool_value)

Match the size of the control to the scale of the joint.

Parameters:bool_value (bool) – Wether to match the control to the scale of the joint.
set_respect_side(bool_value, tolerance=0.001)

Respecting side will change the color of controls based on their position along the X coordinate. Less than x will be red. Greater than x will be blue. Inside the center axis will be yellow. This will also change the naming of the control. The end suffix letter will change to L, R or C depending on where it is in space.

Parameters:
  • bool_value (bool) – Wether to have the control respect side by changing name and color.
  • tolerance (float) – The value a control needs to be away from the center before it has a side.
set_run_after_increment(function)

function will get passed the current control and current transform.

set_scalable(bool_value)

Turn off/on the ability for controls to scale the joints.

Parameters:bool_value (bool) – Wether to open the scale attributes of the controls.
set_setup_parent(parent_transform)

Sets the parent of the setup group for this rig. This usually should get run after create.

set_sub_control_color(color)

Set the color of sub controls.

set_sub_control_shape(shape_name)

Sets the look of the curve for the sub controls.

set_sub_control_size(float_value)

Sets the default size of the sub control curve.

set_sub_visibility(bool_value)

This controls wether sub controls are visible by default after building the rig.

Parameters:bool_value (bool) –
set_use_joint_controls(bool_value, scale_compensate=False)
set_xform_values(rotate=[0, 180, 0], scale=[1, 1, -1])

This is good for mirroring control behavior

side_center = ‘C’
side_left = ‘L’
side_right = ‘R’