Cleanup: Outliner: Remove unused parameter

Searching back in the outliner did not require the unused SpaceOutliner
parameter.
This commit is contained in:
Nathan Craddock 2020-03-07 11:19:39 -07:00
parent 6b49a9db52
commit 9867a82072
5 changed files with 16 additions and 20 deletions

View File

@ -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

View File

@ -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,

View File

@ -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)) {

View File

@ -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;

View File

@ -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;