[Bf-blender-cvs] [3e8b1550dc4] master: Fix "Select" option being ignored when linking collection instances

Campbell Barton noreply at git.blender.org
Wed Sep 9 06:52:28 CEST 2020


Commit: 3e8b1550dc429b35aef8ad599ac94f913ab0d436
Author: Campbell Barton
Date:   Wed Sep 9 14:39:54 2020 +1000
Branches: master
https://developer.blender.org/rB3e8b1550dc429b35aef8ad599ac94f913ab0d436

Fix "Select" option being ignored when linking collection instances

Also check 'BASE_SELECTABLE' before selecting
which was only done for collections.

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

M	source/blender/blenloader/intern/readfile.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 195bb1e7f9f..18d563cb365 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10312,7 +10312,7 @@ static void add_loose_objects_to_scene(Main *mainvar,
           base->local_view_bits |= v3d->local_view_uuid;
         }
 
-        if (flag & FILE_AUTOSELECT) {
+        if ((flag & FILE_AUTOSELECT) && (base->flag & BASE_SELECTABLE)) {
           /* Do NOT make base active here! screws up GUI stuff,
            * if you want it do it at the editor level. */
           base->flag |= BASE_SELECTED;
@@ -10370,7 +10370,7 @@ static void add_loose_object_data_to_scene(Main *mainvar,
           base->local_view_bits |= v3d->local_view_uuid;
         }
 
-        if (flag & FILE_AUTOSELECT) {
+        if ((flag & FILE_AUTOSELECT) && (base->flag & BASE_SELECTABLE)) {
           /* Do NOT make base active here! screws up GUI stuff,
            * if you want it do it at the editor level. */
           base->flag |= BASE_SELECTED;
@@ -10416,13 +10416,16 @@ static void add_collections_to_scene(Main *mainvar,
         base->local_view_bits |= v3d->local_view_uuid;
       }
 
-      if (base->flag & BASE_SELECTABLE) {
+      if ((flag & FILE_AUTOSELECT) && (base->flag & BASE_SELECTABLE)) {
         base->flag |= BASE_SELECTED;
       }
 
       BKE_scene_object_base_flag_sync_from_base(base);
       DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
-      view_layer->basact = base;
+
+      if (flag & FILE_AUTOSELECT) {
+        view_layer->basact = base;
+      }
 
       /* Assign the collection. */
       ob->instance_collection = collection;



More information about the Bf-blender-cvs mailing list