diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-05-17 18:19:06 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-05-17 18:19:06 +0300 |
commit | 49aeee5a3dfa9fc0ae29e99f7c5c0cc0124e560e (patch) | |
tree | 49ace019e0509cd188f24d11c8f799ab676f6bbd /source/blender/makesdna/DNA_action_types.h | |
parent | 29a17d54da1f4b85a59487e032165bb44dc1b065 (diff) |
Bendy Bones: Advanced B-Bones for Easier + Simple Rigging
This commit/patch/branch brings a bunch of powerful new options for B-Bones and
for working with B-Bones, making it easier for animators to create their own
rigs, using fewer bones (which also means hopefully lighter + faster rigs ;)
This functionality was first demoed by Daniel at BConf15
Some highlights from this patch include:
* You can now directly control the shape of B-Bones using a series of properties
instead of being restricted to trying to indirectly control them through the
neighbouring bones. See the "Bendy Bones" panel...
* B-Bones can be shaped in EditMode to define a "curved rest pose" for the bone.
This is useful for things like eyebrows and mouths/eyelids
* You can now make B-Bones use custom bones as their reference bone handles,
instead of only using the parent/child bones. To do so, enable the
"Use Custom Reference Handles" toggle. If none are specified, then the BBone will
only use the Bendy Bone properties.
* Constraints Head/Tail option can now slide along the B-Bone shape, instead of
just linearly interpolating between the endpoints of the bone.
For more details, see:
* http://aligorith.blogspot.co.nz/2016/05/bendy-bones-dev-update.html
* http://aligorith.blogspot.co.nz/2016/05/an-in-depth-look-at-how-b-bones-work.html
-- Credits --
Original Idea: Daniel M Lara (pepeland)
Original Patch/Research: Jose Molina
Additional Development + Polish: Joshua Leung (aligorith)
Testing/Feedback: Daniel M Lara (pepeland), Juan Pablo Bouza (jpbouza)
Diffstat (limited to 'source/blender/makesdna/DNA_action_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 96d7ec3128c..4d82e4528d6 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -199,7 +199,8 @@ 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 pad0[5]; + char bboneflag; + char pad0[4]; struct Bone *bone; /* set on read file or rebuild pose */ struct bPoseChannel *parent; /* set on read file or rebuild pose */ @@ -242,7 +243,16 @@ typedef struct bPoseChannel { float ikstretch; float ikrotweight; /* weight of joint rotation constraint */ float iklinweight; /* weight of joint stretch constraint */ - + + /* curved bones settings - these are for animating, and are applied on top of the copies in pchan->bone */ + float roll1, roll2; + float curveInX, curveInY; + float curveOutX, curveOutY; + float scaleIn, scaleOut; + + struct bPoseChannel *bbone_prev; /* next/prev bones to use as handle references when calculating bbones (optional) */ + struct bPoseChannel *bbone_next; + void *temp; /* use for outliner */ } bPoseChannel; @@ -253,17 +263,17 @@ typedef enum ePchan_Flag { POSE_LOC = (1 << 0), POSE_ROT = (1 << 1), POSE_SIZE = (1 << 2), - /* old IK/cache stuff... */ -#if 0 - POSE_IK_MAT = (1 << 3), - POSE_UNUSED2 = (1 << 4), - POSE_UNUSED3 = (1 << 5), - POSE_UNUSED4 = (1 << 6), - POSE_UNUSED5 = (1 << 7), - /* has Standard IK */ - POSE_HAS_IK = (1 << 8), -#endif - /* IK/Pose solving*/ + + /* old IK/cache stuff + * - used to be here from (1 << 3) to (1 << 8) + * but has been repurposed since 2.77.2 + * as they haven't been used in over 10 years + */ + + /* has BBone deforms */ + POSE_BBONE_SHAPE = (1 << 3), + + /* IK/Pose solving */ POSE_CHAIN = (1 << 9), POSE_DONE = (1 << 10), /* visualization */ @@ -318,6 +328,16 @@ 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) +/* PoseChannel->bboneflag */ +typedef enum ePchan_BBoneFlag { + /* Use custom reference bones (for roll and handle alignment), instead of immediate neighbours */ + PCHAN_BBONE_CUSTOM_HANDLES = (1 << 1), + /* Evaluate start handle as being "relative" */ + PCHAN_BBONE_CUSTOM_START_REL = (1 << 2), + /* Evaluate end handle as being "relative" */ + PCHAN_BBONE_CUSTOM_END_REL = (1 << 3), +} ePchan_BBoneFlag; + /* PoseChannel->rotmode and Object->rotmode */ typedef enum eRotationModes { /* quaternion rotations (default, and for older Blender versions) */ |