|
Blender
V2.93
|
#include <string.h>#include "BLI_listbase.h"#include "BLI_utildefines.h"#include "DNA_action_types.h"#include "DNA_screen_types.h"#include "DNA_space_types.h"#include "BKE_armature.h"#include "BKE_context.h"#include "BKE_layer.h"#include "BKE_object.h"#include "BKE_outliner_treehash.h"#include "ED_outliner.h"#include "ED_screen.h"#include "UI_interface.h"#include "UI_view2d.h"#include "outliner_intern.h"Go to the source code of this file.
Definition at line 500 of file outliner_utils.c.
References BKE_view_layer_base_find(), C, CTX_data_view_layer(), CTX_wm_region(), CTX_wm_space_outliner(), TreeElement::directdata, TreeStoreElem::id, ID_OB, TreeElement::idcode, NULL, outliner_find_item_at_y(), SpaceOutliner::tree, TREESTORE, TSE_SOME_ID, TreeStoreElem::type, UI_view2d_region_to_view(), and ARegion::v2d.
Referenced by datadropper_id_sample_pt().
| TreeElement* outliner_find_editbone | ( | ListBase * | lb, |
| const EditBone * | ebone | ||
| ) |
Definition at line 261 of file outliner_utils.c.
References ELEM, LISTBASE_FOREACH, NULL, TREESTORE, TSE_EBONE, TSE_SOME_ID, and TreeStoreElem::type.
| TreeElement* outliner_find_element_with_flag | ( | const ListBase * | lb, |
| short | flag | ||
| ) |
Definition at line 399 of file outliner_utils.c.
References LISTBASE_FOREACH, NULL, outliner_find_element_with_flag(), and TREESTORE.
Referenced by do_outliner_range_select(), find_walk_select_start_element(), get_target_element(), outliner_find_element_with_flag(), and outliner_item_rename_find_active().
| TreeElement* outliner_find_id | ( | SpaceOutliner * | space_outliner, |
| ListBase * | lb, | ||
| const ID * | id | ||
| ) |
Definition at line 225 of file outliner_utils.c.
References TreeStoreElem::id, LISTBASE_FOREACH, NULL, TREESTORE, TSE_SOME_ID, and TreeStoreElem::type.
| 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 | ||
| ) |
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 view_co_x (view-space).
Definition at line 153 of file outliner_utils.c.
References outliner_find_item_at_x_in_row_recursive(), outliner_item_is_co_over_icon(), TREESTORE, and TSELEM_OPEN.
Referenced by outliner_highlight_update(), and outliner_item_do_activate_from_cursor().
|
static |
Definition at line 114 of file outliner_utils.c.
References ListBase::first, TreeElement::flag, TreeElement::next, TreeElement::subtree, TE_ICONROW, TE_ICONROW_MERGED, and TreeElement::xs.
Referenced by outliner_find_item_at_x_in_row().
| TreeElement* outliner_find_item_at_y | ( | const SpaceOutliner * | space_outliner, |
| const ListBase * | tree, | ||
| float | view_co_y | ||
| ) |
Try to find an item under y-coordinate view_co_y (view-space).
Definition at line 78 of file outliner_utils.c.
References BLI_listbase_is_empty(), LISTBASE_FOREACH, TreeElement::next, NULL, outliner_find_item_at_y(), tree, TREESTORE, TSELEM_OPEN, UI_UNIT_Y, and TreeElement::ys.
Referenced by ED_outliner_give_base_under_cursor(), outliner_box_select_invoke(), outliner_drop_insert_find(), outliner_find_first_desired_element_at_y(), outliner_find_item_at_y(), outliner_highlight_update(), outliner_item_do_activate_from_cursor(), outliner_item_drag_element_find(), outliner_item_openclose_invoke(), outliner_item_openclose_modal(), outliner_item_rename_find_hovered(), and outliner_operation().
| TreeElement* outliner_find_parent_element | ( | ListBase * | lb, |
| TreeElement * | parent_te, | ||
| const TreeElement * | child_te | ||
| ) |
Definition at line 188 of file outliner_utils.c.
References LISTBASE_FOREACH, NULL, and outliner_find_parent_element().
Referenced by collection_drop_invoke(), and outliner_find_parent_element().
| TreeElement* outliner_find_posechannel | ( | ListBase * | lb, |
| const bPoseChannel * | pchan | ||
| ) |
Definition at line 243 of file outliner_utils.c.
References ELEM, LISTBASE_FOREACH, NULL, TREESTORE, TSE_POSE_BASE, TSE_POSE_CHANNEL, and TreeStoreElem::type.
| TreeElement* outliner_find_tree_element | ( | ListBase * | lb, |
| const TreeStoreElem * | store_elem | ||
| ) |
Definition at line 173 of file outliner_utils.c.
References LISTBASE_FOREACH, NULL, and outliner_find_tree_element().
Referenced by datastack_drop_reorder(), namebutton_fn(), outliner_find_tree_element(), outliner_find_tse(), outliner_mode_toggle_fn(), and outliner_restore_scrolling_position().
| TreeElement* outliner_find_tse | ( | SpaceOutliner * | space_outliner, |
| const TreeStoreElem * | tse | ||
| ) |
Definition at line 206 of file outliner_utils.c.
References BKE_outliner_treehash_lookup_any(), TreeStoreElem::id, TreeStoreElem::nr, NULL, outliner_find_tree_element(), SpaceOutliner::runtime, SpaceOutliner::tree, SpaceOutliner_Runtime::treehash, and TreeStoreElem::type.
| bool outliner_is_element_visible | ( | const TreeElement * | te | ) |
Definition at line 414 of file outliner_utils.c.
References TreeStoreElem::flag, TreeElement::parent, TREESTORE, and TSE_CLOSED.
Referenced by do_outliner_range_select(), and find_walk_select_start_element().
| bool outliner_item_is_co_over_icon | ( | const TreeElement * | te, |
| float | view_co_x | ||
| ) |
Definition at line 441 of file outliner_utils.c.
References UI_UNIT_X, and TreeElement::xs.
Referenced by outliner_find_item_at_x_in_row().
| bool outliner_item_is_co_over_name | ( | const TreeElement * | te, |
| float | view_co_x | ||
| ) |
Definition at line 447 of file outliner_utils.c.
References UI_UNIT_X, TreeElement::xend, and TreeElement::xs.
Referenced by outliner_item_rename_find_hovered().
| bool outliner_item_is_co_over_name_icons | ( | const TreeElement * | te, |
| float | view_co_x | ||
| ) |
Definition at line 431 of file outliner_utils.c.
References TREESTORE, TSE_VIEW_COLLECTION_BASE, UI_UNIT_X, TreeElement::xend, and TreeElement::xs.
Referenced by outliner_box_select_invoke(), and outliner_item_do_activate_from_cursor().
| bool outliner_item_is_co_within_close_toggle | ( | const TreeElement * | te, |
| float | view_co_x | ||
| ) |
Definition at line 453 of file outliner_utils.c.
References UI_UNIT_X, and TreeElement::xs.
Referenced by outliner_item_do_activate_from_cursor(), outliner_item_drag_drop_invoke(), and outliner_item_openclose_invoke().
| float outliner_restrict_columns_width | ( | const SpaceOutliner * | space_outliner | ) |
Definition at line 356 of file outliner_utils.c.
References ATTR_FALLTHROUGH, SpaceOutliner::outlinevis, SpaceOutliner::show_restrict_flags, SO_DATA_API, SO_ID_ORPHANS, SO_LIBRARIES, SO_OVERRIDES_LIBRARY, SO_RESTRICT_ENABLE, SO_RESTRICT_HIDE, SO_RESTRICT_HOLDOUT, SO_RESTRICT_INDIRECT_ONLY, SO_RESTRICT_RENDER, SO_RESTRICT_SELECT, SO_RESTRICT_VIEWPORT, SO_SCENES, SO_SEQUENCE, SO_VIEW_LAYER, UI_UNIT_X, and V2D_SCROLL_WIDTH.
| void outliner_scroll_view | ( | SpaceOutliner * | space_outliner, |
| ARegion * | region, | ||
| int | delta_y | ||
| ) |
Definition at line 459 of file outliner_utils.c.
References View2D::cur, MIN2, outliner_tree_dimensions(), UI_UNIT_Y, ARegion::v2d, rctf::ymax, and rctf::ymin.
Referenced by outliner_item_rename(), outliner_scroll_page_exec(), outliner_show_active_exec(), and outliner_walk_scroll().
| ID* outliner_search_back | ( | TreeElement * | te, |
| short | idcode | ||
| ) |
Definition at line 294 of file outliner_utils.c.
References TreeStoreElem::id, NULL, outliner_search_back_te(), and TREESTORE.
Referenced by constraint_fn(), modifier_fn(), outliner_do_object_operation_ex(), parent_drop_allowed(), parent_drop_set_parents(), tree_element_active_camera_get(), tree_element_active_material_get(), tree_element_camera_activate(), tree_element_material_activate(), and tree_element_object_activate().
| TreeElement* outliner_search_back_te | ( | TreeElement * | te, |
| short | idcode | ||
| ) |
Definition at line 279 of file outliner_utils.c.
References TreeElement::idcode, NULL, TreeElement::parent, TREESTORE, TSE_SOME_ID, and TreeStoreElem::type.
Referenced by outliner_search_back(), and tree_element_object_activate().
| void outliner_tag_redraw_avoid_rebuild_on_open_change | ( | const SpaceOutliner * | space_outliner, |
| ARegion * | region | ||
| ) |
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.
Definition at line 487 of file outliner_utils.c.
References ED_region_tag_redraw(), ED_region_tag_redraw_no_rebuild(), and outliner_requires_rebuild_on_open_change().
| bool outliner_tree_traverse | ( | const SpaceOutliner * | space_outliner, |
| ListBase * | tree, | ||
| int | filter_te_flag, | ||
| int | filter_tselem_flag, | ||
| TreeTraversalFunc | func, | ||
| void * | customdata | ||
| ) |
Iterate over all tree elements (pre-order traversal), executing func callback for each tree element matching the optional filters.
| filter_te_flag | If not 0, only TreeElements with this flag will be visited. |
| filter_tselem_flag | Same as filter_te_flag, but for the TreeStoreElem. |
| func | Custom callback to execute for each visited item. |
Definition at line 315 of file outliner_utils.c.
References TreeStoreElem::flag, outliner_tree_traverse(), TRAVERSE_BREAK, TRAVERSE_CONTINUE, TRAVERSE_SKIP_CHILDS, tree, and TREESTORE.
Referenced by collection_flag_exec(), collection_instance_exec(), collection_isolate_exec(), collection_link_exec(), collection_new_exec(), collection_view_layer_exec(), collection_visibility_exec(), collections_view_layer_poll(), ED_outliner_selected_objects_get(), outliner_active_collection(), outliner_active_layer_collection(), outliner_collection_delete(), outliner_color_tag_set_exec(), outliner_delete_exec(), outliner_hide_exec(), outliner_item_drag_drop_invoke(), and outliner_tree_traverse().
| void outliner_viewcontext_init | ( | const bContext * | C, |
| TreeViewContext * | tvc | ||
| ) |
Definition at line 51 of file outliner_utils.c.
References BKE_object_pose_armature_get(), C, CTX_data_scene(), CTX_data_view_layer(), Object::mode, NULL, OB_ARMATURE, TreeViewContext::ob_edit, OB_MESH, OB_MODE_WEIGHT_PAINT, TreeViewContext::ob_pose, TreeViewContext::obact, OBACT, OBEDIT_FROM_OBACT, TreeViewContext::scene, Object::type, and TreeViewContext::view_layer.