diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-10 22:22:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-10 22:22:09 +0300 |
commit | 72712b6725623889130ac136f58537fca4d83e34 (patch) | |
tree | e2f63b65aeaa5da903eddd980ab0c78d0de2caa4 /source/blender | |
parent | 111036dbc6d1f5782f38224d1f47a49a6f2bf239 (diff) |
UV project didnt use the view3d's camera (only the scenes)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 3dff61505c5..331e1d33879 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -956,6 +956,7 @@ static int from_view_exec(bContext *C, wmOperator *op) Camera *camera= NULL; EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data); ARegion *ar= CTX_wm_region(C); + View3D *v3d= CTX_wm_view3d(C); RegionView3D *rv3d= ar->regiondata; EditFace *efa; MTFace *tf; @@ -969,8 +970,8 @@ static int from_view_exec(bContext *C, wmOperator *op) } /* establish the camera object, so we can default to view mapping if anything is wrong with it */ - if ((rv3d->persp==RV3D_CAMOB) && (scene->camera) && (scene->camera->type==OB_CAMERA)) { - camera=scene->camera->data; + if ((rv3d->persp==RV3D_CAMOB) && (v3d->camera) && (v3d->camera->type==OB_CAMERA)) { + camera= v3d->camera->data; } if(RNA_boolean_get(op->ptr, "orthographic")) { @@ -989,7 +990,6 @@ static int from_view_exec(bContext *C, wmOperator *op) } } else if (camera) { - if (camera->type==CAM_PERSP) { camsize=1/tan(DEG2RAD(camera->angle)/2.0f); /* calcs ez as distance from camera plane to viewer */ } @@ -997,7 +997,7 @@ static int from_view_exec(bContext *C, wmOperator *op) camsize=camera->ortho_scale; } - if (invert_m4_m4(invmat,scene->camera->obmat)) { + if (invert_m4_m4(invmat, v3d->camera->obmat)) { copy_m4_m4(rotmat, obedit->obmat); /* also make aspect ratio adjustment factors */ |