[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11549] trunk/blender/source/blender/src/ editarmature.c: when applying size/ rotation the envelope and bone radius wasnt being scaled.
Campbell Barton
cbarton at metavr.com
Sat Aug 11 14:58:35 CEST 2007
Revision: 11549
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11549
Author: campbellbarton
Date: 2007-08-11 14:58:35 +0200 (Sat, 11 Aug 2007)
Log Message:
-----------
when applying size/rotation the envelope and bone radius wasnt being scaled.
Modified Paths:
--------------
trunk/blender/source/blender/src/editarmature.c
Modified: trunk/blender/source/blender/src/editarmature.c
===================================================================
--- trunk/blender/source/blender/src/editarmature.c 2007-08-11 12:09:09 UTC (rev 11548)
+++ trunk/blender/source/blender/src/editarmature.c 2007-08-11 12:58:35 UTC (rev 11549)
@@ -346,12 +346,17 @@
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 @@
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 */
More information about the Bf-blender-cvs
mailing list