[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26783] trunk/blender/source/blender/ editors/uvedit/uvedit_unwrap_ops.c: UV project didnt use the view3d' s camera (only the scenes)
Campbell Barton
ideasman42 at gmail.com
Wed Feb 10 20:22:09 CET 2010
Revision: 26783
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26783
Author: campbellbarton
Date: 2010-02-10 20:22:09 +0100 (Wed, 10 Feb 2010)
Log Message:
-----------
UV project didnt use the view3d's camera (only the scenes)
Modified Paths:
--------------
trunk/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c
Modified: trunk/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c
===================================================================
--- trunk/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c 2010-02-10 19:14:49 UTC (rev 26782)
+++ trunk/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c 2010-02-10 19:22:09 UTC (rev 26783)
@@ -956,6 +956,7 @@
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 @@
}
/* 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 @@
}
}
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 @@
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 */
More information about the Bf-blender-cvs
mailing list