Fix #21577: incorrect camera selected when loading file without UI.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 6 Apr 2010 01:18:52 +0000 (01:18 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 6 Apr 2010 01:18:52 +0000 (01:18 +0000)
source/blender/blenloader/intern/readfile.c

index dcd7d9d0dab11d81d6c6516c26925e1ce01bb235..1f6d36dc95710cacf469cbd93e4ee0ff988f2e29 100644 (file)
@@ -4757,7 +4757,10 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
                                        View3D *v3d= (View3D*) sl;
                                        BGpic *bgpic;
                                        
                                        View3D *v3d= (View3D*) sl;
                                        BGpic *bgpic;
                                        
-                                       v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera, 1);
+                                       if(v3d->scenelock)
+                                               v3d->camera= NULL; /* always get from scene */
+                                       else
+                                               v3d->camera= restore_pointer_by_name(newmain, (ID *)v3d->camera, 1);
                                        if(v3d->camera==NULL)
                                                v3d->camera= sc->scene->camera;
                                        v3d->ob_centre= restore_pointer_by_name(newmain, (ID *)v3d->ob_centre, 1);
                                        if(v3d->camera==NULL)
                                                v3d->camera= sc->scene->camera;
                                        v3d->ob_centre= restore_pointer_by_name(newmain, (ID *)v3d->ob_centre, 1);