From 2c44789bc35d45b8d7c8a2ad9c6073de516b05c8 Mon Sep 17 00:00:00 2001 From: Falk David Date: Mon, 27 May 2024 16:54:48 +0200 Subject: [PATCH] GPv3: Draw Tool: Use the `Post-Processing` toggle In the `Stroke` panel for the draw tool settings, there is a toggle to enable/disable post processing. This is now hooked up in the code. --- .../editors/sculpt_paint/grease_pencil_paint.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/sculpt_paint/grease_pencil_paint.cc b/source/blender/editors/sculpt_paint/grease_pencil_paint.cc index 7ef462f2533..18581c6b695 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_paint.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_paint.cc @@ -855,15 +855,21 @@ void PaintOperation::on_stroke_done(const bContext &C) Object *object = CTX_data_active_object(&C); GreasePencil &grease_pencil = *static_cast(object->data); + Paint *paint = &scene->toolsettings->gp_paint->paint; + Brush *brush = BKE_paint_brush(paint); + BrushGpencilSettings *settings = brush->gpencil_settings; + const bool do_post_processing = (settings->flag & GP_BRUSH_GROUP_SETTINGS) != 0; + /* Grease Pencil should have an active layer. */ BLI_assert(grease_pencil.has_active_layer()); bke::greasepencil::Layer &active_layer = *grease_pencil.get_active_layer(); /* Drawing should exist. */ bke::greasepencil::Drawing &drawing = *grease_pencil.get_editable_drawing_at(active_layer, scene->r.cfra); - - const float simplifiy_threshold_px = 0.5f; - this->simplify_stroke(C, drawing, simplifiy_threshold_px); + if (do_post_processing) { + const float simplifiy_threshold_px = 0.5f; + this->simplify_stroke(C, drawing, simplifiy_threshold_px); + } this->process_stroke_end(C, drawing); drawing.tag_topology_changed();