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
This commit is contained in:
Alexander Gavrilov
2018-07-07 18:39:45 +03:00
parent 310f1b0579
commit 3378782eee
11 changed files with 171 additions and 33 deletions

View File

@@ -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)