Hey all, I'm trying to get a script to run when Houdini is fully loaded. I'm aware of 123.py, but the issue is my script to run is a dialog that locks up the process until the user finalizes it.
The dialog ends up being executed as the splash screen is still in effect and therefore gets hidden behind it. Is there a callback I can hook into instead that would occur when Houdini is completely loaded?
Thanks!
Python event callback when Houdini fully loaded
5829 5 2- sashaouellet
- Member
- 14 posts
- Joined: 5月 2017
- Offline
- Enivob
- Member
- 2558 posts
- Joined: 6月 2008
- Offline
Check out the docs.
http://www.sidefx.com/docs/houdini/hom/locations.html#events [www.sidefx.com]
http://www.sidefx.com/docs/houdini/hom/hou/hipFile.html#addEventCallback [www.sidefx.com]
The event type you probably want is .AfterLoad.
http://www.sidefx.com/docs/houdini/hom/hou/hipFileEventType.html [www.sidefx.com]
http://www.sidefx.com/docs/houdini/hom/locations.html#events [www.sidefx.com]
http://www.sidefx.com/docs/houdini/hom/hou/hipFile.html#addEventCallback [www.sidefx.com]
The event type you probably want is .AfterLoad.
http://www.sidefx.com/docs/houdini/hom/hou/hipFileEventType.html [www.sidefx.com]
Edited by Enivob - 2017年11月27日 16:50:40
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
- sashaouellet
- Member
- 14 posts
- Joined: 5月 2017
- Offline
Enivob
Check out the docs.
http://www.sidefx.com/docs/houdini/hom/locations.html#events [www.sidefx.com]
http://www.sidefx.com/docs/houdini/hom/hou/hipFile.html#addEventCallback [www.sidefx.com]
The event type you probably want is .AfterLoad.
http://www.sidefx.com/docs/houdini/hom/hou/hipFileEventType.html [www.sidefx.com]
Thanks, but I've taken a look at these docs. AfterLoad triggers after a .hip is loaded, but I need an event that occurs after initial startup, once the UI is 100% ready to go. As I've stated, 123.py triggers too early while Houdini is still loading everything.
- bonsak
- Member
- 459 posts
- Joined: 10月 2011
- Offline
- sashaouellet
- Member
- 14 posts
- Joined: 5月 2017
- Offline
The solution is to use the hdefereval module and pass the callback to executeDeferred, which will execute when the main event loop is idle.
import hdefereval # A function that needs the UI to be fully available (i.e. for desktop manipulation) def functionToExecuteOnStartup(): print 'foobar' hdefereval.executeDeferred(functionToExecuteOnStartup)
Edited by sashaouellet - 2017年12月4日 14:05:04
- Mat Suarez
- Member
- 16 posts
- Joined: 12月 2014
- Offline
-
- Quick Links