This blog post is my attempt to collect and unfiy some of the useful stuff in Houdini I have picked along the way. Feel free to comment or contact me regarding any of this. Here we go!

Using the Textport to Update Paths in Any String Channel

If you need to update a ton of nodes with the wrong path and you don’t wanna do it by hand, you can run this function in the Textport Console to update them all. Pretty handy for FBXs and such.

For example, let’s say that I have an absolute path pointing to my project, but want to use a variable instead I can run the following line to make the change:

opchange "C:/Projects/2021/The_Windmill" '$JOB'

In this case it’s important to enclose ‘$JOB’ in single quotes otherwise it’ll expand to the full path. Credit to Dave Stewart for pointing this out. Thanks Dave!

And of course, if you wanna know more about this function and other forms of it, make sure you check its documentation on SideFX’s website.

Jan 5th, 2021

Get Part of a String (a Substring)

I’m currently working as an intern for The Artery in NYC (although remotely thanks to some weird pandemic going on) and by accident I ended up rendering something to the wrong directory. The folder is the shot name and the shot name is partly contained in the $HIPNAME variable, so in order to make sure I didn’t mess it up, I ended up making use of this very handy Hscript function: substr()The best way to explain what this does is the one SideFX has in their documentaition: “Returns the characters of s between the start position and the start + length position.” 

To ellaborate, let’s say the Output path was something like: 

$JOB/007_Renders/ABCD_sh0100/$HIPNAME/$HIPNAME.$F4.exr

And the $HIPNAME would evidently be something like: ABCD_sh0100_FA_v01.hip, right? so it would be easy to make the current path something like the following:

$JOB/007_Renders/`substr($HIPNAME, 0, 10)`/$HIPNAME/$HIPNAME.$F4.exr

This way if I use this standard in the hip file of every scene, I can make sure that as long as I keep the naming convention consistent, I don’t have to worry about the rendered images going into their corresponding folder.

 

Jan 17th, 2021