Search - User list
Full Version: Execute python code after a "Render to Disk in Background"
Root » Technical Discussion » Execute python code after a "Render to Disk in Background"
Aquakwak
Hello!

I'm trying to execute a function after a render "in background" has finished (on nodes like mantra or filecache).
I can launch the "Render to Disk in Background" in python using something like:
hou.hscript('opparm -c /out/mantra executebackground')
But I don't know how to have a callback or something when the render is over.
Does somebody know how to do it?
Thanks!
Enivob
ROP nodes offer a Scripts tab where you can execute code before/after the render of the frame. Take a look there.
Aquakwak
Interesting, I didn't know. The "filecache" and "mantra" node indeed have a Script tab (sadly not the rop_alembic node).
The Scripts do work in "Save to Disk", but in both nodes they don't activate in "Save to Disk in Background" it seems...
jsmack
Aquakwak
The Scripts do work in "Save to Disk", but in both nodes they don't activate in "Save to Disk in Background" it seems...

They do, but in the background. Are you looking for a way to execute scripts in the foreground when a background task completes? I think the only way would be to use a PDG task graph.
Aquakwak
Hi! Thanks for the answer.
Do you know how to debug "background" task? In terminal or inside houdini's Python Shell I have no result for prints to see if it's working or not.
Also like you said executing scripts in foreground looks interesting, do you know where I can find tuts or infos about PDG task graph? It's the first time I hear about it and I don't find much online.

Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB