Blender
V3.3
|
#include <cstring>
#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.hh"
#include "tree/tree_display.hh"
#include "tree/tree_iterator.hh"
Go to the source code of this file.
Get base of object under cursor. Used for eyedropper tool.
Definition at line 469 of file outliner_utils.cc.
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, 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 235 of file outliner_utils.cc.
References ELEM, LISTBASE_FOREACH, TREESTORE, TSE_EBONE, TSE_SOME_ID, and TreeStoreElem::type.
TreeElement* outliner_find_element_with_flag | ( | const ListBase * | lb, |
short | flag | ||
) |
Find first tree element in tree with matching tree-store flag.
Definition at line 374 of file outliner_utils.cc.
References LISTBASE_FOREACH, 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 199 of file outliner_utils.cc.
References TreeStoreElem::id, LISTBASE_FOREACH, 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 129 of file outliner_utils.cc.
References outliner_find_item_at_x_in_row_recursive(), outliner_item_is_co_over_icon(), TREESTORE, TSE_R_LAYER, TSELEM_OPEN, and TreeStoreElem::type.
Referenced by outliner_highlight_update(), and outliner_item_do_activate_from_cursor().
|
static |
Definition at line 98 of file outliner_utils.cc.
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 62 of file outliner_utils.cc.
References BLI_listbase_is_empty(), LISTBASE_FOREACH, TreeElement::next, 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 | ||
) |
Find parent element of te.
Definition at line 164 of file outliner_utils.cc.
References LISTBASE_FOREACH, 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 217 of file outliner_utils.cc.
References ELEM, LISTBASE_FOREACH, TREESTORE, TSE_POSE_BASE, TSE_POSE_CHANNEL, and TreeStoreElem::type.
TreeElement* outliner_find_tree_element | ( | ListBase * | lb, |
const TreeStoreElem * | store_elem | ||
) |
Find specific item from the trees-tore.
Definition at line 150 of file outliner_utils.cc.
References LISTBASE_FOREACH, 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 | ( | struct SpaceOutliner * | space_outliner, |
const TreeStoreElem * | tse | ||
) |
tse
is not in the tree-store, we use its contents to find a match.
Definition at line 181 of file outliner_utils.cc.
References BKE_outliner_treehash_lookup_any(), TreeStoreElem::id, TreeStoreElem::nr, outliner_find_tree_element(), SpaceOutliner::runtime, SpaceOutliner::tree, SpaceOutliner_Runtime::treehash, and TreeStoreElem::type.
bool outliner_is_element_in_view | ( | const TreeElement * | te, |
const View2D * | v2d | ||
) |
Definition at line 404 of file outliner_utils.cc.
References View2D::cur, UI_UNIT_Y, rctf::ymax, rctf::ymin, and TreeElement::ys.
bool outliner_is_element_visible | ( | const TreeElement * | te | ) |
Find if element is visible in the outliner tree, i.e. if all of its parents are expanded. Doesn't check if the item is in view-bounds, for that use outliner_is_element_in_view().
Definition at line 388 of file outliner_utils.cc.
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 419 of file outliner_utils.cc.
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 | ||
) |
Find if x coordinate is over element name.
Definition at line 424 of file outliner_utils.cc.
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 | ||
) |
Find if x coordinate is over an icon or name.
Definition at line 409 of file outliner_utils.cc.
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 | ||
) |
Find if x coordinate is over element disclosure toggle.
Definition at line 429 of file outliner_utils.cc.
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_right_columns_width | ( | const SpaceOutliner * | space_outliner | ) |
Definition at line 323 of file outliner_utils.cc.
References ATTR_FALLTHROUGH, SpaceOutliner::lib_override_view_mode, OL_RNA_COL_SIZEX, SpaceOutliner::outlinevis, SpaceOutliner::show_restrict_flags, SO_DATA_API, SO_ID_ORPHANS, SO_LIB_OVERRIDE_VIEW_HIERARCHIES, SO_LIB_OVERRIDE_VIEW_PROPERTIES, 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 | ( | struct SpaceOutliner * | space_outliner, |
struct ARegion * | region, | ||
int | delta_y | ||
) |
Scroll view vertically while keeping within total bounds.
Definition at line 434 of file outliner_utils.cc.
References View2D::cur, MIN2, offset, 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 268 of file outliner_utils.cc.
References TreeStoreElem::id, 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 253 of file outliner_utils.cc.
References TreeElement::idcode, 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 | ||
) |
Definition at line 457 of file outliner_utils.cc.
References ED_region_tag_redraw(), ED_region_tag_redraw_no_rebuild(), SpaceOutliner::runtime, and SpaceOutliner_Runtime::tree_display.
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 281 of file outliner_utils.cc.
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 39 of file outliner_utils.cc.
References BKE_object_pose_armature_get(), C, CTX_data_scene(), CTX_data_view_layer(), Object::mode, 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.