Share

Pins

Pins are helper transforms that act as guides for defining the pivot matrices of controls and joints within a module's user_setup sub-compound.

Pins are initially stored on the module's inputs port and are authored at the module's interface level before being exposed to the host application.

Each pin consists of:

  • A name (string)
  • A pivot matrix (Math::double4x4)

While the name is optional, it is strongly recommended to provide one. Named pins can be easily queried using the dedicated find_pin or find_all_pins utility nodes.

In addition, you can name a pin like a path in a hierarchy, for example, "parent/pin". When the rig gets created in the scene, the pin will be created as a child of its specified parent if it is valid. If it is not valid, the pin is created under its own local container.

Setting Default Pins

Setting default pins is essential to create functional modules.

When the module's inputs port is unconnected, you can define default pins directly using the array widget in the Parameter Editor.

  • Use the plus (1) button to add a new element to the pins array.
  • Use the trash (2) button to remove an existing element from the pins array.

editing pins in the Parameter Editor

The matrix values that you set here serve as the module's default pins definitions and will be used to create the corresponding pin objects in the scene when the rig is generated from the module.

Note that you can also set your default pins on a module's inputs port through scripting using the vnnNode command. The example below sets two pins named first and second both to the identity matrix.

cmds.vnnNode("bifrostGraphShape1", "/template_module", setPortDefaultValues=("inputs", "{{first, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, second, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, , {}, {}, {}, {}, {}, {}, , 0, 0}"))

After you have created the desired number of default pins, connect the module's inputs port to the input node of its graph (going upward through any parent compounds as necessary). Once the inputs port is exposed to the host application in this way, the pin values will be fully driven from there. You can still change the number of pins using the setAttr command on the Maya attributes.

To start over and reset any changes made in Maya, first delete the port on the input node and then connect the inputs port to a new one.

Visualizing Pins

If a rig has not been created yet and there are no objects in the host application driving them, pins can still be visualized for debugging.

To view pins in the viewport:

  1. Activate the module's D (Diagnostics) terminal flag.
  2. Enable Display Pins in the module's Parameter Editor, under the Diagnostics port group.

Pins appear as red dots in the viewport and if you enable Display Transforms, their axes drawn as well.

visualizing pins

Was this information helpful?