Blender  V3.3
Classes
outliner_edit.cc File Reference
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
#include "DNA_anim_types.h"
#include "DNA_collection_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_action.h"
#include "BKE_animsys.h"
#include "BKE_appdir.h"
#include "BKE_armature.h"
#include "BKE_blender_copybuffer.h"
#include "BKE_context.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_override.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_workspace.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "ED_keyframing.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "UI_view2d.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_path.h"
#include "GPU_material.h"
#include "outliner_intern.hh"
#include "tree/tree_element_rna.hh"
#include "tree/tree_iterator.hh"

Go to the source code of this file.

Classes

struct  OpenCloseData
 

Functions

View Show Active (Outliner) Operator
static void outliner_show_active (SpaceOutliner *space_outliner, ARegion *region, TreeElement *te, ID *id)
 
void outliner_set_coordinates (const ARegion *region, const SpaceOutliner *space_outliner)
 
static int outliner_open_back (TreeElement *te)
 
static TreeElementoutliner_show_active_get_element (bContext *C, SpaceOutliner *space_outliner, ViewLayer *view_layer)
 
static int outliner_show_active_exec (bContext *C, wmOperator *UNUSED(op))
 
void OUTLINER_OT_show_active (wmOperatorType *ot)
 
Highlight on Cursor Motion Operator
static int outliner_highlight_update (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
void OUTLINER_OT_highlight_update (wmOperatorType *ot)
 
Toggle Open/Closed Operator
void outliner_item_openclose (TreeElement *te, bool open, bool toggle_all)
 
static int outliner_item_openclose_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int outliner_item_openclose_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OUTLINER_OT_item_openclose (wmOperatorType *ot)
 
Rename Operator
static void do_item_rename (ARegion *region, TreeElement *te, TreeStoreElem *tselem, ReportList *reports)
 
void item_rename_fn (bContext *C, ReportList *reports, Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
 
static TreeElementoutliner_item_rename_find_active (const SpaceOutliner *space_outliner, ReportList *reports)
 
static TreeElementoutliner_item_rename_find_hovered (const SpaceOutliner *space_outliner, ARegion *region, const wmEvent *event)
 
static int outliner_item_rename (bContext *C, wmOperator *op, const wmEvent *event)
 
void OUTLINER_OT_item_rename (wmOperatorType *ot)
 
ID Delete Operator
static void id_delete_tag (bContext *C, ReportList *reports, TreeElement *te, TreeStoreElem *tselem)
 
void id_delete_tag_fn (bContext *C, ReportList *reports, Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
 
static int outliner_id_delete_tag (bContext *C, ReportList *reports, TreeElement *te, const float mval[2])
 
static int outliner_id_delete_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OUTLINER_OT_id_delete (wmOperatorType *ot)
 
ID Remap Operator
static int outliner_id_remap_exec (bContext *C, wmOperator *op)
 
static bool outliner_id_remap_find_tree_element (bContext *C, wmOperator *op, ListBase *tree, const float y)
 
static int outliner_id_remap_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static const EnumPropertyItemoutliner_id_itemf (bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
 
void OUTLINER_OT_id_remap (wmOperatorType *ot)
 
void id_remap_fn (bContext *C, ReportList *UNUSED(reports), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
 
ID Copy Operator
static int outliner_id_copy_tag (SpaceOutliner *space_outliner, ListBase *tree)
 
static int outliner_id_copy_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_id_copy (wmOperatorType *ot)
 
ID Paste Operator
static int outliner_id_paste_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_id_paste (wmOperatorType *ot)
 
Library Relocate Operator
static int lib_relocate (bContext *C, TreeElement *te, TreeStoreElem *tselem, wmOperatorType *ot, const bool reload)
 
static int outliner_lib_relocate_invoke_do (bContext *C, ReportList *reports, TreeElement *te, const float mval[2], const bool reload)
 
static int outliner_lib_relocate_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OUTLINER_OT_lib_relocate (wmOperatorType *ot)
 
void lib_relocate_fn (bContext *C, ReportList *UNUSED(reports), Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
 
static int outliner_lib_reload_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
Library Reload Operator
void OUTLINER_OT_lib_reload (wmOperatorType *ot)
 
void lib_reload_fn (bContext *C, ReportList *UNUSED(reports), Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
 
Apply Settings Utilities
static int outliner_count_levels (ListBase *lb, const int curlevel)
 
int outliner_flag_is_any_test (ListBase *lb, short flag, const int curlevel)
 
bool outliner_flag_set (const SpaceOutliner &space_outliner, const short flag, const short set)
 
bool outliner_flag_set (const ListBase &lb, const short flag, const short set)
 
bool outliner_flag_flip (const SpaceOutliner &space_outliner, const short flag)
 
bool outliner_flag_flip (const ListBase &lb, const short flag)
 
Toggle Expanded (Outliner) Operator
static int outliner_toggle_expanded_exec (bContext *C, wmOperator *UNUSED(op))
 
void OUTLINER_OT_expanded_toggle (wmOperatorType *ot)
 
Toggle Selected (Outliner) Operator
static int outliner_select_all_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_select_all (wmOperatorType *ot)
 
View Panning (Outliner) Operator
static int outliner_scroll_page_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_scroll_page (wmOperatorType *ot)
 
Show One Level Operator
static void outliner_openclose_level (ListBase *lb, int curlevel, int level, int open)
 
static int outliner_one_level_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_show_one_level (wmOperatorType *ot)
 
Show Hierarchy Operator
static int subtree_has_objects (ListBase *lb)
 
static void tree_element_show_hierarchy (Scene *scene, SpaceOutliner *space_outliner)
 
static int outliner_show_hierarchy_exec (bContext *C, wmOperator *UNUSED(op))
 
void OUTLINER_OT_show_hierarchy (wmOperatorType *ot)
 
Animation Internal Utilities
static bool ed_operator_outliner_datablocks_active (bContext *C)
 
static void tree_element_to_path (TreeElement *te, TreeStoreElem *tselem, ID **id, char **path, int *array_index, short *flag, short *UNUSED(groupmode))
 
Driver Add Operator
static int outliner_drivers_addsel_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_drivers_add_selected (wmOperatorType *ot)
 
Driver Remove Operator
static int outliner_drivers_deletesel_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_drivers_delete_selected (wmOperatorType *ot)
 
Keying-Set Add Operator
static int outliner_keyingset_additems_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_keyingset_add_selected (wmOperatorType *ot)
 
Keying-Set Remove Operator
static int outliner_keyingset_removeitems_exec (bContext *C, wmOperator *UNUSED(op))
 
void OUTLINER_OT_keyingset_remove_selected (wmOperatorType *ot)
 
Purge Orphan Data-Blocks Operator
static bool ed_operator_outliner_id_orphans_active (bContext *C)
 
static int outliner_orphans_purge_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static int outliner_orphans_purge_exec (bContext *C, wmOperator *op)
 
void OUTLINER_OT_orphans_purge (wmOperatorType *ot)
 

Driver Internal Utilities

enum  { DRIVERS_EDITMODE_ADD = 0 , DRIVERS_EDITMODE_REMOVE }
 
static void do_outliner_drivers_editop (SpaceOutliner *space_outliner, ReportList *reports, short mode)
 

Keying-Set Internal Utilities

enum  { KEYINGSET_EDITMODE_ADD = 0 , KEYINGSET_EDITMODE_REMOVE }
 
static KeyingSetverify_active_keyingset (Scene *scene, short add)
 
static void do_outliner_keyingset_editop (SpaceOutliner *space_outliner, KeyingSet *ks, const short mode)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Driver Operations

These operators are only available in data-browser mode for now, as they depend on having RNA paths and/or hierarchies available.

Enumerator
DRIVERS_EDITMODE_ADD 
DRIVERS_EDITMODE_REMOVE 

Definition at line 1868 of file outliner_edit.cc.

◆ anonymous enum

anonymous enum

Keying-Set Operations

These operators are only available in data-browser mode for now, as they depend on having RNA paths and/or hierarchies available.

Enumerator
KEYINGSET_EDITMODE_ADD 
KEYINGSET_EDITMODE_REMOVE 

Definition at line 2034 of file outliner_edit.cc.

Function Documentation

◆ do_item_rename()

static void do_item_rename ( ARegion region,
TreeElement te,
TreeStoreElem tselem,
ReportList reports 
)
static

◆ do_outliner_drivers_editop()

static void do_outliner_drivers_editop ( SpaceOutliner space_outliner,
ReportList reports,
short  mode 
)
static

◆ do_outliner_keyingset_editop()

static void do_outliner_keyingset_editop ( SpaceOutliner space_outliner,
KeyingSet ks,
const short  mode 
)
static

◆ ed_operator_outliner_datablocks_active()

static bool ed_operator_outliner_datablocks_active ( bContext C)
static

◆ ed_operator_outliner_id_orphans_active()

static bool ed_operator_outliner_id_orphans_active ( bContext C)
static

◆ id_delete_tag()

static void id_delete_tag ( bContext C,
ReportList reports,
TreeElement te,
TreeStoreElem tselem 
)
static

◆ id_delete_tag_fn()

void id_delete_tag_fn ( bContext C,
ReportList reports,
Scene UNUSEDscene,
TreeElement te,
TreeStoreElem UNUSEDtsep,
TreeStoreElem tselem,
void UNUSEDuser_data 
)

Definition at line 499 of file outliner_edit.cc.

References C, and id_delete_tag().

Referenced by outliner_id_operation_exec(), and outliner_lib_operation_exec().

◆ id_remap_fn()

void id_remap_fn ( bContext C,
ReportList UNUSEDreports,
Scene UNUSEDscene,
TreeElement UNUSEDte,
TreeStoreElem UNUSEDtsep,
TreeStoreElem tselem,
void UNUSEDuser_data 
)

◆ item_rename_fn()

void item_rename_fn ( bContext C,
ReportList reports,
Scene UNUSEDscene,
TreeElement te,
TreeStoreElem UNUSEDtsep,
TreeStoreElem tselem,
void UNUSEDuser_data 
)

Definition at line 356 of file outliner_edit.cc.

References C, CTX_wm_region(), and do_item_rename().

Referenced by outliner_id_operation_exec(), and outliner_object_operation_exec().

◆ lib_reload_fn()

void lib_reload_fn ( bContext C,
ReportList UNUSEDreports,
Scene UNUSEDscene,
TreeElement te,
TreeStoreElem UNUSEDtsep,
TreeStoreElem tselem,
void UNUSEDuser_data 
)

Definition at line 1041 of file outliner_edit.cc.

References C, lib_relocate(), ot, and WM_operatortype_find().

Referenced by outliner_lib_operation_exec().

◆ lib_relocate()

static int lib_relocate ( bContext C,
TreeElement te,
TreeStoreElem tselem,
wmOperatorType ot,
const bool  reload 
)
static

◆ lib_relocate_fn()

void lib_relocate_fn ( bContext C,
ReportList UNUSEDreports,
Scene UNUSEDscene,
TreeElement te,
TreeStoreElem UNUSEDtsep,
TreeStoreElem tselem,
void UNUSEDuser_data 
)

Definition at line 984 of file outliner_edit.cc.

References C, lib_relocate(), ot, and WM_operatortype_find().

Referenced by outliner_lib_operation_exec().

◆ outliner_count_levels()

static int outliner_count_levels ( ListBase lb,
const int  curlevel 
)
static

Definition at line 1060 of file outliner_edit.cc.

References LISTBASE_FOREACH, and TreeElement::subtree.

Referenced by outliner_one_level_exec().

◆ outliner_drivers_addsel_exec()

static int outliner_drivers_addsel_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_drivers_deletesel_exec()

static int outliner_drivers_deletesel_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_flag_flip() [1/2]

bool outliner_flag_flip ( const ListBase lb,
const short  flag 
)

◆ outliner_flag_flip() [2/2]

bool outliner_flag_flip ( const SpaceOutliner space_outliner,
const short  flag 
)

Definition at line 1116 of file outliner_edit.cc.

References SpaceOutliner::tree.

Referenced by outliner_select_all_exec().

◆ outliner_flag_is_any_test()

int outliner_flag_is_any_test ( ListBase lb,
short  flag,
const int  curlevel 
)

◆ outliner_flag_set() [1/2]

bool outliner_flag_set ( const ListBase lb,
const short  flag,
const short  set 
)

◆ outliner_flag_set() [2/2]

bool outliner_flag_set ( const SpaceOutliner space_outliner,
short  flag,
short  set 
)

◆ outliner_highlight_update()

static int outliner_highlight_update ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ outliner_id_copy_exec()

static int outliner_id_copy_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_id_copy_tag()

static int outliner_id_copy_tag ( SpaceOutliner space_outliner,
ListBase tree 
)
static

◆ outliner_id_delete_invoke()

static int outliner_id_delete_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ outliner_id_delete_tag()

static int outliner_id_delete_tag ( bContext C,
ReportList reports,
TreeElement te,
const float  mval[2] 
)
static

◆ outliner_id_itemf()

static const EnumPropertyItem* outliner_id_itemf ( bContext C,
PointerRNA ptr,
PropertyRNA UNUSEDprop,
bool r_free 
)
static

◆ outliner_id_paste_exec()

static int outliner_id_paste_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_id_remap_exec()

static int outliner_id_remap_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_id_remap_find_tree_element()

static bool outliner_id_remap_find_tree_element ( bContext C,
wmOperator op,
ListBase tree,
const float  y 
)
static

◆ outliner_id_remap_invoke()

static int outliner_id_remap_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ outliner_item_openclose()

void outliner_item_openclose ( TreeElement te,
bool  open,
bool  toggle_all 
)

◆ outliner_item_openclose_invoke()

static int outliner_item_openclose_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ outliner_item_openclose_modal()

static int outliner_item_openclose_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ outliner_item_rename()

static int outliner_item_rename ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ outliner_item_rename_find_active()

static TreeElement* outliner_item_rename_find_active ( const SpaceOutliner space_outliner,
ReportList reports 
)
static

◆ outliner_item_rename_find_hovered()

static TreeElement* outliner_item_rename_find_hovered ( const SpaceOutliner space_outliner,
ARegion region,
const wmEvent event 
)
static

◆ outliner_keyingset_additems_exec()

static int outliner_keyingset_additems_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_keyingset_removeitems_exec()

static int outliner_keyingset_removeitems_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ outliner_lib_reload_invoke()

static int outliner_lib_reload_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ outliner_lib_relocate_invoke()

static int outliner_lib_relocate_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ outliner_lib_relocate_invoke_do()

static int outliner_lib_relocate_invoke_do ( bContext C,
ReportList reports,
TreeElement te,
const float  mval[2],
const bool  reload 
)
static

◆ outliner_one_level_exec()

static int outliner_one_level_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_open_back()

static int outliner_open_back ( TreeElement te)
static

Definition at line 1244 of file outliner_edit.cc.

References TreeStoreElem::flag, TreeElement::parent, TREESTORE, and TSE_CLOSED.

Referenced by outliner_show_active().

◆ outliner_openclose_level()

static void outliner_openclose_level ( ListBase lb,
int  curlevel,
int  level,
int  open 
)
static

◆ outliner_orphans_purge_exec()

static int outliner_orphans_purge_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_orphans_purge_invoke()

static int outliner_orphans_purge_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ OUTLINER_OT_drivers_add_selected()

void OUTLINER_OT_drivers_add_selected ( wmOperatorType ot)

◆ OUTLINER_OT_drivers_delete_selected()

void OUTLINER_OT_drivers_delete_selected ( wmOperatorType ot)

◆ OUTLINER_OT_expanded_toggle()

void OUTLINER_OT_expanded_toggle ( wmOperatorType ot)

◆ OUTLINER_OT_highlight_update()

void OUTLINER_OT_highlight_update ( wmOperatorType ot)

◆ OUTLINER_OT_id_copy()

void OUTLINER_OT_id_copy ( wmOperatorType ot)

◆ OUTLINER_OT_id_delete()

void OUTLINER_OT_id_delete ( wmOperatorType ot)

◆ OUTLINER_OT_id_paste()

void OUTLINER_OT_id_paste ( wmOperatorType ot)

◆ OUTLINER_OT_id_remap()

void OUTLINER_OT_id_remap ( wmOperatorType ot)

◆ OUTLINER_OT_item_openclose()

void OUTLINER_OT_item_openclose ( wmOperatorType ot)

◆ OUTLINER_OT_item_rename()

void OUTLINER_OT_item_rename ( wmOperatorType ot)

◆ OUTLINER_OT_keyingset_add_selected()

void OUTLINER_OT_keyingset_add_selected ( wmOperatorType ot)

◆ OUTLINER_OT_keyingset_remove_selected()

void OUTLINER_OT_keyingset_remove_selected ( wmOperatorType ot)

◆ OUTLINER_OT_lib_reload()

void OUTLINER_OT_lib_reload ( wmOperatorType ot)

◆ OUTLINER_OT_lib_relocate()

void OUTLINER_OT_lib_relocate ( wmOperatorType ot)

◆ OUTLINER_OT_orphans_purge()

void OUTLINER_OT_orphans_purge ( wmOperatorType ot)

◆ OUTLINER_OT_scroll_page()

void OUTLINER_OT_scroll_page ( wmOperatorType ot)

◆ OUTLINER_OT_select_all()

void OUTLINER_OT_select_all ( wmOperatorType ot)

◆ OUTLINER_OT_show_active()

void OUTLINER_OT_show_active ( wmOperatorType ot)

◆ OUTLINER_OT_show_hierarchy()

void OUTLINER_OT_show_hierarchy ( wmOperatorType ot)

◆ OUTLINER_OT_show_one_level()

void OUTLINER_OT_show_one_level ( wmOperatorType ot)

◆ outliner_scroll_page_exec()

static int outliner_scroll_page_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_select_all_exec()

static int outliner_select_all_exec ( bContext C,
wmOperator op 
)
static

◆ outliner_set_coordinates()

void outliner_set_coordinates ( const ARegion region,
const SpaceOutliner space_outliner 
)

◆ outliner_show_active()

static void outliner_show_active ( SpaceOutliner space_outliner,
ARegion region,
TreeElement te,
ID id 
)
static

◆ outliner_show_active_exec()

static int outliner_show_active_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ outliner_show_active_get_element()

static TreeElement* outliner_show_active_get_element ( bContext C,
SpaceOutliner space_outliner,
ViewLayer view_layer 
)
static

◆ outliner_show_hierarchy_exec()

static int outliner_show_hierarchy_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ outliner_toggle_expanded_exec()

static int outliner_toggle_expanded_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ subtree_has_objects()

static int subtree_has_objects ( ListBase lb)
static

Helper function for #tree_element_shwo_hierarchy() - recursively checks whether subtrees have any objects.

Definition at line 1614 of file outliner_edit.cc.

References ID_OB, TreeElement::idcode, LISTBASE_FOREACH, TreeElement::subtree, TREESTORE, TSE_SOME_ID, and TreeStoreElem::type.

Referenced by tree_element_show_hierarchy().

◆ tree_element_show_hierarchy()

static void tree_element_show_hierarchy ( Scene scene,
SpaceOutliner space_outliner 
)
static

◆ tree_element_to_path()

static void tree_element_to_path ( TreeElement te,
TreeStoreElem tselem,
ID **  id,
char **  path,
int *  array_index,
short *  flag,
short *  UNUSEDgroupmode 
)
static

◆ verify_active_keyingset()

static KeyingSet* verify_active_keyingset ( Scene scene,
short  add 
)
static