Commit: b274a01e58e19ef4b6e45b96cfe21c0c2597b3fe
Author: Antonioya
Date:   Tue Aug 7 13:36:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb274a01e58e19ef4b6e45b96cfe21c0c2597b3fe

Fix T56261: Grease Pencil simplify options get segment fault

The depsgraph was not updated as expected with the function used and the cache 
was not set as dirty.

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

M       source/blender/makesrna/intern/rna_scene.c
M       source/blender/makesrna/intern/rna_sculpt_paint.c

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

diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 6e572b084d4..bb87dde06c1 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -534,7 +534,12 @@ static const EnumPropertyItem 
transform_orientation_items[] = {
 /* Grease Pencil update cache */
 static void rna_GPencil_update(Main *bmain, Scene *UNUSED(scene), PointerRNA 
*UNUSED(ptr))
 {
-       DEG_id_type_tag(bmain, ID_GD);
+       /* mark all grease pencil datablocks */
+       for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) {
+               gpd->flag |= GP_DATA_CACHE_IS_DIRTY;
+               DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA);
+       }
+
        WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
 }
 
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c 
b/source/blender/makesrna/intern/rna_sculpt_paint.c
index c500c5f261f..37a5376f5d5 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -35,6 +35,7 @@
 #include "rna_internal.h"
 
 #include "DNA_ID.h"
+#include "DNA_gpencil_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_brush_types.h"
 #include "DNA_screen_types.h"
@@ -120,7 +121,12 @@ const EnumPropertyItem 
rna_enum_symmetrize_direction_items[] = {
 
 static void rna_GPencil_update(Main *bmain, Scene *UNUSED(scene), PointerRNA 
*UNUSED(ptr))
 {
-       DEG_id_type_tag(bmain, ID_GD);
+       /* mark all grease pencil datablocks */
+       for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) {
+               gpd->flag |= GP_DATA_CACHE_IS_DIRTY;
+               DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA);
+       }
+
        WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
 }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to