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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-10-05 12:35:59 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-10-05 13:29:05 +0300
commit3c0736bc4b88bd4081ab25e2bd99908fb549ded1 (patch)
tree62f782d942a8e20fb32962f7341692477cd1ac19 /source/blender/blenkernel/intern/armature.c
parent8ce5f015dc0571c8c83ac046936dfaa874915662 (diff)
Redefine the Relative custom B-Bone handle type to be more reasonable.
Specifically, it should always use the position of the custom handle bone head, even when affecting the handle at the tail of the main bone, and shouldn't apply the special handling for joining two B-Bones. This handle type was unusably broken before a bug fix included in recent changes, so it should be safe to break backward compatibility.
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 5ffb38414a8..91661f0a4e3 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -508,7 +508,6 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB
bool done = false;
param.use_prev = true;
- param.prev_bbone = (prev->bone->segments > 1);
/* Transform previous point inside this bone space. */
if (bone->bbone_prev_type == BBONE_HANDLE_RELATIVE) {
@@ -525,6 +524,9 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB
}
}
else {
+ /* Apply special handling for smoothly joining B-Bone chains */
+ param.prev_bbone = (prev->bone->segments > 1);
+
/* Use bone head as absolute position. */
copy_v3_v3(h1, rest ? prev->bone->arm_head : prev->pose_head);
}
@@ -544,23 +546,25 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB
bool done = false;
param.use_next = true;
- param.next_bbone = (next->bone->segments > 1);
/* Transform next point inside this bone space. */
if (bone->bbone_next_type == BBONE_HANDLE_RELATIVE) {
/* Use delta movement (from restpose), and apply this relative to the current bone's tail. */
if (rest) {
- /* In restpose, arm_tail == pose_tail */
+ /* In restpose, arm_head == pose_head */
copy_v3_fl3(param.next_h, 0.0f, param.length, 0.0);
done = true;
}
else {
float delta[3];
- sub_v3_v3v3(delta, next->pose_tail, next->bone->arm_tail);
+ sub_v3_v3v3(delta, next->pose_head, next->bone->arm_head);
add_v3_v3v3(h2, pchan->pose_tail, delta);
}
}
else {
+ /* Apply special handling for smoothly joining B-Bone chains */
+ param.next_bbone = (next->bone->segments > 1);
+
/* Use bone tail as absolute position. */
copy_v3_v3(h2, rest ? next->bone->arm_tail : next->pose_tail);
}