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:
authorCampbell Barton <ideasman42@gmail.com>2011-05-15 07:07:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-15 07:07:07 +0400
commit36bec40fbcf036acccb3e0541f5328a3266c7010 (patch)
treedc7407e20dd560669fb3c81a98e98f0bb01d600e /source
parentbaa64d17516c444e777b06850b459fd965dc741f (diff)
fix for bug with camera locking, view dolly and rotate with 'about selection' preference enabled would offset the camera.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 6d145bcc6a3..01d89e6d84b 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -360,6 +360,11 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
vod->ar= CTX_wm_region(C);
vod->v3d= vod->sa->spacedata.first;
vod->rv3d= rv3d= vod->ar->regiondata;
+
+ /* set the view from the camera, if view locking is enabled.
+ * we may want to make this optional but for now its needed always */
+ ED_view3d_camera_lock_init(vod->v3d, vod->rv3d);
+
vod->dist0= rv3d->dist;
copy_qt_qt(vod->oldquat, rv3d->viewquat);
vod->origx= vod->oldx= event->x;
@@ -797,8 +802,6 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_PASS_THROUGH;
}
- ED_view3d_camera_lock_init(vod->v3d, vod->rv3d);
-
/* switch from camera view when: */
if(rv3d->persp != RV3D_PERSP) {
@@ -993,11 +996,8 @@ static int viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* makes op->customdata */
viewops_data_create(C, op, event);
-
vod= op->customdata;
- ED_view3d_camera_lock_init(vod->v3d, vod->rv3d);
-
if (event->type == MOUSEPAN) {
viewmove_apply(vod, event->prevx, event->prevy);
request_depth_update(vod->rv3d);
@@ -1308,8 +1308,6 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
viewops_data_create(C, op, event);
vod= op->customdata;
- ED_view3d_camera_lock_init(vod->v3d, vod->rv3d);
-
/* if one or the other zoom position aren't set, set from event */
if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my"))
{
@@ -1515,11 +1513,8 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* makes op->customdata */
viewops_data_create(C, op, event);
-
vod= op->customdata;
- ED_view3d_camera_lock_init(vod->v3d, vod->rv3d);
-
/* if one or the other zoom position aren't set, set from event */
if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my"))
{