diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-09 02:07:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-09 02:07:06 +0400 |
commit | d9ce1cda94c256326d09efa69b55682bde98ea8b (patch) | |
tree | ceb0555b93092d0a48fa82025553ae12fcc31ae3 /source/blender/blenkernel/intern/blender.c | |
parent | f6abd6ee401fb19a3005c0f0b604674b026eb270 (diff) |
Python/context: python could get invalid bpy.data in scene update handler after
undo.
The way this got updated from the context is a bit unreliable, and for handlers
the update couldn't happen because there is no context passed in. Now it's
updated from setup_app_data, which is where the change actually happens. I left
in the other updates to be sure but they should not be needed anymore.
Diffstat (limited to 'source/blender/blenkernel/intern/blender.c')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index d8ae95e08e2..b2cbf0a1ce1 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -91,6 +91,10 @@ #include "WM_api.h" // XXXXX BAD, very BAD dependency (bad level call) - remove asap, elubie +#ifdef WITH_PYTHON +#include "BPY_extern.h" +#endif + Global G; UserDef U; /* ListBase = {NULL, NULL}; */ @@ -288,6 +292,11 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath G.f = bfd->globalf; +#ifdef WITH_PYTHON + /* let python know about new main */ + BPY_context_update(C); +#endif + if (!G.background) { //setscreen(G.curscreen); } |