diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2021-06-15 13:51:19 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2021-06-18 18:56:04 +0300 |
commit | b6030711a24f154de9c1c7287cf91d3cde3721c8 (patch) | |
tree | c40bde218083bb8134a50da182224487fdf4866b /source/blender/draw | |
parent | 638c16f41010d716a3ee47017eb0155044dd825a (diff) |
Armature: add automatic B-Bone Scale toggles.
Currently B-Bone scaling can only be controlled via their
properties, thus requiring up to 8 drivers per joint between
B-Bones to transfer scaling factors from the handle bone.
A Scale Easing option is added to multiply the easing value
by the Y scale channels to synchronize them - this produces a
natural scaling effect where both the shape of the curve and
the scale is affected.
In addition, four toggles are added for each handle, which
multiply each of the X, Y, Z and Ease values by the matching
Local Scale channel of the handle bone, thus replacing trivial
drivers. The Scale Easing option has no effect on this process
since it's easy to just enable both Length and Ease buttons.
Differential Revision: https://developer.blender.org/D9870
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_armature.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index cef78044fde..ea636c3d185 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -1180,6 +1180,16 @@ static void ebone_spline_preview(EditBone *ebone, const float result_array[MAX_B param.curve_out_x = ebone->curve_out_x; param.curve_out_z = ebone->curve_out_z; + if (ebone->bbone_flag & BBONE_SCALE_EASING) { + param.ease1 *= param.scale_in[1]; + param.curve_in_x *= param.scale_in[1]; + param.curve_in_z *= param.scale_in[1]; + + param.ease2 *= param.scale_out[1]; + param.curve_out_x *= param.scale_out[1]; + param.curve_out_z *= param.scale_out[1]; + } + ebone->segments = BKE_pchan_bbone_spline_compute(¶m, false, (Mat4 *)result_array); } |