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/makesdna/DNA_armature_types.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/makesdna/DNA_armature_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_armature_types.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 85780bc33c5..f5574b36602 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -86,12 +86,13 @@ typedef struct Bone { /** Curved bones settings - these define the "rest-pose" for a curved bone. */ 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; /** Length of bezier handles. */ float ease1, ease2; - float scale_in_x, scale_in_y; - float scale_out_x, scale_out_y; + float scale_in_x DNA_DEPRECATED, scale_in_z DNA_DEPRECATED; + float scale_out_x DNA_DEPRECATED, scale_out_z DNA_DEPRECATED; + float scale_in[3], scale_out[3]; /** Patch for upward compatibility, UNUSED! */ float size[3]; @@ -103,6 +104,10 @@ typedef struct Bone { /** 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 Bone *bbone_prev; struct Bone *bbone_next; @@ -259,8 +264,10 @@ typedef enum eBone_Flag { BONE_NO_LOCAL_LOCATION = (1 << 22), /** object child will use relative transform (like deform) */ BONE_RELATIVE_PARENTING = (1 << 23), +#ifdef DNA_DEPRECATED_ALLOW /** it will add the parent end roll to the inroll */ BONE_ADD_PARENT_END_ROLL = (1 << 24), +#endif /** this bone was transformed by the mirror function */ BONE_TRANSFORM_MIRROR = (1 << 25), /** this bone is associated with a locked vertex group, ONLY USE FOR DRAWING */ @@ -291,6 +298,12 @@ typedef enum eBone_BBoneHandleType { BBONE_HANDLE_TANGENT = 3, /* Custom handle in tangent mode (use direction, not location). */ } eBone_BBoneHandleType; +/* bone->bbone_flag */ +typedef enum eBone_BBoneFlag { + /** Add the parent Out roll to the In roll. */ + BBONE_ADD_PARENT_END_ROLL = (1 << 0), +} eBone_BBoneFlag; + #define MAXBONENAME 64 #ifdef __cplusplus |