diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-10-13 21:51:46 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-10-13 21:58:53 +0400 |
commit | f9cbb908a3fbd73970920def8356993b9e016d1d (patch) | |
tree | 7d9745c33b831bd1cafbcdd610a156f5322fd916 /source/blender/makesdna/DNA_constraint_types.h | |
parent | af346f991827fef81b21fe30370d84bc338d6461 (diff) |
Integrated limits for volume preservation in stretch-to constraints.
Currently the volume variation feature in stretch constraints is
unlimited. This has to be compensated by riggers by adding scale limit
constraints, but these are unaware of the stretch orientation and can
lead to flipping. Also the stretch calculation itself is not working
properly and can lead to collapsing volume.
The patch fixes this with several modifications:
- Interpret the volume variation factor as exponent, which works better
with large values for artistic purposes.
- Add integrated limits to the volume "bulge" factor, so secondary
constraints for compensation become unnecessary
- Add a smoothness factor to make limits less visible.
Eventually a generic volume preservation constraint would be nicer,
because multiple constraints currently implement volume variation of
their own. This feature could actually work very nicely independent from
other constraint features.
Differential Revision: https://developer.blender.org/D826
Diffstat (limited to 'source/blender/makesdna/DNA_constraint_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_constraint_types.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 0277956cac5..fb33879e2c1 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -284,10 +284,14 @@ typedef struct bFollowPathConstraint { /* Stretch to constraint */ typedef struct bStretchToConstraint { struct Object *tar; + int flag; int volmode; - int plane; + int plane; float orglength; float bulge; + float bulge_min; + float bulge_max; + float bulge_smooth; char subtarget[64]; /* MAX_ID_NAME-2 */ } bStretchToConstraint; @@ -820,6 +824,12 @@ typedef enum eObjectSolver_Flags { #define CONSTRAINT_DRAW_PIVOT 0x40 #define CONSTRAINT_DISABLE_LINKED_COLLISION 0x80 +/* ObjectSolver Constraint -> flag */ +typedef enum eStretchTo_Flags { + STRETCHTOCON_USE_BULGE_MIN = (1 << 0), + STRETCHTOCON_USE_BULGE_MAX = (1 << 1), +} eStretchTo_Flags; + /* important: these defines need to match up with PHY_DynamicTypes headerfile */ #define CONSTRAINT_RB_BALL 1 #define CONSTRAINT_RB_HINGE 2 |