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>2010-10-14 06:05:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-14 06:05:37 +0400
commit266811368b620ee6609be8c07a1d0037b244b9b1 (patch)
treed94b4bc8590306dbdcfb3ab8f6782de5a3f3bc70 /source
parenta9197c3aa21a5b5368e03feffd5b8d27c156b8fb (diff)
bugfix [#21959] 'Apply rotation' to scaled object behaves wrong
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/object_transform.c12
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);