Sculpt: fix crash when no brush
If no brush exists the stroke operator falls through to the grab transform op in the global view3d keymap. This now works. It would be nice if we could get rid of that keymap entry though and add it manually to the edit/paint modes that need it.
This commit is contained in:
parent
7151c2dc3e
commit
918282d391
|
@ -4839,6 +4839,10 @@ static bool sculpt_needs_connectivity_info(const Sculpt *sd,
|
|||
SculptSession *ss,
|
||||
int stroke_mode)
|
||||
{
|
||||
if (!brush) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ss && ss->pbvh && SCULPT_is_automasking_enabled(sd, ss, brush)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -191,7 +191,8 @@ void SCULPT_filter_cache_init(bContext *C,
|
|||
|
||||
BKE_pbvh_search_gather(pbvh, SCULPT_search_sphere_cb, &search_data2, &nodes, &totnode);
|
||||
|
||||
if (SCULPT_pbvh_calc_area_normal(
|
||||
if (BKE_paint_brush(&sd->paint) &&
|
||||
SCULPT_pbvh_calc_area_normal(
|
||||
brush, ob, nodes, totnode, true, ss->filter_cache->initial_normal)) {
|
||||
copy_v3_v3(ss->last_normal, ss->filter_cache->initial_normal);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue