diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-08-05 18:48:05 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-10-04 19:55:44 +0300 |
commit | 61a24c799b2882c22a43591138a113d7f09be0ed (patch) | |
tree | ea85047e68ff64bf7e25329a7e7048f1b9dbfeb1 /source/blender/makesdna | |
parent | 6932eaa2bcaff0649c82f6b31a205319c966bd15 (diff) |
Move B-Bone custom handle settings to Edit mode.
Custom handle settings actually affect the B-Bone rest shape,
so they should be changed in Edit mode rather than Pose mode.
This is necessary to be able to display the correct rest shape
of the bone in Edit Mode.
Also, instead of flags, introduce an enum to specify the handle
operation modes, so that new ones could be added later.
Differential Revision: https://developer.blender.org/D3588
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_armature_types.h | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 55e1a43925d..d6991041ec6 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -224,7 +224,7 @@ typedef struct bPoseChannel { char constflag; /* for quick detecting which constraints affect this channel */ char selectflag; /* copy of bone flag, so you can work with library armatures, not for runtime use */ char drawflag; - char bboneflag; + char bboneflag DNA_DEPRECATED; char pad0[4]; struct Bone *bone; /* set on read file or rebuild pose */ @@ -278,7 +278,7 @@ typedef struct bPoseChannel { float ease1, ease2; float scaleIn, scaleOut; - struct bPoseChannel *bbone_prev; /* next/prev bones to use as handle references when calculating bbones (optional) */ + struct bPoseChannel *bbone_prev; /* B-Bone custom handles; set on read file or rebuild pose based on pchan->bone data */ struct bPoseChannel *bbone_next; void *temp; /* use for outliner */ @@ -361,6 +361,7 @@ typedef enum ePchan_DrawFlag { #define PCHAN_CUSTOM_DRAW_SIZE(pchan) \ (pchan)->custom_scale * (((pchan)->drawflag & PCHAN_DRAW_NO_CUSTOM_BONE_SIZE) ? 1.0f : (pchan)->bone->length) +#ifdef DNA_DEPRECATED_ALLOW /* PoseChannel->bboneflag */ typedef enum ePchan_BBoneFlag { /* Use custom reference bones (for roll and handle alignment), instead of immediate neighbors */ @@ -370,6 +371,7 @@ typedef enum ePchan_BBoneFlag { /* Evaluate end handle as being "relative" */ PCHAN_BBONE_CUSTOM_END_REL = (1 << 3), } ePchan_BBoneFlag; +#endif /* PoseChannel->rotmode and Object->rotmode */ typedef enum eRotationModes { diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 937caffb71e..141ad7c3ce0 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -78,8 +78,10 @@ typedef struct Bone { int layer; /* layers that bone appears on */ short segments; /* for B-bones */ - short pad1; - + char bbone_prev_type; /* Type of next/prev bone handles */ + char bbone_next_type; + struct Bone *bbone_prev; /* Next/prev bones to use as handle references when calculating bbones (optional) */ + struct Bone *bbone_next; } Bone; typedef struct bArmature { @@ -214,6 +216,13 @@ typedef enum eBone_Flag { } eBone_Flag; +/* bone->bbone_prev_type, bbone_next_type */ +typedef enum eBone_BBoneHandleType { + BBONE_HANDLE_AUTO = 0, /* Default mode based on parents & children. */ + BBONE_HANDLE_ABSOLUTE, /* Custom handle in absolute position mode. */ + BBONE_HANDLE_RELATIVE, /* Custom handle in relative position mode. */ +} eBone_BBoneHandleType; + #define MAXBONENAME 64 #endif |