From d617294c49912b1b0473bbbe58f62a3549641482 Mon Sep 17 00:00:00 2001 From: Roland Hess Date: Tue, 16 Mar 2010 12:55:56 +0000 Subject: New "Maintain Volume" constraint. When attached to a bone, you specify a "free" axis. Upon scaling, this free axis scales normally, but the constraint forces the other two axes to adjust themselves appropriately so that overall bone volume is maintained. So, setting "Y" as the free axis (the default) creates a bone that automatically squashes and stretches when scaling. Thanks to Aligorith, Fweeb, Cessen and others for the feedback. --- source/blender/makesdna/DNA_constraint_types.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 6e837588f0c..358cbb6e34c 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -208,6 +208,12 @@ typedef struct bSizeLikeConstraint { char subtarget[32]; } bSizeLikeConstraint; +/* Maintain Volume Constraint */ +typedef struct bSameVolumeConstraint { + int flag; + float volume; +} bSameVolumeConstraint; + /* Copy Transform Constraint */ typedef struct bTransLikeConstraint { Object *tar; @@ -412,6 +418,7 @@ typedef enum eBConstraint_Types { CONSTRAINT_TYPE_DAMPTRACK, /* New Tracking constraint that minimises twisting */ CONSTRAINT_TYPE_SPLINEIK, /* Spline-IK - Align 'n' bones to a curve */ CONSTRAINT_TYPE_TRANSLIKE, /* Copy transform matrix */ + CONSTRAINT_TYPE_SAMEVOL, /* Maintain volume during scaling */ /* NOTE: no constraints are allowed to be added after this */ NUM_CONSTRAINT_TYPES @@ -499,6 +506,13 @@ typedef enum eCopyScale_Flags { SIZELIKE_OFFSET = (1<<3), } eCopyScale_Flags; +/* bSameVolumeConstraint.flag */ +typedef enum eSameVolume_Modes { + SAMEVOL_X = 0, + SAMEVOL_Y, + SAMEVOL_Z, +} eSameVolume_Modes; + /* Locked-Axis Values (Locked Track) */ typedef enum eLockAxis_Modes { LOCK_X = 0, -- cgit v1.2.3