diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-09-29 09:21:56 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-09-29 09:21:56 +0300 |
commit | bbc69563d0704a8269318d8699e7c2bf4edc91c2 (patch) | |
tree | 7d9d0aa1f35597442f633c3b2d88ff4d2df704d4 /source/blender/editors/sculpt_paint/sculpt_transform.c | |
parent | a4ff106c5864343dd40cc945a5bdc74ed22d4274 (diff) |
Sculpt: Normal-based automasking modes
Two new normal-based automasking modes.
The first mode, "brush", compares vertex normals with the initial
normal at the beginning of the brush stroke.
The second, "view", compares vertex normals with the view normal.
If "occlusion" is on then rays will be shot from each vertex to test
if it is occluded by other geometry (note: this can be very slow).\
Only geometry inside the sculpt mesh is considered.
Each mode has an associated angular limit and a falloff.
Reviewed by: Julien Kaspar and Jeroen Bakker
Differential Revision: https://developer.blender.org/D15297
Ref D15297
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_transform.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_transform.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_transform.c b/source/blender/editors/sculpt_paint/sculpt_transform.c index dfaa0bd4daa..f841cd14386 100644 --- a/source/blender/editors/sculpt_paint/sculpt_transform.c +++ b/source/blender/editors/sculpt_paint/sculpt_transform.c @@ -46,7 +46,7 @@ #include <math.h> #include <stdlib.h> -void ED_sculpt_init_transform(struct bContext *C, Object *ob, const char *undo_name) +void ED_sculpt_init_transform(struct bContext *C, Object *ob, const int mval[2], const char *undo_name) { Sculpt *sd = CTX_data_tool_settings(C)->sculpt; SculptSession *ss = ob->sculpt; @@ -66,7 +66,8 @@ void ED_sculpt_init_transform(struct bContext *C, Object *ob, const char *undo_n ss->pivot_rot[3] = 1.0f; SCULPT_vertex_random_access_ensure(ss); - SCULPT_filter_cache_init(C, ob, sd, SCULPT_UNDO_COORDS); + + SCULPT_filter_cache_init(C, ob, sd, SCULPT_UNDO_COORDS, mval, 5.0); if (sd->transform_mode == SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC) { ss->filter_cache->transform_displacement_mode = SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL; |