[Bf-blender-cvs] [70dd380d721] soc-2019-outliner: Outliner: Merged Element Search Menu Cleanup

Nathan Craddock noreply at git.blender.org
Wed Jul 24 03:05:29 CEST 2019


Commit: 70dd380d7214c6e4ea302aac013d31d393bde994
Author: Nathan Craddock
Date:   Tue Jul 23 13:34:01 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB70dd380d7214c6e4ea302aac013d31d393bde994

Outliner: Merged Element Search Menu Cleanup

Simplified the struct passed to the popup menu

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index c91fa30745c..beb6edb8122 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -90,8 +90,7 @@ typedef struct TreeElementIcon {
 
 typedef struct MergedSearchData {
   TreeElement *parent_element;
-  TreeStoreElem *tselem;
-  int element_type;
+  TreeElement *select_element;
 } MergedSearchData;
 
 #define TREESTORE_ID_TYPE(_id) \
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 679e4e17165..f53641540b4 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1425,8 +1425,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
     if (merged_elements) {
       MergedSearchData *select_data = MEM_callocN(sizeof(MergedSearchData), "merge_search_data");
       select_data->parent_element = te;
-      select_data->tselem = TREESTORE(activate_te);
-      select_data->element_type = tree_element_id_type_to_index(activate_te);
+      select_data->select_element = activate_te;
 
       UI_popup_block_invoke(
           C, merged_element_search_menu, select_data, merged_element_search_free_cb);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index b9a087fddf6..925e18f058b 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -514,10 +514,11 @@ static void merged_element_search_cb(const bContext *UNUSED(C),
 {
   MergedSearchData *search_data = (MergedSearchData *)data;
   TreeElement *parent = search_data->parent_element;
-  short tselem_type = search_data->tselem->type;
-  int type = search_data->element_type;
+  TreeElement *te = search_data->select_element;
 
-  merged_element_search_cb_recursive(&parent->subtree, tselem_type, type, str, items);
+  int type = tree_element_id_type_to_index(te);
+
+  merged_element_search_cb_recursive(&parent->subtree, TREESTORE(te)->type, type, str, items);
 }
 
 /* Activate an element from the merged element search menu */



More information about the Bf-blender-cvs mailing list