[Bf-blender-cvs] [bcdba7c34da] master: UI: Deselect other objects when dragging into 3D View

Julian Eisel noreply at git.blender.org
Tue Jan 19 18:49:13 CET 2021


Commit: bcdba7c34da05b1ab54f7ba2494fc8b93e0d3d6c
Author: Julian Eisel
Date:   Tue Jan 19 18:42:49 2021 +0100
Branches: master
https://developer.blender.org/rBbcdba7c34da05b1ab54f7ba2494fc8b93e0d3d6c

UI: Deselect other objects when dragging into 3D View

When dragging an object into the 3D View, e.g. from the Outliner or the Asset
Browser, other objects wouldn't get deselected. That differs from what other
drop operations do, which create a new object. They deselect other objects in a
lower-level function, which happens to not be called for just dropping objects.
So I guess this is an oversight.
Old behavior was also a bit annoying because users seem to expect this to
deselect.

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

M	source/blender/editors/object/object_add.c

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

diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index c6d6b8b16b9..4e8936357eb 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -3364,6 +3364,9 @@ static int object_add_named_exec(bContext *C, wmOperator *op)
     ED_view3d_cursor3d_position(C, mval, false, basen->object->loc);
   }
 
+  /* object_add_duplicate_internal() doesn't deselect other objects, unlike object_add_common() or
+   * BKE_view_layer_base_deselect_all(). */
+  ED_object_base_deselect_all(view_layer, NULL, BA_DESELECT);
   ED_object_base_select(basen, BA_SELECT);
   ED_object_base_activate(C, basen);



More information about the Bf-blender-cvs mailing list