The last article was about the price in time.
This one covers the other price: how hard it is to fix things, and having to follow Houdini's rules.
Parameters are static
HDK parameter definitions are static.
You cannot add or reorder them at run time. To fix a label or a default, you change the source, build, and restart Houdini (article 4).
There is one more thing: a numeric range cap cannot be enforced by the widget alone.
With commands or expressions you can enter values beyond the widget's cap. So every numeric parameter gets a range, and the cook clamps the value with the same constant as well.
Things that break silently
Here are the traps from earlier articles, side by side:
- A forgotten header: without
UT_DSOVersion.h, the node simply does not appear, with no warning (article 2). - Miscounted folders: a wrong switcher count makes parameters spill into other tabs (article 4).
- Announcing changes: forgetting
bumpAllDataIds()leaves stale results (article 9). - Adding inside a loop: adding points in a parallel loop makes Houdini die with no message (article 5).
What they share is that they break quietly when you get them wrong.
Compiling cleanly is no guarantee of being right.
Operations that crash
The rules documents also list a few operations that crash.
- Name lifetime: if you build a parameter name (
PRM_Name) as a temporary variable, what it points to disappears later and Houdini crashes. - Array terminator: a parameter template array must end with an empty template.
- Editing a live asset: using
setParmTemplateGroupandupdateFromNodeon an asset (HDA) in use crashes. Unlock it and recreate it.
Thread rules
Writing point positions in parallel (setPos3) is not thread-safe when it has to allocate a new memory page.
Points jumped to the origin or stretched off to infinity. The fix is to allocate points with appendPointBlock before the loop and only write through handles after that. When something breaks, go back to a serial for first and compare the results (article 5).
Environment rules
The errors when a plugin will not load are also a fixed set.
- "Missing version information": a forgotten
UT_DSOVersion.h. - "allowed range is X.XX-Y.YY": the compiler version is outside what that Houdini build allows. Specify
-T v143again. - You cannot tell why it will not load: the environment variable
HOUDINI_DSO_ERROR=1prints load errors. - You added your own path but the node does not show up:
HOUDINI_DSO_PATHneeds a trailing&, which keeps the default paths from disappearing.
These are written into the checklist as symptom, cause and fix.
In other words, they are records so that something I tripped on once does not get me a second time.
Summary
HDK rules break quietly when you get them wrong.
That is why rules, checklists and tests became necessary. I count building that machinery as part of the HDK's price.
Next is the last article of the series, where I write what I will do with HDK development given all this.
Comments