Python callback after USD ROP execution

   2441   3   1
User Avatar
Member
5 posts
Joined: Jan. 2020
Offline
Hey there everybody!

I'm doing research on USD/Solaris automation and for the past few days I've been stuck on a particular problem. I'm trying to find a proper way to run a Python callback after the execution of a USD ROP. At first, I was trying to figure out the best way to do this for the USD ROP node specifically but in hindsight it would be great to know the proper procedure for ROP's in general. As far as I can tell from the documentation and Google, there doesn't seem to be a way to do this with the standard Houdini Python API.

The callback would create a symlink to the rendered file among other things.

TLDR; Trying to figure out a way to run a Python callback after a ROP execution.
User Avatar
Staff
4525 posts
Joined: July 2005
Offline
Almost every ROP in Houdini has parameters for scripts that run Pre-render (before any rendering starts), pre-frame (before each frame), post-frame (after each frame), and post-render (after all frames are complete). In your case the Post-frame or Post-Render scripts seem like the likely places to put such logic.
User Avatar
Member
5 posts
Joined: Jan. 2020
Offline
mtucker
Almost every ROP in Houdini has parameters for scripts that run Pre-render (before any rendering starts), pre-frame (before each frame), post-frame (after each frame), and post-render (after all frames are complete). In your case the Post-frame or Post-Render scripts seem like the likely places to put such logic.

Yeah I guess that would be an option. It seems a little messy (probably have to create a new digital asset). Also, there's not a lot of documentation on it, is there any way to get some parameters from the ROP node? I don't think `kwargs` works right?
Edited by bkamphues - Feb. 14, 2022 10:41:17
User Avatar
Staff
4525 posts
Joined: July 2005
Offline
I would expect kwargs to work, but I'm not totally sure. If not, then I'm sure hou.pwd() would return the ROP node being executed.

Another approach that could work for many (though not all) ROPs would be to alter the "Command" parameter. Many ROPs have this parameter to control the external application that is run by the ROP. USD Render ROPs default to "husk" as the command, but you could change this to "myhuskwrapper" (a shell script or batch file on Windows), which would invoke husk (passing through any command line arguments), then run whatever additional logic you want.
  • Quick Links