Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-03-13 23:54:42 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-03-13 23:54:54 +0300
commit7d56c425f8e64346eac6e78ed49d5c5ce2fe1025 (patch)
treed2fc27d1aa976008ba0bdcbd70f2b40f6345f90b
parentdc99c3532a736b6620e973dcd5447abc98bee77a (diff)
GPencil: Don'r Replace color if vertex color is empty
The replace tools only must work over previously vertex painted.
-rw-r--r--source/blender/editors/gpencil/gpencil_vertex_paint.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 9cdea22d45e..45dc22bafba 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -484,19 +484,15 @@ static bool brush_replace_apply(tGP_BrushVertexpaintData *gso, bGPDstroke *gps,
/* Apply color to Stroke point. */
if (GPENCIL_TINT_VERTEX_COLOR_STROKE(brush)) {
- copy_v3_v3(pt->vert_color, gso->linear_color);
- /* If not mix color, full replace. */
- if (pt->vert_color[3] == 0.0f) {
- pt->vert_color[3] = 1.0f;
+ if (pt->vert_color[3] > 0.0f) {
+ copy_v3_v3(pt->vert_color, gso->linear_color);
}
}
/* Apply color to Fill area (all with same color and factor). */
if (GPENCIL_TINT_VERTEX_COLOR_FILL(brush)) {
- copy_v3_v3(gps->vert_color_fill, gso->linear_color);
- /* If not mix color, full replace. */
- if (gps->vert_color_fill[3] == 0.0f) {
- gps->vert_color_fill[3] = 1.0f;
+ if (gps->vert_color_fill[3] > 0.0f) {
+ copy_v3_v3(gps->vert_color_fill, gso->linear_color);
}
}