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.
This commit is contained in:
Antonio Vazquez 2018-08-07 13:36:30 +02:00
parent ac2cdb21e6
commit b274a01e58
Notes: blender-bot 2023-02-14 05:28:08 +01:00
Referenced by issue #56261, Grease Pencil simplify options change get segment fault
2 changed files with 13 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);
}