Fix #110038: Crash when sculpting on GP object with modifier

When trying to sculpt a Grease Pencil object with a line art modifier
(other modifiers probably also casue issues), Blender would crash.
I wasn't able to track down the exact issue but it's related to how
the update-cache stores pointers to original data.

This reverts part of e2befa425a to not make use of the update
cache while sculpting. Combined with modifiers, this approach
is just too unstable right now.

Pull Request: https://projects.blender.org/blender/blender/pulls/114410
This commit is contained in:
Falk David
2023-11-02 17:08:36 +01:00
committed by Falk David
parent db5cae78b7
commit 05d6818aa2

View File

@@ -304,7 +304,6 @@ static void gpencil_update_geometry(bGPdata *gpd)
LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
if (gps->flag & GP_STROKE_TAG) {
BKE_gpencil_stroke_geometry_update(gpd, gps);
BKE_gpencil_tag_full_update(gpd, gpl, gpf, gps);
gps->flag &= ~GP_STROKE_TAG;
changed = true;
}
@@ -1389,7 +1388,6 @@ static void gpencil_sculpt_brush_init_stroke(bContext *C, tGP_BrushEditData *gso
*/
if (IS_AUTOKEY_ON(scene) && (gpf->framenum != cfra)) {
BKE_gpencil_frame_addcopy(gpl, cfra);
BKE_gpencil_tag_full_update(gpd, gpl, nullptr, nullptr);
/* Need tag to recalculate evaluated data to avoid crashes. */
DEG_id_tag_update(&gso->gpd->id, ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, nullptr);
@@ -1760,9 +1758,6 @@ static bool gpencil_sculpt_brush_do_frame(bContext *C,
/* Delay a full recalculation for other frames. */
gpencil_recalc_geometry_tag(gps_active);
}
bGPDlayer *gpl_active = (gpl->runtime.gpl_orig) ? gpl->runtime.gpl_orig : gpl;
bGPDframe *gpf_active = (gpf->runtime.gpf_orig) ? gpf->runtime.gpf_orig : gpf;
BKE_gpencil_tag_full_update(gpd, gpl_active, gpf_active, gps_active);
}
}