Long `onGenerate` callback

   190   3   0
User Avatar
Member
92 posts
Joined: Nov. 2010
Offline
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
Ostap Pochtarenko
User Avatar
Staff
174 posts
Joined: May 2014
Offline
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.
User Avatar
Member
92 posts
Joined: Nov. 2010
Offline
That would be great!
Thanks
Ostap Pochtarenko
User Avatar
Staff
174 posts
Joined: May 2014
Offline
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.
Edited by tpetrick - May 27, 2019 11:30:45
  • Quick Links