[Bf-blender-cvs] [9867a82072b] master: Cleanup: Outliner: Remove unused parameter

Nathan Craddock noreply at git.blender.org
Sat Mar 7 19:29:23 CET 2020


Commit: 9867a82072bb7d4394cbe8679b6c73d4ae209dbe
Author: Nathan Craddock
Date:   Sat Mar 7 11:19:39 2020 -0700
Branches: master
https://developer.blender.org/rB9867a82072bb7d4394cbe8679b6c73d4ae209dbe

Cleanup: Outliner: Remove unused parameter

Searching back in the outliner did not require the unused SpaceOutliner
parameter.

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

M	source/blender/editors/space_outliner/outliner_dragdrop.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/outliner_utils.c

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

diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index fbf319bea37..32ead9e8c3f 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -237,7 +237,7 @@ static TreeElement *outliner_drop_insert_collection_find(bContext *C,
 
 /* ******************** Parent Drop Operator *********************** */
 
-static bool parent_drop_allowed(SpaceOutliner *soops, TreeElement *te, Object *potential_child)
+static bool parent_drop_allowed(TreeElement *te, Object *potential_child)
 {
   TreeStoreElem *tselem = TREESTORE(te);
   if (te->idcode != ID_OB || tselem->type != 0) {
@@ -257,7 +257,7 @@ static bool parent_drop_allowed(SpaceOutliner *soops, TreeElement *te, Object *p
   }
 
   /* check that parent/child are both in the same scene */
-  Scene *scene = (Scene *)outliner_search_back(soops, te, ID_SCE);
+  Scene *scene = (Scene *)outliner_search_back(te, ID_SCE);
 
   /* currently outliner organized in a way that if there's no parent scene
    * element for object it means that all displayed objects belong to
@@ -316,7 +316,7 @@ static bool parent_drop_poll(bContext *C,
     return false;
   }
 
-  if (parent_drop_allowed(soops, te, potential_child)) {
+  if (parent_drop_allowed(te, potential_child)) {
     TREESTORE(te)->flag |= TSE_DRAG_INTO;
     ED_region_tag_redraw_no_rebuild(CTX_wm_region(C));
     return true;
@@ -332,7 +332,7 @@ static void parent_drop_set_parents(
   SpaceOutliner *soops = CTX_wm_space_outliner(C);
 
   TreeElement *te = outliner_find_id(soops, &soops->tree, &parent->id);
-  Scene *scene = (Scene *)outliner_search_back(soops, te, ID_SCE);
+  Scene *scene = (Scene *)outliner_search_back(te, ID_SCE);
 
   if (scene == NULL) {
     /* currently outliner organized in a way, that if there's no parent scene
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 4cc8ece0066..1d39dc156b2 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -484,7 +484,7 @@ TreeElement *outliner_find_parent_element(ListBase *lb,
 TreeElement *outliner_find_id(struct SpaceOutliner *soops, ListBase *lb, const struct ID *id);
 TreeElement *outliner_find_posechannel(ListBase *lb, const struct bPoseChannel *pchan);
 TreeElement *outliner_find_editbone(ListBase *lb, const struct EditBone *ebone);
-struct ID *outliner_search_back(SpaceOutliner *soops, TreeElement *te, short idcode);
+struct ID *outliner_search_back(TreeElement *te, short idcode);
 bool outliner_tree_traverse(const SpaceOutliner *soops,
                             ListBase *tree,
                             int filter_te_flag,
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index dd2179da815..6d449e98c7e 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -318,7 +318,7 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
     ob = (Object *)tselem->id;
   }
   else {
-    ob = (Object *)outliner_search_back(soops, te, ID_OB);
+    ob = (Object *)outliner_search_back(te, ID_OB);
 
     /* Don't return when activating children of the previous active object. */
     if (ob == OBACT(view_layer) && set == OL_SETSEL_NONE) {
@@ -329,7 +329,7 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
     return OL_DRAWSEL_NONE;
   }
 
-  sce = (Scene *)outliner_search_back(soops, te, ID_SCE);
+  sce = (Scene *)outliner_search_back(te, ID_SCE);
   if (sce && scene != sce) {
     WM_window_set_active_scene(CTX_data_main(C), C, CTX_wm_window(C), sce);
     scene = sce;
@@ -405,7 +405,6 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
 static eOLDrawState tree_element_active_material(bContext *C,
                                                  Scene *UNUSED(scene),
                                                  ViewLayer *view_layer,
-                                                 SpaceOutliner *soops,
                                                  TreeElement *te,
                                                  const eOLSetState set)
 {
@@ -413,7 +412,7 @@ static eOLDrawState tree_element_active_material(bContext *C,
   Object *ob;
 
   /* we search for the object parent */
-  ob = (Object *)outliner_search_back(soops, te, ID_OB);
+  ob = (Object *)outliner_search_back(te, ID_OB);
   // note: ob->matbits can be NULL when a local object points to a library mesh.
   if (ob == NULL || ob != OBACT(view_layer) || ob->matbits == NULL) {
     return OL_DRAWSEL_NONE; /* just paranoia */
@@ -461,11 +460,10 @@ static eOLDrawState tree_element_active_material(bContext *C,
 static eOLDrawState tree_element_active_camera(bContext *C,
                                                Scene *scene,
                                                ViewLayer *UNUSED(view_layer),
-                                               SpaceOutliner *soops,
                                                TreeElement *te,
                                                const eOLSetState set)
 {
-  Object *ob = (Object *)outliner_search_back(soops, te, ID_OB);
+  Object *ob = (Object *)outliner_search_back(te, ID_OB);
 
   if (set != OL_SETSEL_NONE) {
     scene->camera = ob;
@@ -1033,13 +1031,13 @@ eOLDrawState tree_element_active(bContext *C,
       }
       break;
     case ID_MA:
-      return tree_element_active_material(C, tvc->scene, tvc->view_layer, soops, te, set);
+      return tree_element_active_material(C, tvc->scene, tvc->view_layer, te, set);
     case ID_WO:
       return tree_element_active_world(C, tvc->scene, tvc->view_layer, soops, te, set);
     case ID_TXT:
       return tree_element_active_text(C, tvc->scene, tvc->view_layer, soops, te, set);
     case ID_CA:
-      return tree_element_active_camera(C, tvc->scene, tvc->view_layer, soops, te, set);
+      return tree_element_active_camera(C, tvc->scene, tvc->view_layer, te, set);
   }
   return OL_DRAWSEL_NONE;
 }
@@ -1208,7 +1206,7 @@ static void do_outliner_item_activate_tree_element(bContext *C,
       WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, tvc->scene);
     }
     else if (OB_DATA_SUPPORT_EDITMODE(te->idcode)) {
-      Object *ob = (Object *)outliner_search_back(soops, te, ID_OB);
+      Object *ob = (Object *)outliner_search_back(te, ID_OB);
       if ((ob != NULL) && (ob->data == tselem->id)) {
         Base *base = BKE_view_layer_base_find(tvc->view_layer, ob);
         if ((base != NULL) && (base->flag & BASE_VISIBLE_DEPSGRAPH)) {
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 63ffe3da27b..4cd93b5d257 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -832,7 +832,7 @@ void outliner_do_object_operation_ex(bContext *C,
     if (tselem->flag & TSE_SELECTED) {
       if (tselem->type == 0 && te->idcode == ID_OB) {
         // when objects selected in other scenes... dunno if that should be allowed
-        Scene *scene_owner = (Scene *)outliner_search_back(soops, te, ID_SCE);
+        Scene *scene_owner = (Scene *)outliner_search_back(te, ID_SCE);
         if (scene_owner && scene_act != scene_owner) {
           WM_window_set_active_scene(CTX_data_main(C), C, CTX_wm_window(C), scene_owner);
         }
@@ -1048,9 +1048,8 @@ static void constraint_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tsel
 {
   bContext *C = C_v;
   Main *bmain = CTX_data_main(C);
-  SpaceOutliner *soops = CTX_wm_space_outliner(C);
   bConstraint *constraint = (bConstraint *)te->directdata;
-  Object *ob = (Object *)outliner_search_back(soops, te, ID_OB);
+  Object *ob = (Object *)outliner_search_back(te, ID_OB);
 
   if (event == OL_CONSTRAINTOP_ENABLE) {
     constraint->flag &= ~CONSTRAINT_OFF;
@@ -1089,9 +1088,8 @@ static void modifier_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem
 {
   bContext *C = (bContext *)Carg;
   Main *bmain = CTX_data_main(C);
-  SpaceOutliner *soops = CTX_wm_space_outliner(C);
   ModifierData *md = (ModifierData *)te->directdata;
-  Object *ob = (Object *)outliner_search_back(soops, te, ID_OB);
+  Object *ob = (Object *)outliner_search_back(te, ID_OB);
 
   if (event == OL_MODIFIER_OP_TOGVIS) {
     md->mode ^= eModifierMode_Realtime;
diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c
index a12defac813..61ba4e9551d 100644
--- a/source/blender/editors/space_outliner/outliner_utils.c
+++ b/source/blender/editors/space_outliner/outliner_utils.c
@@ -255,7 +255,7 @@ TreeElement *outliner_find_editbone(ListBase *lb, const EditBone *ebone)
   return NULL;
 }
 
-ID *outliner_search_back(SpaceOutliner *UNUSED(soops), TreeElement *te, short idcode)
+ID *outliner_search_back(TreeElement *te, short idcode)
 {
   TreeStoreElem *tselem;
   te = te->parent;



More information about the Bf-blender-cvs mailing list