diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-06 21:04:53 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-06 21:20:17 +0300 |
commit | f600b4bc67667b867899cac3725ac7ed44bfbfe3 (patch) | |
tree | 145927ae29bd2e5fe2b09228176a9644f143db6f /release | |
parent | 0709fac41ef0a20955069fcd6609577189e96d5c (diff) |
Shrinkwrap: new mode that projects along the target normal.
The Nearest Surface Point shrink method, while fast, is neither
smooth nor continuous: as the source point moves, the projected
point can both stop and jump. This causes distortions in the
deformation of the shrinkwrap modifier, and the motion of an
animated object with a shrinkwrap constraint.
This patch implements a new mode, which, instead of using the simple
nearest point search, iteratively solves an equation for each triangle
to find a point which has its interpolated normal point to or from the
original vertex. Non-manifold boundary edges are treated as infinitely
thin cylinders that cast normals in all perpendicular directions.
Since this is useful for the constraint, and having multiple
objects with constraints targeting the same guide mesh is a quite
reasonable use case, rather than calculating the mesh boundary edge
data over and over again, it is precomputed and cached in the mesh.
Reviewers: mont29
Differential Revision: https://developer.blender.org/D3836
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_constraint.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index b1c0217f9c9..dcd84d105ad 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -748,7 +748,7 @@ class ConstraintButtonsPanel: layout.prop(con, "distance") layout.prop(con, "shrinkwrap_type") - if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE'}: + if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE', 'TARGET_PROJECT'}: layout.prop(con, 'wrap_mode', text="Snap Mode") if con.shrinkwrap_type == 'PROJECT': @@ -769,7 +769,7 @@ class ConstraintButtonsPanel: rowsub.prop(con, "use_invert_cull") layout.prop(con, "project_limit") - if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE'}: + if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE', 'TARGET_PROJECT'}: layout.prop(con, "use_track_normal") row = layout.row(align=True) diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 2633168e2fa..34f277269fe 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -828,7 +828,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.label(text="Mode:") col.prop(md, "wrap_method", text="") - if md.wrap_method in {'PROJECT', 'NEAREST_SURFACEPOINT'}: + if md.wrap_method in {'PROJECT', 'NEAREST_SURFACEPOINT', 'TARGET_PROJECT'}: col.prop(md, "wrap_mode", text="") if md.wrap_method == 'PROJECT': |