[Bf-blender-cvs] [216a215ba58] blender-v3.1-release: Fix T93573: Remove outline from instances in edit mode

Hans Goudey noreply at git.blender.org
Wed Mar 2 16:50:00 CET 2022


Commit: 216a215ba58ac67af5e7bfa334bbcef4e812ea3f
Author: Hans Goudey
Date:   Wed Mar 2 10:49:48 2022 -0500
Branches: blender-v3.1-release
https://developer.blender.org/rB216a215ba58ac67af5e7bfa334bbcef4e812ea3f

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 aa13c4b386b1 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

===================================================================

M	source/blender/draw/engines/overlay/overlay_engine.c

===================================================================

diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c
index 12db2bd02cf..516696640ce 100644
--- a/source/blender/draw/engines/overlay/overlay_engine.c
+++ b/source/blender/draw/engines/overlay/overlay_engine.c
@@ -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 &&



More information about the Bf-blender-cvs mailing list