Long `onGenerate` callback

   1913   3   0
User Avatar
Member
209 posts
Joined: 11月 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
User Avatar
スタッフ
585 posts
Joined: 5月 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
209 posts
Joined: 11月 2010
Offline
That would be great!
Thanks
User Avatar
スタッフ
585 posts
Joined: 5月 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 - 2019年5月27日 11:30:45
  • Quick Links