constrain_mpm
Use this compound to create constraints on the point_position
of the source geometry that will be enforced during simulation. A constraint is a way to force certain points to travel according to the animated motion of either the input mpm_source
geometry or the constraint_geometry
. The position that a point is constrained to is called the target position. The constraint can either be hard, meaning deviation isn't allowed, or soft, meaning it acts as a guide to the motion (see the strength
input). Note: You can constrain the source to stay still as well by providing input that doesn't move.
The mpm_source
input should be connected to the cloth_source
output of make_mpm_cloth
, the fiber_source
output of make_mpm_fiber
, or the shell_source
output of make_shell_fiber
. The out_mpm_source
output from this compound should be connected to the sources
input of simulate_mpm
. Multiple constrain_mpm
compounds can also be chained together in between make_mpm_cloth
and simulate_mpm
. When conflicting constraints would apply to the same point the last constraint added overrides the previous constraints.
Inputs
mpm_source
The constraints will apply to any number of mpm_source
that are attached. If no constraint_geometry
are provided, the motion of the input geometry will be used to set the target position.
constraint_geometry
Any points of the mpm_source
input geometry inside the bounds_shape
of a constraint_geometry
input will be constrained, to follow the relative transform of the constraint_geometry
between the start_frame
and the current frame. The transform can be calculated in one of two ways:
- If the
constraint_geometry
has afloat4x4
propertytransform
, that will be used. - Otherwise, it will calculate the best fit relative scale, rotation and translation between the two geometries.
The points to be constrained will be determined on the start_frame
of the source and will not be updated during the simulation. However, their target position and strength will be updated throughout the simulation.
enable_constraints
Whether any constraints should be added.
start_frame
The frame when the simulated source geometry should begin to be constrained.
use_end_frame
Whether to deactivate the constraints after the end_frame
.
end_frame
The last frame that the simulated source geometry will be constrained, if use_end_frame
is enabled.
strength
A strength of 0 corresponds to unconstrained and a value of 1 to a hard or absolute constraint. Fractional values indicate soft constraints — the source will behave as if attached by zero rest length springs.
use_color_set
Whether or not to use a color set property value to scale the strength of the constraint.
color_set_name
The name of the color set on the geometry of the input mpm_source
. You can add a watchpoint to see the name and the type of the color set on the input geometry. Color the alpha, RGB or RGBA channels to map the color set to a float.
bounds_shape
Whether to use the axis-aligned bounding box or bounding sphere of the constraint_geometry
inputs to determine which points should be constrained.