Share

Template module

The template_module is an empty module to use as the base for your own custom modules. It provides the standard module interface and shared components used across all modules in the framework.

This includes:

  • The common inputs, outputs, and parents ports.
  • General parameters for module configuration.
  • A diagnostics terminal flag for quick visual feedback.

the template_module compound

Common Ports

Modules expose a set of standardized ports used for passing data in and out, and for connecting modules to each another. These ports are essential when building hierarchies of connected modules.

The template_module provides these ports by default:

  • inputs: Contains the pins, control and joint operator matrices, attribute data, and custom setup and animation data passed as Bifrost objects. This port is typically exposed to the host application and is used to drive the module.
  • outputs: Contains all control and joint data generated by the module, including final transforms, names, paths, attribute descriptions, and so on. This port is usually exposed to the host application, but it can also be connected to the parents port of downstream modules.
  • parents: Accepts the outputs port from upstream modules. This is used to parent the module's entities under entities defined in parent modules.

General Parameters

The template_module provides a set of common module parameters in the General port group.

Name & State

The name parameter serves as the identifier of a module. It can also be used inside the user_setup sub-compound as a prefix or suffix when defining control and joint names.

The state parameter controls the transforms of a module. It can be used to inspect different transform states, such as the relative or absolute rest pose, or the animated pose of controls and joints.

Diagnostics

The parameters under the Diagnostics port group control what is drawn in the viewport when the module's D (Diagnostics) terminal flag is activated. This is useful for quickly inspecting what a module generates even when there aren't any connected objects in the host scene.

If display_transforms is enabled, transform axes will be drawn for all enabled entity types in this group. For example, if both display_joints and display_transforms are enabled, both the joints themselves and their transform axes are shown in the viewport.

Evaluation

The profile_evaluation parameter, when enabled, emits profiling events with a module's name. These events are visible in the host application's profiler and can be used to measure how long the module takes to compute.

The edit_mode parameter controls what is recomputed when the graph evaluates the module. To maximize runtime performance, modules automatically cache expensive operations. However, when edit_mode is enabled, the module bypasses caching and recomputes both the setup and any lookup operations, such as those performed by find_* nodes used inside user_animation. You should enable edit_mode while authoring the module or adjusting parameters that directly affect user_setup, to ensure that all dependent computations are properly updated. Once the module is finalized and ready for animation, this parameter should be disabled to maximize the runtime performance of the module.

Editing the template

The template is designed to help you focus on authoring the rig logic inside the user_setup and user_animation sub-compounds, while the surrounding infrastructure is already in place.

To create your own custom module:

  1. Add a template_module node to a Bifrost graph.

  2. Right-click on the node and select Make Editable.

  3. Rename the compound as needed and set a default name for it.

  4. Author your rig logic inside:

    • user_setup (1): For defining controls and joints, as well as how some entities should be parented under other entities from parent modules.
    • user_animation (2): For advanced transfomation solving, such as blending, IK solving, etc.
  5. Optionally, you can expose parameters at the top level of your module by connecting them to the user_setup_inputs (3) and user_animation_inputs (4) nodes. This would allow you to control operations done within user_setup or user_animation sub-compounds directly from the main module node.

  6. Finally, after your module is ready to be used, publish it by right clicking on the module node and do Publish.

Warning:

Do not modify any other internal nodes or connections within the template. These handle shared module logic and are required for a module to work correctly.

inside the template_module compound

Was this information helpful?