VortexVFX

VortexVFX

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Run python external-file-writer with click of a button? Dec. 14, 2022, 4:26 a.m.

animatrix_
Yes that should work.

Cheers. Sorry, just edited my earlier message - realised I should just go try it myself, and it does indeed work.

Run python external-file-writer with click of a button? Dec. 14, 2022, 4:15 a.m.

animatrix_
You can use:

hou.Node.cook(force=True)

https://www.sidefx.com/docs/houdini/hom/hou/Node.html [www.sidefx.com]

Thanks. So, is this the right idea? I'd add a Button to the subnet's parameter interface, then put together a short 1-line python script in the Callback Script line along the lines of:
hou.node("./node_i_want_to_cook").cook(force=True)

(Edit: realised it was silly asking when I could just go try it myself. That does indeed seem to work! Thanks for your help.)

Run python external-file-writer with click of a button? Dec. 14, 2022, 3:19 a.m.

Hey all,

I've cobbled together a python-based script to write out geometry to some external files, in a standard Python SOP node, and have it running multiple times in a for-loop to output a bunch of iterations at once... works great when I set the display flag on the output of the loop, and thereby force the whole thing to cook.

...I'd like to find the simplest way to turn it into a sort of custom ROP though... currently, it can get triggered without meaning to by changing display flags around, and I prefer to just have the whole thing cook on-demand using a "Render" button on a parent subnet.

I'm a bit clueless about callback scripts and such... can anyone break down exactly how I'd get a button-press to force a particular node/network to cook, or point me to a resource that explains it in simple terms?