[Bf-blender-cvs] [8f7b7d8b79d] temp-gpencil-fill: GPencil: Reduce minimum size for internal stroke drawing used in Fill
Antonio Vazquez
noreply at git.blender.org
Sat Feb 6 12:28:10 CET 2021
Commit: 8f7b7d8b79d39f0e5278e2efe48ed381cb33b305
Author: Antonio Vazquez
Date: Fri Feb 5 20:01:00 2021 +0100
Branches: temp-gpencil-fill
https://developer.blender.org/rB8f7b7d8b79d39f0e5278e2efe48ed381cb33b305
GPencil: Reduce minimum size for internal stroke drawing used in Fill
===================================================================
M source/blender/editors/gpencil/drawgpencil.c
M source/blender/editors/gpencil/gpencil_fill.c
===================================================================
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 4e2951c3571..751f8333aaa 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -171,7 +171,8 @@ static void gpencil_draw_stroke_3d(tGPDdraw *tgpw,
int totpoints = tgpw->gps->totpoints;
const float viewport[2] = {(float)tgpw->winx, (float)tgpw->winy};
- float curpressure = points[0].pressure;
+ const float min_thickness = 0.05f;
+
float fpt[3];
/* if cyclic needs more vertex */
@@ -205,7 +206,6 @@ static void gpencil_draw_stroke_3d(tGPDdraw *tgpw,
immUniform1i("fill_stroke", (int)tgpw->is_fill_stroke);
/* draw stroke curve */
- GPU_line_width(max_ff(curpressure * thickness, 1.0f));
immBeginAtMost(GPU_PRIM_LINE_STRIP_ADJ, totpoints + cyclic_add + 2);
const bGPDspoint *pt = points;
@@ -215,18 +215,19 @@ static void gpencil_draw_stroke_3d(tGPDdraw *tgpw,
gpencil_set_point_varying_color(points, ink, attr_id.color, (bool)tgpw->is_fill_stroke);
if ((cyclic) && (totpoints > 2)) {
- immAttr1f(attr_id.thickness, max_ff((points + totpoints - 1)->pressure * thickness, 1.0f));
+ immAttr1f(attr_id.thickness,
+ max_ff((points + totpoints - 1)->pressure * thickness, min_thickness));
mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + totpoints - 1)->x);
}
else {
- immAttr1f(attr_id.thickness, max_ff((points + 1)->pressure * thickness, 1.0f));
+ immAttr1f(attr_id.thickness, max_ff((points + 1)->pressure * thickness, min_thickness));
mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + 1)->x);
}
immVertex3fv(attr_id.pos, fpt);
}
/* set point */
gpencil_set_point_varying_color(pt, ink, attr_id.color, (bool)tgpw->is_fill_stroke);
- immAttr1f(attr_id.thickness, max_ff(pt->pressure * thickness, 1.0f));
+ immAttr1f(attr_id.thickness, max_ff(pt->pressure * thickness, min_thickness));
mul_v3_m4v3(fpt, tgpw->diff_mat, &pt->x);
immVertex3fv(attr_id.pos, fpt);
}
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 6cefa4c50fb..4bb6b6639fe 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -582,7 +582,7 @@ static void gpencil_draw_datablock(tGPDfill *tgpf, const float ink[4])
tgpw.is_fill_stroke = (tgpf->fill_draw_mode == GP_FILL_DMODE_CONTROL) ? false : true;
/* Reduce thickness to avoid gaps. */
- tgpw.lthick = gpl->line_change - (20 * tgpf->fill_factor);
+ tgpw.lthick = gpl->line_change; // -(200 * tgpf->fill_factor);
tgpw.opacity = 1.0;
copy_v4_v4(tgpw.tintcolor, ink);
tgpw.onion = true;
More information about the Bf-blender-cvs
mailing list