bgdev.utils.locators

Utility methods about locators.

created

05/03/2017

author

Benoit GIELLY <benoit.gielly@gmail.com>

attach_locators_to_curve()[source]

Attach a locator on each curve CVs.

create_aim_locator(middle=False, aim_vector=(1, 0, 0), up_vector=(0, 1, 0))[source]

Create a locator that’s oriented on the selection.

If selection is 2 or 3, it will use the second as the aim axis, and the third as up. If middle is set to False, it will snap it to the first selected.

Parameters
  • middle (bool) – snap in between points 1 and 2 if True, else on point 1.

  • aim_vector (tuple) – default aim vector for the aimConstraint.

  • up_vector (tuple) – default up vector for the aimConstraint.

Returns

The locator created.

Return type

str

Raises

RuntimeError – If nothing is selected.

locator_on_selection(method='matrix')[source]

Create and snap a locator on selected nodes.

Parameters

method (str) – “matrix” uses Maya’s xform command with matrix flag enabled. “pivot” uses Maya’s xform command with rotatePivot flag enabled. “manip” queries Maya’s move manipulator position and orientation.