Houdini 20.5 Nodes Geometry nodes

Topo Transfer geometry node

Non-rigidly deforms a surface to match the size and shape of a different surface.

On this page
Since 18.5

Overview

This node takes a template mesh and non-rigidly deforms it to match the size and shape of a target mesh.

This deformation is performed iteratively. The template mesh is usually more rigid at the beginning of the deformation process, which allows the node to capture the overall size and rough shape of the target mesh, and less rigid towards the end, which allows the node to capture small shape details. You can control the rigidity of the template mesh throughout the iterations using the Rigid Weights parameter.

To improve the performance and the robustness of the deformation process, the node uses a reduced-to-fine deformation strategy. Internally, the node deforms the reduced version of the original template mesh and then propagates the deformation to all points of the template mesh.

The node also uses user-defined landmark point correspondences between the template and the target meshes to help improve the deformation’s quality. You can control the influence of the landmarks throughout the iterations using the Landmark Weights parameter.

Note

This node uses Intel’s Math Kernel Library when run on x86 processors. You can use an environment variable to tune the library for speed or for producing identical results from run to run.

Retargeting topology

To retarget one topology to another in Houdini, the following is required:

  • Position the template and target meshes close to each other in world space.

  • The template and target meshes must have similar scales.

  • The template mesh has to be manifold geometry. If any part of the source is not connected to its mesh (for example, like a separate piece of teeth geometry), then an error will be issued. For such cases, Topo Transfer supports geometric constraints that require some additional setup. See the Tips and tricks section for more details.

For best results, position the template and target meshes on-top of (overlapping) each other and use landmarks to guide the deformation. Landmarks are user-defined point correspondences between the two meshes.

Overlapping source and target geometry

