diff options
Diffstat (limited to 'source/blender/editors/space_outliner')
19 files changed, 130 insertions, 101 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index ff0bd533671..946d7a0538d 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -134,11 +134,6 @@ TreeTraversalAction outliner_find_selected_objects(TreeElement *te, void *custom return TRAVERSE_CONTINUE; } -/** - * Populates the \param objects: ListBase with all the outliner selected objects - * We store it as (Object *)LinkData->data - * \param objects: expected to be empty - */ void ED_outliner_selected_objects_get(const bContext *C, ListBase *objects) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index ed52eeab98c..a4d5f2635d4 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -1515,7 +1515,6 @@ void OUTLINER_OT_item_drag_drop(wmOperatorType *ot) /* *************************** Drop Boxes ************************** */ -/* region dropbox definition */ void outliner_dropboxes(void) { ListBase *lb = WM_dropboxmap_find("Outliner", SPACE_OUTLINER, RGN_TYPE_WINDOW); diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 956c455c545..c339f07fd58 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2933,12 +2933,6 @@ static void outliner_draw_iconrow_doit(uiBlock *block, (*offsx) += UI_UNIT_X; } -/** - * Return the index to use based on the TreeElement ID and object type - * - * We use a continuum of indices until we get to the object data-blocks - * and we then make room for the object types. - */ int tree_element_id_type_to_index(TreeElement *te) { TreeStoreElem *tselem = TREESTORE(te); diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index e449e4a609b..9f6fd5d91bb 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -154,9 +154,6 @@ void OUTLINER_OT_highlight_update(wmOperatorType *ot) /** \name Toggle Open/Closed Operator * \{ */ -/** - * Open or close a tree element, optionally toggling all children recursively. - */ void outliner_item_openclose(SpaceOutliner *space_outliner, TreeElement *te, bool open, @@ -964,9 +961,6 @@ void OUTLINER_OT_lib_relocate(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* XXX This does not work with several items - * (it is only called once in the end, due to the 'deferred' - * file-browser invocation through event system...). */ void lib_relocate_fn(bContext *C, ReportList *UNUSED(reports), Scene *UNUSED(scene), @@ -975,6 +969,10 @@ void lib_relocate_fn(bContext *C, TreeStoreElem *tselem, void *UNUSED(user_data)) { + /* XXX: This does not work with several items + * (it is only called once in the end, due to the 'deferred' + * file-browser invocation through event system...). */ + wmOperatorType *ot = WM_operatortype_find("WM_OT_lib_relocate", false); lib_relocate(C, te, tselem, ot, false); @@ -1068,10 +1066,6 @@ int outliner_flag_is_any_test(ListBase *lb, short flag, const int curlevel) return 0; } -/** - * Set or unset \a flag for all outliner elements in \a lb and sub-trees. - * \return if any flag was modified. - */ bool outliner_flag_set(ListBase *lb, short flag, short set) { bool changed = false; @@ -1225,7 +1219,6 @@ static void outliner_set_coordinates_element_recursive(SpaceOutliner *space_outl } } -/* to retrieve coordinates with redrawing the entire tree */ void outliner_set_coordinates(ARegion *region, SpaceOutliner *space_outliner) { int starty = (int)(region->v2d.tot.ymax) - UI_UNIT_Y; diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 5336376b576..dfc9017360c 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -250,8 +250,17 @@ typedef enum TreeItemSelectAction { void outliner_free_tree(ListBase *tree); void outliner_cleanup_tree(struct SpaceOutliner *space_outliner); +/** + * Free \a element and its sub-tree and remove its link in \a parent_subtree. + * + * \note Does not remove the #TreeStoreElem of \a element! + * \param parent_subtree: Sub-tree of the parent element, so the list containing \a element. + */ void outliner_free_tree_element(TreeElement *element, ListBase *parent_subtree); +/** + * Main entry point for building the tree data-structure that the outliner represents. + */ void outliner_build_tree(struct Main *mainvar, struct Scene *scene, struct ViewLayer *view_layer, @@ -260,6 +269,10 @@ void outliner_build_tree(struct Main *mainvar, bool outliner_requires_rebuild_on_select_or_active_change( const struct SpaceOutliner *space_outliner); +/** + * Check if a display mode needs a full rebuild if the open/collapsed state changes. + * Element types in these modes don't actually add children if collapsed, so the rebuild is needed. + */ bool outliner_requires_rebuild_on_open_change(const struct SpaceOutliner *space_outliner); typedef struct IDsSelectedData { @@ -285,19 +298,34 @@ void outliner_collection_isolate_flag(struct Scene *scene, const char *propname, const bool value); +/** + * Return the index to use based on the TreeElement ID and object type + * + * We use a continuum of indices until we get to the object data-blocks + * and we then make room for the object types. + */ int tree_element_id_type_to_index(TreeElement *te); /* outliner_select.c -------------------------------------------- */ +/** + * Generic call for non-id data to make active in UI + */ void tree_element_type_active_set(struct bContext *C, const TreeViewContext *tvc, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set, bool recursive); +/** + * Generic call for non-id data to check the active state in UI. + */ eOLDrawState tree_element_type_active_state_get(const struct bContext *C, const struct TreeViewContext *tvc, const TreeElement *te, const TreeStoreElem *tselem); +/** + * Generic call for ID data check or make/check active in UI. + */ void tree_element_activate(struct bContext *C, const TreeViewContext *tvc, TreeElement *te, @@ -309,17 +337,32 @@ eOLDrawState tree_element_active_state_get(const TreeViewContext *tvc, struct bPoseChannel *outliner_find_parent_bone(TreeElement *te, TreeElement **r_bone_te); +/** + * Select the item using the set flags. + */ void outliner_item_select(struct bContext *C, struct SpaceOutliner *space_outliner, struct TreeElement *te, const short select_flag); +/** + * Find if x coordinate is over an icon or name. + */ bool outliner_item_is_co_over_name_icons(const TreeElement *te, float view_co_x); bool outliner_item_is_co_over_icon(const TreeElement *te, float view_co_x); +/** + * Find if x coordinate is over element name. + */ bool outliner_item_is_co_over_name(const TreeElement *te, float view_co_x); +/** + * Find if x coordinate is over element disclosure toggle. + */ bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x); bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner, const float view_mval[2]); +/** + * Toggle the item's interaction mode if supported. + */ void outliner_item_mode_toggle(struct bContext *C, TreeViewContext *tvc, TreeElement *te, @@ -334,6 +377,10 @@ typedef void (*outliner_operation_fn)(struct bContext *C, TreeStoreElem *, void *); +/** + * \param recurse_selected: Set to false for operations which are already + * recursively operating on their children. + */ void outliner_do_object_operation_ex(struct bContext *C, struct ReportList *reports, struct Scene *scene, @@ -350,6 +397,10 @@ void outliner_do_object_operation(struct bContext *C, outliner_operation_fn operation_fn); int outliner_flag_is_any_test(ListBase *lb, short flag, const int curlevel); +/** + * Set or unset \a flag for all outliner elements in \a lb and sub-trees. + * \return if any flag was modified. + */ bool outliner_flag_set(ListBase *lb, short flag, short set); bool outliner_flag_flip(ListBase *lb, short flag); @@ -390,14 +441,24 @@ void id_remap_fn(struct bContext *C, struct TreeStoreElem *tselem, void *user_data); +/** + * To retrieve coordinates with redrawing the entire tree. + */ void outliner_set_coordinates(struct ARegion *region, struct SpaceOutliner *space_outliner); +/** + * Open or close a tree element, optionally toggling all children recursively. + */ void outliner_item_openclose(struct SpaceOutliner *space_outliner, TreeElement *te, bool open, bool toggle_all); /* outliner_dragdrop.c */ + +/** + * Region dropbox definition. + */ void outliner_dropboxes(void); void OUTLINER_OT_item_drag_drop(struct wmOperatorType *ot); @@ -446,6 +507,8 @@ void merged_element_search_menu_invoke(struct bContext *C, TreeElement *parent_te, TreeElement *activate_te); +/* Menu only! Calls other operators */ + void OUTLINER_OT_operation(struct wmOperatorType *ot); void OUTLINER_OT_scene_operation(struct wmOperatorType *ot); void OUTLINER_OT_object_operation(struct wmOperatorType *ot); @@ -510,19 +573,41 @@ void OUTLINER_OT_collection_color_tag_set(struct wmOperatorType *ot); void outliner_viewcontext_init(const struct bContext *C, TreeViewContext *tvc); +/** + * Try to find an item under y-coordinate \a view_co_y (view-space). + * \note Recursive + */ TreeElement *outliner_find_item_at_y(const SpaceOutliner *space_outliner, const ListBase *tree, float view_co_y); +/** + * Collapsed items can show their children as click-able icons. This function tries to find + * such an icon that represents the child item at x-coordinate \a view_co_x (view-space). + * + * \return a hovered child item or \a parent_te (if no hovered child found). + */ TreeElement *outliner_find_item_at_x_in_row(const SpaceOutliner *space_outliner, TreeElement *parent_te, float view_co_x, bool *r_is_merged_icon, bool *r_is_over_icon); +/** + * Tse is not in the treestore, we use its contents to find a match. + */ TreeElement *outliner_find_tse(struct SpaceOutliner *space_outliner, const TreeStoreElem *tse); +/** + * Find specific item from the trees-tore. + */ TreeElement *outliner_find_tree_element(ListBase *lb, const TreeStoreElem *store_elem); +/** + * Find parent element of te. + */ TreeElement *outliner_find_parent_element(ListBase *lb, TreeElement *parent_te, const TreeElement *child_te); +/** + * Find treestore that refers to given ID. + */ TreeElement *outliner_find_id(struct SpaceOutliner *space_outliner, ListBase *lb, const struct ID *id); @@ -530,6 +615,14 @@ TreeElement *outliner_find_posechannel(ListBase *lb, const struct bPoseChannel * TreeElement *outliner_find_editbone(ListBase *lb, const struct EditBone *ebone); TreeElement *outliner_search_back_te(TreeElement *te, short idcode); struct ID *outliner_search_back(TreeElement *te, short idcode); +/** + * Iterate over all tree elements (pre-order traversal), executing \a func callback for + * each tree element matching the optional filters. + * + * \param filter_te_flag: If not 0, only TreeElements with this flag will be visited. + * \param filter_tselem_flag: Same as \a filter_te_flag, but for the TreeStoreElem. + * \param func: Custom callback to execute for each visited item. + */ bool outliner_tree_traverse(const SpaceOutliner *space_outliner, ListBase *tree, int filter_te_flag, @@ -537,16 +630,33 @@ bool outliner_tree_traverse(const SpaceOutliner *space_outliner, TreeTraversalFunc func, void *customdata); float outliner_restrict_columns_width(const struct SpaceOutliner *space_outliner); +/** + * Find first tree element in tree with matching treestore flag. + */ TreeElement *outliner_find_element_with_flag(const ListBase *lb, short flag); +/** + * Find if element is visible in the outliner tree. + */ bool outliner_is_element_visible(const TreeElement *te); +/** + * Scroll view vertically while keeping within total bounds. + */ void outliner_scroll_view(struct SpaceOutliner *space_outliner, struct ARegion *region, int delta_y); +/** + * The outliner should generally use #ED_region_tag_redraw_no_rebuild() to avoid unnecessary tree + * rebuilds. If elements are open or closed, we may still have to rebuild. + * Upon changing the open/closed state, call this to avoid rebuilds if possible. + */ void outliner_tag_redraw_avoid_rebuild_on_open_change(const struct SpaceOutliner *space_outliner, struct ARegion *region); /* outliner_sync.c ---------------------------------------------- */ +/** + * If outliner is dirty sync selection from view layer and sequencer. + */ void outliner_sync_selection(const struct bContext *C, struct SpaceOutliner *space_outliner); /* outliner_context.c ------------------------------------------- */ diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 5e409db0059..855975eb2dc 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -184,7 +184,6 @@ static void do_outliner_item_mode_toggle_generic(bContext *C, TreeViewContext *t ED_undo_group_end(C); } -/* Toggle the item's interaction mode if supported */ void outliner_item_mode_toggle(bContext *C, TreeViewContext *tvc, TreeElement *te, @@ -747,7 +746,6 @@ static void tree_element_text_activate(bContext *C, TreeElement *te) /* ---------------------------------------------- */ -/* generic call for ID data check or make/check active in UI */ void tree_element_activate(bContext *C, const TreeViewContext *tvc, TreeElement *te, @@ -778,9 +776,6 @@ void tree_element_activate(bContext *C, } } -/** - * Generic call for non-id data to make active in UI - */ void tree_element_type_active_set(bContext *C, const TreeViewContext *tvc, TreeElement *te, @@ -1086,9 +1081,6 @@ eOLDrawState tree_element_active_state_get(const TreeViewContext *tvc, return OL_DRAWSEL_NONE; } -/** - * Generic call for non-id data to check the active state in UI. - */ eOLDrawState tree_element_type_active_state_get(const bContext *C, const TreeViewContext *tvc, const TreeElement *te, @@ -1446,7 +1438,6 @@ static void do_outliner_item_activate_tree_element(bContext *C, } } -/* Select the item using the set flags */ void outliner_item_select(bContext *C, SpaceOutliner *space_outliner, TreeElement *te, diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c index d78767019b5..d95a0dde858 100644 --- a/source/blender/editors/space_outliner/outliner_sync.c +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -52,7 +52,6 @@ #include "outliner_intern.h" -/* Functions for tagging outliner selection syncing is dirty from operators */ void ED_outliner_select_sync_from_object_tag(bContext *C) { wmWindowManager *wm = CTX_wm_manager(C); @@ -89,7 +88,6 @@ bool ED_outliner_select_sync_is_dirty(const bContext *C) return wm->outliner_sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_ALL; } -/* Copy sync select dirty flag from window manager to all outliners to be synced lazily on draw */ void ED_outliner_select_sync_flag_outliners(const bContext *C) { Main *bmain = CTX_data_main(C); @@ -352,7 +350,6 @@ static void outliner_sync_selection_from_outliner(Scene *scene, } } -/* Set clean outliner and mark other outliners for syncing */ void ED_outliner_select_sync_from_outliner(bContext *C, SpaceOutliner *space_outliner) { /* Don't sync if not checked or in certain outliner display modes */ @@ -547,7 +544,6 @@ static void get_sync_select_active_data(const bContext *C, SyncSelectActiveData active_data->sequence = SEQ_select_active_get(scene); } -/* If outliner is dirty sync selection from view layer and sequencer. */ void outliner_sync_selection(const bContext *C, SpaceOutliner *space_outliner) { /* Set which types of data to sync from sync dirty flag and outliner display mode */ diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index ae2b1870884..01f0feec771 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -1095,10 +1095,6 @@ static void singleuser_world_fn(bContext *C, } } -/** - * \param recurse_selected: Set to false for operations which are already - * recursively operating on their children. - */ void outliner_do_object_operation_ex(bContext *C, ReportList *reports, Scene *scene_act, @@ -2984,7 +2980,6 @@ static int outliner_operation(bContext *C, wmOperator *op, const wmEvent *event) return do_outliner_operation_event(C, op->reports, region, space_outliner, hovered_te); } -/* Menu only! Calls other operators */ void OUTLINER_OT_operation(wmOperatorType *ot) { ot->name = "Context Menu"; diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 5427ae31ac3..3353726de18 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -203,12 +203,6 @@ void outliner_cleanup_tree(SpaceOutliner *space_outliner) outliner_storage_cleanup(space_outliner); } -/** - * Free \a element and its sub-tree and remove its link in \a parent_subtree. - * - * \note Does not remove the #TreeStoreElem of \a element! - * \param parent_subtree: Sub-tree of the parent element, so the list containing \a element. - */ void outliner_free_tree_element(TreeElement *element, ListBase *parent_subtree) { BLI_assert(BLI_findindex(parent_subtree, element) > -1); @@ -235,10 +229,6 @@ bool outliner_requires_rebuild_on_select_or_active_change(const SpaceOutliner *s return exclude_flags & (SO_FILTER_OB_STATE_SELECTED | SO_FILTER_OB_STATE_ACTIVE); } -/** - * Check if a display mode needs a full rebuild if the open/collapsed state changes. - * Element types in these modes don't actually add children if collapsed, so the rebuild is needed. - */ bool outliner_requires_rebuild_on_open_change(const SpaceOutliner *space_outliner) { return ELEM(space_outliner->outlinevis, SO_DATA_API); @@ -822,13 +812,6 @@ static void outliner_add_id_contents(SpaceOutliner *space_outliner, } } -/** - * TODO: this function needs to be split up! It's getting a bit too large... - * - * \note "ID" is not always a real ID. - * \note If child items are only added to the tree if the item is open, - * the `TSE_` type _must_ be added to #outliner_element_needs_rebuild_on_open_change(). - */ TreeElement *outliner_add_element(SpaceOutliner *space_outliner, ListBase *lb, void *idv, @@ -1176,7 +1159,6 @@ TreeElement *outliner_add_collection_recursive(SpaceOutliner *space_outliner, /* Hierarchy --------------------------------------------- */ -/* make sure elements are correctly nested */ void outliner_make_object_parent_hierarchy(ListBase *lb) { /* build hierarchy */ @@ -1876,7 +1858,6 @@ static void outliner_clear_newid_from_main(Main *bmain) /* ======================================================= */ /* Main Tree Building API */ -/* Main entry point for building the tree data-structure that the outliner represents. */ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c index c62ca468747..d370d508198 100644 --- a/source/blender/editors/space_outliner/outliner_utils.c +++ b/source/blender/editors/space_outliner/outliner_utils.c @@ -71,10 +71,6 @@ void outliner_viewcontext_init(const bContext *C, TreeViewContext *tvc) /** \} */ -/** - * Try to find an item under y-coordinate \a view_co_y (view-space). - * \note Recursive - */ TreeElement *outliner_find_item_at_y(const SpaceOutliner *space_outliner, const ListBase *tree, float view_co_y) @@ -142,12 +138,6 @@ static TreeElement *outliner_find_item_at_x_in_row_recursive(const TreeElement * return (TreeElement *)parent_te; } -/** - * Collapsed items can show their children as click-able icons. This function tries to find - * such an icon that represents the child item at x-coordinate \a view_co_x (view-space). - * - * \return a hovered child item or \a parent_te (if no hovered child found). - */ TreeElement *outliner_find_item_at_x_in_row(const SpaceOutliner *space_outliner, TreeElement *parent_te, float view_co_x, @@ -167,7 +157,6 @@ TreeElement *outliner_find_item_at_x_in_row(const SpaceOutliner *space_outliner, return te; } -/* Find specific item from the trees-tore. */ TreeElement *outliner_find_tree_element(ListBase *lb, const TreeStoreElem *store_elem) { LISTBASE_FOREACH (TreeElement *, te, lb) { @@ -182,7 +171,6 @@ TreeElement *outliner_find_tree_element(ListBase *lb, const TreeStoreElem *store return NULL; } -/* Find parent element of te */ TreeElement *outliner_find_parent_element(ListBase *lb, TreeElement *parent_te, const TreeElement *child_te) @@ -200,7 +188,6 @@ TreeElement *outliner_find_parent_element(ListBase *lb, return NULL; } -/* tse is not in the treestore, we use its contents to find a match */ TreeElement *outliner_find_tse(SpaceOutliner *space_outliner, const TreeStoreElem *tse) { TreeStoreElem *tselem; @@ -219,7 +206,6 @@ TreeElement *outliner_find_tse(SpaceOutliner *space_outliner, const TreeStoreEle return NULL; } -/* Find treestore that refers to given ID */ TreeElement *outliner_find_id(SpaceOutliner *space_outliner, ListBase *lb, const ID *id) { LISTBASE_FOREACH (TreeElement *, te, lb) { @@ -302,14 +288,6 @@ ID *outliner_search_back(TreeElement *te, short idcode) return NULL; } -/** - * Iterate over all tree elements (pre-order traversal), executing \a func callback for - * each tree element matching the optional filters. - * - * \param filter_te_flag: If not 0, only TreeElements with this flag will be visited. - * \param filter_tselem_flag: Same as \a filter_te_flag, but for the TreeStoreElem. - * \param func: Custom callback to execute for each visited item. - */ bool outliner_tree_traverse(const SpaceOutliner *space_outliner, ListBase *tree, int filter_te_flag, @@ -393,7 +371,6 @@ float outliner_restrict_columns_width(const SpaceOutliner *space_outliner) return (num_columns * UI_UNIT_X + V2D_SCROLL_WIDTH); } -/* Find first tree element in tree with matching treestore flag */ TreeElement *outliner_find_element_with_flag(const ListBase *lb, short flag) { LISTBASE_FOREACH (TreeElement *, te, lb) { @@ -408,7 +385,6 @@ TreeElement *outliner_find_element_with_flag(const ListBase *lb, short flag) return NULL; } -/* Find if element is visible in the outliner tree */ bool outliner_is_element_visible(const TreeElement *te) { TreeStoreElem *tselem; @@ -425,7 +401,6 @@ bool outliner_is_element_visible(const TreeElement *te) return true; } -/* Find if x coordinate is over an icon or name */ bool outliner_item_is_co_over_name_icons(const TreeElement *te, float view_co_x) { /* Special case: count area left of Scene Collection as empty space */ @@ -441,19 +416,16 @@ bool outliner_item_is_co_over_icon(const TreeElement *te, float view_co_x) return (view_co_x > (te->xs + UI_UNIT_X)) && (view_co_x < (te->xs + UI_UNIT_X * 2)); } -/* Find if x coordinate is over element name. */ bool outliner_item_is_co_over_name(const TreeElement *te, float view_co_x) { return (view_co_x > (te->xs + UI_UNIT_X * 2)) && (view_co_x < te->xend); } -/* Find if x coordinate is over element disclosure toggle */ bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x) { return (view_co_x > te->xs) && (view_co_x < te->xs + UI_UNIT_X); } -/* Scroll view vertically while keeping within total bounds */ void outliner_scroll_view(SpaceOutliner *space_outliner, ARegion *region, int delta_y) { int tree_width, tree_height; @@ -477,11 +449,6 @@ void outliner_scroll_view(SpaceOutliner *space_outliner, ARegion *region, int de } } -/** - * The outliner should generally use #ED_region_tag_redraw_no_rebuild() to avoid unnecessary tree - * rebuilds. If elements are open or closed, we may still have to rebuild. - * Upon changing the open/closed state, call this to avoid rebuilds if possible. - */ void outliner_tag_redraw_avoid_rebuild_on_open_change(const SpaceOutliner *space_outliner, ARegion *region) { @@ -494,7 +461,6 @@ void outliner_tag_redraw_avoid_rebuild_on_open_change(const SpaceOutliner *space } } -/* Get base of object under cursor. Used for eyedropper tool */ Base *ED_outliner_give_base_under_cursor(bContext *C, const int mval[2]) { ARegion *region = CTX_wm_region(C); diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 205f0117e6a..6c45d39e0d8 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -449,7 +449,6 @@ static void outliner_deactivate(struct ScrArea *area) ED_region_tag_redraw_no_rebuild(BKE_area_find_region_type(area, RGN_TYPE_WINDOW)); } -/* only called once, from space_api/spacetypes.c */ void ED_spacetype_outliner(void) { SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype time"); diff --git a/source/blender/editors/space_outliner/tree/tree_display.h b/source/blender/editors/space_outliner/tree/tree_display.h index c0a751f2cd5..b6dc33ba7b7 100644 --- a/source/blender/editors/space_outliner/tree/tree_display.h +++ b/source/blender/editors/space_outliner/tree/tree_display.h @@ -49,12 +49,20 @@ ListBase outliner_tree_display_build_tree(TreeDisplay *tree_display, TreeSourceD /* The following functions are needed to build the tree. They are calls back into C; the way * elements are created should be refactored and ported to C++ with a new design/API too. */ +/** + * TODO: this function needs to be split up! It's getting a bit too large... + * + * \note "ID" is not always a real ID. + * \note If child items are only added to the tree if the item is open, + * the `TSE_` type _must_ be added to #outliner_element_needs_rebuild_on_open_change(). + */ struct TreeElement *outliner_add_element(SpaceOutliner *space_outliner, ListBase *lb, void *idv, struct TreeElement *parent, short type, short index); +/* make sure elements are correctly nested */ void outliner_make_object_parent_hierarchy(ListBase *lb); bool outliner_animdata_test(const struct AnimData *adt); TreeElement *outliner_add_collection_recursive(SpaceOutliner *space_outliner, diff --git a/source/blender/editors/space_outliner/tree/tree_display.hh b/source/blender/editors/space_outliner/tree/tree_display.hh index 8aaf396888f..54e64655b18 100644 --- a/source/blender/editors/space_outliner/tree/tree_display.hh +++ b/source/blender/editors/space_outliner/tree/tree_display.hh @@ -148,6 +148,9 @@ class TreeDisplaySequencer final : public AbstractTreeDisplay { private: TreeElement *add_sequencer_contents() const; + /** + * Helped function to put duplicate sequence in the same tree. + */ SequenceAddOp need_add_seq_dup(Sequence *seq) const; void add_seq_dup(Sequence *seq, TreeElement *te, short index) const; }; diff --git a/source/blender/editors/space_outliner/tree/tree_display_libraries.cc b/source/blender/editors/space_outliner/tree/tree_display_libraries.cc index 371813cfb3f..836f0937cf4 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_libraries.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_libraries.cc @@ -33,7 +33,6 @@ namespace blender::ed::outliner { -/* Convenience/readability. */ template<typename T> using List = ListBaseWrapper<T>; TreeDisplayLibraries::TreeDisplayLibraries(SpaceOutliner &space_outliner) diff --git a/source/blender/editors/space_outliner/tree/tree_display_orphaned.cc b/source/blender/editors/space_outliner/tree/tree_display_orphaned.cc index 69ccf014642..eeb3ca6893a 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_orphaned.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_orphaned.cc @@ -31,7 +31,6 @@ namespace blender::ed::outliner { -/* Convenience/readability. */ template<typename T> using List = ListBaseWrapper<T>; TreeDisplayIDOrphans::TreeDisplayIDOrphans(SpaceOutliner &space_outliner) diff --git a/source/blender/editors/space_outliner/tree/tree_display_override_library.cc b/source/blender/editors/space_outliner/tree/tree_display_override_library.cc index 0e4636db69d..943e182277c 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_override_library.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_override_library.cc @@ -34,6 +34,11 @@ namespace blender::ed::outliner { /* Convenience/readability. */ +/* Convenience/readability. */ +/* Convenience/readability. */ +/* Convenience/readability. */ +/* Convenience/readability. */ +/* Convenience/readability. */ template<typename T> using List = ListBaseWrapper<T>; TreeDisplayOverrideLibrary::TreeDisplayOverrideLibrary(SpaceOutliner &space_outliner) diff --git a/source/blender/editors/space_outliner/tree/tree_display_scenes.cc b/source/blender/editors/space_outliner/tree/tree_display_scenes.cc index 390f81cfcd1..29442aace37 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_scenes.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_scenes.cc @@ -29,7 +29,6 @@ namespace blender::ed::outliner { -/* Convenience/readability. */ template<typename T> using List = ListBaseWrapper<T>; TreeDisplayScenes::TreeDisplayScenes(SpaceOutliner &space_outliner) diff --git a/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc b/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc index 02af6a13cb3..aa28b164584 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc @@ -31,7 +31,6 @@ namespace blender::ed::outliner { -/* Convenience/readability. */ template<typename T> using List = ListBaseWrapper<T>; TreeDisplaySequencer::TreeDisplaySequencer(SpaceOutliner &space_outliner) @@ -63,7 +62,6 @@ ListBase TreeDisplaySequencer::buildTree(const TreeSourceData &source_data) return tree; } -/* Helped function to put duplicate sequence in the same tree. */ SequenceAddOp TreeDisplaySequencer::need_add_seq_dup(Sequence *seq) const { if ((!seq->strip) || (!seq->strip->stripdata)) { diff --git a/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc b/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc index c3d0aecd3cb..ebbc9baaa9f 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc @@ -37,7 +37,6 @@ namespace blender::ed::outliner { -/* Convenience/readability. */ template<typename T> using List = ListBaseWrapper<T>; class ObjectsChildrenBuilder { |