fix for minor glitch when setting the camera in local view (camera could try to smoot...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 30 Apr 2011 03:36:59 +0000 (03:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 30 Apr 2011 03:36:59 +0000 (03:36 +0000)
source/blender/editors/space_view3d/view3d_view.c
source/blender/makesdna/DNA_scene_types.h

index 15f6fae8c71d661a1941240b4f1b409f3e7e2ad6..8a975eec40f1b088d353102c703c665f2ef0f60a 100644 (file)
@@ -472,7 +472,7 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *UNUSED(op))
        Object *ob = CTX_data_active_object(C);
 
        if(ob) {
-               Object *camera_old= (rv3d->persp == RV3D_CAMOB && scene->camera) ? scene->camera : NULL;
+               Object *camera_old= (rv3d->persp == RV3D_CAMOB) ? V3D_CAMERA_SCENE(scene, v3d) : NULL;
                rv3d->persp= RV3D_CAMOB;
                v3d->camera= ob;
                if(v3d->scenelock)
index b15860682209f55244a1a87c30105efe3df40c9f..b3d66e61f3db92196f7bf4276824c171bba44a44 100644 (file)
@@ -1053,6 +1053,9 @@ typedef struct Scene {
 #define BASACT                 (scene->basact)
 #define OBACT                  (BASACT? BASACT->object: NULL)
 
+#define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL)
+#define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
+
 #define ID_NEW(a)              if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
 #define ID_NEW_US(a)   if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;}
 #define ID_NEW_US2(a)  if( ((ID *)a)->newid) {(a)= ((ID *)a)->newid; ((ID *)a)->us++;}