How to

  1. In the Network Editor, create a new Topo Transfer SOP node.

  2. Connect the source geometry’s node to the first input on the Topo Transfer node and the target geometry’s node to the second input.

  3. Turn on the Display flag for the Topo Transfer node.

    The undeformed template geometry appears in the viewport and a warning appears on the Topo Transfer node.

    Before the Topo Transfer node can cook, it first needs at least one valid landmark point pair. A landmark point pair is not valid until you set the position of its target point.

    Note

    If you want to cook the Topo Transfer node without using landmark points to improve the quality of the deformation, you can disable landmark groups by turning off the Enable Landmarks parameter on the Topo Transfer node.

  4. In the Network Editor, make sure that the Topo Transfer node is selected, hover your mouse pointer over the viewport, and then press Enter.

    The following occurs:

    • A new landmark group is automatically created for your Topo Transfer node.

    • You are now in the edit state for that landmark group.

    • The Landmark toolbar appears across the top of the viewport, and the new landmark group’s name appears in the Group Name toolbar field.

      This toolbar contains the controls that allow you to create landmark groups and edit landmark group point correspondences.

      Since you are in the edit state, the landmark group edit options for the current landmark group appear in the toolbar.

    • The template landmark guide mesh appears in the viewport.

    • A new landmark group appears under Landmarks in the Topo Transfer node’s parameters. Each landmark group contains one or more landmark point pairs.

    Tip

    You can also create landmark groups by clicking the Create Group button in the Landmark toolbar or the Landmarks > Landmark Groups > + button in the Topo Transfer node’s parameters.

    Note

    If you create a landmark group through the Topo Transfer node’s parameters instead, then you can only directly enter the edit state for that group by clicking its Edit Landmark Group button.

  5. Rename the new landmark group.

    In the Landmark Group toolbar, click in the Group Name field, type the new name for the landmark group, and then press Enter.

    Group Name field, Landmark toolbar when in the edit state

    Tip

    You can also rename a landmark group using the Landmarks > Landmark Groups > Name field in the Topo Transfer node’s parameters.

  6. In the viewport, -click the locations on the template guide mesh where you want to place the landmark point pairs.

    The new landmark point pairs automatically snap to the template guide mesh’s surface. You can freely -drag the landmark point pairs to any location on the guide mesh, not just its polygonal indices.

    A landmark point pair consists of a template point and its corresponding target point. Initially, a target point has the same location as its corresponding template point.

    Tip

    • You can delete a template point or a target point by -clicking on the point in the viewport. Deleting a template point deletes its landmark points pair.

    • You can reposition the template guide mesh using the translate handles.

    Translate handles
  7. Press G to switch to viewing the target guide mesh.

    Tip

    You can also use the Show drop-down menu options in the Landmark toolbar to switch between viewing the template and target guide meshes.

    A green ring appears around the current active template point. Your next click on the target guide mesh will place the target point for that active template point.

    Green ring around active template point

    Note

    The green ring only dictates target point placement order when using -clicks to place points. You can place target points in any order by -dragging them instead.

  8. For your landmark point pairs, do the following:

    • Click the locations on the target guide mesh you want to move the target points to. The target points automatically snap to the target guide mesh’s surface.

    • -drag the landmark point pair to move its target point to the desired location on the target guide mesh. The target point automatically snaps to the target guide mesh’s surface.

      Note

      • When you have multiple landmark point pairs, you can -drag their target points in any order. The green ring only dictates placement order when -click placing target points.

      • Where you can move the target point to on the target guide mesh is determined by the Target Points Group and Target Point Coordinates parameter settings. By default, you can freely -drag the target points to any location on the target guide mesh, not just its polygonal indices.

    When in the edit state, template points always appear as green circles, target points always appear as light blue squares, and dashed lines appears between the template and target points to indicate their landmark point pair relationships.

    Tip

    • You can change the color of all the landmark point pairs in a landmark group with the Landmark Group > Color parameter. This only specifies the color the points appear as when in the landmark group state, not the color they appear as when in the edit state.

    • To see a transparent version of the template guide mesh while viewing your target guide mesh, turn on Show Source Silhouette in the Landmark toolbar.

  9. When you have finished editing the positions of the template and target points in the landmark group, click Done Editing in the Landmark toolbar or press Enter to save your changes and exit the edit state.

  10. In the Landmark toolbar, click Solve to trigger the cook (solve) for the node.

    The following occurs:

    • The progress of the solve appears at the bottom of the Houdini window.

    • The output geometry appears in the viewport.

      Example: Output geometry

    Note

    You can also trigger the solve from the edit state.

    Now that you can see the output geometry from the topo transfer operation, you can refine its deformations.

  11. Repeat steps 4-10 for each landmark group you want to create.

  12. For areas of the template mesh or target mesh that have greater detail, add extra landmark point pairs to those areas.

    This increases the registration in those mesh areas and improves the quality of the output geometry.

    For example, for detailed humanoid models, the areas around the eyes, nose, ears, and mouth require greater attention during the topology transfer process to produce a more accurate deformation result.

    Warning

    Do not apply too many landmark point pairs as this will constrain the solve too much and may produce the opposite effect of what you are trying to achieve.

  13. For areas of the template mesh that you want to exclude from the solve, use the Rigid Primitives parameter to specify which primitives to ignore:

    • Use the Rigid Primitives drop-down list to select existing primitive groups. You can select multiple groups.

    • Use the Rigid Primitives select geometry tool (arrow button next to the parameter) to select the primitives in the viewport.

      • ⇧ Shift + to add primitives to the selection.

      • ⌃ Ctrl + to remove primitives from the selection.

      Example: Primitives to exclude

    Tip

    You can select both rigid primitive groups and individual primitives.

    • Press Enter to save your selection, exit the rigid primitives edit state, and trigger the cook (solve).

      The improved output geometry appears in the viewport.

      Example: Template mesh with rigid primitives and the resulting output geometry.
    • Similarly, the Rigid Mask parameter lets you specify a weighted scalar as a percentage of exclusion for each point. Weighted exclusion may be combined with rigid primitives or used independently.

      • Select 'MaskOn' from the Mask Mode parameter.

      • Click the attribute paint button to enter attribute paint mode to create a weight map, or specify an existing mask attribute from the drop-down list.

      • The Mask Tolerance parameter lets you specify the amount of precision to use when comparing weights to one which is when a point is fully rigid.

      Example: Template mesh with a rigid weight mask and the resulting output geometry.
  14. Adjust the Topo Transfer node’s parameter settings as needed.

Landmark toolbar

When in the landmark group state, the Edit Landmark Group toolbar appears across the top of the viewport. This toolbar contains the controls that allow you to create new landmark groups, edit a landmark group’s point correspondences, and determine how the landmark guide meshes are visualized in the viewport.

Solve

Triggers the node’s cook (solve).

Show

Switches which landmark guide mesh—template or target—is shown in the viewport.

You can also use the hotkey G to toggle between displaying the template or target guide meshes.

Template

Displays the template landmark guide mesh in the viewport.

Target

Displays the target landmark guide mesh in the viewport.

Center Camera

