Houdini HScript
· Houdini MOC · #note/sink
Snippets
// animated texture frame numbering
path/to/texture/image_name_`padzero(5, clamp($F, 0, 120))`.exr
path/to/texture/image_name_`padzero(5, clamp($F+25, 0, 120))`.exr
// camera focus distance
vlength(vtorigin(".", "/obj/null1"))
vlength(vtorigin(".", opinputpath(".", 0)))
Common symbols
|
|
% |
modulus, remainder on integer division |
&& |
logical operator AND |
|| |
logical operator OR |
>= |
greater than or equal (Do not reverse the order – won’t work) |
<= |
less than or equal |
< |
less than |
> |
greater than |
== |
equal comparison |
!= |
not equal |
`` |
backticks convert an expression into a string ie. ch(“../someparameter”) in the font node would print that verbatim, but putting this i backticks would give me the value |
if |
if (condition, then part, else part), example if ($F > 0, 1, 0 ) |
ifs |
as above but returns a string, for example ifs($F>1,”Hi”,”There”) |
int() |
integer, similar functions floor(), ceil(), round() |
$F |
frame number integer |
$FF |
frame number float |
$CY |
copynumber, local to the copy node so to get the information to a node above you need to stamp it to retrieve it you use stamp expressions |
stamp |
stamp(“../copy1”,”kermit”, 0) = stamp(node it is from, name you called the variable, default value just incase ) |