diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index a677c9d8568..e5e2b3ad8a7 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -808,9 +808,10 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel): if brush.use_space: col.separator() - row = col.row() + row = col.row(align=True) row.active = brush.use_space row.prop(brush, "spacing", text="Spacing") + row.prop(brush, "use_pressure_spacing", toggle=True, text="") if brush.sculpt_capabilities.has_smooth_stroke: col = layout.column() @@ -853,9 +854,10 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel): col.active = brush.sculpt_capabilities.has_spacing col.prop(brush, "use_space") - row = col.row() + row = col.row(align=True) row.active = brush.use_space row.prop(brush, "spacing", text="Spacing") + row.prop(brush, "use_pressure_spacing", toggle=True, text="") class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel): diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 4d350e2fe3a..e2bcde2f651 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -760,8 +760,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf) keymap = WM_keymap_find(keyconf, "Image Paint", 0, 0); keymap->poll = image_texture_paint_poll; - WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "PAINT_OT_image_paint_proj", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); +// WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "PAINT_OT_image_paint_proj", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PAINT_OT_grab_clone", RIGHTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PAINT_OT_clone_cursor_set", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 0180f50fab6..537d868ed67 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -247,17 +247,23 @@ static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const const Scene *scene = CTX_data_scene(C); int steps; int i; - float pressure = 1.0f; + float size_pressure = 1.0f; + float pressure = event_tablet_data(event, NULL); /* XXX mysterious :) what has 'use size' do with this here... if you don't check for it, pressure fails */ if (BKE_brush_use_size_pressure(scene, stroke->brush)) - pressure = event_tablet_data(event, NULL); + size_pressure = pressure; - if (pressure > FLT_EPSILON) { + if (size_pressure > FLT_EPSILON) { /* brushes can have a minimum size of 1.0 but with pressure it can be smaller then a pixel * causing very high step sizes, hanging blender [#32381] */ - const float size_clamp = max_ff(1.0f, BKE_brush_size_get(scene, stroke->brush) * pressure); - scale = (size_clamp * stroke->brush->spacing / 50.0f) / length; + const float size_clamp = max_ff(1.0f, BKE_brush_size_get(scene, stroke->brush) * size_pressure); + float spacing = stroke->brush->spacing; + + if (stroke->brush->flag & BRUSH_SPACING_PRESSURE) + spacing = max_ff(1.0f, spacing * (1.5f - pressure)); + + scale = (size_clamp * spacing / 50.0f) / length; if (scale > FLT_EPSILON) { mul_v2_fl(vec, scale);