diff options
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_edit.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 219 |
1 files changed, 114 insertions, 105 deletions
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 0fbcee12207..cd2fcd8e2cf 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -103,21 +103,22 @@ static int outliner_highlight_update(bContext *C, wmOperator *UNUSED(op), const } ARegion *region = CTX_wm_region(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); float view_mval[2]; UI_view2d_region_to_view( ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); - TreeElement *hovered_te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); + TreeElement *hovered_te = outliner_find_item_at_y( + space_outliner, &space_outliner->tree, view_mval[1]); if (hovered_te) { - hovered_te = outliner_find_item_at_x_in_row(soops, hovered_te, view_mval[0], NULL); + hovered_te = outliner_find_item_at_x_in_row(space_outliner, hovered_te, view_mval[0], NULL); } bool changed = false; if (!hovered_te || !(hovered_te->store_elem->flag & TSE_HIGHLIGHTED)) { - changed = outliner_flag_set(&soops->tree, TSE_HIGHLIGHTED | TSE_DRAG_ANY, false); + changed = outliner_flag_set(&space_outliner->tree, TSE_HIGHLIGHTED | TSE_DRAG_ANY, false); if (hovered_te) { hovered_te->store_elem->flag |= TSE_HIGHLIGHTED; changed = true; @@ -174,14 +175,14 @@ typedef struct OpenCloseData { static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); float view_mval[2]; UI_view2d_region_to_view( ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); if (event->type == MOUSEMOVE) { - TreeElement *te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); + TreeElement *te = outliner_find_item_at_y(space_outliner, &space_outliner->tree, view_mval[1]); OpenCloseData *data = (OpenCloseData *)op->customdata; @@ -221,7 +222,7 @@ static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEv static int outliner_item_openclose_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); const bool toggle_all = RNA_boolean_get(op->ptr, "all"); @@ -229,7 +230,7 @@ static int outliner_item_openclose_invoke(bContext *C, wmOperator *op, const wmE UI_view2d_region_to_view( ®ion->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]); - TreeElement *te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]); + TreeElement *te = outliner_find_item_at_y(space_outliner, &space_outliner->tree, view_mval[1]); if (te && outliner_item_is_co_within_close_toggle(te, view_mval[0])) { TreeStoreElem *tselem = TREESTORE(te); @@ -438,13 +439,14 @@ static void do_outliner_item_rename(ReportList *reports, static int outliner_item_rename(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; /* Rename active element if key pressed, otherwise rename element at cursor coordinates */ if (event->val == KM_PRESS) { - TreeElement *active_element = outliner_find_element_with_flag(&soops->tree, TSE_ACTIVE); + TreeElement *active_element = outliner_find_element_with_flag(&space_outliner->tree, + TSE_ACTIVE); if (active_element) { do_item_rename(region, active_element, TREESTORE(active_element), op->reports); @@ -456,7 +458,7 @@ static int outliner_item_rename(bContext *C, wmOperator *op, const wmEvent *even else { UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); - for (te = soops->tree.first; te; te = te->next) { + for (te = space_outliner->tree.first; te; te = te->next) { do_outliner_item_rename(op->reports, region, te, fmval); } } @@ -567,15 +569,15 @@ static int outliner_id_delete_invoke_do(bContext *C, static int outliner_id_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; - BLI_assert(region && soops); + BLI_assert(region && space_outliner); UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); - for (te = soops->tree.first; te; te = te->next) { + for (te = space_outliner->tree.first; te; te = te->next) { int ret; if ((ret = outliner_id_delete_invoke_do(C, op->reports, te, fmval))) { @@ -608,7 +610,7 @@ void OUTLINER_OT_id_delete(wmOperatorType *ot) static int outliner_id_remap_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); const short id_type = (short)RNA_enum_get(op->ptr, "id_type"); ID *old_id = BLI_findlink(which_libbase(CTX_data_main(C), id_type), @@ -617,7 +619,7 @@ static int outliner_id_remap_exec(bContext *C, wmOperator *op) RNA_enum_get(op->ptr, "new_id")); /* check for invalid states */ - if (soops == NULL) { + if (space_outliner == NULL) { return OPERATOR_CANCELLED; } @@ -684,14 +686,14 @@ static bool outliner_id_remap_find_tree_element(bContext *C, static int outliner_id_remap_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); float fmval[2]; if (!RNA_property_is_set(op->ptr, RNA_struct_find_property(op->ptr, "id_type"))) { UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); - outliner_id_remap_find_tree_element(C, op, &soops->tree, fmval[1]); + outliner_id_remap_find_tree_element(C, op, &space_outliner->tree, fmval[1]); } return WM_operator_props_dialog_popup(C, op, 200); @@ -783,7 +785,7 @@ void id_remap_fn(bContext *C, /** \name ID Copy Operator * \{ */ -static int outliner_id_copy_tag(SpaceOutliner *soops, ListBase *tree) +static int outliner_id_copy_tag(SpaceOutliner *space_outliner, ListBase *tree) { TreeElement *te; TreeStoreElem *tselem; @@ -802,8 +804,8 @@ static int outliner_id_copy_tag(SpaceOutliner *soops, ListBase *tree) } /* go over sub-tree */ - if (TSELEM_OPEN(tselem, soops)) { - num_ids += outliner_id_copy_tag(soops, &te->subtree); + if (TSELEM_OPEN(tselem, space_outliner)) { + num_ids += outliner_id_copy_tag(space_outliner, &te->subtree); } } @@ -813,12 +815,12 @@ static int outliner_id_copy_tag(SpaceOutliner *soops, ListBase *tree) static int outliner_id_copy_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); char str[FILE_MAX]; BKE_copybuffer_begin(bmain); - const int num_ids = outliner_id_copy_tag(soops, &soops->tree); + const int num_ids = outliner_id_copy_tag(space_outliner, &space_outliner->tree); if (num_ids == 0) { BKE_report(op->reports, RPT_INFO, "No selected data-blocks to copy"); return OPERATOR_CANCELLED; @@ -968,15 +970,15 @@ static int outliner_lib_relocate_invoke_do( static int outliner_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; - BLI_assert(region && soops); + BLI_assert(region && space_outliner); UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); - for (te = soops->tree.first; te; te = te->next) { + for (te = space_outliner->tree.first; te; te = te->next) { int ret; if ((ret = outliner_lib_relocate_invoke_do(C, op->reports, te, fmval, false))) { @@ -1019,15 +1021,15 @@ void lib_relocate_fn(bContext *C, static int outliner_lib_reload_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); TreeElement *te; float fmval[2]; - BLI_assert(region && soops); + BLI_assert(region && space_outliner); UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); - for (te = soops->tree.first; te; te = te->next) { + for (te = space_outliner->tree.first; te; te = te->next) { int ret; if ((ret = outliner_lib_relocate_invoke_do(C, op->reports, te, fmval, true))) { @@ -1194,14 +1196,14 @@ int common_restrict_check(bContext *C, Object *ob) static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op)) { - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); - if (outliner_flag_is_any_test(&soops->tree, TSE_CLOSED, 1)) { - outliner_flag_set(&soops->tree, TSE_CLOSED, 0); + if (outliner_flag_is_any_test(&space_outliner->tree, TSE_CLOSED, 1)) { + outliner_flag_set(&space_outliner->tree, TSE_CLOSED, 0); } else { - outliner_flag_set(&soops->tree, TSE_CLOSED, 1); + outliner_flag_set(&space_outliner->tree, TSE_CLOSED, 1); } ED_region_tag_redraw(region); @@ -1231,27 +1233,28 @@ void OUTLINER_OT_expanded_toggle(wmOperatorType *ot) static int outliner_select_all_exec(bContext *C, wmOperator *op) { - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); int action = RNA_enum_get(op->ptr, "action"); if (action == SEL_TOGGLE) { - action = outliner_flag_is_any_test(&soops->tree, TSE_SELECTED, 1) ? SEL_DESELECT : SEL_SELECT; + action = outliner_flag_is_any_test(&space_outliner->tree, TSE_SELECTED, 1) ? SEL_DESELECT : + SEL_SELECT; } switch (action) { case SEL_SELECT: - outliner_flag_set(&soops->tree, TSE_SELECTED, 1); + outliner_flag_set(&space_outliner->tree, TSE_SELECTED, 1); break; case SEL_DESELECT: - outliner_flag_set(&soops->tree, TSE_SELECTED, 0); + outliner_flag_set(&space_outliner->tree, TSE_SELECTED, 0); break; case SEL_INVERT: - outliner_flag_flip(&soops->tree, TSE_SELECTED); + outliner_flag_flip(&space_outliner->tree, TSE_SELECTED); break; } - ED_outliner_select_sync_from_outliner(C, soops); + ED_outliner_select_sync_from_outliner(C, space_outliner); DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); @@ -1283,7 +1286,7 @@ void OUTLINER_OT_select_all(wmOperatorType *ot) /** \name View Show Active (Outliner) Operator * \{ */ -static void outliner_set_coordinates_element_recursive(SpaceOutliner *soops, +static void outliner_set_coordinates_element_recursive(SpaceOutliner *space_outliner, TreeElement *te, int startx, int *starty) @@ -1295,22 +1298,22 @@ static void outliner_set_coordinates_element_recursive(SpaceOutliner *soops, te->ys = (float)(*starty); *starty -= UI_UNIT_Y; - if (TSELEM_OPEN(tselem, soops)) { + if (TSELEM_OPEN(tselem, space_outliner)) { TreeElement *ten; for (ten = te->subtree.first; ten; ten = ten->next) { - outliner_set_coordinates_element_recursive(soops, ten, startx + UI_UNIT_X, starty); + outliner_set_coordinates_element_recursive(space_outliner, ten, startx + UI_UNIT_X, starty); } } } /* to retrieve coordinates with redrawing the entire tree */ -void outliner_set_coordinates(ARegion *region, SpaceOutliner *soops) +void outliner_set_coordinates(ARegion *region, SpaceOutliner *space_outliner) { TreeElement *te; int starty = (int)(region->v2d.tot.ymax) - UI_UNIT_Y; - for (te = soops->tree.first; te; te = te->next) { - outliner_set_coordinates_element_recursive(soops, te, 0, &starty); + for (te = space_outliner->tree.first; te; te = te->next) { + outliner_set_coordinates_element_recursive(space_outliner, te, 0, &starty); } } @@ -1332,7 +1335,7 @@ static int outliner_open_back(TreeElement *te) /* Return element representing the active base or bone in the outliner, or NULL if none exists */ static TreeElement *outliner_show_active_get_element(bContext *C, - SpaceOutliner *so, + SpaceOutliner *space_outliner, ViewLayer *view_layer) { TreeElement *te; @@ -1343,7 +1346,7 @@ static TreeElement *outliner_show_active_get_element(bContext *C, return NULL; } - te = outliner_find_id(so, &so->tree, &obact->id); + te = outliner_find_id(space_outliner, &space_outliner->tree, &obact->id); if (te != NULL && obact->type == OB_ARMATURE) { /* traverse down the bone hierarchy in case of armature */ @@ -1366,41 +1369,44 @@ static TreeElement *outliner_show_active_get_element(bContext *C, return te; } -static void outliner_show_active(SpaceOutliner *so, ARegion *region, TreeElement *te, ID *id) +static void outliner_show_active(SpaceOutliner *space_outliner, + ARegion *region, + TreeElement *te, + ID *id) { /* open up tree to active object/bone */ if (TREESTORE(te)->id == id) { if (outliner_open_back(te)) { - outliner_set_coordinates(region, so); + outliner_set_coordinates(region, space_outliner); } return; } LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) { - outliner_show_active(so, region, ten, id); + outliner_show_active(space_outliner, region, ten, id); } } static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) { - SpaceOutliner *so = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ViewLayer *view_layer = CTX_data_view_layer(C); ARegion *region = CTX_wm_region(C); View2D *v2d = ®ion->v2d; - TreeElement *active_element = outliner_show_active_get_element(C, so, view_layer); + TreeElement *active_element = outliner_show_active_get_element(C, space_outliner, view_layer); if (active_element) { ID *id = TREESTORE(active_element)->id; /* Expand all elements in the outliner with matching ID */ - LISTBASE_FOREACH (TreeElement *, te, &so->tree) { - outliner_show_active(so, region, te, id); + LISTBASE_FOREACH (TreeElement *, te, &space_outliner->tree) { + outliner_show_active(space_outliner, region, te, id); } /* Also open back from the active_element (only done for the first found occurrence of ID * though). */ - outliner_show_active(so, region, active_element, id); + outliner_show_active(space_outliner, region, active_element, id); /* Center view on first element found */ int size_y = BLI_rcti_size_y(&v2d->mask) + 1; @@ -1484,7 +1490,7 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot) /* find next element that has this name */ static TreeElement *outliner_find_name( - SpaceOutliner *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound) + SpaceOutliner *space_outliner, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound) { TreeElement *te, *tes; @@ -1506,7 +1512,7 @@ static TreeElement *outliner_find_name( } } - tes = outliner_find_name(soops, &te->subtree, name, flags, prev, prevFound); + tes = outliner_find_name(space_outliner, &te->subtree, name, flags, prev, prevFound); if (tes) { return tes; } @@ -1517,37 +1523,37 @@ static TreeElement *outliner_find_name( } static void outliner_find_panel( - Scene *UNUSED(scene), ARegion *region, SpaceOutliner *soops, int again, int flags) + Scene *UNUSED(scene), ARegion *region, SpaceOutliner *space_outliner, int again, int flags) { ReportList *reports = NULL; /* CTX_wm_reports(C); */ TreeElement *te = NULL; TreeElement *last_find; TreeStoreElem *tselem; int ytop, xdelta, prevFound = 0; - char name[sizeof(soops->search_string)]; + char name[sizeof(space_outliner->search_string)]; /* get last found tree-element based on stored search_tse */ - last_find = outliner_find_tse(soops, &soops->search_tse); + last_find = outliner_find_tse(space_outliner, &space_outliner->search_tse); /* determine which type of search to do */ if (again && last_find) { /* no popup panel - previous + user wanted to search for next after previous */ - BLI_strncpy(name, soops->search_string, sizeof(name)); - flags = soops->search_flags; + BLI_strncpy(name, space_outliner->search_string, sizeof(name)); + flags = space_outliner->search_flags; /* try to find matching element */ - te = outliner_find_name(soops, &soops->tree, name, flags, last_find, &prevFound); + te = outliner_find_name(space_outliner, &space_outliner->tree, name, flags, last_find, &prevFound); if (te == NULL) { /* no more matches after previous, start from beginning again */ prevFound = 1; - te = outliner_find_name(soops, &soops->tree, name, flags, last_find, &prevFound); + te = outliner_find_name(space_outliner, &space_outliner->tree, name, flags, last_find, &prevFound); } } else { /* pop up panel - no previous, or user didn't want search after previous */ name[0] = '\0'; /* XXX if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) { */ - /* te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound); */ + /* te = outliner_find_name(space_outliner, &space_outliner->tree, name, flags, NULL, &prevFound); */ /* } */ /* else return; XXX RETURN! XXX */ } @@ -1557,12 +1563,12 @@ static void outliner_find_panel( tselem = TREESTORE(te); if (tselem) { /* expand branches so that it will be visible, we need to get correct coordinates */ - if (outliner_open_back(soops, te)) { - outliner_set_coordinates(region, soops); + if (outliner_open_back(space_outliner, te)) { + outliner_set_coordinates(region, space_outliner); } /* deselect all visible, and select found element */ - outliner_flag_set(soops, &soops->tree, TSE_SELECTED, 0); + outliner_flag_set(space_outliner, &space_outliner->tree, TSE_SELECTED, 0); tselem->flag |= TSE_SELECTED; /* make te->ys center of view */ @@ -1579,10 +1585,10 @@ static void outliner_find_panel( region->v2d.cur.xmax += xdelta; /* store selection */ - soops->search_tse = *tselem; + space_outliner->search_tse = *tselem; - BLI_strncpy(soops->search_string, name, sizeof(soops->search_string)); - soops->search_flags = flags; + BLI_strncpy(space_outliner->search_string, name, sizeof(space_outliner->search_string)); + space_outliner->search_flags = flags; /* redraw */ ED_region_tag_redraw_no_rebuild(region); @@ -1628,23 +1634,23 @@ static void outliner_openclose_level(ListBase *lb, int curlevel, int level, int static int outliner_one_level_exec(bContext *C, wmOperator *op) { - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); const bool add = RNA_boolean_get(op->ptr, "open"); int level; - level = outliner_flag_is_any_test(&soops->tree, TSE_CLOSED, 1); + level = outliner_flag_is_any_test(&space_outliner->tree, TSE_CLOSED, 1); if (add == 1) { if (level) { - outliner_openclose_level(&soops->tree, 1, level, 1); + outliner_openclose_level(&space_outliner->tree, 1, level, 1); } } else { if (level == 0) { - level = outliner_count_levels(&soops->tree, 0); + level = outliner_count_levels(&space_outliner->tree, 0); } if (level) { - outliner_openclose_level(&soops->tree, 1, level - 1, 0); + outliner_openclose_level(&space_outliner->tree, 1, level - 1, 0); } } @@ -1699,7 +1705,7 @@ static int subtree_has_objects(ListBase *lb) } /* recursive helper function for Show Hierarchy operator */ -static void tree_element_show_hierarchy(Scene *scene, SpaceOutliner *soops, ListBase *lb) +static void tree_element_show_hierarchy(Scene *scene, SpaceOutliner *space_outliner, ListBase *lb) { TreeElement *te; TreeStoreElem *tselem; @@ -1734,8 +1740,8 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOutliner *soops, List tselem->flag |= TSE_CLOSED; } - if (TSELEM_OPEN(tselem, soops)) { - tree_element_show_hierarchy(scene, soops, &te->subtree); + if (TSELEM_OPEN(tselem, space_outliner)) { + tree_element_show_hierarchy(scene, space_outliner, &te->subtree); } } } @@ -1743,12 +1749,12 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOutliner *soops, List /* show entire object level hierarchy */ static int outliner_show_hierarchy_exec(bContext *C, wmOperator *UNUSED(op)) { - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); /* recursively open/close levels */ - tree_element_show_hierarchy(scene, soops, &soops->tree); + tree_element_show_hierarchy(scene, space_outliner, &space_outliner->tree); ED_region_tag_redraw(region); @@ -1782,8 +1788,8 @@ static bool ed_operator_outliner_datablocks_active(bContext *C) { ScrArea *area = CTX_wm_area(C); if ((area) && (area->spacetype == SPACE_OUTLINER)) { - SpaceOutliner *so = CTX_wm_space_outliner(C); - return (so->outlinevis == SO_DATA_API); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); + return (space_outliner->outlinevis == SO_DATA_API); } return 0; } @@ -1957,7 +1963,7 @@ enum { } /*eDrivers_EditModes*/; /* Recursively iterate over tree, finding and working on selected items */ -static void do_outliner_drivers_editop(SpaceOutliner *soops, +static void do_outliner_drivers_editop(SpaceOutliner *space_outliner, ListBase *tree, ReportList *reports, short mode) @@ -2025,8 +2031,8 @@ static void do_outliner_drivers_editop(SpaceOutliner *soops, } /* go over sub-tree */ - if (TSELEM_OPEN(tselem, soops)) { - do_outliner_drivers_editop(soops, &te->subtree, reports, mode); + if (TSELEM_OPEN(tselem, space_outliner)) { + do_outliner_drivers_editop(space_outliner, &te->subtree, reports, mode); } } } @@ -2039,15 +2045,16 @@ static void do_outliner_drivers_editop(SpaceOutliner *soops, static int outliner_drivers_addsel_exec(bContext *C, wmOperator *op) { - SpaceOutliner *soutliner = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); /* check for invalid states */ - if (soutliner == NULL) { + if (space_outliner == NULL) { return OPERATOR_CANCELLED; } /* recursively go into tree, adding selected items */ - do_outliner_drivers_editop(soutliner, &soutliner->tree, op->reports, DRIVERS_EDITMODE_ADD); + do_outliner_drivers_editop( + space_outliner, &space_outliner->tree, op->reports, DRIVERS_EDITMODE_ADD); /* send notifiers */ WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); /* XXX */ @@ -2078,15 +2085,16 @@ void OUTLINER_OT_drivers_add_selected(wmOperatorType *ot) static int outliner_drivers_deletesel_exec(bContext *C, wmOperator *op) { - SpaceOutliner *soutliner = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); /* check for invalid states */ - if (soutliner == NULL) { + if (space_outliner == NULL) { return OPERATOR_CANCELLED; } /* recursively go into tree, adding selected items */ - do_outliner_drivers_editop(soutliner, &soutliner->tree, op->reports, DRIVERS_EDITMODE_REMOVE); + do_outliner_drivers_editop( + space_outliner, &space_outliner->tree, op->reports, DRIVERS_EDITMODE_REMOVE); /* send notifiers */ WM_event_add_notifier(C, ND_KEYS, NULL); /* XXX */ @@ -2153,7 +2161,7 @@ static KeyingSet *verify_active_keyingset(Scene *scene, short add) } /* Recursively iterate over tree, finding and working on selected items */ -static void do_outliner_keyingset_editop(SpaceOutliner *soops, +static void do_outliner_keyingset_editop(SpaceOutliner *space_outliner, KeyingSet *ks, ListBase *tree, short mode) @@ -2211,8 +2219,8 @@ static void do_outliner_keyingset_editop(SpaceOutliner *soops, } /* go over sub-tree */ - if (TSELEM_OPEN(tselem, soops)) { - do_outliner_keyingset_editop(soops, ks, &te->subtree, mode); + if (TSELEM_OPEN(tselem, space_outliner)) { + do_outliner_keyingset_editop(space_outliner, ks, &te->subtree, mode); } } } @@ -2225,7 +2233,7 @@ static void do_outliner_keyingset_editop(SpaceOutliner *soops, static int outliner_keyingset_additems_exec(bContext *C, wmOperator *op) { - SpaceOutliner *soutliner = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); Scene *scene = CTX_data_scene(C); KeyingSet *ks = verify_active_keyingset(scene, 1); @@ -2234,12 +2242,12 @@ static int outliner_keyingset_additems_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Operation requires an active keying set"); return OPERATOR_CANCELLED; } - if (soutliner == NULL) { + if (space_outliner == NULL) { return OPERATOR_CANCELLED; } /* recursively go into tree, adding selected items */ - do_outliner_keyingset_editop(soutliner, ks, &soutliner->tree, KEYINGSET_EDITMODE_ADD); + do_outliner_keyingset_editop(space_outliner, ks, &space_outliner->tree, KEYINGSET_EDITMODE_ADD); /* send notifiers */ WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL); @@ -2270,17 +2278,18 @@ void OUTLINER_OT_keyingset_add_selected(wmOperatorType *ot) static int outliner_keyingset_removeitems_exec(bContext *C, wmOperator *UNUSED(op)) { - SpaceOutliner *soutliner = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); Scene *scene = CTX_data_scene(C); KeyingSet *ks = verify_active_keyingset(scene, 1); /* check for invalid states */ - if (soutliner == NULL) { + if (space_outliner == NULL) { return OPERATOR_CANCELLED; } /* recursively go into tree, adding selected items */ - do_outliner_keyingset_editop(soutliner, ks, &soutliner->tree, KEYINGSET_EDITMODE_REMOVE); + do_outliner_keyingset_editop( + space_outliner, ks, &space_outliner->tree, KEYINGSET_EDITMODE_REMOVE); /* send notifiers */ WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL); @@ -2313,8 +2322,8 @@ static bool ed_operator_outliner_id_orphans_active(bContext *C) { ScrArea *area = CTX_wm_area(C); if (area != NULL && area->spacetype == SPACE_OUTLINER) { - SpaceOutliner *so = CTX_wm_space_outliner(C); - return (so->outlinevis == SO_ID_ORPHANS); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); + return (space_outliner->outlinevis == SO_ID_ORPHANS); } return true; } @@ -2382,7 +2391,7 @@ static int outliner_orphans_purge_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ScrArea *area = CTX_wm_area(C); - SpaceOutliner *soops = CTX_wm_space_outliner(C); + SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); int num_tagged[INDEX_ID_MAX] = {0}; if ((num_tagged[INDEX_ID_NULL] = RNA_int_get(op->ptr, "num_deleted")) == 0) { @@ -2409,7 +2418,7 @@ static int outliner_orphans_purge_exec(bContext *C, wmOperator *op) * handling notifiers/redraw which leads to deleting the same object twice. * cleanup tree here to prevent such cases. */ if ((area != NULL) && (area->spacetype == SPACE_OUTLINER)) { - outliner_cleanup_tree(soops); + outliner_cleanup_tree(space_outliner); } DEG_relations_tag_update(bmain); |