Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Wed, 30 May 2018 05:34:22 +0000 (07:34 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 30 May 2018 05:34:22 +0000 (07:34 +0200)
1  2 
source/blender/editors/space_outliner/outliner_select.c
source/blender/makesdna/DNA_object_types.h

@@@ -846,33 -935,23 +846,33 @@@ static void do_outliner_item_activate_t
                                                break;
                                        }
                                }
 +                              FOREACH_COLLECTION_BASE_RECURSIVE_END
  
 -                              for (gob = gr->gobject.first; gob; gob = gob->next) {
 -                                      ED_base_object_select(BKE_scene_base_find(scene, gob->ob), sel);
 +                              FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(gr, object)
 +                              {
 +                                      ED_object_base_select(BKE_view_layer_base_find(view_layer, object), sel);
                                }
 +                              FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
                        }
                        else {
 -                              BKE_scene_base_deselect_all(scene);
 -
 -                              for (gob = gr->gobject.first; gob; gob = gob->next) {
 -                                      if ((gob->ob->flag & SELECT) == 0)
 -                                              ED_base_object_select(BKE_scene_base_find(scene, gob->ob), BA_SELECT);
 +                              BKE_view_layer_base_deselect_all(view_layer);
 +
 +                              FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(gr, object)
 +                              {
 +                                      Base *base = BKE_view_layer_base_find(view_layer, object);
 +                                      /* Object may not be in this scene */
 +                                      if (base != NULL) {
 +                                              if ((base->flag & BASE_SELECTED) == 0) {
 +                                                      ED_object_base_select(base, BA_SELECT);
 +                                              }
 +                                      }
                                }
 +                              FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
                        }
 -
 +                      
                        WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
                }
-               else if (ELEM(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) {
+               else if (OB_DATA_SUPPORT_EDITMODE(te->idcode)) {
                        WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL);
                }
                else {  // rest of types
@@@ -389,12 -378,16 +389,16 @@@ enum 
  #define OB_TYPE_SUPPORT_PARVERT(_type) \
        (ELEM(_type, OB_MESH, OB_SURF, OB_CURVE, OB_LATTICE))
  
+ /** Matches #OB_TYPE_SUPPORT_EDITMODE. */
+ #define OB_DATA_SUPPORT_EDITMODE(_type) \
+       (ELEM(_type, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR))
  /* is this ID type used as object data */
  #define OB_DATA_SUPPORT_ID(_id_type) \
 -      (ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_CA, ID_LT, ID_AR))
 +      (ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_LP, ID_CA, ID_LT, ID_AR))
  
  #define OB_DATA_SUPPORT_ID_CASE \
 -      ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_CA: case ID_LT: case ID_AR
 +      ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_LP: case ID_CA: case ID_LT: case ID_AR
  
  /* partype: first 4 bits: type */
  enum {