66 #include "RNA_prototypes.h"
127 bool changed =
false;
168 if (base_active != base) {
185 const bool do_extend)
242 for (base =
reinterpret_cast<Base *
>(
FIRSTBASE(view_layer)); base; base = base->
next) {
267 for (ebone = ebone_parent->
next; ebone; ebone = ebone->
next) {
314 if (sce &&
scene != sce) {
324 if (base !=
nullptr) {
392 if (ob ==
nullptr || ob !=
OBACT(view_layer) || ob->
matbits ==
nullptr) {
432 Scene *sce =
nullptr;
443 if (sce &&
scene != sce) {
496 uint objects_len = 0;
499 for (
uint object_index = 0; object_index < objects_len; object_index++) {
503 if (
ELEM(
nullptr, ob_iter, ob_iter->
pose, ob_iter->
data)) {
523 arm->act_bone = pchan->
bone;
553 bone_iter = bone_iter->
next) {
602 ob_params.no_dup_data =
true;
605 view_layer,
nullptr, &bases_len, &ob_params);
705 select_single_seq(seq, 1);
716 select_single_seq(p, 0);
757 const bool handle_all_types)
764 if (handle_all_types) {
791 switch (tselem->
type) {
863 if (ob && ob->
data == arm) {
901 if (base ==
nullptr) {
918 if (ob == ob_pose && ob->
pose) {
970 tree_element_cast<TreeElementSequenceStripDuplicate>(te);
1013 if (ob ==
nullptr || ob !=
OBACT(view_layer) || ob->
matbits ==
nullptr) {
1052 if (tep ==
nullptr) {
1096 switch (tselem->
type) {
1211 switch (tselem->
type) {
1367 const bool recursive,
1368 const bool do_activate_data)
1380 else if (do_activate_data) {
1391 if (do_activate_data ==
false) {
1427 if (base !=
nullptr) {
1443 else if (do_activate_data) {
1452 const short select_flag)
1502 selecting = !selecting;
1572 const float view_mval[2])
1589 const bool use_range,
1590 const bool deselect_all)
1596 bool changed =
false, rebuild_tree =
false;
1619 bool merged_elements =
false;
1620 bool is_over_icon =
false;
1622 space_outliner, te, view_mval[0], &merged_elements, &is_over_icon);
1625 if (merged_elements) {
1690 ot->
idname =
"OUTLINER_OT_item_activate";
1691 ot->
description =
"Handle mouse clicks to select and activate items";
1703 ot->
srna,
"extend_range",
false,
"Extend Range",
"Select a range from active element");
1709 "Deselect On Nothing",
1710 "Deselect all when nothing under the cursor");
1727 outliner_item_select(
1728 C, space_outliner, te, (select ? OL_ITEM_SELECT : OL_ITEM_DESELECT) | OL_ITEM_EXTEND);
1790 ot->
idname =
"OUTLINER_OT_select_box";
1791 ot->
description =
"Use box selection to select tree elements";
1808 ot->
srna,
"tweak",
false,
"Tweak",
"Tweak gesture from empty space for box selection");
1854 while (successor->
parent) {
1859 successor = successor->
parent;
1873 else if (te->
next) {
1893 else if (!toggle_all && te->
parent) {
1919 const int direction,
1921 const bool toggle_all)
1925 switch (direction) {
1966 active_te = active_te->
parent;
1982 if (te->
ys > y_max) {
1985 else if (te->
ys < y_min) {
2024 ot->
name =
"Walk Select";
2025 ot->
idname =
"OUTLINER_OT_select_walk";
2026 ot->
description =
"Use walk navigation to select tree elements";
2040 ot->
srna,
"toggle_all",
false,
"Toggle All",
"Toggle open/close hierarchy");
#define PBONE_SELECTABLE(arm, bone)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
void BKE_constraint_panel_expand(struct bConstraint *con)
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
struct SpaceOutliner * CTX_wm_space_outliner(const bContext *C)
struct LayerCollection * CTX_data_layer_collection(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
struct ReportList * CTX_wm_reports(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
void BKE_gpencil_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active)
void BKE_gpencil_modifier_panel_expand(struct GpencilModifierData *md)
struct ViewLayer * BKE_view_layer_find_from_collection(const struct Scene *scene, struct LayerCollection *lc)
bool BKE_layer_collection_activate(struct ViewLayer *view_layer, struct LayerCollection *lc)
void BKE_view_layer_base_deselect_all(struct ViewLayer *view_layer)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
struct Base ** BKE_view_layer_array_from_bases_in_mode_params(struct ViewLayer *view_layer, const struct View3D *v3d, uint *r_len, const struct ObjectsInModeParams *params)
void BKE_view_layer_base_select_and_set_active(struct ViewLayer *view_layer, struct Base *selbase)
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
void BKE_modifier_panel_expand(struct ModifierData *md)
General operations, lookup, etc. for blender objects.
bool BKE_object_is_child_recursive(const struct Object *ob_parent, const struct Object *ob_child)
struct Object * BKE_object_pose_armature_get(struct Object *ob)
bool BKE_object_is_mode_compat(const struct Object *ob, eObjectMode object_mode)
void BKE_object_modifier_set_active(struct Object *ob, struct ModifierData *md)
struct ModifierData * BKE_object_active_modifier(const struct Object *ob)
struct Object ** BKE_object_pose_array_get_unique(struct ViewLayer *view_layer, struct View3D *v3d, unsigned int *r_objects_len)
bool BKE_object_is_in_editmode(const struct Object *ob)
struct ParticleSystem * psys_get_current(struct Object *ob)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_shaderfx_panel_expand(struct ShaderFxData *fx)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
Object groups, one object can be in many groups at once.
@ eModifierType_ParticleSystem
@ eModifierType_Collision
@ eModifierType_DynamicPaint
Object is a sort of wrapper for general info.
#define OB_TYPE_SUPPORT_EDITMODE(_type)
@ TSE_VIEW_COLLECTION_BASE
@ TSE_GPENCIL_EFFECT_BASE
#define FIRSTBASE(_view_layer)
#define OBACT(_view_layer)
@ BCONTEXT_BONE_CONSTRAINT
#define EBONE_SELECTABLE(arm, ebone)
void ED_object_base_activate_with_mode_exit_if_needed(struct bContext *C, struct Base *base)
void ED_object_mode_generic_exit(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode)
bool ED_object_editmode_exit_ex(struct Main *bmain, struct Scene *scene, struct Object *obedit, int flag)
bool ED_object_editmode_enter_ex(struct Main *bmain, struct Scene *scene, struct Object *ob, int flag)
bool ED_object_mode_set(struct bContext *C, eObjectMode mode)
void ED_outliner_select_sync_from_object_tag(struct bContext *C)
void ED_outliner_select_sync_from_outliner(struct bContext *C, struct SpaceOutliner *space_outliner)
void ED_region_tag_redraw_no_rebuild(struct ARegion *region)
bool ED_operator_outliner_active(struct bContext *C)
void ED_region_tag_redraw(struct ARegion *region)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
void ED_sequencer_deselect_all(struct Scene *scene)
bool ED_text_activate_in_screen(struct bContext *C, struct Text *text)
void ED_undo_group_begin(struct bContext *C)
void ED_undo_push(struct bContext *C, const char *str)
void ED_undo_group_end(struct bContext *C)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
void UI_view2d_region_to_view_rctf(const struct View2D *v2d, const struct rctf *rect_src, struct rctf *rect_dst) ATTR_NONNULL()
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
#define NS_LAYER_COLLECTION
bool ED_armature_edit_deselect_all_multi_ex(struct Base **bases, uint bases_len)
bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child)
void ED_armature_ebone_select_set(EditBone *ebone, bool select)
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
void activate(bool forceActivation=false) const
Sequence & getSequence() const
Sequence & getSequence() const
const Depsgraph * depsgraph
void(* MEM_freeN)(void *vmemh)
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool active
all scheduled work for the GPU.
void all_open(const SpaceOutliner &space_outliner, const VisitorFn visitor)
bool outliner_flag_set(const SpaceOutliner &space_outliner, const short flag, const short set)
void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all)
void outliner_viewcontext_init(const struct bContext *C, TreeViewContext *tvc)
TreeElement * outliner_find_element_with_flag(const ListBase *lb, short flag)
float outliner_right_columns_width(const struct SpaceOutliner *space_outliner)
bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x)
void outliner_scroll_view(struct SpaceOutliner *space_outliner, struct ARegion *region, int delta_y)
bool outliner_item_is_co_over_name_icons(const TreeElement *te, float view_co_x)
TreeElement * outliner_search_back_te(TreeElement *te, short idcode)
TreeElement * outliner_find_item_at_y(const SpaceOutliner *space_outliner, const ListBase *tree, float view_co_y)
bool outliner_is_element_visible(const TreeElement *te)
bool outliner_shows_mode_column(const SpaceOutliner &space_outliner)
struct ID * outliner_search_back(TreeElement *te, short idcode)
#define TSELEM_OPEN(telm, sv)
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)
void outliner_tag_redraw_avoid_rebuild_on_open_change(const struct SpaceOutliner *space_outliner, struct ARegion *region)
void merged_element_search_menu_invoke(struct bContext *C, TreeElement *parent_te, TreeElement *activate_te)
static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void do_outliner_ebone_select_recursive(bArmature *arm, EditBone *ebone_parent, bool select)
static eOLDrawState tree_element_viewlayer_state_get(const bContext *C, const TreeElement *te)
static void tree_element_camera_activate(bContext *C, Scene *scene, TreeElement *te)
void outliner_item_mode_toggle(bContext *C, TreeViewContext *tvc, TreeElement *te, const bool do_extend)
static eOLDrawState tree_element_posegroup_state_get(const ViewLayer *view_layer, const TreeElement *te, const TreeStoreElem *tselem)
static void do_outliner_item_mode_toggle_generic(bContext *C, TreeViewContext *tvc, Base *base)
static void tree_element_master_collection_activate(const bContext *C)
static void do_outliner_item_editmode_toggle(bContext *C, Scene *scene, Base *base)
static eOLDrawState tree_element_active_world_get(const Scene *scene, const TreeElement *te)
static bool outliner_is_co_within_restrict_columns(const SpaceOutliner *space_outliner, const ARegion *region, float view_co_x)
static eOLDrawState tree_element_defgroup_state_get(const ViewLayer *view_layer, const TreeElement *te, const TreeStoreElem *tselem)
static TreeElement * outliner_find_next_element(SpaceOutliner *space_outliner, TreeElement *te)
static TreeElement * outliner_find_previous_element(SpaceOutliner *space_outliner, TreeElement *te)
static eOLDrawState tree_element_ebone_state_get(const TreeElement *te)
void tree_element_activate(bContext *C, const TreeViewContext *tvc, TreeElement *te, const eOLSetState set, const bool handle_all_types)
static bool do_outliner_range_select_recursive(ListBase *lb, TreeElement *active, TreeElement *cursor, bool selecting)
static int outliner_item_do_activate_from_cursor(bContext *C, const int mval[2], const bool extend, const bool use_range, const bool deselect_all)
static eOLDrawState tree_element_object_state_get(const TreeViewContext *tvc, const TreeStoreElem *tselem)
static int outliner_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void tree_element_world_activate(bContext *C, Scene *scene, TreeElement *te)
eOLDrawState tree_element_active_state_get(const TreeViewContext *tvc, const TreeElement *te, const TreeStoreElem *tselem)
static void do_outliner_item_posemode_toggle(bContext *C, Scene *scene, Base *base)
void OUTLINER_OT_select_walk(wmOperatorType *ot)
static TreeElement * outliner_element_find_successor_in_parents(TreeElement *te)
static void tree_element_object_activate(bContext *C, Scene *scene, ViewLayer *view_layer, TreeElement *te, const eOLSetState set, bool recursive)
static eOLDrawState tree_element_pose_state_get(const ViewLayer *view_layer, const TreeStoreElem *tselem)
static eOLDrawState tree_element_gplayer_state_get(const TreeElement *te)
static TreeElement * do_outliner_select_walk(SpaceOutliner *space_outliner, TreeElement *te, const int direction, const bool extend, const bool toggle_all)
static void do_outliner_range_select(bContext *C, SpaceOutliner *space_outliner, TreeElement *cursor, const bool extend)
static void tree_element_bone_activate(bContext *C, ViewLayer *view_layer, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set, bool recursive)
static TreeElement * outliner_find_rightmost_visible_child(SpaceOutliner *space_outliner, TreeElement *te)
static void do_outliner_object_select_recursive(ViewLayer *view_layer, Object *ob_parent, bool select)
void outliner_item_select(bContext *C, SpaceOutliner *space_outliner, TreeElement *te, const short select_flag)
static void tree_element_viewlayer_activate(bContext *C, TreeElement *te)
static void outliner_sync_to_properties_editors(const bContext *C, PointerRNA *ptr, const int context)
void tree_element_type_active_set(bContext *C, const TreeViewContext *tvc, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set, bool recursive)
static eOLDrawState tree_element_posechannel_state_get(const Object *ob_pose, const TreeElement *te, const TreeStoreElem *tselem)
void OUTLINER_OT_item_activate(wmOperatorType *ot)
static void do_outliner_bone_select_recursive(bArmature *arm, Bone *bone_parent, bool select)
static void tree_element_modifier_activate(bContext *C, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set)
static void tree_element_material_activate(bContext *C, ViewLayer *view_layer, TreeElement *te)
static bool outliner_is_co_within_active_mode_column(bContext *C, SpaceOutliner *space_outliner, const float view_mval[2])
static int outliner_item_activate_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static eOLDrawState tree_element_active_scene_get(const TreeViewContext *tvc, const TreeElement *te, const TreeStoreElem *tselem)
static TreeElement * outliner_walk_right(SpaceOutliner *space_outliner, TreeElement *te, bool toggle_all)
static void tree_element_constraint_activate(bContext *C, ViewLayer *view_layer, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set)
static void tree_element_psys_activate(bContext *C, TreeStoreElem *tselem)
static void tree_element_gplayer_activate(bContext *C, TreeElement *te, TreeStoreElem *tselem)
static TreeElement * outliner_walk_left(SpaceOutliner *space_outliner, TreeElement *te, bool toggle_all)
static eOLDrawState tree_element_active_material_get(const ViewLayer *view_layer, const TreeElement *te)
static void tree_element_posegroup_activate(bContext *C, TreeElement *te, TreeStoreElem *tselem)
static void outliner_box_select(bContext *C, SpaceOutliner *space_outliner, const rctf *rectf, const bool select)
bPoseChannel * outliner_find_parent_bone(TreeElement *te, TreeElement **r_bone_te)
static void tree_element_text_activate(bContext *C, TreeElement *te)
static void tree_element_active_ebone__sel(bContext *C, bArmature *arm, EditBone *ebone, short sel)
static eOLDrawState tree_element_bone_state_get(const ViewLayer *view_layer, const TreeElement *te, const TreeStoreElem *tselem)
static void outliner_walk_scroll(SpaceOutliner *space_outliner, ARegion *region, TreeElement *te)
static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreElem *tselem)
static eOLDrawState tree_element_modifier_state_get(const TreeElement *te, const TreeStoreElem *tselem)
eOLDrawState tree_element_type_active_state_get(const bContext *C, const TreeViewContext *tvc, const TreeElement *te, const TreeStoreElem *tselem)
static void tree_element_sequence_dup_activate(Scene *scene, TreeElement *UNUSED(te))
static void tree_element_layer_collection_activate(bContext *C, TreeElement *te)
static void do_outliner_item_activate_tree_element(bContext *C, const TreeViewContext *tvc, SpaceOutliner *space_outliner, TreeElement *te, TreeStoreElem *tselem, const bool extend, const bool recursive, const bool do_activate_data)
static eOLDrawState tree_element_layer_collection_state_get(const bContext *C, const TreeElement *te)
static eOLDrawState tree_element_active_camera_get(const Scene *scene, const TreeElement *te)
static eOLDrawState tree_element_sequence_state_get(const Scene *scene, const TreeElement *te)
bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner, const float view_mval[2])
static void tree_element_defgroup_activate(bContext *C, TreeElement *te, TreeStoreElem *tselem)
void OUTLINER_OT_select_box(wmOperatorType *ot)
static void tree_element_posechannel_activate(bContext *C, ViewLayer *view_layer, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set, bool recursive)
static TreeElement * find_walk_select_start_element(SpaceOutliner *space_outliner, bool *changed)
static void tree_element_ebone_activate(bContext *C, ViewLayer *view_layer, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set, bool recursive)
static eOLDrawState tree_element_master_collection_state_get(const bContext *C)
static void tree_element_sequence_activate(bContext *C, Scene *scene, TreeElement *te, const eOLSetState set)
static eOLDrawState tree_element_sequence_dup_state_get(const TreeElement *te)
static int outliner_box_select_exec(bContext *C, wmOperator *op)
bool ED_object_posemode_enter_ex(struct Main *bmain, Object *ob)
bool ED_object_posemode_exit_ex(struct Main *bmain, Object *ob)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Editing * SEQ_editing_get(const Scene *scene)
void SEQ_select_active_set(Scene *scene, Sequence *seq)
struct ToolSettings * toolsettings
struct TreeElement * parent
TreeStoreElem * store_elem
struct TreeElement * prev
struct TreeElement * next
struct ViewLayer * view_layer
ListBase layer_collections
struct EditBone * act_edbone
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Establish and manage Outliner trees for different display modes.
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
void WM_operator_properties_select_walk_direction(wmOperatorType *ot)
void WM_operator_properties_border_to_rctf(struct wmOperator *op, rctf *rect)
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
void WM_window_set_active_view_layer(wmWindow *win, ViewLayer *view_layer)
void WM_windows_scene_data_sync(const ListBase *win_lb, Scene *scene)
Scene * WM_window_get_active_scene(const wmWindow *win)