Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-01-06 21:32:20 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-01-06 21:32:20 +0400
commit491fe9df19714d9373614cb71b68dc98116380e4 (patch)
treed6fc8e2713ce02de7f63f22d5976ac4a2a05b692 /source/blender/makesrna/intern/rna_screen.c
parent5ba14fd210355e0bbff7746cdc58ec96b7a489de (diff)
Fix #29568: Blender restores deleted scene
Special notifiers used for scene deletion which lead to undo pushes after SCENE_OT_delete operator happening with scene still present in the mainfile. That was a reason why operator redo used to restore scene. It's not so obvious why special notifier type is needed for scene set and deletion -- it confuses undo system without having some obvious advantages. Using "direct" scene deletion and setting seems to be working fine so let's see if there'll be some issues with this.
Diffstat (limited to 'source/blender/makesrna/intern/rna_screen.c')
-rw-r--r--source/blender/makesrna/intern/rna_screen.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index c8792ef30f3..fa1f6c72430 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -54,6 +54,7 @@ EnumPropertyItem region_type_items[] = {
#ifdef RNA_RUNTIME
+#include "BKE_global.h"
static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
{
@@ -62,7 +63,6 @@ static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
if(value.data == NULL)
return;
- /* exception: can't set screens inside of area/region handers */
sc->newscene= value.data;
}
@@ -70,10 +70,14 @@ static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
{
bScreen *sc= (bScreen*)ptr->data;
- /* exception: can't set screens inside of area/region handers, and must
- use context so notifier gets to the right window */
+ /* exception: must use context so notifier gets to the right window */
if(sc->newscene) {
+ ED_screen_set_scene(C, sc->newscene);
WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene);
+
+ if(G.f & G_DEBUG)
+ printf("scene set %p\n", sc->newscene);
+
sc->newscene= NULL;
}
}