From f0361fcf54e8d15790e2bad5c7402f6af3c24083 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 13 Jan 2015 18:06:53 +1300 Subject: Pataz-Gooseberry Request: Limits on Volume Preservation for Spline IK This commit adds a new type of volume preservation mode to Spline IK which makes it possible to set limits on the minimum and maximum scaling of bone "fatness". * The old volume preseving mode has been kept but renamed, to avoid breaking old rigs. "Volume Presevation" uses the new method, while "Inverse Preservation" is the old one. * The code and settings for this new xz scale mode are directly lifted from the improved Stretch To constraint --- source/blender/makesdna/DNA_constraint_types.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'source/blender/makesdna/DNA_constraint_types.h') diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index fb33879e2c1..86991245068 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -173,6 +173,12 @@ typedef struct bSplineIKConstraint { /* settings */ short flag; /* general settings for constraint */ short xzScaleMode; /* method used for determining the x & z scaling of the bones */ + + /* volume preservation settings */ + float bulge; + float bulge_min; + float bulge_max; + float bulge_smooth; } bSplineIKConstraint; @@ -680,15 +686,19 @@ typedef enum eKinematic_Flags { /* bSplineIKConstraint->flag */ typedef enum eSplineIK_Flags { /* chain has been attached to spline */ - CONSTRAINT_SPLINEIK_BOUND = (1<<0), + CONSTRAINT_SPLINEIK_BOUND = (1 << 0), /* root of chain is not influenced by the constraint */ - CONSTRAINT_SPLINEIK_NO_ROOT = (1<<1), + CONSTRAINT_SPLINEIK_NO_ROOT = (1 << 1), /* bones in the chain should not scale to fit the curve */ - CONSTRAINT_SPLINEIK_SCALE_LIMITED = (1<<2), + CONSTRAINT_SPLINEIK_SCALE_LIMITED = (1 << 2), /* evenly distribute the bones along the path regardless of length */ - CONSTRAINT_SPLINEIK_EVENSPLITS = (1<<3), + CONSTRAINT_SPLINEIK_EVENSPLITS = (1 << 3), /* don't adjust the x and z scaling of the bones by the curve radius */ - CONSTRAINT_SPLINEIK_NO_CURVERAD = (1<<4) + CONSTRAINT_SPLINEIK_NO_CURVERAD = (1 << 4), + + /* for "volumetric" xz scale mode, limit the minimum or maximum scale values */ + CONSTRAINT_SPLINEIK_USE_BULGE_MIN = (1 << 5), + CONSTRAINT_SPLINEIK_USE_BULGE_MAX = (1 << 6), } eSplineIK_Flags; /* bSplineIKConstraint->xzScaleMode */ @@ -698,7 +708,9 @@ typedef enum eSplineIK_XZScaleModes { /* bones in the chain should take their x/z scales from the original scaling */ CONSTRAINT_SPLINEIK_XZS_ORIGINAL = 1, /* x/z scales are the inverse of the y-scale */ - CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC = 2 + CONSTRAINT_SPLINEIK_XZS_INVERSE = 2, + /* x/z scales are computed using a volume preserving technique (from Stretch To constraint) */ + CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC = 3 } eSplineIK_XZScaleModes; /* MinMax (floor) flags */ -- cgit v1.2.3