[Bf-blender-cvs] [b372ce3ec0b] greasepencil-refactor: Merge branch 'greasepencil-object' into greasepencil-refactor
Antonio Vazquez
noreply at git.blender.org
Thu Feb 6 15:13:15 CET 2020
Commit: b372ce3ec0b2bc364d45609976b92f00d84b5d71
Author: Antonio Vazquez
Date: Thu Feb 6 15:13:08 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBb372ce3ec0b2bc364d45609976b92f00d84b5d71
Merge branch 'greasepencil-object' into greasepencil-refactor
===================================================================
===================================================================
diff --cc source/blender/editors/gpencil/drawgpencil.c
index b2b3670941f,fe89ea7321f..c83c81732c7
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@@ -320,12 -390,18 +320,12 @@@ static void gp_draw_stroke_fill(bGPdat
const float color[4])
{
BLI_assert(gps->totpoints >= 3);
+ BLI_assert(gps->tot_triangles >= 1);
const bool use_mat = (gpd->mat != NULL);
- Material *ma = (use_mat) ? gpd->mat[gps->mat_nr] : BKE_gpencil_material_default();
+ Material *ma = (use_mat) ? gpd->mat[gps->mat_nr] : BKE_material_default_gpencil();
MaterialGPencilStyle *gp_style = (ma) ? ma->gp_style : NULL;
- /* Calculate triangles cache for filling area (must be done only after changes) */
- if ((gps->flag & GP_STROKE_RECALC_GEOMETRY) || (gps->tot_triangles == 0) ||
- (gps->triangles == NULL)) {
- gp_triangulate_stroke_fill(gps);
- }
- BLI_assert(gps->tot_triangles >= 1);
-
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
uint texcoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@@ -762,12 -840,12 +762,12 @@@ static void gp_draw_strokes(tGPDdraw *t
continue;
}
/* check if the color is visible */
- Material *ma = (use_mat) ? tgpw->gpd->mat[gps->mat_nr] : BKE_gpencil_material_default();
+ Material *ma = (use_mat) ? tgpw->gpd->mat[gps->mat_nr] : BKE_material_default_gpencil();
MaterialGPencilStyle *gp_style = (ma) ? ma->gp_style : NULL;
- if ((gp_style == NULL) || (gp_style->flag & GP_STYLE_COLOR_HIDE) ||
+ if ((gp_style == NULL) || (gp_style->flag & GP_MATERIAL_HIDE) ||
/* if onion and ghost flag do not draw*/
- (tgpw->onion && (gp_style->flag & GP_STYLE_COLOR_ONIONSKIN))) {
+ (tgpw->onion && (gp_style->flag & GP_MATERIAL_ONIONSKIN))) {
continue;
}
More information about the Bf-blender-cvs
mailing list