From bcdba7c34da05b1ab54f7ba2494fc8b93e0d3d6c Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 19 Jan 2021 18:42:49 +0100 Subject: [PATCH] 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. --- source/blender/editors/object/object_add.c | 3 +++ 1 file changed, 3 insertions(+) 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);