Houdini 20.5 Nodes Geometry nodes

FEM Deform geometry node

Deforms a solid piece of geometry (tetrahedral mesh) using the FEM quasistatic solver.

On this page
Since 19.0

Overview

This node deforms a tetrahedral mesh to match the target shape (polygonal surface) supplied on its second input. For example, you can use this node to create a blend shape-like deformation for a muscle in a Muscle & Tissue set-up.

The second input should have a rest position attribute that closely matches the undeformed shape of the tetrahedral mesh. This node uses an attachment constraint to attach the surface of the solid geometry to the rest shape, and then it uses an FEM solver to transform the rest shape to the target shape using a quasistatic solve.

The intent of this node is to maintain the fidelity of the interior tetrahedrons of the solid geometry while its exterior is reshaped, as attempting to deform a tetrahedral mesh without using a solver to perform corrections can easily lead to tetrahedron inversions.

How-to

To...Do this

Set up a target shape for a muscle

If you want a muscle to have some details (for example, like showing grooves or indentations) when it contracts that it does not have when it is relaxed, then you can use this node to specify the target shape you want the muscle to try to achieve when it flexes.

Example: Imported base muscle surface and target shape surface

Notes

  • You can only add one target shape per muscle_id.

  • This procedure assumes that you are starting with an existing complete muscles pass set-up. For more information about muscle networks, see Muscle pass.

  1. In the Network Editor, import the static sculpted polygonal surface you want to use as the target shape for your muscle. This will be the shape your muscle will try to achieve anytime it flexes during it’s simulation.

    There are many ways to bring in or import geometry with SOPs. For example, you can use an Object Merge SOP node, a File SOP, a Stash SOP, an Alembic SOP, and so on.

    Example: Bringing in the target shape surface
  2. Create a tpose point attribute from the original undeformed muscle surface.

    • Create a Set T-Pose SOP node. The Set T-Pose tab menu item creates a Rest Position SOP node with preset Rest ▸ Store Rest t-pose settings.

    • Use the Rest Position SOP to set the muscle’s original undeformed muscle surface as its rest surface.

      • Connect the output of the target shape’s import node to the first input (input 1) on this node, and then connect the output of your static muscle geometry import node to the second input (input 2) on this node.

        Example: Defining the rest surface for the muscle
      • In the Parameter Editor, type tpose in the Rest Attrib field.

  3. Set up the relationship between the base muscle tetrahedral mesh and the modeled surface variation of the muscle that will allow the muscle to morph from one to the other.

    • Create an FEM Deform SOP node.

    • Connect the output from the Muscle Solidify SOP node to the first input (input 1) of the FEM Deform SOP node.

    • Connect the output from the target shape’s Rest Position SOP node (tpose) to the second input (input 2) of the FEM Deform SOP node.

      Example: FEM Deform node in the muscles network

    The surface points of the base muscle tetrahedral mesh are now constrained to the modeled muscle surface variation as it transforms to the target shape over the course of the muscle’s simulation. The muscle’s tetrahedral interior points are now also simulated using a quasistatic solver to maintain the muscle’s shape and volume.

  4. Remove any time dependencies from the FEM Deform SOP's output.

    Since the FEM Deform SOP node produces a static model, you want to remove any time dependencies it may have before sending it downstream in the muscle network.

    • Create a Time Shift SOP node.

    • Connect the output from the FEM Deform SOP node to the input of the Time Shift SOP node.

      Example: Removing time dependencies using a Time Shift SOP
    • Select the Time Shift SOP node.

    • In the Parameter Editor, keep the default Method (By Frame), remove the $F expression from the Frame parameter field, type 1 in the Frame field, and then press Enter.

  5. Create a targetshape point attribute from the modeled variation of the muscle.

    • Create a Set T-Pose SOP node. The Set T-Pose tab menu item creates a Rest Position SOP node with preset Rest ▸ Store Rest t-pose settings.

    • Use the Rest Position SOP to set the modeled variation of the muscle as its target surface.

      • Connect the Muscle Solidify SOP node’s output to the first input (input 1) on this node, and then connect the Time Shift SOP node’s output to the second input (input 2) on this node.

        Example: Defining the target surface for the muscle
      • In the Parameter Editor, type targetshape in the Rest Attrib field.

  6. Specify a custom shape activation attribute for the muscle.

    • Select the Muscle Solver Vellum SOP node in your muscles network.

    • In the Parameter Editor, scroll down to the Activation Attributes section in the Simulation tab.

    • In the Shape parameter field, delete the muscletension attribute, type the name of the custom shape activation attribute (for this example’s procedure, that would be muscleshape) you want to use, and then press Enter. You can use this attribute to drive and animate the muscle’s morph between its original undeformed muscle surface shape (relaxed state) and the shape of its modeled muscle variation (flexed state).

      Example: Defining a custom shape activation attribute
  7. Connect the muscle to the custom shape activation attribute.

    • Just below your the main Muscle Flex SOP node in your muscle network that sets up the muscletension for you muscles, insert a second Muscle Flex SOP node.

      Example: New Muscle Flex SOP node for keying the shape activation attribute values
    • Select this new Muscle Flex SOP node and then open the Parameter Editor.

    • In the Attribute field at the top of the listed node parameters, type the name of the custom shape activation attribute you specified in the Activation Attributes ▸ Shape field on the Muscle Solver Vellum SOP node in step 6, and then press Enter. For example, muscleshape.

    • Click Detect New.

      All incoming muscles are automatically detected and one Muscle ID parameter (flex control) per muscle_id appears in the Muscle Flex tab.

    You can now animate these parameters to determine when the muscle tries to achieve the shape of the target surface and how much of the target surface is reflected in the muscle’s shape as it contracts.

    Example: Keyable Muscle ID (target shape weighting) parameters on the Muscle Flex SOP node
  8. Animate the custom shape activation attribute over the course of the muscle’s simulation.

    On the shape activation’s Muscle Flex SOP node, select the Muscle Flex tab, and then keyframe the Muscle ID parameters over time as needed. A value of 0 is 100% the tpose shape (rest surface) for the muscle, and a value of 1 is 100% the targetshape shape (target surface).

    This will morph the muscle between its defined tpose shape and targetshape shape over the course of its simulation.

    Example: Keyframed custom shape activation