Centers the current view’s camera on the template and target landmark guide meshes.

Show Template Silhouette

When on, displays a transparent version of the template landmark guide mesh when you are viewing the target landmark guide mesh.

Show Geometry Colors

When on, displays either the geometry colors or texture data on the template and target guide mesh. This feature is useful when placing landmarks relative to annotations in the scan data.

Landmark Name

Determines what is displayed next to the landmark points in the viewport.

none

No labels appear next to the landmark points.

group

The name of the landmark group to which a point belongs appears next to each landmark point.

group_#pntid

The point ID for each point appears next to the landmark points.

Group Name

Displays the name of the landmark group you are currently editing. You can use this field to change the name of the landmark group.

This field is only available when in the edit state.

Done Editing

Saves any changes you made to the current landmark group’s point pairs and exit the edit state.

This field is only available when in the edit state.

New Group

Creates a new landmark group.

This field is only available when in the landmark group state.

Edit Group

Opens the Edit landmark group selection window. You can choose which landmark group to edit with this window.

This field is only available when in the landmark group state.

To...Do this

Create a new landmark group

Do one of the following:

  • In the Edit Landmark Group toolbar, click New Group.

  • In the Topo Transfer node’s parameters, click the Landmarks > Landmark Groups > + button.

Note

The first landmark group for a Topo Transfer node is automatically created when you enter the landmark state for the first time.

Edit a landmark group

Do one of the following:

  • In the Edit Landmark Group toolbar, click Edit Group.

    • In the Edit landmark group selection window that appears, select the landmark group you want to edit and then click Done Editing.

  • In the Topo Transfer node’s parameters, click the Landmarks > Landmark Groups > Edit Landmark Group button for the landmark group you want to edit.

Create a landmark point pair

When editing your landmark group, make sure that you are viewing the template guide mesh G in the viewport.

Click the location on the template where you want to create the landmark point pair.

Each landmark point pair contains a template point and a corresponding target point.

Warning

A landmark point pair is not valid until you set the position of its target point.

Tip

You can change the color of all the landmark point pairs in a landmark group with the Landmark Group > Color parameter. This only specifies the color the points appear as when in the landmark group state, not the color they appear as when in the edit state.

Edit a template point’s location

When editing your landmark group, make sure that you are viewing the template guide mesh G in the viewport.

-drag the template landmark point to its new location on the template guide mesh.

Edit a target point’s location

When editing your landmark group, make sure that you have already created your landmark point pair.

In the viewport, switch to viewing the target guide mesh G and then -drag the target point to its new location on the target guide mesh.

When in the edit state, the template point always appears as a green circle, the target point always appears as a light blue square, and a dashed line also appears between the template and target points to indicate their link as a landmark point pair.

Note

Where you can move the target point to on the target guide mesh is determined by the Target Points Group and Target Point Coordinates parameter settings.

Delete a landmark points pair

When editing your landmark group, make sure that you are viewing the template guide mesh in the viewport.

-click the template point of the landmark point pair that you want to delete.

Delete a target point

When editing your landmark group, make sure that you are viewing the target guide mesh in the viewport.

-click the target point that you want to delete.

View landmark group edit results

In the Landmark toolbar, click Solve to trigger the node’s cook (solve).

The output geometry automatically updates in the viewport.

Tips and tricks

Target mesh with missing or unwanted details

Example: Solve of a template mesh heaSd with Rigid Primitives to a 3D head scan target mesh that is missing the back of its head

Scenario

You have a 3D scan and it is missing areas of its geometry or it has areas that you don’t want to capture. For example, the back of the head is missing from your 3D head scan or you don’t want to transfer the topology of the subject’s hair from your 3D head scan.

Solution

Use Rigid Primitives to specify which primitives or primitive groups on the template mesh you do not want to deform to the target mesh.

Target and Template meshes have a very different pose

Example: Non Linear solve of a template mesh in T-pose to a 3D full-body scan target mesh with arms at its sides

Scenario

The pose of your target meshes differs greatly from that of your template mesh. For example, the target body mesh’s arms are at its sides and the template mesh is in a T-pose. Or your template mesh is an open palm but your target hand scan is closed in fist.

Solution

Set the solver type to Non Linear and use landmark groups.

The Non Linear solver handles deformations that require large rotations much better than the Linear solver.

When the points on the target and template meshes are very far apart, adding landmark point pairs to the node helps the solver match the points on the template mesh to those on the target mesh.

