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
path: root/source
diff options
context:
space:
mode:
authorDiego Borghetti <bdiego@gmail.com>2010-06-18 19:23:39 +0400
committerDiego Borghetti <bdiego@gmail.com>2010-06-18 19:23:39 +0400
commit000d23e05ced975fa28c87e78b446624c6992e67 (patch)
treeba399d43bcd60c63f31ea387198f7be43803cf53 /source
parentfe3d388af2ad033f6375acb6d069265af281d352 (diff)
Fix #22625
My fix for #22317 make that every time you delete an object, blender go to perspective view, fixed now.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/object.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 972c07eb272..10c94ed1eeb 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -337,7 +337,7 @@ void unlink_object(Scene *scene, Object *ob)
ModifierData *md;
ARegion *ar;
RegionView3D *rv3d;
- int a;
+ int a, found;
unlink_controllers(&ob->controllers);
unlink_actuators(&ob->actuators);
@@ -609,27 +609,36 @@ void unlink_object(Scene *scene, Object *ob)
while(sa) {
SpaceLink *sl;
- if (sa->spacetype == SPACE_VIEW3D) {
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
- if (ar->regiontype==RGN_TYPE_WINDOW) {
- rv3d= (RegionView3D *)ar->regiondata;
- if (rv3d->persp == RV3D_CAMOB)
- rv3d->persp= RV3D_PERSP;
- if (rv3d->localvd && rv3d->localvd->persp == RV3D_CAMOB)
- rv3d->localvd->persp= RV3D_PERSP;
- }
- }
- }
-
for (sl= sa->spacedata.first; sl; sl= sl->next) {
if(sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
+ found= 0;
if(v3d->camera==ob) {
v3d->camera= NULL;
+ found= 1;
}
if(v3d->localvd && v3d->localvd->camera==ob ) {
v3d->localvd->camera= NULL;
+ found += 2;
+ }
+
+ if (found) {
+ if (sa->spacetype == SPACE_VIEW3D) {
+ for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ if (ar->regiontype==RGN_TYPE_WINDOW) {
+ rv3d= (RegionView3D *)ar->regiondata;
+ if (found == 1 || found == 3) {
+ if (rv3d->persp == RV3D_CAMOB)
+ rv3d->persp= RV3D_PERSP;
+ }
+ if (found == 2 || found == 3) {
+ if (rv3d->localvd && rv3d->localvd->persp == RV3D_CAMOB)
+ rv3d->localvd->persp= RV3D_PERSP;
+ }
+ }
+ }
+ }
}
}
else if(sl->spacetype==SPACE_OUTLINER) {