mgear.core.icon module

Predefined nurbsCurve shapes to be use as a rigging control Icons

mgear.core.icon.arrow(parent=None, name='arrow', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a ARROW shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.axis(parent=None, name='axis', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a AXIS shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.circle(parent=None, name='circle', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None, degree=3)

Create a curve with a CIRCLE shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.compas(parent=None, name='compas', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None, degree=3)

Create a curve with a COMPAS shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.connection_display_curve(name, centers=[], degree=1)

Visual reference curves connectiong points.

Display curve object is a simple curve to show the connection between different guide element..

Parameters:
  • name (str) – Local name of the element.

  • centers (list of dagNode) – List of object to define the curve.

  • degree (int) – Curve degree. Default 1 = lineal.

Returns:

The newly creted curve.

Return type:

dagNode

mgear.core.icon.create(parent=None, name='icon', m=pymel.core.datatypes.Matrix, color=[0, 0, 0], icon='cube', **kwargs)

Icon master function

Create icon master function. This function centralize all the icons creation

Parameters:
  • parent (dagNode) – The parent for the new icon

  • name (str) – Name of the Icon.

  • m (matrix) – Transformation matrix of the icon

  • color (int or list of float) – The color in index base or RGB.

  • icon (str) –

    Icon type. Options: “cube”, “pyramid”, “square”, “flower”, “circle”, “cylinder”, “compas”, “diamond”,

    ”cubewithpeak”, “sphere”, “arrow”, “crossarrow”, “cross”, “null”

  • kwargs – The keyword arguments can vary depending of the icon type. Please refear to the specific icon method for more info.

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.cross(parent=None, name='cross', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a CROSS shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.crossarrow(parent=None, name='crossArrow', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a CROSS ARROW shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.cube(parent=None, name='cube', width=1, height=1, depth=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a CUBE shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • height (float) – Height of the shape.

  • depth (float) – Depth of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.cubewithpeak(parent=None, name='cubewithpeak', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a CUBE WITH PEAK shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.cylinder(parent=None, name='cylinder', width=1, heigth=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None, degree=3)

Create a curve with a CYLINDER shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • height (float) – Height of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.diamond(parent=None, name='diamond', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a DIAMOND shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • height (float) – Height of the shape.

  • depth (float) – Depth of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.flower(parent=None, name='flower', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None, degree=3)

Create a curve with a FLOWER shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.getPointArrayWithOffset(point_pos, pos_offset=None, rot_offset=None)

Get Point array with offset

Convert a list of vector to a List of float and add the position and rotation offset.

Parameters:
  • point_pos (list of vector) – Point positions.

  • pos_offset (vector) – The position offset of the curve from its center.

  • rot_offset (vector) – The rotation offset of the curve from its center. In radians.

Returns:

the new point positions

Return type:

list of vector

mgear.core.icon.guideBladeIcon(parent=None, name='blade', lenX=1.0, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a BLADE GUIDE shape.

Note

This icon is specially design for Shifter blade guides

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • lenX (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.guideLocatorIcon(parent=None, name='locator', width=0.5, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a LOCATOR GUIDE shape.

Note

This icon is specially design for Shifter locator guides

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.guideRootIcon(parent=None, name='root', width=0.5, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a ROOT GUIDE shape.

Note

This icon is specially design for Shifter root guides

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.guideRootIcon2D(parent=None, name='root', width=0.5, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a 2D ROOT GUIDE shape.

Note

This icon is specially design for Shifter root guides

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.null(parent=None, name='null', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a NULL shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.pyramid(parent=None, name='pyramid', width=1, height=1, depth=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a PYRAMIDE shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • height (float) – Height of the shape.

  • depth (float) – Depth of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.setcolor(node, color)

Set the color in the Icons.

Parameters:
  • node (dagNode) – The object

  • color (int or list of float) – The color in index base or RGB.

mgear.core.icon.sphere(parent=None, name='sphere', width=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None, degree=3)

Create a curve with a SPHERE shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode

mgear.core.icon.square(parent=None, name='square', width=1, depth=1, color=[0, 0, 0], m=pymel.core.datatypes.Matrix, pos_offset=None, rot_offset=None)

Create a curve with a SQUARE shape.

Parameters:
  • parent (dagNode) – The parent object of the newly created curve.

  • name (str) – Name of the curve.

  • width (float) – Width of the shape.

  • depth (float) – Depth of the shape.

  • color (int or list of float) – The color in index base or RGB.

  • m (matrix) – The global transformation of the curve.

  • pos_offset (vector) – The xyz position offset of the curve from its center.

  • rot_offset (vector) – The xyz rotation offset of the curve from its center. xyz in radians

Returns:

The newly created icon.

Return type:

dagNode