Fix T77074: Collections: Exclude From ViewLayer toggle crashes

Consider this a bandaid fix (similar to rBe2724abc22d5).

Real issue seems to be that object is still in OB_MODE_PARTICLE_EDIT
whereas it should be in OB_MODE_OBJECT after toggling 'Exclude From
ViewLayer'. So while this patch prevents the crash, it leaves the object
in a weird state (it cannot be selected for example), needs further
investigation.

Maniphest Tasks: T77074

Differential Revision: https://developer.blender.org/D7843
This commit is contained in:
Philipp Oeser 2020-05-26 11:31:58 +02:00
parent 4114e89020
commit f3cf29ac96
Notes: blender-bot 2023-02-14 05:50:03 +01:00
Referenced by issue #77074, Collections: Exclude From ViewLayer toggle crashes when in particle editmode
1 changed files with 2 additions and 1 deletions

View File

@ -243,7 +243,8 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
const bool renderable = DRW_object_is_renderable(ob);
const bool in_pose_mode = ob->type == OB_ARMATURE && OVERLAY_armature_is_pose_mode(ob, draw_ctx);
const bool in_edit_mode = overlay_object_is_edit_mode(pd, ob);
const bool in_particle_edit_mode = ob->mode == OB_MODE_PARTICLE_EDIT;
const bool in_particle_edit_mode = (ob->mode == OB_MODE_PARTICLE_EDIT) &&
(pd->ctx_mode == CTX_MODE_PARTICLE);
const bool in_paint_mode = (ob == draw_ctx->obact) &&
(draw_ctx->object_mode & OB_MODE_ALL_PAINT);
const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL) &&