Houdini 20.5 Networks and parameters

Recipes: saving and recreating node and parameter presets

How to save parameter settings and groups of nodes so you can recreate them when needed.

On this page

Overview

Houdini lets you save a set of parameter values, or a set of network items (nodes, dots, sticky notes, boxes), as a named recipe. You can then apply those parameter values, or recreate those nodes, whenever you want.

You can create three types of recipes: parameter presets, tools, and decorations.

Recipes are saved as assets, where the asset category is a special Data category, not a regular node type category like Sop or Lop.

Saving node presets

You can save a set of parameter values and even spare parameters on a node as a recipe, and then apply those saved parameter values to other nodes. You can then apply the preset to an existing node when you want to set those values all at once.

You can also optionally save the contents of a node as part of the recipe. This might be useful, for example, to save the dive target contents of a Pyro Solver SOP so that applying the recipe sets certain parameters on a node and also fills in the DOP network.

Note

This type of recipe is for changing the parameter values and possibly the contents of an existing node. If you just want a way to put down a certain type of node with certain parameter values and contents, use a [tool recipe|#tool instead (see below).

When you save spare parameters as part of a preset, applying the preset will create those spare parameters on the target node if they don’t already exist.

To...Do this

Save parameter values as a preset

  1. In the parameter editor, set up the parameters you want to save.

  2. In the parameter editor, click the Recipe menu and choose Save Node Preset.

    or

    In the network editor, right click the node and choose Recipes ▸ Save Node Preset.

  3. In the dialog, use the checkboxes to choose which parameters you want to capture in the preset.

    The dialog starts with checks on all parameters that are not at their default values, and all spare parameters.

    • For some node types, parameters may be shown as “off default” and checked by default even though they are the original values the node starts with. For example, for uninteresting historical reasons in the Sphere surface node creation script changes the Primitive Type from its actual default to Polygon Mesh, so it always starts “off default”. This is unfortunate but you can just turn off their checkmarks if you don’t want to save them as part of the preset.

    • Because spare parameters are checked by default, and the Mantra render properties on object nodes are technically spare parameters, if save a preset on an Object node, it starts with all the render properties checked. You can uncheck the Render folder to uncheck all its children, and then re-check any parameters you actually want to save.

  4. By default, the preset includes keyframe animation and expressions on the selected parameters. To save just the current values instead, uncheck Capture Keyframes and Expressions.

  5. In the Preset Options section, enter a Preset Title.

  6. Use the Show for pop up menu to choose which node types can have the preset applied to them. The default is to only show the preset for the source node type. You can choose to show the preset for all nodes of the current node type category, or all node types that match a pattern. See target node patterns for more information.

  7. The default for the Save to menu (User Preferences) saves all recipes into an asset library in your user preferences directory, which usually all you need. However, if you want to embed the recipe in an existing asset, or if you are working on a recipe to be shared (such as in a large studio), you can change where you save the preset and its internal name.

Tip

If you edit the parameters in the parameter editor pane, you can click Reload Values to update the dialog with the new values.

Apply a parameter preset to a node

  • Select the node, then in the parameter editor, click the recipes menu and choose the preset you want to apply.

    or

  • In the network editor, right click a node, open the Recipes submenu and choose the preset you want to apply to the node.

Edit an existing parameter preset

  1. In the main menus, choose Windows ▸ Recipe Manager.

  2. Select the recipe you want to edit and click Edit.

    Houdini creates an instance of the original node type you captured the parameters from, applies the preset to it, and opens the preset editor on it. You can then edit the parameter values, or change the settings in the dialog (such as the preset title).

  3. Click Save to save the preset with the new values.

See how to edit a preset below.

Saving tool recipes

A tool recipe saves a node or set of nodes, including their wiring and current parameter values, as a new tool on the tab menu. You can then choose the tool from the tab menu to recreate the saved node setup.

To...Do this

Save a node or set of nodes as a tool

  1. Select the node or nodes you want to turn into a tool.

  2. Right-click one of selected nodes and choose Recipes ▸ Save Selected Items as Tool.

    The node you right-click becomes the “anchor” node of the recipe. When you “drop” the recipe into a network, the other nodes will be positioned relative to this node. You can edit which node is the “anchor” in the dialog, but it’s convenient to be able to indicate it by which node you right-click.

  3. As with a regular tab menu tool that puts down a single node, the user can choose a recipe from the tab menu and drop it on an existing wire, or start a new wire and use the tab menu choose a recipe tool to connect it to. You can set which nodes in the recipe should be used as the “input” and “output” when the user does this. See controlling wiring below for more information.

  4. You can choose the submenu in which the tool will appear in the tab menu. Choose an existing submenu using the drop down menu to the right of the Tab submenu field, or type a new name into the field to create a new submenu.

    You can have the tool appear in multiple submenus by entering multiple menu labels separated by commas. For example, File IO, Recipes will make the tool appear in both the File IO and Recipes submenus of the tab menu.

  5. You can choose an icon that will appear next to the tool name in the tab menu. This is the same as setting the icon for a digital asset: it can be a file path, an opdef: reference, or the name of a built-in Houdini icon.

  6. If the recipe has more than one node, you can use the Anchor pop-up menu to change which node is the “anchor” node (other nodes are created relative to this node when the user clicks to place the tool contents in the network editor).

  7. In the Recipe Options section, enter a Recipe Title.

  8. The default for the Save to menu (User Preferences) saves all recipes into an asset library in your user preferences directory, which usually all you need. However, if you want to embed the recipe in an existing asset, or if you are working on a recipe to be shared (such as in a large studio), you can change where you save the preset and its internal name.

  9. Click Save.

Place the contents of a tool recipe

Placing a tool recipe works the same as other tools that create a single node, except a recipe can create multiple nodes at once. See adding nodes for more information.

  1. In the network editor, press ⇥ Tab and choose the recipe from the tab menu.

  2. Click to place the recipe contents.

Wire the contents of a tool into or out of a node

Starting a wire and choosing a tool recipe works the same as other tools that create a single node, except a recipe can create multiple nodes at once. See adding nodes for more information.

  1. In the network editor, click an input or output connector on a node to start a wire.

  2. While the new wire is attached to the mouse pointer, press ⇥ Tab and choose the recipe from the tab menu.

  3. Click to place the recipe contents. The new wire is connected to the recipe node the recipe author set as the “input” or “output” of the recipe.

See how to edit a tool below.

Saving decoration recipes

A decoration is similar to a tool recipe, but you designate one node in the recipe as the “central” node. The central node is like a placeholder for the node the user applies the decoration to. When you apply the decoration to a “target” node in the network, Houdini does the following:

  • Applies any parameters the recipe author saved on the central node.

  • Creates the other nodes in the recipe around the target nodes.

  • Rewires connections on the target node into the appropriate nodes in the new node setup, as set by the recipe author.

For example, if you usually append nodes to sharpen the volume after a Pyro solver, you could create a tool recipe that puts down a pre-made set up of a Pyro solver plus the sharpening nodes, or you could create a decoration recipe that adds the sharpening nodes to an existing Pyro solver. Or, you could even create both, to allow you to create new setups using the tool, and add to existing setups using the decoration.

To...Do this

Save a node setup as a decoration

  1. Select the node or nodes you want to turn into a decoration.

  2. Right-click one of selected nodes and choose Recipes ▸ Save Selected Items as Decoration.

    The node you right-click becomes the “central” node of the recipe. The central node represents the node the recipe will be applied to. You can edit which node is “central” in the dialog, but it’s convenient to be able to indicate it by which node you right-click.

  3. You can choose the submenu in which the tool will appear in the tab menu. Choose an existing submenu using the drop down menu to the right of the Tab submenu field, or type a new name into the field to create a new submenu.

    You can have the tool appear in multiple submenus by entering multiple menu labels separated by commas. For example, File IO, Recipes will make the tool appear in both the File IO and Recipes submenus of the tab menu.

  4. Make sure the correct node is marked as the “central” node.

    • The current central node has a yellow outline in the schematic view in the recipe dialog.

    • To change the central node, click the node in the schematic view and choose Set as Central Node, or choose the node from the Central Node popup menu.

  5. The recipe saves all (non-default and spare) parameter values on the non-central nodes it will recreate. You can choose whether to save parameter values on the central node, and re-apply them to the target node when the decoration is applied. This can be useful to set parameter values on the target node needed by the decoration nodes created around it, such as channel references.

    • By default, Capture Parameters on the Centrl Node is on. You can turn it off if you don’t want to save parameters on the central node.

    • You can choose which parameters on the central node are captured using the parameter view in the right pane.

  6. When the user applies your decoration to a node, Houdini will rewire any existing connections on the target node. You can set which nodes in the recipe should be used as the “input” and “output” when this happens. See controlling wiring below for more information.

  7. In the Recipe Options section, enter a Recipe Title.

  8. Use the Show for pop up menu to choose which node types can have the decoration applied to them. The default is to only show the decoration for the central node type. You can choose to show the preset for all nodes of the current node type category, or all node types that match a pattern. See target node patterns for more information.

  9. The default for the Save to menu (User Preferences) saves all recipes into an asset library in your user preferences directory, which usually all you need. However, if you want to embed the recipe in an existing asset, or if you are working on a recipe to be shared (such as in a large studio), you can change where you save the preset and its internal name.

  10. Click Save.

Apply a decoration to a node

In the network editor, right-click the node, open the Recipes submenu and click the decoration you want to apply.

See how to edit a decoration below.

Controlling wiring

You can control how existing connections are wired into the nodes created by tool and decoration recipes.

  • For tool recipes, you can choose which nodes in the recipe act as the “input” and “output” for the recipe. These are used when you start a wiring operation and then choose the tool from the tab menu, or when you drop the tool contents on an existing wire.

  • For decoration recipes, you can choose up to four input nodes, and one output nodes. When the decoration to the “target” node, Houdini rewires any incoming and/or outgoing connections on the target to those nodes.

For example, you might want to create a tool recipe that takes an incoming connection, subdivides it, wires it into the “collision geometry” (third) input of a Vellum Constraints node, collides it with a sphere, splits the output to a visualize node a null, and uses the null as the outgoing connection:

When you capture these nodes as a tool, you would set the Subdivide node as the recipe input, and the null as the recipe output:

Then, if you drop the tool onto a wire:

…Houdini will replace the wire with connections to the intput and output nodes of the recipe:

To...Do this

Set a node as a recipe input or output

In the recipe dialog, click the node in the schematic view, and choose Set as Input or Set as Output, or choose the node from the input or output pop-up menus.

You can only set nodes “upstream” from the central node as an input, and you can only set nodes “downstream” from the central node as the output.

Tip

Currently, Houdini only supports wiring the first input/output of a node. However, as a workaround you can wire a Null node into the input/output and then use the Null as the designated input/output for the recipe.

Target node patterns

For presets and decorations, you can choose which node types the recipe appears for in the recipe menu.

  • The default is for it to appear for the same node types as the original node (for node presets) or the central node (for decorations).

  • When creating a recipe, you can use the Show for menu to choose to show the recipe for any node in the same category (for example, any SOP node), or for any node type whose name matches a certain custom pattern.

To have the recipe show up for a set of nodes, choose Show for ▸ Node Matching a Custom Pattern and set the custom pattern to match the nodes you want the recipe to show for.

  • The pattern uses standard Houdini pattern matching, as in the hou.text.patternMatch function. The * wildcard matches any run of characters.

  • The pattern can be a space-separated list of patterns. The recipe will show for a node type whose name matches any of the patterns in the list.

  • Houdini tries to match the pattern to a node’s internal name including category, for example acme::Sop/foobar::2.0.

  • For example, to match all nodes in the acme namespace, use acme::*.

  • If you want to match multiple categories, such as any SOP or any DOP, you need to write a space-separated list of multiple patterns to match the possible cases, in this case SOP without namespace, SOP with namespace, DOP without namespace, and DOP with namespace: Sop/* *:Sop/* Dop/* *:Dop/*.

  • You don’t have to use wildcards in the pattern. If you want the recipe to only show for a specific set of node types, you can simply write the internal names of those nodes in a space-separated list.

Tip

You can edit the pattern after creating the recipe, if you find a case where the pattern doesn’t match properly.

You can also use hou.text.patternMatch and hou.Node.nameWithCategory to check whether a node would match the pattern:

>>> my_pattern = "acme::*"
>>> # Does this node match the pattern?
>>> hou.text.patternMatches(my_pattern, hou.node("/obj/geo1/my_node").type().nameWithCategory())
True

Choosing where to save (advanced)

The Save to menu in recipe dialogs defaults to User Preferences. This saves all recipes into an asset library in your user preferences directory, which usually all you need. However, if you want to embed the recipe in an existing asset, or if you are working on a recipe to be shared (such as in a large studio), you can change where you save the recipe, and you can edit the recipe asset’s internal name.

For example, if you're making a tool for shared use in a studio, you may want to save it to a shared network drive, and give it an internal name using a studio-specific namespace and a version number, such as acme::vellum_cloth_tool::2.0

Save location

To...Do this

Captureshoose where to save a recipe

In the recipe dialog, click the Save to pop-up menu and choose one of the following:

User Preferences

Saves the recipe asset into $HOUDINI_USER_PREF_DIR/otls/Recipes.hda.

Store In Same Library as ‹name

Saves the recipe into the same asset library as the source node type. This option is not available for “factory” node types installed with Houdini.

$HIP/otls Directory

Saves the asset into an otls subdirectory in the same directory the current scene file.

$JOB/otls Directory

Saves the asset into an otls subdirectory in the path set in the $JOB environment variable.

Embed in Current HIP File

Embeds the asset as part of the current scene file. This is sometimes useful for sharing a self-contained, working scene file. Note that this can bloat the size of the scene file.

Custom File Path

Choose this option, then enter the path to the asset library you want to save to in the field next to the pop-up menu, or click the file chooser icon to choose the file to save to from a file dialog.

Internal name

Each recipe asset has a default internal name designed to prevent naming conflicts. It uses the type of the node you created the asset from as the scope, your username (or the value of $HOUDINI_AUTHOR if it’s set) as the namespace, and an encoded version of the recipe title as the base name.

To...Do this

Change the internal name when you create a recipe

  1. In the recipe dialog, click Show Advanced Options.

  2. Edit the Internal name field.

Editing recipes

To...Do this

Delete a recipe

  1. In the main menus, choose Windows ▸ Recipe Manager.

  2. Select the recipe you want to edit and click Delete.

Rename a recipe

  1. In the main menus, choose Windows ▸ Recipe Manager.

  2. Select the recipe and click the title in the table.

    or

    Select the recipe and click Rename.

Edit the contents of a recipe

  1. In the main menus, choose Windows ▸ Recipe Manager.

  2. Select the recipe you want to edit and click Edit.

    Houdini creates the recipe contents in a temporary subnet, selects them, and opens the recipe editor on it. You can then edit the parameter values, or change the settings in the dialog (such as the title title).

    To add a node to a tool or decoration recipe, create it in the temporary subnet, select it, and click Reload in the recipe editor dialog.

    To remove a node from tool or decoration recipe, delete it from the temporary subnet, and click Reload in the recipe editor dialog.

  3. Click Save to save the preset with the new values.

Tip

Since recipes are stored in digital assets, you can also manage them using the Asset Manager (Assets ▸ Asset Manager), the Type Properties Editor, and HOM functions for manipulating node types and asset definitions.

Advanced Options

You will not usually need to change these settings. To show them, in the recipe dialog, click Show Advanced Options.

Recursively save node contents

If you turn this off, the tool or decoration will only have the top level nodes, it will not save the contents of subnetworks or unlocked assets.

Save Editable Dive Targets

Assets can specify subnetworks in their definitions as editable dive targets, where the user who created the asset instance can put their own nodes to affect how the asset works. Houdini normally saves the contents these subnetworks as part of the recipe. Turn off this option to ignore the contents of these subnetworks.

There are separate controls for saving editable contents of the central/anchor node, and saving them for all other nodes.

Save View Flags (at top level)

Normally, Houdini does not save view flags (output, display, render) as part of the recipe, because usually you don’t want applying a recipe to change them. Non-view flags (such as “frozen” or “bypass”) are always saved. You can turn on this option to save view flags as part of the recipe.

Only Save Nodes

Normally Houdini saves sticky notes, network boxes, and dots, as part of the recipe. If you turn on this option, the recipe will only save nodes, ignoring other types of network objects.

Scripting

You can use the following HOM functions to save and apply recipes:

HOM also has various lower-level functions and methods to return JSON-like data from Houdini objects, and set up Houdini objects based on that JSON-like data:

Networks and parameters

Networks

  • Network editor

    How to create, move, copy, and edit nodes.

  • Network navigation

    How to move around the networks and move between networks.

  • Connecting (wiring) nodes

    How to connect nodes to each other to make them work together.

  • Network types and node flags

    Flags represent some state information on the node, such as which node represents the output of the network. Different network types have different flags.

  • Badges

    Badges indicate some status information about a node. They usually appear as a row of icons below the name of the node.

  • Node Info

    The node info window shows a quick overview of statistics and information about a particular node.

  • Find nodes in a network

    How to use the Find dialog to find nodes based on various criteria.

Editing parameters

Next steps

Expressions

Guru level

Reference