Bugfix #2875
authorTon Roosendaal <ton@blender.org>
Thu, 28 Jul 2005 11:05:21 +0000 (11:05 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 28 Jul 2005 11:05:21 +0000 (11:05 +0000)
Removed old code that was used when the global undo still saved files. It
was restoring pointers in the UI based on names, which gave confusing
results when loading the quit.blend file (actually undobuffer).
Instead it should treat the quit.blend same as "Load without UI" option.

source/blender/blenkernel/intern/blender.c
source/blender/blenloader/intern/readfile.c
source/blender/src/buttons_editing.c

index a235475c8aa6ba6880895c9c3bcaa3fefa9d9b7b..f439a124460d6bd08b6ab8957304d4561b3226d5 100644 (file)
@@ -320,7 +320,7 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
        /* no load screens? */
        if(mode) {
                /* comes from readfile.c */
-               extern void lib_link_screen_restore(Main *, char, Scene *);
+               extern void lib_link_screen_restore(Main *, Scene *);
                
                SWAP(ListBase, G.main->screen, bfd->main->screen);
                
@@ -333,7 +333,7 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
                curscreen->scene= curscene;
 
                /* clear_global will free G.main, here we can still restore pointers */
-               lib_link_screen_restore(bfd->main, mode, curscene);
+               lib_link_screen_restore(bfd->main, curscene);
        }
        
        clear_global();
index 6bf63c2b2b7fd9aefb5bd30dacf4732643a4683d..738a928379b79884f4bda0ba0fb968b31b3abab2 100644 (file)
@@ -239,7 +239,6 @@ typedef struct OldNewMap {
 
 
 /* local prototypes */
-void lib_link_screen_restore(Main *, char , Scene *);
 extern          short freeN(void *vmemh); /* defined in util.h */  
 
 
@@ -2824,16 +2823,16 @@ static void *restore_pointer_by_name(Main *mainp, ID *id, int user)
 }
 
 /* called from kernel/blender.c */
-void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
+/* used to link a file (without UI) to the current UI */
+void lib_link_screen_restore(Main *newmain, Scene *curscene)
 {
        bScreen *sc;
        ScrArea *sa;
 
        sc= newmain->screen.first;
        while(sc) {
-
-               if(mode=='u') sc->scene= restore_pointer_by_name(newmain, (ID *)sc->scene, 1);
-               if(sc->scene==NULL || mode=='n') sc->scene= curscene;
+               
+               sc->scene= curscene;
 
                sa= sc->areabase.first;
                while(sa) {
@@ -2843,8 +2842,7 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
                                if(sl->spacetype==SPACE_VIEW3D) {
                                        View3D *v3d= (View3D*) sl;
                                        
-                                       if(mode=='u') v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera, 1);
-                                       if(v3d->camera==NULL || mode=='n') v3d->camera= sc->scene->camera;
+                                       v3d->camera= sc->scene->camera;
                                        
                                        if(v3d->bgpic) {
                                                v3d->bgpic->ima= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->ima, 1);
@@ -2854,8 +2852,8 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
                                        }
                                        if(v3d->localvd) {
                                                Base *base;
-                                               if(mode=='u') v3d->localvd->camera= restore_pointer_by_name(newmain, (ID *)v3d->localvd->camera, 1);
-                                               if(v3d->localvd->camera==NULL || mode=='n') v3d->localvd->camera= sc->scene->camera;
+
+                                               v3d->localvd->camera= sc->scene->camera;
                                                
                                                /* localview can become invalid during undo/redo steps, so we exit it when no could be found */
                                                for(base= sc->scene->base.first; base; base= base->next) {
index bfedf5218a98d80fd35b5c81dcaf36c842e41658..e17a59821f9bb49c0dd394cb2c4f1864a3b4d8a3 100644 (file)
@@ -1679,7 +1679,7 @@ static void editing_panel_pose_bones(Object *ob, bArmature *arm)
                        
                        uiBlockEndAlign(block);
                        
-                       by-=42;
+                       by-=60;
                        if(by < -200) break;    // for time being... extreme long panels are very slow
                }
        }