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?
Run python external-file-writer with click of a button?
1201 4 0- VortexVFX
- Member
- 33 posts
- Joined: Aug. 2014
- Offline
- animatrix_
- Member
- 4521 posts
- Joined: Feb. 2012
- Offline
You can use:
https://www.sidefx.com/docs/houdini/hom/hou/Node.html [www.sidefx.com]
hou.Node.cook(force=True)
https://www.sidefx.com/docs/houdini/hom/hou/Node.html [www.sidefx.com]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- VortexVFX
- Member
- 33 posts
- Joined: Aug. 2014
- Offline
animatrix_
You can use:hou.Node.cook(force=True)
https://www.sidefx.com/docs/houdini/hom/hou/Node.html [www.sidefx.com]
Thanks.
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.)
Edited by VortexVFX - Dec. 14, 2022 04:25:30
Dan Wood
Vortex VFX Ltd
Vortex VFX Ltd
- animatrix_
- Member
- 4521 posts
- Joined: Feb. 2012
- Offline
VortexVFXanimatrix_
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)
Yes that should work.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- VortexVFX
- Member
- 33 posts
- Joined: Aug. 2014
- Offline
-
- Quick Links