diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-07-09 05:48:08 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-07-09 05:48:08 +0400 |
commit | 304cbc09ab5027893bbc0b96b17f84b6f03fdb85 (patch) | |
tree | 059c7d3d29b7cd34f35da0216866c544eec4b8ee /source/blender/editors/armature/editarmature_generate.c | |
parent | 93428ff82a7cc53e6f684f3607306b213f1b954c (diff) |
Cosmetic changes in etch-a-ton drawing code, mostly.
Diffstat (limited to 'source/blender/editors/armature/editarmature_generate.c')
-rw-r--r-- | source/blender/editors/armature/editarmature_generate.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c index 6d271375c64..6c0eab16af0 100644 --- a/source/blender/editors/armature/editarmature_generate.c +++ b/source/blender/editors/armature/editarmature_generate.c @@ -285,6 +285,8 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase * EditBone *lastBone = NULL; EditBone *child = NULL; EditBone *parent = NULL; + float *normal = NULL; + float size_buffer = 1.2; int bone_start = 0; int end = iter->length; int index; @@ -294,6 +296,13 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase * parent = addEditBone(arm, "Bone"); VECCOPY(parent->head, iter->p); + if (iter->size > 0) + { + parent->rad_head = iter->size * size_buffer; + } + + normal = iter->no; + index = next_subdividion(toolsettings, iter, bone_start, end, parent->head, parent->tail); while (index != -1) { @@ -304,21 +313,33 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase * child->parent = parent; child->flag |= BONE_CONNECTED; + if (iter->size > 0) + { + child->rad_head = iter->size * size_buffer; + parent->rad_tail = iter->size * size_buffer; + } + /* going to next bone, fix parent */ Mat4MulVecfl(invmat, parent->tail); Mat4MulVecfl(invmat, parent->head); - setBoneRollFromNormal(parent, iter->no, invmat, tmat); + setBoneRollFromNormal(parent, normal, invmat, tmat); parent = child; // new child is next parent bone_start = index; // start next bone from current index + normal = iter->no; /* use normal at head, not tail */ + index = next_subdividion(toolsettings, iter, bone_start, end, parent->head, parent->tail); } iter->tail(iter); VECCOPY(parent->tail, iter->p); - + if (iter->size > 0) + { + parent->rad_tail = iter->size * size_buffer; + } + /* fix last bone */ Mat4MulVecfl(invmat, parent->tail); Mat4MulVecfl(invmat, parent->head); |