diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-01 14:29:40 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-01 14:29:40 +0300 |
commit | 2068eaf1b7f7729198ad865f69fa3bd11d7a9edc (patch) | |
tree | cc15c3d1e3d68ff8f8ca47a353b3b1e51dee52ea /source/blender/makesdna/DNA_action_types.h | |
parent | cb45db0336aa7a090c5edc0f8b6f62d334c72baa (diff) |
Rigging Goodies: Spline IK Constraint
At last, this commit introduces the Spline IK Constraint to Blender. Spline IK is a constraint that makes n bones follow the shape of a specified curve.
Simply add a chain of bones, add a curve, add a Spline IK Constraint to the tip bone and set the number of bones in the chain to make it work. Or, try the following test file:
http://download.blender.org/ftp/incoming/250_splineik_spine01.blend
Screenshots of this in action (as proof):
http://download.blender.org/ftp/incoming/b250_splineik_001_before.png
http://download.blender.org/ftp/incoming/b250_splineik_001_after.png
I've implemented this in a similar way to how standard IK solvers are done. However, this code is currently not an IK plugin, since I imagine that it would be useful to be able to combine the 2 types of IK. This can be easily changed though :)
Finally, a few notes on what to expect still:
* Constraint blending currently doesn't affect this. Getting that to work correctly will take a bit more work still.
* Options for not affecting the root joint (to make it easier to attach the chain to a stump or whatever), and non-uniform scaling options have yet to be added. I've marked the places where they can be added though
* Control over the twisting of the chain still needs investigation.
Have fun!
Diffstat (limited to 'source/blender/makesdna/DNA_action_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 8d590692794..7067c967da3 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -159,20 +159,30 @@ typedef struct bPoseChannel { /* PoseChannel (transform) flags */ typedef enum ePchan_Flag { - POSE_LOC = 0x0001, - POSE_ROT = 0x0002, - POSE_SIZE = 0x0004, - POSE_IK_MAT = 0x0008, - POSE_UNUSED2 = 0x0010, - POSE_UNUSED3 = 0x0020, - POSE_UNUSED4 = 0x0040, - POSE_UNUSED5 = 0x0080, - POSE_HAS_IK = 0x0100, - POSE_CHAIN = 0x0200, - POSE_DONE = 0x0400, - POSE_KEY = 0x1000, - POSE_STRIDE = 0x2000, - POSE_IKTREE = 0x4000, + /* has transforms */ + POSE_LOC = (1<<0), + POSE_ROT = (1<<1), + POSE_SIZE = (1<<2), + /* old IK/cache stuff... */ + 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), + /* IK/Pose solving*/ + POSE_CHAIN = (1<<9), + POSE_DONE = (1<<10), + /* visualisation */ + POSE_KEY = (1<<11), + POSE_STRIDE = (1<<12), + /* standard IK solving */ + POSE_IKTREE = (1<<13), + /* has Spline IK */ + POSE_HAS_IKS = (1<<14), + /* spline IK solving */ + POSE_IKSPLINE = (1<<15), } ePchan_Flag; /* PoseChannel constflag (constraint detection) */ @@ -183,7 +193,9 @@ typedef enum ePchan_ConstFlag { PCHAN_HAS_ACTION = (1<<2), PCHAN_HAS_TARGET = (1<<3), /* only for drawing Posemode too */ - PCHAN_HAS_STRIDE = (1<<4) + PCHAN_HAS_STRIDE = (1<<4), + /* spline IK */ + PCHAN_HAS_SPLINEIK = (1<<5), } ePchan_ConstFlag; /* PoseChannel->ikflag */ @@ -202,7 +214,6 @@ typedef enum ePchan_IkFlag { BONE_IK_NO_XDOF_TEMP = (1<<10), BONE_IK_NO_YDOF_TEMP = (1<<11), BONE_IK_NO_ZDOF_TEMP = (1<<12), - } ePchan_IkFlag; /* PoseChannel->rotmode and Object->rotmode */ |