diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-12-11 19:17:39 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2021-06-18 18:56:03 +0300 |
commit | 682a74e0909ba4e669a3f282b3bc5da0ae81e4da (patch) | |
tree | 85aecf8652ddc680973a8cf9eed3a5b60b8a36d7 /source/blender/blenkernel/BKE_armature.h | |
parent | aee04d496035c2b11b640a91b2e7eca86e878cf2 (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/blenkernel/BKE_armature.h')
-rw-r--r-- | source/blender/blenkernel/BKE_armature.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 3002a9cc10d..112b8bf3ad4 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -80,11 +80,10 @@ typedef struct EditBone { /* Bendy-Bone parameters */ short segments; float roll1, roll2; - float curve_in_x, curve_in_y; - float curve_out_x, curve_out_y; + float curve_in_x, curve_in_z; + float curve_out_x, curve_out_z; float ease1, ease2; - float scale_in_x, scale_in_y; - float scale_out_x, scale_out_y; + float scale_in[3], scale_out[3]; /** for envelope scaling */ float oldlength; @@ -92,6 +91,10 @@ typedef struct EditBone { /** Type of next/prev bone handles */ char bbone_prev_type; char bbone_next_type; + /** B-Bone flags. */ + int bbone_flag; + short bbone_prev_flag; + short bbone_next_flag; /** Next/prev bones to use as handle references when calculating bbones (optional) */ struct EditBone *bbone_prev; struct EditBone *bbone_next; @@ -298,8 +301,8 @@ typedef struct BBoneSplineParameters { /* Control values. */ float ease1, ease2; float roll1, roll2; - float scale_in_x, scale_in_y, scale_out_x, scale_out_y; - float curve_in_x, curve_in_y, curve_out_x, curve_out_y; + float scale_in[3], scale_out[3]; + float curve_in_x, curve_in_z, curve_out_x, curve_out_z; } BBoneSplineParameters; void BKE_pchan_bbone_handles_get(struct bPoseChannel *pchan, |