diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-12 18:25:08 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-12 18:25:08 +0400 |
commit | 22230ced410a35a3b28f760794f365fc07bde4d6 (patch) | |
tree | 09f2f9e5f8716aa38b008a6304e997b9dbcc601a /source | |
parent | 27097d137316eb4e155d934272a538775c614739 (diff) |
Fix #34961: camera fly mode would reset camera scale.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_fly.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 2cedf7da725..1720a98c54d 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -735,12 +735,17 @@ static void flyMoveCamera(bContext *C, RegionView3D *rv3d, FlyInfo *fly, float prev_view_imat[4][4]; float diff_mat[4][4]; float parent_mat[4][4]; + float size_mat[4][4]; ED_view3d_to_m4(prev_view_mat, fly->rv3d->ofs, fly->rv3d->viewquat, fly->rv3d->dist); invert_m4_m4(prev_view_imat, prev_view_mat); ED_view3d_to_m4(view_mat, rv3d->ofs, rv3d->viewquat, rv3d->dist); mult_m4_m4m4(diff_mat, view_mat, prev_view_imat); mult_m4_m4m4(parent_mat, diff_mat, fly->root_parent->obmat); + + size_to_mat4(size_mat, fly->root_parent->size); + mult_m4_m4m4(parent_mat, parent_mat, size_mat); + BKE_object_apply_mat4(fly->root_parent, parent_mat, true, false); // BKE_object_where_is_calc(scene, fly->root_parent); @@ -755,8 +760,14 @@ static void flyMoveCamera(bContext *C, RegionView3D *rv3d, FlyInfo *fly, } else { float view_mat[4][4]; + float size_mat[4][4]; + ED_view3d_to_m4(view_mat, rv3d->ofs, rv3d->viewquat, rv3d->dist); + size_to_mat4(size_mat, v3d->camera->size); + mult_m4_m4m4(view_mat, view_mat, size_mat); + BKE_object_apply_mat4(v3d->camera, view_mat, true, false); + id_key = &v3d->camera->id; } |