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 /source/blender/makesrna/intern | |
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 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 3 |
2 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 e2d4093b753..c809cd7b1a4 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -2134,6 +2134,9 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) "Shrink the location to the nearest target surface along a given axis"}, {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the location to the nearest target vertex"}, + {MOD_SHRINKWRAP_TARGET_PROJECT, "TARGET_PROJECT", 0, "Target Normal Project", + "Shrink the location to the nearest target surface " + "along the interpolated vertex normals of the target"}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 44f14be259a..d450e95d397 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -3167,6 +3167,9 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) "Shrink the mesh to the nearest target surface along a given axis"}, {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the mesh to the nearest target vertex"}, + {MOD_SHRINKWRAP_TARGET_PROJECT, "TARGET_PROJECT", 0, "Target Normal Project", + "Shrink the mesh to the nearest target surface " + "along the interpolated vertex normals of the target"}, {0, NULL, 0, NULL, NULL} }; |