Fix T76902: face sets checkbox broken

Due to recent changes the face sets checkbox broke. The cause is that
{7d38f5036794} changed the responsibility of drawing and updating sculpt GPU
buffers to fix render glitches.

This patch moves the checkboxes evaluation to the overlay engine.
This commit is contained in:
Jeroen Bakker 2020-05-26 08:48:57 +02:00
parent 77fdd189e4
commit ecc395e473
Notes: blender-bot 2023-02-14 04:46:12 +01:00
Referenced by commit 1c3b2b5dd8, Fix T77105: Crashes when clicking "new scene" button
Referenced by issue #77105, 2.83 beta crashes when clicking "new scene" button
Referenced by issue #76902, face sets checkbox broken
1 changed files with 8 additions and 0 deletions

View File

@ -46,6 +46,8 @@ static void OVERLAY_engine_init(void *vedata)
const DRWContextState *draw_ctx = DRW_context_state_get();
const RegionView3D *rv3d = draw_ctx->rv3d;
const View3D *v3d = draw_ctx->v3d;
const Scene *scene = draw_ctx->scene;
const ToolSettings *ts = scene->toolsettings;
if (!stl->pd) {
/* Alloc transient pointers */
@ -76,6 +78,12 @@ 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;
}
pd->use_in_front = (v3d->shading.type <= OB_SOLID) ||
BKE_scene_uses_blender_workbench(draw_ctx->scene);