From 47bf0a33ef987a21bf717dcedcc282d39e66bb99 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 27 Nov 2018 10:43:01 +0100 Subject: [PATCH] Fix T57070: Take Two of 2.8 Crash in sculpting mode with tilling and Dyntopo. Accessing ob->bb directly is not a good idea anyway. Still, would like to know why/where this bbox is freed, since it is allocated at least once by depsgraph eval, as part of `BKE_object_handle_data_update()` function... --- source/blender/editors/sculpt_paint/sculpt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index fd1b331d76e..a497d555296 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3954,8 +3954,9 @@ static void do_tiled(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings SculptSession *ss = ob->sculpt; StrokeCache *cache = ss->cache; const float radius = cache->radius; - const float *bbMin = ob->bb->vec[0]; - const float *bbMax = ob->bb->vec[6]; + BoundBox *bb = BKE_object_boundbox_get(ob); + const float *bbMin = bb->vec[0]; + const float *bbMax = bb->vec[6]; const float *step = sd->paint.tile_offset; int dim;