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-07-01 19:54:52 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-07-01 19:55:02 +0300
commitbf5a656ff6840bdaf911abf5692271845377e2d9 (patch)
tree574d8edcc536c4d26038283b2a905fac566034da /source/blender/editors/gpencil
parent11a1ddfd30784f42dc785f6d7e01f32cc4cdcd26 (diff)
GPencil: Fix unreported primitive color always set as Vertex Color
When drawing a primitive, the color was always assigned as vertex color, so it was impossible to change it in the material settings. Now, the color is set to material color or vertex color as expected.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_primitive.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 6bb9f9628fa..632c3a24638 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -695,6 +695,7 @@ static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
bool is_depth = (bool)(*align_flag & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE));
const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) &&
(tgpi->rv3d->persp == RV3D_CAMOB) && (!is_depth);
+ const bool is_vertex_stroke = GPENCIL_USE_VERTEX_COLOR_STROKE(ts, brush);
if (tgpi->type == GP_STROKE_BOX) {
gps->totpoints = (tgpi->tot_edges * 4 + tgpi->tot_stored_edges);
@@ -1019,7 +1020,12 @@ static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
pt->time = 0.0f;
pt->flag = 0;
pt->uv_fac = tpt->uv_fac;
- copy_v4_v4(pt->vert_color, tpt->vert_color);
+ if (is_vertex_stroke) {
+ copy_v4_v4(pt->vert_color, tpt->vert_color);
+ }
+ else {
+ zero_v4(pt->vert_color);
+ }
if (gps->dvert != NULL) {
MDeformVert *dvert = &gps->dvert[i];