Fix T77105: Crashes when clicking "new scene" button

This was introduced on ecc395e473.

Effectively this is reverting that commit for cases when
scene->toolsettings->sculpt is NULL. But since the facesets are only
working for sculpting this should be fine.
This commit is contained in:
2020-05-27 11:58:49 +02:00
parent f772a4b8fa
commit 1c3b2b5dd8

View File

@@ -78,12 +78,15 @@ static void OVERLAY_engine_init(void *vedata)
if (v3d->shading.type == OB_WIRE) {
pd->overlay.flag |= V3D_OVERLAY_WIREFRAMES;
}
if (ts->sculpt) {
if (ts->sculpt->flags & SCULPT_HIDE_FACE_SETS) {
pd->overlay.sculpt_mode_face_sets_opacity = 0.0f;
}
if (ts->sculpt->flags & SCULPT_HIDE_MASK) {
pd->overlay.sculpt_mode_mask_opacity = 0.0f;
}
}
pd->use_in_front = (v3d->shading.type <= OB_SOLID) ||
BKE_scene_uses_blender_workbench(draw_ctx->scene);