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>2020-12-11 19:17:39 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2021-06-18 18:56:03 +0300
commit682a74e0909ba4e669a3f282b3bc5da0ae81e4da (patch)
tree85aecf8652ddc680973a8cf9eed3a5b60b8a36d7 /source/blender/draw/engines/overlay/overlay_armature.c
parentaee04d496035c2b11b640a91b2e7eca86e878cf2 (diff)
Armature: add B-Bone Y scale channel and extra flag fields to DNA.
In addition to the base bone transformation itself, B-Bones have controls that affect transformation of its segments. For rotation the features are quite complete, allowing to both reorient the Bezier handles via properties, and to control them using custom handle bones. However for scaling there are two deficiencies. First, there are only X and Y scale factors (actually X and Z), while lengthwise all segments have the same scaling. The ease option merely affects the shape of the curve, and does not cause actual scaling. Second, scaling can only be controlled via properties, thus requiring up to 6 drivers per joint between B-Bones to transfer scaling factors from the handle bone. This is very inefficient. Finally, the Z channels are confusingly called Y. This commit adds a B-Bone Y Scale channel and extra B-Bone flag fields to DNA with appropriate versioning (including for F-Curves and drivers) in preparation to addressing these limitations. Functionality is not changed, so the new fields are not used until the following commits. Differential Revision: https://developer.blender.org/D9870
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_armature.c')
-rw-r--r--source/blender/draw/engines/overlay/overlay_armature.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c
index 2f9ececc198..cef78044fde 100644
--- a/source/blender/draw/engines/overlay/overlay_armature.c
+++ b/source/blender/draw/engines/overlay/overlay_armature.c
@@ -1167,21 +1167,18 @@ static void ebone_spline_preview(EditBone *ebone, const float result_array[MAX_B
param.roll1 = ebone->roll1;
param.roll2 = ebone->roll2;
- if (prev && (ebone->flag & BONE_ADD_PARENT_END_ROLL)) {
+ if (prev && (ebone->bbone_flag & BBONE_ADD_PARENT_END_ROLL)) {
param.roll1 += prev->roll2;
}
- param.scale_in_x = ebone->scale_in_x;
- param.scale_in_y = ebone->scale_in_y;
-
- param.scale_out_x = ebone->scale_out_x;
- param.scale_out_y = ebone->scale_out_y;
+ copy_v3_v3(param.scale_in, ebone->scale_in);
+ copy_v3_v3(param.scale_out, ebone->scale_out);
param.curve_in_x = ebone->curve_in_x;
- param.curve_in_y = ebone->curve_in_y;
+ param.curve_in_z = ebone->curve_in_z;
param.curve_out_x = ebone->curve_out_x;
- param.curve_out_y = ebone->curve_out_y;
+ param.curve_out_z = ebone->curve_out_z;
ebone->segments = BKE_pchan_bbone_spline_compute(&param, false, (Mat4 *)result_array);
}