Search - User list
Full Version: Long `onGenerate` callback
Root » PDG/TOPs » Long `onGenerate` callback
Ostap
Hi,

Is it possible to visualize long `onGenerate` process without holding the whole Houdini?
Just to show to user that something is going on.
Like you have with a dynamic generation or cmd execution.

Thanks
Ostap
tpetrick
This functionality exists internally, it's just not fully exposed to the Python API. I'll look into making that available and let you know when you can try it out.
Ostap
That would be great!
Thanks
tpetrick
That functionality is now available in the latest build of 17.5. The work item holder has a “commit” method that's available during static generation, which can be used to commit the current list of work items in the item holder to the node. These will show up in the TOPs UI as generation progress for that node. For example, the following in a static Python Processor:

import time

for i in xrange(0,10):
    item_holder.addWorkItem()
    item_holder.commit()
    time.sleep(1.5)

Without the commit, the node wouldn't show any progress until all items were generated (after about 15 seconds). By committing the items after each addWorkItem call, the TOP node badge updates with generation progress every 1.5 seconds. In both cases the badge will be in the spinning/generating state, though.

Work items are the finest granularity progress that can be reported during a long static generate, since the TOP node itself only shows progress at that granularity.
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