Sculpt-dev: fix crash in mask slice
This commit is contained in:
parent
185ca2912f
commit
25ae5ab2d9
|
@ -1450,7 +1450,20 @@ static void sculptsession_free_pbvh(Object *object)
|
|||
}
|
||||
|
||||
if (ss->pbvh) {
|
||||
BKE_pbvh_set_cached(object, ss->pbvh);
|
||||
if (ss->needs_pbvh_rebuild) {
|
||||
if (ss->pmap) {
|
||||
BKE_pbvh_pmap_release(ss->pmap);
|
||||
ss->pmap = NULL;
|
||||
}
|
||||
|
||||
BKE_pbvh_cache_remove(ss->pbvh);
|
||||
BKE_pbvh_free(ss->pbvh);
|
||||
}
|
||||
else {
|
||||
BKE_pbvh_set_cached(object, ss->pbvh);
|
||||
}
|
||||
|
||||
ss->needs_pbvh_rebuild = false;
|
||||
ss->pbvh = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -572,8 +572,9 @@ static int paint_mask_slice_exec(bContext *C, wmOperator *op)
|
|||
if (ob->mode == OB_MODE_SCULPT) {
|
||||
SculptSession *ss = ob->sculpt;
|
||||
|
||||
/* Assign a new Face Set ID to the new faces created by the slice operation. */
|
||||
BKE_sculptsession_update_attr_refs(ob);
|
||||
|
||||
/* Assign a new Face Set ID to the new faces created by the slice operation. */
|
||||
switch (BKE_pbvh_type(ss->pbvh)) {
|
||||
case PBVH_GRIDS:
|
||||
case PBVH_FACES:
|
||||
|
@ -603,6 +604,8 @@ static int paint_mask_slice_exec(bContext *C, wmOperator *op)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ss->needs_pbvh_rebuild = true;
|
||||
}
|
||||
|
||||
ED_sculpt_undo_geometry_end(ob);
|
||||
|
|
Loading…
Reference in New Issue