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>2015-08-26 13:41:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-26 13:42:26 +0300
commitfed0448f920aa85245c8762c6e4abc79ecc046d8 (patch)
tree9b5a72a9a7ab46f1f1f597e855670e2787a63d84 /source
parent6ca12d157fbfdf1a71a06a87fb5f258ae98ebe02 (diff)
Fix for error in recent smooth-view commit
Was assuming there was a camera
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 3fc415ed21b..811eb7e731e 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -3768,6 +3768,8 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar,
{
RegionView3D *rv3d = ar->regiondata; /* no NULL check is needed, poll checks */
float quat[4];
+ const short orig_persp = rv3d->persp;
+
normalize_qt_qt(quat, quat_);
@@ -3810,11 +3812,13 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar,
}
if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
+ /* to camera */
ED_view3d_smooth_view(C, v3d, ar, v3d->camera, NULL,
rv3d->ofs, quat, NULL, NULL,
smooth_viewtx);
}
- else {
+ else if (orig_persp == RV3D_CAMOB && v3d->camera) {
+ /* from camera */
float ofs[3], dist;
copy_v3_v3(ofs, rv3d->ofs);
@@ -3827,7 +3831,12 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar,
ofs, quat, &dist, NULL,
smooth_viewtx);
}
-
+ else {
+ /* no camera involved */
+ ED_view3d_smooth_view(C, v3d, ar, NULL, NULL,
+ NULL, quat, NULL, NULL,
+ smooth_viewtx);
+ }
}
static int viewnumpad_exec(bContext *C, wmOperator *op)