From dc69abcb70a67802ffb37571ef5d14f74359bd54 Mon Sep 17 00:00:00 2001 From: YimingWu Date: Fri, 31 May 2024 04:51:55 +0200 Subject: [PATCH] Fix #122503: GPv3: Always Initialize `vertex_color_` when drawing Lack of initialization of `vertex_color_` will cause garbled color to show up in later interpolated points while drawing in material mode with curves already have `vertex_color` attribute. Now fixed. Pull Request: https://projects.blender.org/blender/blender/pulls/122528 --- source/blender/editors/sculpt_paint/grease_pencil_paint.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/editors/sculpt_paint/grease_pencil_paint.cc b/source/blender/editors/sculpt_paint/grease_pencil_paint.cc index b834893dedc..3f3c18fd017 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_paint.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_paint.cc @@ -185,6 +185,9 @@ struct PaintOperationExecutor { std::make_optional(color_base) : std::nullopt; } + else { + vertex_color_ = std::make_optional(ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f)); + } softness_ = 1.0f - settings_->hardness; BLI_assert(grease_pencil->has_active_layer());