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 /release/scripts/startup/bl_ui | |
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 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_constraint.py | 3 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index 76b87a9011d..c76f3255d97 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -748,6 +748,9 @@ class ConstraintButtonsPanel: layout.prop(con, "distance") layout.prop(con, "shrinkwrap_type") + if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE'}: + layout.prop(con, 'wrap_mode', text="Snap Mode") + if con.shrinkwrap_type == 'PROJECT': row = layout.row(align=True) row.prop(con, "project_axis", expand=True) diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 8833db28056..803abe98055 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -825,6 +825,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.label(text="Mode:") col.prop(md, "wrap_method", text="") + if md.wrap_method in {'PROJECT', 'NEAREST_SURFACEPOINT'}: + col.prop(md, "wrap_mode", text="") + if md.wrap_method == 'PROJECT': split = layout.split() col = split.column() @@ -851,9 +854,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.prop(md, "auxiliary_target") - elif md.wrap_method == 'NEAREST_SURFACEPOINT': - layout.prop(md, "use_keep_above_surface") - def SIMPLE_DEFORM(self, layout, ob, md): layout.row().prop(md, "deform_method", expand=True) |