Houdini Tip of the Day - Python pressButton() and set() Commands

I've been using the Python pressButton() and set() commands to make one-click rendering/caching systems. 

It's a one-line command and looks like this:

Using the "Post-render Script" field you can tell Houdini what to do after the rendering is finished. Make sure to set it from "Hscript" to "Python".
In this case, I wanted Houdini to export another ROP Alembic node that I had setup elsewhere.

So rather than export each of these manually I can just click on button and go relax while they render! Another command I've been using allows us to control Checkboxes on other nodes. It is the set() command and looks like this:


Again, this is certainly not limited to ROP Alembic nodes. That's just what I like to use. You can do the same thing on any node that has the "Post-Render Script" parameter.

Using a ROP Output Driver node instead

You can even type multiple commands and it will work

Open the expression editor with Ctrl + E

If you do type in multiple commands, you may see a strange looking symbol that separates each command. This is called a 'Paragraph Mark'.

It's a bit of a hassle to type that character manually but if you need to, use the shortcut 'Alt + 0182'

I also found out that inside the DOP Network there is a "Post-Render Script" parameter hidden inside the Output node. To access it you need to right click on the Output node and choose 'Allow Editing of Contents'. Once inside you will see that there is a ROP Output Driver node and you could use this to export Alembic's or BGEO's after you simulation is cached.
Pretty awesome functionality if you ask me!

Well that's it!
With one line of code you could be saving yourself hours of time having to wait for something to export then having to press another button manually. With this setup it's all automatic!

Until next time, happy sims!

Follow me on Twitter: @renderyourworld
And also on Facebook