Timeline for How to catch and respond to a scene addition event?
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 21, 2020 at 13:13 | comment | added | lemon | @QuentinWalker, you can fire a timer only once from poll, just in order to allow your code to modify the scene as you need. So no recurrent timer calls. | |
Dec 21, 2020 at 13:07 | comment | added | Quentin Walker | @lemon Yes, I'll throw together a recurring timer check against scene properties to trigger UI refreshes. I'd prefer something more aligned with the handler and msgbus systems but at least I know that it's not failing because of my own ignorance. Which makes a nice change for me. Thanks again for your help! | |
Dec 21, 2020 at 11:17 | comment | added | lemon | Quentin, what proposed @ChrisHayes works. Don't you have some scene properties to rely on in order to trigerr a timer? | |
Dec 20, 2020 at 22:43 | comment | added | Quentin Walker | @Chris Thanks, appreciate the input. I've done something similar in other projects with pooled resources being setup in bulk beforehand and assigned/released dynamically upon demand. In this use case leveraging poll methods to show/suppress panels. But then we're into the complexity of pool management and operator reassignment(?!). There used to be exposed handlers for scene_update and depsgraph_build events in previous version of the API so why these are no longer available and now require hacks on top of workarounds on top of kludges escapes me. Meh! Thanks for your encouragement anyway! :) | |
Dec 20, 2020 at 21:08 | comment | added | Chris Hayes |
This is super hacky and not a direct answer to your question, but I've worked around similar things in the past by registering more panels than I need, and using the poll method to hide the extras. The other thing I've done, as you mentioned, is using a timer. Unfortunately I've never worked with scene handlers so I can't offer anything better.
|
|
Dec 20, 2020 at 17:09 | comment | added | Quentin Walker | @Daurte Thanks, but my question wasn't about custom event handling. Put simply, why isn't the dependency graph update triggered when a scene is added? I believe the depsgraph_build handler used to be exposed in a previous version of blender, and that would have been perfect for my use case, but that's not available. Do you have any constructive advice? | |
Dec 20, 2020 at 17:04 | history | edited | Quentin Walker | CC BY-SA 4.0 |
added 1044 characters in body
|
Dec 20, 2020 at 16:59 | comment | added | Quentin Walker |
@lemon The add-on creates panels in the 3D view sidebar at runtime by registering panels with bl_context = 'objectmode' sub-classed from an unregistered 'template' panel
|
|
Dec 20, 2020 at 16:54 | comment | added | Duarte Farrajota Ramos♦ | blender.stackexchange.com/questions/13569 | |
Dec 20, 2020 at 16:34 | history | edited | Quentin Walker | CC BY-SA 4.0 |
added 41 characters in body
|
Dec 20, 2020 at 16:33 | comment | added | lemon | What is the bl_context of your addon? It should draw or poll if the scene changes, i think. | |
Dec 20, 2020 at 15:44 | history | asked | Quentin Walker | CC BY-SA 4.0 |