diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-08-11 16:58:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-08-11 16:58:35 +0400 |
commit | bd5e0a92461851b8166a8abddc03f287a1d4319c (patch) | |
tree | d3db5abd8bc45188f5365d04b3e32db4f6dbfd65 /source/blender/src | |
parent | bd1db9545283abb5f227ef8f5513dbb85ba26029 (diff) |
when applying size/rotation the envelope and bone radius wasnt being scaled.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/editarmature.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 8eb127902f0..0376f904fe9 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -346,12 +346,17 @@ void apply_rot_armature (Object *ob, float mat[3][3]) ListBase list; EditBone *ebone; bArmature *arm; - + float scale; /* store the scale of the matrix here to use on envelopes */ arm = get_armature(ob); - if (!arm) + if (!arm) { return; - + } else { + float tmp[3] = {1.0, 1.0, 1.0}; + Mat3MulVecfl(mat, tmp); + scale = (fabs(tmp[0]) + fabs(tmp[1]) + fabs(tmp[2])) / 3.0f; + } + /* Put the armature into editmode */ list.first= list.last = NULL; make_boneList(&list, &arm->bonebase, NULL); @@ -360,6 +365,10 @@ void apply_rot_armature (Object *ob, float mat[3][3]) for (ebone = list.first; ebone; ebone=ebone->next){ Mat3MulVecfl(mat, ebone->head); Mat3MulVecfl(mat, ebone->tail); + + ebone->rad_head *= scale; + ebone->rad_tail *= scale; + ebone->dist *= scale; } /* Turn the list into an armature */ |