From bbc69563d0704a8269318d8699e7c2bf4edc91c2 Mon Sep 17 00:00:00 2001 From: Joseph Eagar Date: Wed, 28 Sep 2022 23:21:56 -0700 Subject: 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 --- source/blender/editors/sculpt_paint/sculpt_transform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/sculpt_paint/sculpt_transform.c') 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 #include -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; -- cgit v1.2.3