diff options
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_mask.c | 17 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 10 |
3 files changed, 15 insertions, 14 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 29e462026e1..0fe16720d81 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -158,7 +158,7 @@ class VIEW3D_HT_tool_header(Header): elif mode_string == 'POSE': _row, sub = row_for_mirror() sub.prop(context.object.pose, "use_mirror_x", text="X", toggle=True) - elif mode_string in {'EDIT_MESH', 'PAINT_WEIGHT', 'SCULPT', 'PAINT_VERTEX'}: + elif mode_string in {'EDIT_MESH', 'PAINT_WEIGHT', 'SCULPT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}: # Mesh Modes, Use Mesh Symmetry row, sub = row_for_mirror() sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True) diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 17d13041f28..bacb3b549e3 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -1016,12 +1016,15 @@ static void sculpt_gesture_trim_shape_origin_normal_get(SculptGestureContext *sg break; case SCULPT_GESTURE_TRIM_ORIENTATION_SURFACE: mul_v3_m4v3(r_origin, sgcontext->vc.obact->obmat, sgcontext->ss->gesture_initial_location); - mul_v3_m4v3(r_normal, sgcontext->vc.obact->obmat, sgcontext->ss->gesture_initial_normal); + /* Transforming the normal does not take non uniform scaling into account. Sculpt mode is not + * expected to work on object with non uniform scaling. */ + copy_v3_v3(r_normal, sgcontext->ss->gesture_initial_normal); + mul_mat3_m4_v3(sgcontext->vc.obact->obmat, r_normal); break; } } -static void sculpt_gesture_trim_calculate_depth(bContext *C, SculptGestureContext *sgcontext) +static void sculpt_gesture_trim_calculate_depth(SculptGestureContext *sgcontext) { SculptGestureTrimOperation *trim_operation = (SculptGestureTrimOperation *)sgcontext->operation; @@ -1070,13 +1073,11 @@ static void sculpt_gesture_trim_calculate_depth(bContext *C, SculptGestureContex mid_point_depth = ss->gesture_initial_hit ? 0.0f : (trim_operation->depth_back + trim_operation->depth_front) * 0.5f; - } - Sculpt *sd = CTX_data_tool_settings(C)->sculpt; - Brush *brush = BKE_paint_brush(&sd->paint); - Scene *scene = CTX_data_scene(C); - const float depth_radius = BKE_brush_unprojected_radius_get(scene, brush); + } + + const float depth_radius = ss->cursor_radius; trim_operation->depth_front = mid_point_depth - depth_radius; trim_operation->depth_back = mid_point_depth + depth_radius; } @@ -1312,7 +1313,7 @@ static void sculpt_gesture_apply_trim(SculptGestureContext *sgcontext) static void sculpt_gesture_trim_begin(bContext *C, SculptGestureContext *sgcontext) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); - sculpt_gesture_trim_calculate_depth(C, sgcontext); + sculpt_gesture_trim_calculate_depth(sgcontext); sculpt_gesture_trim_geometry_generate(sgcontext); BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, true, false, false); SCULPT_undo_push_node(sgcontext->vc.obact, NULL, SCULPT_UNDO_GEOMETRY); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index a53c2efed06..42dece9ddd5 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2721,11 +2721,11 @@ static void update_sculpt_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int t const Brush *brush = BKE_paint_brush(&sd->paint); StrokeCache *cache = ob->sculpt->cache; /* Grab brush does not update the sculpt normal during a stroke. */ - const bool update_normal = !(brush->flag & BRUSH_ORIGINAL_NORMAL) && - !(brush->sculpt_tool == SCULPT_TOOL_GRAB) && - !(brush->sculpt_tool == SCULPT_TOOL_ELASTIC_DEFORM) && - !(brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK && - cache->normal_weight > 0.0f); + const bool update_normal = + !(brush->flag & BRUSH_ORIGINAL_NORMAL) && !(brush->sculpt_tool == SCULPT_TOOL_GRAB) && + !(brush->sculpt_tool == SCULPT_TOOL_THUMB && !(brush->flag & BRUSH_ANCHORED)) && + !(brush->sculpt_tool == SCULPT_TOOL_ELASTIC_DEFORM) && + !(brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK && cache->normal_weight > 0.0f); if (cache->mirror_symmetry_pass == 0 && cache->radial_symmetry_pass == 0 && (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(cache) || update_normal)) { |