From d21207e2e9700b4996790a0efae9b7c5207017f0 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 4 Jul 2006 12:10:37 +0000 Subject: Bug as reported on irc often: in default .B.blend a first opening of Outliner happened in Oops block view. I found this was caused by commit of of a new .B.blend in may 2005 (after 2.36, before 2.37). That file had already opened Oops views stored, which have to remain that way of course. A full cleanup of .B.blend i rather not do now, so I've added a patch in code that on read of the built-in .B.blend it sets all existing Oops windows to Outliner. And while working on it anyway, on first opening of a new Outliner, the current Scene level is opened, but showing objects closed. --- source/blender/src/outliner.c | 7 ++++-- source/blender/src/space.c | 8 +++---- source/blender/src/usiblender.c | 51 +++++++++++++++++++---------------------- 3 files changed, 32 insertions(+), 34 deletions(-) (limited to 'source') diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c index 5b47788ab64..d7d89f991d7 100644 --- a/source/blender/src/outliner.c +++ b/source/blender/src/outliner.c @@ -753,7 +753,8 @@ static void outliner_build_tree(SpaceOops *soops) Object *ob; TreeElement *te, *ten; TreeStoreElem *tselem; - + int show_opened= soops->treestore==NULL; /* on first view, we open scenes */ + outliner_free_tree(&soops->tree); outliner_storage_cleanup(soops); @@ -765,7 +766,9 @@ static void outliner_build_tree(SpaceOops *soops) for(sce= G.main->scene.first; sce; sce= sce->id.next) { te= outliner_add_element(soops, &soops->tree, sce, NULL, 0, 0); tselem= TREESTORE(te); - + if(sce==G.scene && show_opened) + tselem->flag &= ~TSE_CLOSED; + for(base= sce->base.first; base; base= base->next) { ten= outliner_add_element(soops, &te->subtree, base->object, te, 0, 0); ten->directdata= base; diff --git a/source/blender/src/space.c b/source/blender/src/space.c index a81dd32f65f..d2be9a19207 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -4539,7 +4539,7 @@ void init_v2d_oops(ScrArea *sa, SpaceOops *soops) } } -static void init_oopsspace(ScrArea *sa, int oops) +static void init_oopsspace(ScrArea *sa) { SpaceOops *soops; @@ -4547,8 +4547,8 @@ static void init_oopsspace(ScrArea *sa, int oops) BLI_addhead(&sa->spacedata, soops); soops->visiflag= OOPS_OB+OOPS_MA+OOPS_ME+OOPS_TE+OOPS_CU+OOPS_IP; - if(oops) soops->type= SO_OOPS; - else soops->type= SO_OUTLINER; + /* new oops is default an outliner */ + soops->type= SO_OUTLINER; soops->spacetype= SPACE_OOPS; soops->blockscale= 0.7; @@ -4778,7 +4778,7 @@ void newspace(ScrArea *sa, int type) else if(type==SPACE_IMASEL) init_imaselspace(sa); else if(type==SPACE_OOPS) - init_oopsspace(sa, xtra); + init_oopsspace(sa); else if(type==SPACE_ACTION) init_actionspace(sa); else if(type==SPACE_TEXT) diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index acf43d9d161..cf55883f6f2 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -69,6 +69,7 @@ #include "DNA_userdef_types.h" #include "DNA_sound_types.h" #include "DNA_scene_types.h" +#include "DNA_screen_types.h" #include "BKE_blender.h" #include "BKE_curve.h" @@ -376,6 +377,24 @@ void BIF_read_file(char *name) BIF_undo_push("Import file"); } +static void outliner_242_patch(void) +{ + ScrArea *sa; + + for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { + SpaceLink *sl= sa->spacedata.first; + for(; sl; sl= sl->next) { + if(sl->spacetype==SPACE_OOPS) { + SpaceOops *soops= (SpaceOops *)sl; + if(soops->type!=SO_OUTLINER) { + soops->type= SO_OUTLINER; + init_v2d_oops(sa, soops); + } + } + } + } +} + /* only here settings for fullscreen */ int BIF_read_homefile(void) { @@ -395,14 +414,7 @@ int BIF_read_homefile(void) tf= tf->next; } BLI_freelistN(&G.ttfdata); - -#if 0 -//#ifdef _WIN32 // FULLSCREEN - static int screenmode = -1; - - screenmode = U.uiflag & USER_FLIPFULLSCREEN; -#endif - + BLI_make_file_string(G.sce, tstr, home, ".B.blend"); strcpy(scestr, G.sce); /* temporal store */ @@ -413,30 +425,13 @@ int BIF_read_homefile(void) success = BKE_read_file(tstr, NULL); } else { success = BKE_read_file_from_memory(datatoc_B_blend, datatoc_B_blend_size, NULL); + /* outliner patch for 2.42 .b.blend */ + outliner_242_patch(); } BLI_clean(scestr); strcpy(G.sce, scestr); - -#if 0 -//#ifdef _WIN32 // FULLSCREEN - /* choose window startmode */ - switch (G.windowstate){ - case G_WINDOWSTATE_USERDEF: /* use the usersetting */ - break; - case G_WINDOWSTATE_FULLSCREEN: /* force fullscreen */ - U.uiflag |= USER_FLIPFULLSCREEN; - break; - case G_WINDOWSTATE_BORDER: /* force with borders */ - U.uiflag &= ~USER_FLIPFULLSCREEN; - } - - if(screenmode != (U.uiflag & USER_FLIPFULLSCREEN)) { - mainwindow_toggle_fullscreen ((U.uiflag & USER_FLIPFULLSCREEN)); - screenmode = (U.uiflag & USER_FLIPFULLSCREEN); - } -#endif - + space_set_commmandline_options(); init_userdef_file(); -- cgit v1.2.3