Skip to main content

rig.muscle

Builds a procedural muscle rig that automatically stretches, squashes, and shears between target points.

This modifier is incredibly versatile. While its primary use case is driving secondary deformation joints to fake muscle volume preservation, it can also be used to constrain entire hierarchies (like a simple body rig). It dynamically calculates the distance and orientation between its "tendon" targets to drive the constrained nodes.

visual demo gif

Usage

Depending on how many targets you provide, the modifier automatically adapts its internal math:

  • Simple Muscle (2 Targets): Creates a straight, linear stretchy setup between Point A and Point B.
  • Spline Muscle (3+ Targets): Automatically generates an underlying NURBS curve and attaches the nodes along it. This allows for complex, curved muscle behaviors (like a jaw muscle or a flexible tube) that respect the tangents of the curve.

Proportional Attachment: During the build phase, the modifier evaluates the initial resting position of each driven node to calculate its automatic attachment ratio. If you constrain multiple objects, they will stretch and twist progressively along the muscle's length, naturally favoring the tendon they are closest to.

Parameters

Core Setup

ParameterTypeDefaultDescription
targetslist[node]The nodes acting as the anchors (tendons) of the muscle. Provide 2 nodes for a linear muscle, or 3+ for a curved Spline muscle.
nodes / nodelist[node]self.nodeThe nodes to be driven by the muscle rig (usually joints or local control groups).
parentnodenodes[0].parentThe node under which the technical muscle rig will be parented.
hookbooloffHow the driven nodes are attached. If off, they are parented inside the muscle hierarchy. If on, they remain in place and are driven via matrix constraints.
namestrCustom name for the muscle rig. Defaults to a combined string of the target names.

Behaviors & Switches

Adding these parameters to your YAML not only sets their default value but also activates the corresponding math nodes and exposes them as animatable attributes on the generated muscle group.

OptionTypeDefaultDescription
orientboolonIf off, the muscle rig ignores the orientation of the targets and only follows their position.
scaleboolonIf off, the muscle rig ignores the scale of the targets.
stretchfloat1.0Default blend value for the stretch behavior (0 to 1).
squashfloatActivates Squash math. Default blend value for volume preservation as the muscle compresses.
shearfloatActivates Shear math. Default blend value for the shearing effect. Keeps the muscle shape natural when targets twist.
weightfloatActivates hook blending. Exposes a weight attribute to dynamically turn the entire muscle effect on or off.

Outputs

When the modifier runs, it generates a technical hierarchy and exposes controls directly on the driven groups.

Generated Nodes & IDs

For each node driven by the modifier, a parent transform group is generated named mu_<name><index>. These groups are automatically tagged with the mod.muscle ID (accessible via <tpl>::mod.muscle.0 in other modifiers).

Animatable Attributes

The following attributes are added to the generated mu_<name> group, allowing other modifiers to blend the math on the fly:

  • @slide (0 to 1): Dynamically moves the driven node along the length of the muscle (or the spline).
  • @stretch (0 to 1): Blends the stretch effect on or off.
  • @squash (0 to 1): Blends the squash volume effect (only if squash was defined in the parameters).
  • @exponent (-2 to 0): Adjusts the pinching/profile of the squash effect (only if squash was defined).
  • @shearing (0 to 1): Blends the shear effect (only if shear was defined).
  • @weight (0 to 1): Master blend switch for the matrix hook (only if hook and weight are used).

Example

Creating a stretchy setup with squash and shear enabled.

rig.muscle:
targets:
- point_A::j.0
- point_B::j.0
nodes:
- tweakers::roots.0
- tweakers::roots.1
- tweakers::roots.2
name: muscle

squash: 1 # Activates the squash system and sets its default to 100%
shear: 1 # Activates the shear system and sets its default to 100%
Demo Scene

To see this setup in action, download the mod_muscle.ma demo scene from our Google Drive folder.