fix for minor glitch when setting the camera in local view (camera could try to smooth view into its self).

This commit is contained in:
Campbell Barton
2011-04-30 03:36:59 +00:00
parent 3be303aa3e
commit 9b1e70140d
2 changed files with 4 additions and 1 deletions

View 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)

View 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++;}