Control

vtool.maya_lib.rigs_util.Control(name) Convenience for creating controls
class Control(name)

Convenience for creating controls

Parameters:name (str) – The name of a control that exists or that should be created.
set_curve_type(type_name)

Set the curve type. The type of shape the curve should have.

Parameters:type_name (str) – eg. ‘circle’, ‘square’, ‘cube’, ‘pin_round’
set_to_joint(joint=None, scale_compensate=False)

Set the control to have a joint as its main transform type.

Parameters:
  • joint (str) – The name of a joint to use. If none joint will be created automatically.
  • scale_compensate (bool) – Whether to connect scale of parent to inverseScale of joint.
  • causes the group above the joint to be able to change scale value without affecting the control's look. (This) –
translate_shape(x, y, z)

Translate the shape curve cvs in object space.

Parameters:
  • x (float) –
  • y (float) –
  • z (float) –
rotate_shape(x, y, z)

Rotate the shape curve cvs in object space

Parameters:
  • x (float) –
  • y (float) –
  • z (float) –
scale_shape(x, y, z, use_pivot=True)

Scale the shape curve cvs relative to the current scale.

Parameters:
  • x (float) –
  • y (float) –
  • z (float) –
  • use_pivot (bool) –
color(value)

Set the color of the curve.

Parameters:value (int) – This corresponds to Maya’s color override value.
color_rgb(r=0, g=0, b=0)

Maya 2015 and above. Set to zero by default. Max value is 1.0.

show_rotate_attributes()

Unlock and set keyable the control’s rotate attributes.

show_scale_attributes()

Unlock and set keyable the control’s scale attributes.

hide_attributes(attributes=None)

Lock and hide the given attributes on the control. If no attributes given, hide translate, rotate, scale and visibility.

Parameters:attributes (list) – List of attributes, eg. [‘translateX’, ‘translateY’]
hide_translate_attributes()

Lock and hide the translate attributes on the control.

hide_rotate_attributes()

Lock and hide the rotate attributes on the control.

hide_scale_attributes()

Lock and hide the scale attributes on the control.

hide_visibility_attribute()

Lock and hide the visibility attribute on the control.

hide_scale_and_visibility_attributes()

Lock and hide the visibility and scale attributes on the control.

hide_keyable_attributes()

Lock and hide all keyable attributes on the control.

rotate_order(xyz_order_string)

Set the rotate order on a control.

color_respect_side(sub=False, center_tolerance=0.001)

Look at the position of a control, and color it according to its side on left, right or center.

Parameters:
  • sub (bool) – Wether to set the color to sub colors.
  • center_tolerance (float) – The distance the control can be from the center before its considered left or right.
Returns:

The side the control is on in a letter. Can be ‘L’,’R’ or ‘C’

Return type:

str

get()
Returns:The name of the control.
Return type:str
get_xform_group(name)

This returns an xform group above the control.

Parameters:name (str) – The prefix name supplied when creating the xform group. Usually xform or driver.
create_xform()

Create an xform above the control.

Returns:The name of the xform group.
Return type:str
rename(new_name)

Give the control a new name.

Parameters:name (str) – The new name.
delete_shapes()

Delete the shapes beneath the control.

copy_shapes(transform)