[Bf-blender-cvs] [71fc909601d] greasepencil-refactor: GPencil: Optimize triangulation calc in sculpt
Antonio Vazquez
noreply at git.blender.org
Mon Feb 3 09:06:18 CET 2020
Commit: 71fc909601d60848dba2073d49203fec05e3271f
Author: Antonio Vazquez
Date: Mon Feb 3 09:06:08 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB71fc909601d60848dba2073d49203fec05e3271f
GPencil: Optimize triangulation calc in sculpt
===================================================================
M source/blender/editors/gpencil/gpencil_sculpt_paint.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 68b0d06736c..9213afd6fca 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -1700,11 +1700,17 @@ static bool gpsculpt_brush_do_frame(bContext *C,
if (changed) {
bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig : gps;
if (gpl->actframe == gpf) {
- BKE_gpencil_stroke_geometry_update(gps_active);
- gps->flag &= ~GP_STROKE_TAG;
+ MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ /* Update active frame now, only if material has fill. */
+ if (gp_style->flag & GP_MATERIAL_FILL_SHOW) {
+ BKE_gpencil_stroke_geometry_update(gps_active);
+ }
+ else {
+ gpencil_recalc_geometry_tag(gps_active);
+ }
}
else {
- /* Delay calculation for non active frames. */
+ /* Delay a full recalculation for other frames. */
gpencil_recalc_geometry_tag(gps_active);
}
}
More information about the Bf-blender-cvs
mailing list