diff options
author | Martin Poirier <theeth@yahoo.com> | 2008-11-14 01:35:40 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2008-11-14 01:35:40 +0300 |
commit | dc4ef17eea1a0dba1e9b9e99970005a394b1d37d (patch) | |
tree | f754f74d3c629e3cd77656a19d5850c4c55d99b3 /source/blender/include | |
parent | e76f7e793064f72557a8148b8c8cbf748cdaf152 (diff) |
==Armature==
Fix the roll mess in transform. Since roll is based on an automatically calculated up axis, transforming bones would mess up bone orientation. This code automatically adjusts the roll value to keep bone orientation as consistant as possible. That works all around in transform for all transformations.
Doesn't work with x-axis mirror though as that doesn't use transform elements (fixing it would be nice for later)
Most interesting is that it works with the mirror tool (obviously), so you don't have to fix all the rolls after mirroring one side of an armature.
It could be made an option if someone presents a good enough point for that, but I can't see why you'd want the previous mess instead.
NB: this also ports a utility fonction from etch-a-ton to set bone roll from an up axis.
Diffstat (limited to 'source/blender/include')
-rw-r--r-- | source/blender/include/BIF_editarmature.h | 2 | ||||
-rw-r--r-- | source/blender/include/transform.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h index 02d73680818..ce275563a87 100644 --- a/source/blender/include/BIF_editarmature.h +++ b/source/blender/include/BIF_editarmature.h @@ -68,6 +68,8 @@ typedef struct EditBone } EditBone; +float rollBoneToVector(EditBone *bone, float new_up_axis[3]); + void make_boneList(struct ListBase *list, struct ListBase *bones, EditBone *parent); void editbones_to_armature (struct ListBase *list, struct Object *ob); diff --git a/source/blender/include/transform.h b/source/blender/include/transform.h index bd91bf8100a..fa7b8fc0a19 100644 --- a/source/blender/include/transform.h +++ b/source/blender/include/transform.h @@ -160,7 +160,7 @@ typedef struct TransData { TransDataExtension *ext; /* for objects, poses. 1 single malloc per TransInfo! */ TransDataIpokey *tdi; /* for objects, ipo keys. per transdata a malloc */ TransDataCurveHandleFlags *hdata; /* for curves, stores handle flags for modification/cancel */ - void *tdmir; /* mirrored element pointer, in editmode mesh to EditVert */ + void *extra; /* extra data (mirrored element pointer, in editmode mesh to EditVert) (editbone for roll fixing) (...) */ short flag; /* Various flags */ short protectflag; /* If set, copy of Object or PoseChannel protection */ /*#ifdef WITH_VERSE*/ |