[Bf-blender-cvs] [5283f90bd09] soc-2019-outliner: Outliner cleanup

Nathan Craddock noreply at git.blender.org
Sat Aug 3 06:08:23 CEST 2019


Commit: 5283f90bd092f79769b4c81b4b731ada1781f67f
Author: Nathan Craddock
Date:   Thu Aug 1 17:13:10 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB5283f90bd092f79769b4c81b4b731ada1781f67f

Outliner cleanup

Cleanup and comment code more thoroughly after initial branch
review. Renamed SO_SYNC_SELECTION to SO_SYNC_SELECT.

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

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/startup/bl_ui/space_outliner.py
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/editors/interface/interface_eyedropper_datablock.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_select.c
M	source/blender/editors/space_outliner/outliner_tools.c
M	source/blender/editors/space_outliner/space_outliner.c
M	source/blender/makesdna/DNA_outliner_types.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/windowmanager/intern/wm_event_system.c

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

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 77933edb5c7..434f8e195a2 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -706,7 +706,7 @@ def km_outliner(params):
         ("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True},
          {"properties": [("extend", True), ("deselect_all", not params.legacy)]}),
         ("outliner.item_activate", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True},
-         {"properties": [("extend", False), ("range", True), ("deselect_all", not params.legacy)]}),
+         {"properties": [("extend", False), ("extend_range", True), ("deselect_all", not params.legacy)]}),
         ("outliner.select_box", {"type": 'B', "value": 'PRESS'}, None),
         ("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, {"properties": [("tweak", True)]}),
         ("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True},
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index 0cc0cf22732..f3e8d322a7b 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -48,7 +48,7 @@ class OUTLINER_HT_header(Header):
 
         if display_mode == 'SEQUENCE':
             row = layout.row(align=True)
-            row.prop(space, "use_sync_selection", text="")
+            row.prop(space, "use_sync_select", text="")
 
         row = layout.row(align=True)
         if display_mode in {'SCENES', 'VIEW_LAYER'}:
@@ -308,7 +308,7 @@ class OUTLINER_PT_filter(Panel):
         display_mode = space.display_mode
 
         row = layout.row(align=True)
-        row.prop(space, "use_sync_selection", text="Sync Selection")
+        row.prop(space, "use_sync_select", text="Sync Selection")
         layout.separator()
 
         if display_mode == 'VIEW_LAYER':
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 9df39fe15a2..340888297d0 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3538,7 +3538,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
         for (SpaceLink *space = sa->spacedata.first; space; space = space->next) {
           if (space->spacetype == SPACE_OUTLINER) {
             SpaceOutliner *soutliner = (SpaceOutliner *)space;
-            soutliner->flag |= SO_IS_DIRTY | SO_SYNC_SELECTION;
+            soutliner->flag |= SO_IS_DIRTY | SO_SYNC_SELECT;
           }
         }
       }
diff --git a/source/blender/editors/interface/interface_eyedropper_datablock.c b/source/blender/editors/interface/interface_eyedropper_datablock.c
index 723ca43bfc5..dc1b8d786ff 100644
--- a/source/blender/editors/interface/interface_eyedropper_datablock.c
+++ b/source/blender/editors/interface/interface_eyedropper_datablock.c
@@ -158,7 +158,7 @@ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int
   ddr->name[0] = '\0';
 
   if (sa) {
-    if (sa->spacetype == SPACE_VIEW3D || sa->spacetype == SPACE_OUTLINER) {
+    if (ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_OUTLINER)) {
       ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
       if (ar) {
         const int mval[2] = {mx - ar->winrct.xmin, my - ar->winrct.ymin};
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 8f44be7f377..9c9f133cfde 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -3636,7 +3636,7 @@ void draw_outliner(const bContext *C)
 
   /* Sync selection state from view layer or clean outliner if needed */
   if (!ELEM(soops->outlinevis, SO_LIBRARIES, SO_DATA_API, SO_ID_ORPHANS) &&
-      soops->flag & SO_SYNC_SELECTION) {
+      soops->flag & SO_SYNC_SELECT) {
     outliner_sync_selection(C, soops);
   }
   else {
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index e53bb4041b3..407c631552e 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1175,7 +1175,7 @@ static int outliner_select_all_exec(bContext *C, wmOperator *op)
       break;
   }
 
-  if (soops->flag & SO_SYNC_SELECTION) {
+  if (soops->flag & SO_SYNC_SELECT) {
     outliner_select_sync(C, soops);
   }
 
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 56ecc4f20c3..a28330e4282 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -139,6 +139,8 @@ enum {
   TE_DISABLED = (1 << 4),
   TE_DRAGGING = (1 << 5),
   TE_CHILD_NOT_IN_COLLECTION = (1 << 6),
+  /* Child elements of the same type in the iconrow are drawn merged as one icon.
+   * TE_ICONROW_MERGED is set for an element that is part of these merged child icons. */
   TE_ICONROW_MERGED = (1 << 7),
 };
 
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 88cedb68604..10bce2525d8 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1160,7 +1160,7 @@ static void do_outliner_item_activate_tree_element(bContext *C,
   else if (tselem->type == TSE_POSE_BASE) {
     /* Support pose mode toggle, keeping the active object as is. */
   }
-  else if (soops->flag & SO_SYNC_SELECTION) {
+  else if (soops->flag & SO_SYNC_SELECT) {
     /* Only activate when synced selection is enabled */
     tree_element_set_active_object(C,
                                    scene,
@@ -1239,7 +1239,7 @@ static void do_outliner_item_activate_tree_element(bContext *C,
       tree_element_active(C, scene, view_layer, soops, te, OL_SETSEL_NORMAL, false);
     }
   }
-  else if (soops->flag & SO_SYNC_SELECTION) {
+  else if (soops->flag & SO_SYNC_SELECT) {
     tree_element_type_active(C,
                              scene,
                              view_layer,
@@ -1427,7 +1427,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
     }
     ED_undo_push(C, "Outliner selection change");
 
-    if (soops->flag & SO_SYNC_SELECTION) {
+    if (soops->flag & SO_SYNC_SELECT) {
       outliner_select_sync(C, soops);
     }
   }
@@ -1439,7 +1439,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
 static int outliner_item_activate_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
   const bool extend = RNA_boolean_get(op->ptr, "extend");
-  const bool use_range = RNA_boolean_get(op->ptr, "range");
+  const bool use_range = RNA_boolean_get(op->ptr, "extend_range");
   const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
   return outliner_item_do_activate_from_cursor(C, event->mval, extend, use_range, deselect_all);
 }
@@ -1456,7 +1456,8 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
 
   PropertyRNA *prop;
   RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection for activation");
-  prop = RNA_def_boolean(ot->srna, "range", false, "Range", "Select a range from active element");
+  prop = RNA_def_boolean(
+      ot->srna, "extend_range", false, "Extend Range", "Select a range from active element");
   RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 
   prop = RNA_def_boolean(ot->srna,
@@ -1516,7 +1517,7 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op)
   WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
   ED_region_tag_redraw(ar);
 
-  if (soops->flag & SO_SYNC_SELECTION) {
+  if (soops->flag & SO_SYNC_SELECT) {
     outliner_select_sync(C, soops);
   }
 
@@ -1807,7 +1808,7 @@ static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEven
   /* Scroll outliner to focus on walk element */
   outliner_walk_scroll(ar, walk_element);
 
-  if (soops->flag & SO_SYNC_SELECTION) {
+  if (soops->flag & SO_SYNC_SELECT) {
     outliner_select_sync(C, soops);
   }
   ED_region_tag_redraw(ar);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index d42e92ed943..b64c42f994e 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -478,6 +478,9 @@ void OUTLINER_OT_scene_operation(wmOperatorType *ot)
 }
 /* ******************************************** */
 
+/* Stores the parent and a child element of a merged iconrow icon for
+ * the merged select popup menu. The subtree of the parent is searched and
+ * the child is needed to only show elements of the same type in the popup. */
 typedef struct MergedSearchData {
   TreeElement *parent_element;
   TreeElement *select_element;
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 0815d980c7f..43f2b22410c 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -302,7 +302,7 @@ static SpaceLink *outliner_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
   soutliner->filter_id_type = ID_GR;
   soutliner->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_HIDE;
   soutliner->outlinevis = SO_VIEW_LAYER;
-  soutliner->flag |= SO_IS_DIRTY | SO_SYNC_SELECTION;
+  soutliner->flag |= SO_IS_DIRTY | SO_SYNC_SELECT;
 
   /* header */
   ar = MEM_callocN(sizeof(ARegion), "header for outliner");
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index 561a8876ace..1e93e0a63c6 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -60,7 +60,9 @@ enum {
   TSE_DRAG_INTO = (1 << 6),
   TSE_DRAG_BEFORE = (1 << 7),
   TSE_DRAG_AFTER = (1 <<

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list