Simon Verstraete - Houdini blog #42 Orient (artstation.com)
SUPER useful to make orient from your Normal and Up vectors (you will of course have to make those first!)
Simon Verstraete - Houdini blog #42 Orient (artstation.com)
SUPER useful to make orient from your Normal and Up vectors (you will of course have to make those first!)
Sometimes you need to use the current loop or the current piece number in an expression on one of the nodes in the same loop. You can get this information with a Block Begin SOP node that uses the Fetch Metadata method.
Set up a looping block using the instructions above.
Select the Block Begin SOP node, and then in the Parameter Editor click Create Meta Import Node.
This button adds a second Block Begin SOP node to the side of the existing one. This node is set up to generate an empty geometry with some detail attributes.
The detail attributes are as follows:
numiterations
The expected total number of iterations, taking into account the Max Iterations and Single Pass parameters on the Block End SOP node of the loop.
iteration
The current iteration number, always starting at 0
and increasing by 1 each loop.
value
In piecewise loops, this is the current value of the attribute. For example, the piece
integer or name
string, or if there is no attribute, the current point or primitive number.
In simple repetition loops, this is a floating point value starting at the Block End SOP’s Start Value and increasing by the specified Increment each loop.
ivalue
In simple repetition, this is an integer version of value
. This can be useful if the value is naturally an integer (for example, starts at 1
and increments by 2
) and/or if values are over 24 million (where floating point numbers lose precision).
To grab the value of these attributes in a node inside the loop, do the following:
In a Houdini expression, use the detail expression function.
For example:
detail("../block_begin2", "iteration", 0)
In an Attribute Wrangle SOP node, use the detail VEX function.
In Python, use hou.Geometry.attribValue():
node("../block_begin2").geometry().attribValue("iteration")
Use the julian matrix - (point wrangle)
matrix M=detail(1,"xform");
@P=@P*M;
plug the transform you want to "copy" into input 2 ("1") and the object you want to transform with said transform into input 1 ("0").
MAKE SURE the transform node has the xform ticked at the bottom, so the wrangle can actually access the "xform"
This is especially relevant for when you overuse $CEX etc bounding box for pivots & you suddenly change the geo size. Eg you rotate your thing into place, and do so using the centre of a short object, but suddenly you need to substitute it with a much taller thing.
Didn't realise this...and wasted about half an hour figuring it out..
If you, for example, are using a FETCH node or a rivet and need to export an object with the transforms you can a) use the bake animation ROP (must be used in ROP context!) b) click File>export as FBX or Alembic.
For the latter to work, you must place your stuff into a SUBNETWORK, or it will not export correctly. VERY ANNOYING. It's a bit like putting things into a group before exporting an alembic in Maya, just much less obvious.