Template geometry consists of multiple disjoint islands

Scenario

The template contains multiple disjoint islands.

Solution

Toggle on Enable Geometry Constraints, and optionally specify the main island which should act as a parent for the rest of the islands using the Manual option in the Constraint Selection parameter.

Example: Mapping the Tommy model with inner eye and denture geometry to Fianna’s head scan using Topo Transfer’s geometry constraints.
Example: Another example of using Topo Transfer with template geometry consisting of multiple islands. Here the template geometry (left) is composed of two seperate meshes, the head and the cloth. The result (right) is the transfer of the target geometry to the head mesh while deforming the cloth geometry relative to changes on the head mesh.

Note

When Enable Geometry Constraints is active, the Reduction Factor allows only an initial percentage for the start of the range because, in this case, no polygonal reduction is used at the end of the range.

Note

The automatic Constraint Selection will simply assume the island with the largest point count is the main geometry. When this is not the case, the main geometry must be specified manually.

Using Topo Transfer with externally defined landmarks

Scenario

Landmark information for template and target geometry already exists in the network outside the Topo Transfer node.

Solution

  • Connect the template landmarks to the third input on the Topo Transfer node.

  • Connect the target landmarks to the fourth input on the Topo Transfer node.

  • If the correspondence between the two sets of landmarks is established by labels stored as string attributes defined on the template and target landmarks, then toggle on the Use Landmark Attribute and specify the attribute that contains the label information.

    Note

    If no attribute labels are provided, Topo Transfer will assume the corresponding landmark pairs are ordered sequentially between the two lists.

    Tip

    For more information about creating externally defined landmarks, see the help page for Topo Landmark.

Parameters

Geometry Constraints

Enable Geometry Constraints

Adds a constraint so secondary geometry is factored into the solve.

Constraint Selection

Sets the main geometry component for constraining additional geometry. This parameter provides a choice of manually specifying the main geometry or letting the node automatically determine the main geometry. Manually specifying the geometry is conveyed as a set of primitive groups using the drop-down list and/or using the geometry select tool.

Iterations

Iterations

Sets the number of iterations that are performed. At each iteration, the node deforms the reduced template mesh using the current Rigid Weights and Landmark Weights parameter settings.

The higher the number of Iterations, the greater the matching quality and the slower the solution.

Reduced Levels

Sets the number of reduction levels between the first and last Iteration. Each level corresponds to the template mesh with a reduced number of polygons.

The number of polygons to keep for each level is determined by the Reduction Factor parameter.

What Iterations belong to which Reduced Levels is determined by Iterations / Reduced Levels.

For example, if there are 12 Iterations and 4 Reduced Levels, then there would be 3 Iterations in each Reduced Level.

Example: Reduced Levels dividing evenly into Iterations

If the Reduced Levels value does not divide evenly into Iterations, then the result is rounded up and the last Reduced Level would contain the remaining Iterations.

Reduced Levels not dividing evenly into Iterations

Reduction Factor

Sets the percentage of the original polygons in the template mesh to use for the first and last Reduced Levels.

What Reduction Factor is used for each Reduced Level is determined by (Reduction Factor(last) - Reduction Factor(first)) / Reduced Levels * Reduced Level #.

For example, a Reduction Factor of 0.1 (first) and 0.9 (last) means that the Reduction Factor would be set to 10% for the first few Reduced Levels, to 90% for the last few levels, and to values between 10% and 90% for the intermediate Reduced Levels.

Setting the final percentage to 1.0 performs the final iterations on the whole mesh and ensures that the landmark pairs are aligned as close as possible.

Reduction Factor for each Reduced Level when the Reduced Levels evenly divide the number of Iterations
Reduction Factor for each Reduced Level when the Reduced Levels do not evenly divide the number of Iterations

Rigid Weights

Sets the template mesh rigidness for the first and last Iterations. This value is linearly interpolated for the intermediate Iterations. Higher Rigid Weights force neighboring points to deform in a similar manner. Lower Rigid Weights allow neighboring points to move more independently so that the template mesh can deform to capture all the little details of the target mesh.

When setting your Rigid Weights, try to start with a higher rigid weight value (first field) and then gradually decrease it (last field). This allows the node to first capture the overall pose or shape of the target mesh, and then try to match the target mesh details for the final iterations.

If you keep the Rigid Weights high for all iterations, then the template mesh will deform as rigidly as possible and will not try to capture the target mesh’s details.

Landmark Weights

