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.
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.
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.
After exposing the inputs port to the host application, the pin values will be fully driven from there.
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}"))
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:
- Activate the module's D (Diagnostics) terminal flag.
- 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.