Attributes

muscletension

point

Stores the variable muscle flex values over time as point transforms.

Parameters

Reset Quasistatic Simulation

Clears the simulation cache.

Rest Position Attribute

Specifies the name of the vector point attribute from the second input that holds the rest position. If geometry is wired into the third input, this input geometry will be used as the rest position. This parameter is only available when the third input is not used.

Stiffness Multiplier

Determines how strongly the tetrahedra will resist local changes in shape and volume.

Attach to Local Space

When on, the tetrahedral surface is constrained to the goal locations that are some distance away from the rest surface.

Attach Distance Threshold

When on, the distance threshold is used when determining which points to constrain. Only the points that have a goal surface within the specified distance threshold are constrained.

Attach Strength

Sets the strength of the force moving the tetrahedral surface points as they adapt to the goal positions.

Attach Damping

Determines how quickly the tetrahedral surface points adapt to the goal positions.

Visualize Quality

When on, these parameters allow you to visualize the deformations of your tetrahedral mesh in the viewport state so that you can achieve the best quality output.

For example, you can use these parameters to isolate tetrahedrons with inversions or poor quality and then adjust their stiffness and constraint parameters accordingly. Good quality meshes with zero inversions are ideal when simulating with solid geometry.

Type

Determines what information about your tetrahedra is being visualized in the viewport.

Mesh Quality

Measures the deviation of each tetrahedron from reaching an ideal equilateral shape.

Inversion

Flags tetrahedrons with reversed winding order.

Position Type

When measuring quality or determining inversions, specifies which position attribute is used.

Current

The current P position attribute is used.

Material

The materialP position attribute is used.

Quality Threshold

Specifies the quality threshold value for flagging poor quality tetrahedrons. As a guideline, try to produce zero tetrahedrons at a quality threshold of 0.05.

This parameter is only available when Type is set to Inversion.

Isolate Primitives Below Threshold

When on, isolate only the offending tetrahedra that fall below the quality threshold.

This parameter is only available when Type is set to Inversion.

Isolate Inverted

When on, isolate only the offending inverted tetrahedra.

Exterior Surface

When on, the exterior surface appears in the viewport. When off, the exterior surface is hidden in the viewport.

Exterior Surface Color

Sets the RGB color of the exterior surface of your tetrahedral mesh.

Exterior Surface Alpha

Sets the opacity of the exterior surface of your tetrahedral mesh. This allows you to more easily view any problematic tetrahedra in the interior of your solid geometry.

Inputs

Input 1

Solid tetrahedral mesh geometry.

Input 2

Target surface geometry with a rest position.

Input 3

Optional geometry that defines the rest position. If the third input is used, this geometry is used

as the rest position instead of the vector attribute on the second input.

See also

Geometry nodes