Fix #124906: GPv3: Eraser crash when pressure is enabled
This is due to uninitialized `curve_strength` table. It is either initialized for active tool or the eraser (if ctrl is held). So fix is to choose correct brush in execute() function. Also fix the inverted condition in begin() function to choose eraser brush. Pull Request: https://projects.blender.org/blender/blender/pulls/124975
This commit is contained in:
committed by
Falk David
parent
1144235e90
commit
c7ecaf67fd
@@ -505,6 +505,10 @@ struct EraseOperationExecutor {
|
||||
Paint *paint = &scene->toolsettings->gp_paint->paint;
|
||||
Brush *brush = BKE_paint_brush(paint);
|
||||
|
||||
if (brush->gpencil_tool == GPAINT_TOOL_DRAW) {
|
||||
brush = BKE_paint_eraser_brush(paint);
|
||||
}
|
||||
|
||||
/* Get the tool's data. */
|
||||
this->mouse_position = extension_sample.mouse_position;
|
||||
this->eraser_radius = self.radius_;
|
||||
@@ -605,7 +609,7 @@ void EraseOperation::on_stroke_begin(const bContext &C, const InputSample & /*st
|
||||
{
|
||||
Paint *paint = BKE_paint_get_active_from_context(&C);
|
||||
Brush *brush = BKE_paint_brush(paint);
|
||||
if (brush->gpencil_tool != GPAINT_TOOL_DRAW) {
|
||||
if (brush->gpencil_tool == GPAINT_TOOL_DRAW) {
|
||||
/* If we're using the draw tool to erase (e.g. while holding ctrl), then we should use the
|
||||
* eraser brush instead. */
|
||||
brush = BKE_paint_eraser_brush(paint);
|
||||
|
||||
Reference in New Issue
Block a user