I'm a developer of SideKick ( https://vimeo.com/209455457 [vimeo.com] )
And I'm running into an issue.. if we tell Houdini to load a scene while it's cooking a sim, or when it's otherwise busy calculating a graph, Houdini just crashes.
I can't find a way using python to detect the there is a cook going on or not, any clues on how to approach this?
And second, i'd would like to get a sim's progress so I can display a progressbar in max.
[python] Check if cooking / get progress
3329 3 1- Jonathan de Blok
- Member
- 249 posts
- Joined: July 2013
- Offline
- edward
- Member
- 7694 posts
- Joined: July 2005
- Offline
I'm surprised that it let you do this as there's usually a lock taken whenever you perform scene operations from python. If you can isolate a reproducible case, please submit a bug. I would have just expected the scene load to stall until it was done cooking.
To detect when a cook is going on or not, maybe you can register an event callback via hou.ui.addEventLoopCallback() so that you only do safe work on the main thread. Cooking also occurs in response to event handling on the main thread so I would expect no cooking to be happening when inside your event loop callback.
I don't know if there's any way to hook into cook progress from python. Maybe you can have Houdini started up from an environment where HOUDINI_ERRORLOG_FILENAME and HOUDINI_ERRORLOG_LEVEL are set and then you can poll for the progress from the error log when in Max.
To detect when a cook is going on or not, maybe you can register an event callback via hou.ui.addEventLoopCallback() so that you only do safe work on the main thread. Cooking also occurs in response to event handling on the main thread so I would expect no cooking to be happening when inside your event loop callback.
I don't know if there's any way to hook into cook progress from python. Maybe you can have Houdini started up from an environment where HOUDINI_ERRORLOG_FILENAME and HOUDINI_ERRORLOG_LEVEL are set and then you can poll for the progress from the error log when in Max.
- Jonathan de Blok
- Member
- 249 posts
- Joined: July 2013
- Offline
The callback might work indeed. A repo case is a bit hard to isolate, it involves a lot of moving parts and I don't think it a bug, more case of us rudely party crashing Houdini though the backdoor while it's cooking
And on second thought.. we actually don't want to wait for the sim to stop so I guess we'll just set time to 0 and send a few virtual ‘esc’ keypresses as wait a second or so to make it stop in case it was doing anything. A bit crude but effective.
Polling the errorlog is interesting approach.. (could be used to detect if a cook is happening as well)
Thanks!
And on second thought.. we actually don't want to wait for the sim to stop so I guess we'll just set time to 0 and send a few virtual ‘esc’ keypresses as wait a second or so to make it stop in case it was doing anything. A bit crude but effective.
Polling the errorlog is interesting approach.. (could be used to detect if a cook is happening as well)
Thanks!
More code, less clicks.
- dgsantana
- Member
- 8 posts
- Joined: Aug. 2007
- Offline
-
- Quick Links