GP: Tag datablock after mode change
authorAntonioya <blendergit@gmail.com>
Wed, 5 Dec 2018 16:21:38 +0000 (17:21 +0100)
committerAntonioya <blendergit@gmail.com>
Wed, 5 Dec 2018 16:22:03 +0000 (17:22 +0100)
source/blender/editors/gpencil/annotate_paint.c

index c7a8e357e541aa34c8183f4bc55ee04bc5e63c45..19697eddef7c5a0bb761e204910d84b39a4532e2 100644 (file)
@@ -1881,7 +1881,9 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
        if (sa && sa->spacetype == SPACE_VIEW3D) {
                if ((ob != NULL) && (ob->type == OB_GPENCIL)) {
                        ob->mode = OB_MODE_OBJECT;
-                       ED_gpencil_setup_modes(C, (bGPdata *)ob->data, 0);
+                       bGPdata *gpd = (bGPdata *)ob->data;
+                       ED_gpencil_setup_modes(C, gpd, 0);
+                       DEG_id_tag_update(&gpd->id, DEG_TAG_COPY_ON_WRITE);
 
                        ViewLayer *view_layer = CTX_data_view_layer(C);
                        BKE_view_layer_base_deselect_all(view_layer);