Fix T93573: Remove outline from instances in edit mode

This commit removes the outline from instances generated from an object
when in edit mode. This takes the change in aa13c4b386 a bit further,
with the idea that instance outlines are more like regular outlines.

Because evaluated object data that doesn't match the original object
type is treated as an instance internally, this fixes the way evaluated
meshes for curves objects have an outline, for example.

See the differential revision for a visual comparison.

Differential Revision: https://developer.blender.org/D14226
This commit is contained in:
Hans Goudey 2022-03-02 10:49:48 -05:00
parent 7935d3668a
commit 216a215ba5
Notes: blender-bot 2023-02-14 06:17:14 +01:00
Referenced by issue #93573, Regression: Selection outline of curves in edit mode
1 changed files with 6 additions and 0 deletions

View File

@ -303,6 +303,11 @@ 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 is_instance = (ob->base_flag & BASE_FROM_DUPLI);
const bool instance_parent_in_edit_mode = is_instance ?
overlay_object_is_edit_mode(
pd, DRW_object_get_dupli_parent(ob)) :
false;
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) &&
@ -329,6 +334,7 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
const bool draw_wires = draw_surface && has_surface &&
(pd->wireframe_mode || !pd->hide_overlays);
const bool draw_outlines = !in_edit_mode && !in_paint_mode && renderable && has_surface &&
!instance_parent_in_edit_mode &&
(pd->v3d_flag & V3D_SELECT_OUTLINE) &&
(ob->base_flag & BASE_SELECTED);
const bool draw_bone_selection = (ob->type == OB_MESH) && pd->armature.do_pose_fade_geom &&