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
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')
-rw-r--r--source/blender/blenkernel/intern/armature.c12
-rw-r--r--source/blender/draw/intern/draw_armature.c6
2 files changed, 12 insertions, 6 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);
}
diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c
index a2394a6716c..a73bddf880f 100644
--- a/source/blender/draw/intern/draw_armature.c
+++ b/source/blender/draw/intern/draw_armature.c
@@ -975,12 +975,13 @@ static void ebone_spline_preview(EditBone *ebone, float result_array[MAX_BBONE_S
if (prev) {
param.use_prev = true;
- param.prev_bbone = (prev->segments > 1);
if (ebone->bbone_prev_type == BBONE_HANDLE_RELATIVE) {
zero_v3(param.prev_h);
}
else {
+ param.prev_bbone = (prev->segments > 1);
+
mul_v3_m4v3(param.prev_h, imat, prev->head);
}
@@ -992,12 +993,13 @@ static void ebone_spline_preview(EditBone *ebone, float result_array[MAX_BBONE_S
if (next) {
param.use_next = true;
- param.next_bbone = (next->segments > 1);
if (ebone->bbone_next_type == BBONE_HANDLE_RELATIVE) {
copy_v3_fl3(param.next_h, 0.0f, param.length, 0.0);
}
else {
+ param.next_bbone = (next->segments > 1);
+
mul_v3_m4v3(param.next_h, imat, next->tail);
}