Determines how strongly the node tries to snap template and target landmark points to each other for the first and last Iterations. This value is linearly interpolated for the intermediate Iterations. Higher Landmark Weights force the landmark points to be at the exact same world space location at the final iteration. Lower Landmark Weights decrease the chance that the template landmark points will match the target landmark points.

Rigid Mask

Specifies the template mesh rigid weights for each point as a percentage of exclusion from the shape correspondence component during the deformation process.

Mask Mode

Enables/disables the rigid mask parameter.

Mask Tolerance

An absolute tolerance value applied during numerical comparisons with rgid mask values.

Rigid Primitives

Specifies the template mesh primitive groups that are excluded from the deformation process and are instead deformed as rigidly as possible.

You can specify multiple existing primitive groups using the drop-down list and/or use the select geometry tool (arrow button) to manually select the primitives.

Closest point correspondences

For each Iteration, the node does the following:

  • Looks at each template point.

  • Finds a corresponding matching target point.

  • Tries to deform the template mesh to reduce the distance between both the matches.

Distance Tolerance

Sets the distance tolerance (in world units). The threshold value for the distance tolerance is calculated by multiplying the Distance Tolerance with the bounding box radius of the template mesh. template and target points whose distances deviate outside the threshold are not matched.

Norm Tolerance

Sets the angle tolerance (in degrees). template and target points whose normals deviate above the angle tolerance are not matched.

Solver

Type

Non Linear

Handles general deformation problems including cases that require large rotations between the template and the target.

Linear

Handles cases where deformations do not require large rotations and has faster performance than Non Linear for large meshes.

Iterations

Maximum number of iterations the solver is allowed to take before stopping if the Tolerance has not been reached. A smaller value increases the performance but may affect the quality of the solution.

Tolerance

Quality tolerance of the solver solution between the first and last Iteration. A larger value increases the performance but may affect the quality of the solution.

Landmarks

Use Landmark Attribute

This parameter is enabled when landmark data is provided as input through the third and fourth inputs. Specifying a string attribute name tells Topo Transfer where to look for labels that connect the pairs of points. When the attribute is toggled off, or no string is given, then Topo Transfer will assume that the input point data corresponds sequentially.

Enable Landmarks

When on, landmark groups participate in the node’s solve.

Landmark Groups

Lets you create or remove landmark groups, and it lists the current number of landmark groups for the node.

Enable

When on, the individual landmark group is active and its points are used to generate the result of the topology transfer.

Edit Landmark Group

Enables the edit state for the individual landmark group and opens the Edit Landmark Group toolbar above the viewport window.

Color

Specifies the color of all the landmark points that belong to the landmark group. This only specifies the color the points appear as when in the landmark group state, not the color they appear as when in the edit state.

Name

Specifies the name of the landmark group.

Template Points Group

Lists the point number locations of the template landmark points.

Template Point Coordinates

When on, you can -drag your template points to any location on the template guide mesh, not just its polygonal indices. When off, template points can only be placed at polygonal indices.

This field lists the world space coordinates of the template points.

Target Points Group

Lists the point number locations of the target points.

This parameter is only available when Target Point Coordinates is off.

Target Point Coordinates

When on, you can -drag your target points to any location on the target guide mesh, not just its polygonal indices. When off, target points can only be placed at polygonal indices.

This field lists the world space coordinates of the target points.

Inputs

Template Mesh

The mesh that is deformed.

The template mesh must be manifold geometry. A mesh is a manifold when each edge is incident to only one or two faces, the faces incident to a vertex forming a closed or an open fan, and the mesh is one continuous patch. If your mesh has multiple patches (for example, teeth, gum, and eye geometries are typically detached from body geometry), then the node will throw an error.

Tip

  • You can use the Poly Doctor node (with the Topology > Visualize Maximal Manifold Patches parameter enabled) to visualize different patches.

  • You can use the Delete node to delete unwanted patches.

Target Mesh

The Template Geometry is deformed to match the size and shape of this mesh.

Source Mesh Landmarks

Optional points to be used as template mesh landmarks.

Note

When landmarks are given as input they will override any landmarks specified as parameters on the node.

Target Mesh Landmarks

Optional points to be used as target landmarks.

Note

When template landmarks are given as input, target landmarks should be given as input as well.

Examples

TopoTransferBasic Example for Topo Transfer geometry node

This example demonstrates how to use the Topo Transfer node with some example scan data.

See also

Geometry nodes