I work mostly with video, and often need to edit multiple scenes in the same file. For example, I might want to have two or three video clips in compositor tabs, then edit the composite outputs in individual video sequencer scenes, and then combine the edited sequences into a final render. So, I often have to switch tabs and then immediately switch scenes. It would be nice if the tabs could just each be associated with a scene.
I’m pretty good with python, but I’m a little lost in the blender API. Is there anything I can hook into to be notified when the tab changes, so that I can trigger the scene change? Also, is it even possible to switch the current scene from python?
Sorry if this is a total newbie question. Doing it manually doesn’t show anything in the info window, and my google/grep skills are coming up a bit short.
Afaik the subscription lasts until you load a new file. If you want it to persist between files, you can write a function which reapplies the callback and append it to bpy.app.handlers.load_post. Handlers are interfaced as lists.
As for where to store the subscribe handle, python is persistent between files, so should be fine to store it in modules, classes, etc. In the example I’ve been using bpy._handle because I’m lazy, but it would make sense to store it somewhere in your future addon module.
Aha! If the rule is the workspace only allows runtime properties, then I guess there’s a documentation bug, but it feels more like a bug bug.
Basically, for each workspace (or at least some workspaces), I want to store the scene it’s associated with, so that when I switch back to that workspace, it switches the current scene… Then I’ll be able to have a tab at the top for each scene.
If storing it on the screen rather than the workspace itself is the way to do that, then so be it. Thanks!
I’ve read the window manager at least is supposed to not save its properties. When a custom property is changed through the ui, blender pushes an undo if the property is stored in a serializable location. Some addons however leverage the fact that the window manager doesn’t store the properties, in order to avoid pushing an undo.