Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-07-07 18:39:45 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-09-26 16:52:58 +0300
commit3378782eeeb55a6ed64dba479e37f8b98fab63b1 (patch)
tree1ae6e8fd713d4c7b22a05a4024f2f7dbc09efe2b /source/blender/makesdna/DNA_modifier_types.h
parent310f1b057926d6250adf11db6621f2606b61827f (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/makesdna/DNA_modifier_types.h')
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 247b08475a1..811373e626c 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -870,7 +870,7 @@ typedef struct ShrinkwrapModifierData {
float keepDist; /* distance offset to keep from mesh/projection point */
short shrinkType; /* shrink type projection */
char shrinkOpts; /* shrink options */
- char pad1;
+ char shrinkMode; /* shrink to surface mode */
float projLimit; /* limit the projection ray cast */
char projAxis; /* axis to project over */
@@ -889,6 +889,20 @@ enum {
MOD_SHRINKWRAP_NEAREST_VERTEX = 2,
};
+/* Shrinkwrap->shrinkMode */
+enum {
+ /* Move vertex to the surface of the target object (keepDist towards original position) */
+ MOD_SHRINKWRAP_ON_SURFACE = 0,
+ /* Move the vertex inside the target object; don't change if already inside */
+ MOD_SHRINKWRAP_INSIDE = 1,
+ /* Move the vertex outside the target object; don't change if already outside */
+ MOD_SHRINKWRAP_OUTSIDE = 2,
+ /* Move vertex to the surface of the target object, with keepDist towards the outside */
+ MOD_SHRINKWRAP_OUTSIDE_SURFACE = 3,
+ /* Move vertex to the surface of the target object, with keepDist along the normal */
+ MOD_SHRINKWRAP_ABOVE_SURFACE = 4,
+};
+
/* Shrinkwrap->shrinkOpts */
enum {
/* allow shrinkwrap to move the vertex in the positive direction of axis */
@@ -901,7 +915,9 @@ enum {
/* ignore vertex moves if a vertex ends projected on a back face of the target */
MOD_SHRINKWRAP_CULL_TARGET_BACKFACE = (1 << 4),
+#ifdef DNA_DEPRECATED_ALLOW
MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE = (1 << 5), /* distance is measure to the front face of the target */
+#endif
MOD_SHRINKWRAP_INVERT_VGROUP = (1 << 6),
};