Houdini Attribute Scrambler SOP v3.0 HDA (Python 3 compatible)
Attribute blending similar to Photoshop layer blending modes.
Valid input attributes: point/prim float and vector (3 floats, which includes color).
It helps keep node graphs cleaner and it's fun to use. (Disclaimer: 'fun' is subjective:) Reduces the need for common, repetitive tasks, like binding and exporting attributes in attribute VOPs or typing in wrangles for things like lerp or any of the operations below:
Supported operations:
- Copy (v3)
- Add
- Subtract
- Multiply
- Divide
- Minimum
- Maximum
- Average
- Screen
- Overlay
- Exclusion
- Linear Interpolation
- Pin Light
- Difference
A demo of v2 which lacks a few options and features but works in much the same way otherwise:
Changes in v3.0:
- Entirely re-written
- Advanced VEX (scroll to the bottom for more info)
- 'Copy' operation - just overwrite all previous operations with this attrib (useful for then/now comparisons while dialing in your final numbers)
- Python 2 & 3 compatible
- Vector (3flt) support (that includes color)
- Creates the (input) attribute if it doesn't exist (and indicates that to you)
- Not compatible with v1 and v2 (but both are included inside)
- Parameter interface
- Dynamic drop-down menus will list compatible attributes only.
Inside the HDA: Attribute VOP and Attribute Wrangler are essentially identical. The former contains a single snippet of code and is independent of external 'include' files. The latter is there for debugging convenience but requires an #include directive for haki.h (haki.h needs to be copied to $HOME/houdiniX.X/vex/include)
If you want to study it on your own, you've got:
- Declaring and using a struct in VEX via outer code or
include
directive - Looping over a multi-parm in VEX
- Generating menu items using Python Menu Scripts with conditional formatting
- Dynamic "Hide When" through custom functions in the HDA PythonModule (advanced)
- Using the HDA "Descriptive Parm" with a Python script for dynamic hints
(If you take that road above, remember to "Show Invisible Parameters" first.)
You get a .hda file and I get a pack of beer!