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
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2012-12-22 15:08:25 +0400
committerTon Roosendaal <ton@blender.org>2012-12-22 15:08:25 +0400
commit39a6af35f5d309c54477edcf8eaad02633ea4c71 (patch)
treee97c06ef25e12585344760463f22198f5725d1f1 /source/blender/blenkernel/intern/object.c
parentbabbed1adc4995116ef01d8be3b3f1407d0d24db (diff)
Small tweak in the new "Relative Parent" option for Bones that have Object-children:
- Transform now is relative to the bone root. For backwards compatibility this transform was set to the tip for parenting... Now the new parenting option uses the root, the old one still the tip. I've noted in the code to check on a version patch, to make it consistent.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 8826f86d72a..9a54e091524 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1839,15 +1839,19 @@ static void ob_parbone(Object *ob, Object *par, float mat[4][4])
}
/* get bone transform */
- if (pchan->bone->flag & BONE_RELATIVE_PARENTING)
+ if (pchan->bone->flag & BONE_RELATIVE_PARENTING) {
+ /* the new option uses the root - expected bahaviour, but differs from old... */
+ /* XXX check on version patching? */
copy_m4_m4(mat, pchan->chan_mat);
- else
+ }
+ else {
copy_m4_m4(mat, pchan->pose_mat);
- /* but for backwards compatibility, the child has to move to the tail */
- copy_v3_v3(vec, mat[1]);
- mul_v3_fl(vec, pchan->bone->length);
- add_v3_v3(mat[3], vec);
+ /* but for backwards compatibility, the child has to move to the tail */
+ copy_v3_v3(vec, mat[1]);
+ mul_v3_fl(vec, pchan->bone->length);
+ add_v3_v3(mat[3], vec);
+ }
}
static void give_parvert(Object *par, int nr, float vec[3])