diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-14 06:05:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-14 06:05:37 +0400 |
commit | 266811368b620ee6609be8c07a1d0037b244b9b1 (patch) | |
tree | d94b4bc8590306dbdcfb3ab8f6782de5a3f3bc70 /source/blender/editors/object/object_transform.c | |
parent | a9197c3aa21a5b5368e03feffd5b8d27c156b8fb (diff) |
bugfix [#21959] 'Apply rotation' to scaled object behaves wrong
Diffstat (limited to 'source/blender/editors/object/object_transform.c')
-rw-r--r-- | source/blender/editors/object/object_transform.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index d4644847a5c..1551db73e74 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -457,8 +457,18 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo object_to_mat3(ob, rsmat); else if(apply_scale) object_scale_to_mat3(ob, rsmat); - else if(apply_rot) + else if(apply_rot) { + float tmat[3][3], timat[3][3]; + + /* simple rotation matrix */ object_rot_to_mat3(ob, rsmat); + + /* correct for scale, note mul_m3_m3m3 has swapped args! */ + object_scale_to_mat3(ob, tmat); + invert_m3_m3(timat, tmat); + mul_m3_m3m3(rsmat, timat, rsmat); + mul_m3_m3m3(rsmat, rsmat, tmat); + } else unit_m3(rsmat); |