diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-10-18 17:33:14 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-10-18 17:41:41 +0300 |
commit | 970d7ed860f1df7ad316830f7fef6babb5c66d7e (patch) | |
tree | 3ad531b4c2df886cc7adfed3dea76302be1e1003 /source/blender/editors/sculpt_paint | |
parent | 082fb6603d591679635f3f9134d862650642b3f7 (diff) |
Fix T70790: Crash in sculpt mode switching from two meshes after reload saved file
This fixes the crash, but it does not fix the core issue. The PBVH should
always be available when an object is in sculpt mode and tools should
not need to check for that.
Reviewed By: jbakker
Maniphest Tasks: T70790
Differential Revision: https://developer.blender.org/D6063
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 025bb707a81..06fa03ccbc6 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -6369,9 +6369,9 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, Po /* Returns true if any of the smoothing modes are active (currently * one of smooth brush, autosmooth, mask smooth, or shift-key * smooth) */ -static bool sculpt_needs_conectivity_info(const Brush *brush, SculptSession *ss, int stroke_mode) +static bool sculpt_needs_connectivity_info(const Brush *brush, SculptSession *ss, int stroke_mode) { - if (ss && sculpt_automasking_enabled(ss, brush)) { + if (ss && ss->pbvh && sculpt_automasking_enabled(ss, brush)) { return true; } return ((stroke_mode == BRUSH_STROKE_SMOOTH) || (ss && ss->cache && ss->cache->alt_smooth) || @@ -6385,7 +6385,7 @@ static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob, const B SculptSession *ss = ob->sculpt; View3D *v3d = CTX_wm_view3d(C); - bool need_pmap = sculpt_needs_conectivity_info(brush, ss, 0); + bool need_pmap = sculpt_needs_connectivity_info(brush, ss, 0); if (ss->shapekey_active || ss->deform_modifiers_active || (!BKE_sculptsession_use_pbvh_draw(ob, v3d) && need_pmap)) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); @@ -6738,7 +6738,7 @@ static void sculpt_brush_stroke_init(bContext *C, wmOperator *op) view3d_operator_needs_opengl(C); sculpt_brush_init_tex(scene, sd, ss); - is_smooth = sculpt_needs_conectivity_info(brush, ss, mode); + is_smooth = sculpt_needs_connectivity_info(brush, ss, mode); BKE_sculpt_update_object_for_edit(depsgraph, ob, is_smooth, need_mask); } |