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:
authorTon Roosendaal <ton@blender.org>2004-11-14 15:56:56 +0300
committerTon Roosendaal <ton@blender.org>2004-11-14 15:56:56 +0300
commit847ff75b359f9996c342709d69a2f82f8398fa38 (patch)
treea7e09a4b01463771b49d4c83aa2fc7cc0bd99f28 /source/blender/blenloader/intern
parenta61677f37f41c46f19dcead10de74440262cfbf8 (diff)
Bugfix in undo:
localview got stuck after an Undo command, it now restores to normal view when no localviewed objects are there. Please note again; localview is UI, so actually not saved in the undo...
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readfile.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 482ec2864fc..ae60f05b96c 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2730,12 +2730,10 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
for (sl= sa->spacedata.first; sl; sl= sl->next) {
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;
- if(v3d->scenelock) v3d->lay= sc->scene->lay;
-
if(v3d->bgpic) {
v3d->bgpic->ima= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->ima, 1);
v3d->bgpic->tex= restore_pointer_by_name(newmain, (ID *)v3d->bgpic->tex, 1);
@@ -2743,9 +2741,18 @@ void lib_link_screen_restore(Main *newmain, char mode, Scene *curscene)
v3d->bgpic->rect= NULL;
}
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;
+
+ /* 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) {
+ if(base->lay & v3d->lay) break;
+ }
+ if(base==NULL) endlocalview(sa);
}
+ else if(v3d->scenelock) v3d->lay= sc->scene->lay;
+
}
else if(sl->spacetype==SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo *)sl;