HDA Management

Setup HDA

Subnet

Use subnet to encapsulate collection of nodes intended to serve in HDA and expose specified parameters for user access.

Always end the internals of a subnet with an Output node to clarify HDA return data.

image

HDA Naming Convention

Include Namespace For Custom HDA Collection:

Operator Name = namespace::tool_name::versionNo

Example = archi::bkgd::1.0

Operator Label = Namespace + Tool Name + Version

Example = Archi Bkgd 1.0

image

Versioned HDA

Create a subnet and RMB to access the Versioned Digital Asset options, including creating a new versioned HDA and Preferences.

image

The Preferences dialog box allows for specifying the namespace, save path, and menu context. These settings are used to specify the typical conditions for new HDAs and helps to save time and effort in inputting repetitive field values.

Menu Entry: To create a subfolder, separate with a forward slash (Archi/Light).

image

The dialog box for the New Versioned Digital Asset reiterates many of the same options as is listed under Preferences. The Version can be specified to manage iterations of the HDA as it evolves.

image

Rename HDA Namespace

For instances in which an HDA needs to be reconfigured with a different name, namespace, or version, the following steps can provide opportunities to make these edits. This can be particularly useful when version controlling the HDA with new versions and preserving older versions being used in existing or past project files.

  • Select the HDA in a Houdini session and unlock it for editing.
  • Navigate to Assets > Asset Manager.
  • Copy the HDA to be renamed or versioned.
    • In the following example, structure::Sop/column::1.0 is being copied to create the one labeled structure::Sop/column_classical::1.0.
    • image
  • The following dialog box appears with options to rename or version the copied HDA as applicable. If renaming, enable the option In asset sections, replace operator name with the new one.
  • image
  • With the new copy being created, the previous version still exists within the HDA.
  • Depending on the intent of the new version, Delete the inapplicable HDA/s as necessary to keep definition clean and organized. Or if the new version is simply an updated version, this step may not be necessary if previous versions are intended to be preserved.
  • image

Example HDA Setup

User Interface

UI Controls

Balance

In an effort to balance resources, time, and quality, a goal for a procedural model can be to generate a Minimum Viable Product (MVP) as a starting point. With the opportunity to enhance it, revisions can be integrated to boost its capabilities and composition.

Balance

Along the same lines of the MVP, the base HDA can support a simplified UI for quick and effective customizations while a more in-depth set of controls can be accessed by a user through an advanced control tab.

Edit HDA

Typical Considerations

Prerequisites

Verify HDA is unlocked to make edits to parameters and internal operations.

Save HDA

Save the HDA via Assets > Save Asset > Asset Name periodically to update edits.

Saving the HDA will propagate its updates to instances throughout project.

Nested HDA

Link nested HDA parameters to parent HDA UI in Collapsible Folder Type to keep nested data organized.

Internal Notes

This color legend aims to keep content organized and consistent through HDA development.

Components

  • Network boxes are used to encapsulate sections of node networks for building components and sub-components within a complete HDA.

Generic Note

  • Intended for quick notes through the development process that may eventually be converted to one of the other note types.

To Do Task

  • Highlighted red to note its imperative nature.

Key Strategy

  • As part of the learning process, collections and configurations of nodes that achieve unique strategies are highlighted and documented for self-education.
image

Parameter to be linked to HDA UI

  • This is to identify nodes with parameters intended to be linked to the HDA main UI. Eventually, these convert to the next type of note and node.

Parameter linked to HDA UI

  • These clarify the nodes with parameters linked to the HDA UI for future reference and troubleshooting.

Properties

Basic

Icon

Save image file to be used as HDA icon as 48x48 PNG with transparent background.

To reference existing icons used in Houdini nodes, access the available node icons and mappings in the following directory:

$HFS/houdini/help/icons

Inputs/Outputs

Specify Minimum Inputs, Maximum Inputs, and Maximum Outputs intended for the HDA to work as intended.

Setting the Maximum Inputs to 28 or greater will configure the input of the HDA to be a multi-input. Specifying less than 28 will configure individual node input connectors.

Parameters

Add all applicable parameters to the Parameters tab in the Edit Operator Type Properties panel.

Spare Parameters

Create Parameters

Use a consistent naming convention for folders and parameters used to define the user interface. The Name for each should be unique, whereas the Label can be more customized.

Folder

Example Convention

Name: folder_<foldername>

Label: <FolderName>

Example

Name: folder_cable

Label: Cable

Parameter

Example Convention

Name: <foldername>_<parametername>

Label: <FolderName> <ParameterName>

Example

Name: cable_radius

Label: Radius

External References Conflict

If a subnet or collection of nodes are converted to an HDA with internal parameters linked to references outside of the HDA environment or vice versa, the following dialog prompts as notification that these linked references and parameters should be resolved before being used in other Houdini files.

image

Disable When / Hide When Syntax

General syntax: { parameter_name comparison_operator value }

  • It can include multiple conditions within the curly braces.
  • Spaces required around comparison operator.
image

Input/Output

To assist with user interactivity, annotate with concise, descriptive labels specifying intended input. For instance:

Input 1 Label: Input: Terrain

Input 2 Label: Input: Curve

image

Help

Reference Help Card section below.

Interactive

To collect custom HDAs into a specified directory for access when using the TAB menu in the network, specify the custom directory/menu name in the following field.

Shelf Tools > Context > Network Pane > TAB Submenu Path

image

The above Network Pane tab also includes the options for specifying the network context in which the HDA can be accessed.

Extra Files & Embedded Asset File References

Embed applicable asset files within an HDA using the Extra Files tab. Reference these embedded files in the HDA's parameters using opdef: and the relative path to the HDA.

image

Resources:

Cooking Processes

Nested simulations and processes that require cooking need to have a manual cook button option in the HDA UI, with the optional auto cook toggle, if warranted for real-time manipulation. A Time Shift node can be enabled downstream to lock the simulation to a specific frame so that each cook operation reverts the geometry back to the specified frame.

⚠️
Caution: Keep in mind that depending on the simulation or process that is to be cooked, it may take some time once an edit is made to the HDA parameters by the user. As such, having a manual and auto cook option gives the user the option to manage the process.

Manual Cook Button

Link button in HDA UI to manual reset or process button in respective node within HDA network; for instance, the Reset Simulation button in a Vellum Solver.

This can be addressed by inputting the relevant Python script to activate the Reset Simulation button in a button parameter added to the HDA UI.

Parameter Tab > Button Parameter > Parameter > Callback Script

hou.parm('/obj/hda/vellumsolver1/resimulate').pressButton()

Auto Cook Toggle

Locate Python node upstream from simulation or other process with the code below to define a stream that auto cooks when update to the parent HDA is made. Note that the parent node is the HDA in which the simulation/process is nested in.

node = hou.pwd().parent()
# This code to re-cook is called when HDA has parameters updated.
hou.node("../vellumsolver1").parm("resimulate").pressButton()

A Switch node is positioned next in the stream and linked to the auto cook toggle in the parent HDA UI.

Python

Python States

Paint Attributes

  1. Add a Button parameter to the HDA within its Parameters tab.
  2. Specify the appropriate Python callback in the parameter's Callback Script to enable an action through the node inside the HDA, such as the following:
    1. Replace the <node_name> with the name of the node located inside the HDA that is intended to be guided by the corresponding callback script.
    2. Enable Paint & Viewer State
    3. hou.pwd().node("<node_name>").setSelected(True)
    4. Clear Paint
    5. hou.pwd().node("<node_name>").parm("reset").pressButton()
  3. Include the applicable nodes in the HDA's Node tab under Editable Nodes. This allows the specified nodes to be accessible once the HDA is locked. Without specifying a node as such, attempting to enact a node's action in a locked HDA via a callback script (as noted above) will result in a dialog message noting that an access issue has been encountered and the action cannot be completed.

The following video showcases the above callbacks in action in a subnet intended to be converted into an HDA.

Example Files

Location: $HH/viewer_states/examples/

Combined Callbacks

In instances where multiple callbacks need to be integrated within a single parameter control, each individual callback can be included and separated with a semicolon (;).

hou.pwd().node("<node_name>").setSelected(True); hou.pwd().node("<node_name>").setDisplayFlag(True)

Secure HDA

Locked HDA

A notable part of structuring an HDA is the streamlined access to key parameters that a user is intended to manage to work with the HDA and to limit the user from being hampered by a complex network within. For this, it is good practice to lock an HDA once it has been created. Simply having it locked allows others to still be able to unlock the HDA and access the inner network, which may be warranted if custom edits are intended by the user.

Process

  • Select the HDA.
  • Assets > Lock Asset.

Black Boxed HDA

For greater security, convert the asset to a Black Boxed HDA. This will allow for the continued use of the HDA by a user solely through the designed user interface and exposed parameters, but will prevent access into the network within it, even when unlocked.

Process

  • Select the asset and lock it using the steps above.
  • Once it is locked, Assets > Create Black Boxed Asset from Selection....

Help Card

Example HDA Help Card

image

Icon & Images

Add image files for use as icon/s and images in help card to the Extra Files tab in the Edit Operator Type Properties panel. Note the syntax to reference icon in markup section below.

Wiki Markup

<!-- ******************************************************
Add title of the node, context in which it is used, and the icon.
****************************************************** -->

= Hans =
#context: obj
#icon: opdef:.?hansPalacios_parasiteSketchUp_03.png

<!-- ******************************************************
Add quick description for node.
****************************************************** -->

""" Automatically does this and that."""

<!-- ******************************************************
Add section title and text.
****************************************************** -->

== Overview ==
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Separate paragraphs by adding a full line between paragraphs.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

<!-- ******************************************************
Add @-sign section top-level heading.
****************************************************** -->

@parameters

<!-- ******************************************************
Add properties for the parameters and their specific data.
****************************************************** -->

Float Parameter:
        #id: floatparameter
        This parameter controls this and that.

Uniform Scale:
        #id: uniformscale
        This controls this and that.

<!-- ******************************************************
Include the @name syntax followed by the intended title for the section
****************************************************** -->

@name Section title

<!-- ******************************************************
Add a web link using the following formatting.
****************************************************** -->

[Hans Palacios|https://www.hanspalacios.com]

<!-- ******************************************************
This help file is stored by Houdini in a JSON format in the following folder:
...\Documents\houdini18.0\config\Help\cache\nodes\sop
****************************************************** -->

Generated Help Card

The above markup located in the HDA generates the following help card when accessed via the HDA help button.

image

Wiki Markup Reference

Access HDA

OP Libraries

Enabling the Use OPlibraries Files to Find OTLs option in Asset Manager > Configuration mitigates the search using the HOUDINI_OTLSCAN_PATH environment variable.

Listing an HDA in the OPcustomize file simply hides the HDA from being accessible through the main Houdini UI. The HDA can still be scanned and listed as an HDA in the Asset Manager.

Node is identified with node type name with category:

hou.node(”/out/hda”).type().nameWithCategory()