[Bf-blender-cvs] [bcf23c5d5da] greasepencil-refactor: GPencil: Tag datablock when init stroke

Antonio Vazquez noreply at git.blender.org
Wed Jan 8 19:17:48 CET 2020


Commit: bcf23c5d5da0b93b22a047e2dc6ba9c24a7a821a
Author: Antonio Vazquez
Date:   Wed Jan 8 19:17:30 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBbcf23c5d5da0b93b22a047e2dc6ba9c24a7a821a

GPencil: Tag datablock when init stroke

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

M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_primitive.c

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index e35d1f54865..457fe9f51b2 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2173,6 +2173,8 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps
       }
     }
   }
+  /* Tag datablock. */
+  gp_update_cache(p->gpd);
 }
 
 /* finish off a stroke (clears buffer, but doesn't finish the paint operation) */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 61f5dbfe270..31c0cd5a651 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -409,6 +409,8 @@ static void gp_primitive_set_initdata(bContext *C, tGPDprimitive *tgpi)
   /* Random generator, only init once. */
   uint rng_seed = (uint)(PIL_check_seconds_timer_i() & UINT_MAX);
   tgpi->rng = BLI_rng_new(rng_seed);
+
+  DEG_id_tag_update(&tgpi->gpd->id, ID_RECALC_COPY_ON_WRITE);
 }
 
 /* add new segment to curve */



More information about the Bf-blender-cvs mailing list