Commit: 24bbe0591327f6f925f3023022167e3751c8bf20 Author: Pablo Dobarro Date: Thu Jan 14 02:03:49 2021 +0100 Branches: sculpt-dev https://developer.blender.org/rB24bbe0591327f6f925f3023022167e3751c8bf20
Add automatic falloff type switching to expand =================================================================== M source/blender/editors/sculpt_paint/sculpt_expand.c M source/blender/editors/sculpt_paint/sculpt_intern.h =================================================================== diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.c b/source/blender/editors/sculpt_paint/sculpt_expand.c index 73458d4590e..37b472ded30 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.c +++ b/source/blender/editors/sculpt_paint/sculpt_expand.c @@ -539,6 +539,7 @@ static int sculpt_expand_invoke(bContext *C, wmOperator *op, const wmEvent *even /* Update object. */ BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false); SCULPT_vertex_random_access_ensure(ss); + SCULPT_boundary_info_ensure(ob); SCULPT_undo_push_begin(ob, "expand"); /* Create the Expand Cache. */ @@ -561,8 +562,14 @@ static int sculpt_expand_invoke(bContext *C, wmOperator *op, const wmEvent *even sculpt_expand_initial_state_store(ob, ss->expand_cache); /* Initialize the factors. */ + + eSculptExpandFalloffType falloff_type = SCULPT_EXPAND_FALLOFF_GEODESICS; + if (SCULPT_vertex_is_boundary(ss, initial_vertex)) { + falloff_type = SCULPT_EXPAND_FALLOFF_BOUNDARY_TOPOLOGY; + } + sculpt_expand_falloff_factors_from_vertex_and_symm_create( - ss->expand_cache, sd, ob, initial_vertex, SCULPT_EXPAND_FALLOFF_BOUNDARY_TOPOLOGY); + ss->expand_cache, sd, ob, initial_vertex, falloff_type); /* Initial update. */ sculpt_expand_update_for_vertex(C, ob, initial_vertex); diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index b149864b545..0c2b4d5f53a 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -1175,12 +1175,15 @@ typedef struct ExpandCache { int totnode; bool invert; - bool mask_preserve_previous; + int update_face_set; + eSculptExpandTargetType target; float *initial_mask; int *initial_face_sets; + + } ExpandCache; typedef struct FilterCache { _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs