Fix T60031: Joining two Grease Pencilobjects sometimes crashes
authorAntonioya <blendergit@gmail.com>
Wed, 2 Jan 2019 16:10:37 +0000 (17:10 +0100)
committerAntonioya <blendergit@gmail.com>
Wed, 2 Jan 2019 16:10:37 +0000 (17:10 +0100)
The drawing cache was not set as dirty and drawing engine used old data.

source/blender/editors/gpencil/gpencil_data.c

index 51046726e19306715d4e4bbbfbab7075b51d88d8..a8cfe91740cdd5610217e93d922b5ec8e27ec9e8 100644 (file)
@@ -2140,6 +2140,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
                                                BKE_animdata_merge_copy(bmain, &gpd_dst->id, &gpd_src->id, ADT_MERGECOPY_KEEP_DST, false);
                                        }
                                }
+                               DEG_id_tag_update(&gpd_src->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE);
                        }
 
                        /* Free the old object */
@@ -2148,6 +2149,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
        }
        CTX_DATA_END;
 
+       DEG_id_tag_update(&gpd_dst->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE);
        DEG_relations_tag_update(bmain);  /* because we removed object(s) */
 
        WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);