diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-07-07 18:39:45 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-09-26 16:52:58 +0300 |
commit | 3378782eeeb55a6ed64dba479e37f8b98fab63b1 (patch) | |
tree | 1ae6e8fd713d4c7b22a05a4024f2f7dbc09efe2b /source/blender/makesrna/intern/rna_constraint.c | |
parent | 310f1b057926d6250adf11db6621f2606b61827f (diff) |
Implement additional modes for Shrinkwrap to a surface.
In addition to the original map to surface and Keep Above Surface,
add modes that only affect vertices that are inside or outside
the object. This is inspired by the Limit Distance constraint,
and can be useful for crude collision detection in rigs.
The inside/outside test works based on face normals and may not be
completely reliable near 90 degree or sharper angles in the target.
Reviewers: campbellbarton, mont29
Differential Revision: https://developer.blender.org/D3717
Diffstat (limited to 'source/blender/makesrna/intern/rna_constraint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 52c6bc105fd..39966983a8a 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1934,6 +1934,12 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Select type of shrinkwrap algorithm for target position"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + prop = RNA_def_property(srna, "wrap_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "shrinkMode"); + RNA_def_property_enum_items(prop, rna_enum_modifier_shrinkwrap_mode_items); + RNA_def_property_ui_text(prop, "Snap Mode", "Select how to constrain the object to the target surface"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0f, FLT_MAX); |