Search - User list
Full Version: Document for the callback function onPrepareTask()?
Root » PDG/TOPs » Document for the callback function onPrepareTask()?
EricSheng
I'm reading the shipped Top nodes' implementations and I find the callback function called onPrepareTask(). I can't find any information about it. Can I find the callback functions list for PDG somewhere?
tpetrick
I've added a detailed doc on all of the processor callbacks, which will be available in the next set of daily builds. I'll link the help page here tomorrow when it's available. For now, here's a quick summary of the callbacks that weren't already documented as part of the Python Processor node docs or the custom node guide:

* onPreCook()
Called once on all nodes that will be evaluated during a cook. This is called before any onGenerate callbacks, and gives the node the opportunity to load shared resources or initialize variables.

* onPostCook()
Called once on all nodes that were active during the cook, after the last work item has completed cooking. This gives nodes an opportunity to unload shared resources used during the cook.

* onPrepareTask(work_item)
Called once for each work item in the node immediately before it is scheduled for cooking. This method is called before PDG checks for cached files on disk, so it can be used as a way to add expected output files for caching purposes. It can also be used to access output files or attributes of the work item's dependencies, modify the command line of the work item, or do other last-minute work needed before cooking the item. If this method returns failure the work item is marked as failed.

* onCookTask(work_item)
Called when an in-process work item needs to cook. This is only run for work items that are explicitly created as in-process item, by passing the `inProcess=True` argument when adding them to the work item holder during the onGenerate callback. This callback is able to write attributes to the work item and attach output results, as well as running whatever in-process work is necessary to cook the work item. The callback runs inside the main Houdini process on a background thread.

* onSelectTask(work_item)
This is a UI callback specific for us ewith TOPs. When a work item is selected in the TOPs UI, this hook is executed after the item has been selected. This is used by the Wedge node to push work item parameter values to the scene, but could also be used to run custom visualization logic. Note there is also an event hook for selection as well.

* onDeselectTask(work_item)
This callback is the opposite of the select callback - it runs whenever a work item is deselected. The Wedge TOP uses this to restore parameter values back to their original value on deselection.
tpetrick
See https://www.sidefx.com/docs/houdini/tops/processors.html [www.sidefx.com] for more details.
EricSheng
tpetrick
See https://www.sidefx.com/docs/houdini/tops/processors.html [www.sidefx.com] for more details.
Thanks, do we have callbacks like onPreGenerate or onPostGenerate? Cause currently if I define onPreCook or onPostCook, it will run even if I just generate static workitems.
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