Houdini-Digital-Asset-Creation

Houdini Digital Asset Creation

Tips and Tricks

Introduction


I find myself re-using a few techniques and methods frequently in my Houdini digital asset creation techniques. These are my top tips & tricks.


On Creation - Namespaces

I always put my operator name into a namespace I come up with, as well as a version number. The syntax for namespacing your digital assets is:  nameSpace::nodeName::versionNumber

Example can be seen below. Note: I will be using the Normal Map From Heightfield HDA as an example, that will fill in any gaps from the post detailing the functionality of this node.

On creation options

HDA Creation - On Create

I add all my digital assets into a namespace so that I can easily get to them through Python, which can come in handy. Below is a Python function that will get all nodes from a scene with my namespace.


Basic - Icon


Use one of the hundreds of icons that ship with Houdini (if you don't have time to make your own).

Houdini Digital Asset Creation - Basic Icon

HDA Creation - Basic - Icon


Scripts - Callbacks


Hook up the On Create Python callback immediately to set the color and shape of tools.

Houdini Digital Asset Creation - Scripts Callback

HDA Creation - Scripts Callback

The Python snippets below has the code for the OnCreated, PythonModule as well as a function that prints out the string representation of all the node shapes that are available by default in Houdini.


Parameters

Disable & Hide Rules


Prevent the execution of a button click unless you have all the inputs you need - use the HDA disable and hide rules. Simple example below - disable the export button unless the export path has been filled in.

Houdini Digital Asset Creation - Disable Rule

Hda Creation - Disable Rule

You can get pretty complex with these rule operators. Here is a cheat sheet when comparing different parameter values against each other.

For AND operation: { option1 != 1 option2 != 1 }
For OR operation: { option1 != 1 } { option2 != 1 }
Combination: { option1 != 1 option2 != 1 } { optionX > 0 }

Tricky - ALWAYS use "" and not ''  (example {  option1 == "" } NOT   {  option1 == '' } - gets me all the time (thanks Python)


Parameter callbacks


While you can drag and drop parameters from nodes inside your HDA into the parameter interface to connect them, do not forget about the power of callbacks.

One use case is a callback on the output path in the above example. When that changes, we can check if the file exists, is read only and we may want to implement a source control check out before attempting to write the file. We could also set the enable/disable state of the export button in this Python callback.

Example implemented below.

Houdini Digital Asset Creation - Parameter Callbacks

HDA Creation - Parameter Callbacks

Houdini Digital Asset Creation - Parameter Callbacks - Code

Hda Creation Parameter Callbacks - Code

Get as complex as you need with callbacks and do pretty much anything - power!!


Help!


You gotta love a tool framework where they have already thought of providing a hook to the help documentation. If you select any Houdini factory node and RMB -> Help... you will land on the documentation page for that node.

TIP: In your Houdini Environment, set the flag HOUDINI_EXTERNAL_HELP_BROWSER = 1 to get the documentation showing in your default browser instead of Houdini's internal browser.

Side Fx made it very easy for you to hook into this system through the help section of the Houdini Digital Asset. The template code below can be found in this SideFx documentation. I also provide the code snippet below. The code adds everything you need for a documentation page.

Houdini Digital Asset Creation - Help Template

HDA Creation - Help Template

The code modified to work with this Houdini digital asset creation.

Tip: For internal images, you map the image by providing the path: CATEGORYNAME/svgName
From the example above, the icon name is "BUTTONS_add_image.svg" -  becomes BUTTONS/add_image.
You can find all the icons in "C:\Program Files\Side Effects Software\Houdini HoudiniVersion\houdini\help\icons.zip".
Browse that file to see how things are organized.

This is the web page result from the above help section.


Houdini Digital Asset Creation - Documentation

HDA Creation - Documentation


Conclusion


Hopefully, some of these tips & tricks can help you in your Houdini digital asset creation process. Keep an eye out for updates. I will add more tips and tricks when I learn new things I deem worthy. Drop a message below, if you know of something I should add  or if you just want to say hello.


About the Author

Christian Akesson

Facebook Twitter Google+

Senior Technical Artist at Nvidia. Maya user since beta 1 in 1999. Mostly in Houdini and Omniverse these days...