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:
Dalai Felinto 2020-05-27 11:58:49 +02:00
parent f772a4b8fa
commit 1c3b2b5dd8
Notes: blender-bot 2023-02-14 01:52:41 +01:00
Referenced by issue #77103, [Interface: Scenes] Blender crashes on making new scene
Referenced by issue #77105, 2.83 beta crashes when clicking "new scene" button
Referenced by issue #77088, Crash due to NULL `sculpt` pointer in toolsettings in draw code.
1 changed files with 8 additions and 5 deletions

View File

@ -78,11 +78,14 @@ static void OVERLAY_engine_init(void *vedata)
if (v3d->shading.type == OB_WIRE) {
pd->overlay.flag |= V3D_OVERLAY_WIREFRAMES;
}
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;
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) ||