[Bf-blender-cvs] [f0e9ecd26bb] greasepencil-object: GPencil: Fix error in Multiedit

Antonioya noreply at git.blender.org
Mon May 20 16:05:28 CEST 2019


Commit: f0e9ecd26bb8990ac28035e482a177c46a482688
Author: Antonioya
Date:   Mon May 20 16:05:18 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rBf0e9ecd26bb8990ac28035e482a177c46a482688

GPencil: Fix error in Multiedit

This error was related to the change to use depsgraph

===================================================================

M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c

===================================================================

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index c4668f3fa45..c270480e4dd 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -713,6 +713,7 @@ void DRW_gpencil_get_edit_geom(struct GpencilBatchCacheElem *be,
   Object *ob = draw_ctx->obact;
   bGPdata *gpd = ob->data;
   const bool is_weight_paint = (gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE);
+  const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
 
   int vgindex = ob->actdef - 1;
   if (!BLI_findlink(&ob->defbase, vgindex)) {
@@ -790,7 +791,7 @@ void DRW_gpencil_get_edit_geom(struct GpencilBatchCacheElem *be,
         ARRAY_SET_ITEMS(fcolor, 1.0f, 0.0f, 0.0f, 1.0f);
         fsize = vsize + 1;
       }
-      else if (pt->runtime.pt_orig == NULL) {
+      else if ((!is_multiedit) && (pt->runtime.pt_orig == NULL)) {
         ARRAY_SET_ITEMS(fcolor, linecolor[0], linecolor[1], linecolor[2], selectColor[3]);
         mul_v4_fl(fcolor, 0.9f);
         copy_v4_v4(fcolor, fcolor);
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index f510b8964fc..8b7b2ff4175 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1041,7 +1041,8 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache,
 
     /* be sure recalc all cache in source stroke to avoid recalculation when frame change
      * and improve fps */
-    DRW_gpencil_recalc_geometry_caches(ob, gpl, gp_style, gps->runtime.gps_orig);
+    DRW_gpencil_recalc_geometry_caches(
+        ob, gpl, gp_style, (gps->runtime.gps_orig) ? gps->runtime.gps_orig : gps);
 
     /* if the fill has any value, it's considered a fill and is not drawn if simplify fill is
      * enabled */



More information about the Bf-blender-cvs mailing list