74 if (tselem->
id ==
nullptr) {
114 if (space_outliner->
treestore ==
nullptr) {
120 space_outliner->
runtime->
tree_hash = treehash::TreeHash::create_from_treestore(
136 tselem->
nr = type ? nr : 0;
173 element->abstract_element =
nullptr;
190static void outliner_add_line_styles(
SpaceOutliner *space_outliner,
213 linestyle->
id.
tag &= ~ID_TAG_DOIT;
215 space_outliner, lb,
reinterpret_cast<ID *
>(linestyle),
nullptr, te,
TSE_SOME_ID, 0);
231 if (!space_outliner->
runtime || !space_outliner->
runtime->tree_display) {
236 return space_outliner->
runtime->tree_display->add_element(
237 lb, owner_id, create_data, parent, type, index, expand);
254 ID *persistent_dataptr = owner_id ? owner_id :
static_cast<ID *
>(create_data);
265 persistent_dataptr =
nullptr;
267 else if (persistent_dataptr ==
nullptr) {
358 "Expected this ID type to be ported to new Outliner tree-element design");
366 "Expected override types to be ported to new Outliner tree-element design");
372 "Element type should use `AbstractTreeElement` to for correct initialization "
373 "of its `TreeElement` data");
388 BLI_assert_msg(
false,
"Element type should use `AbstractTreeElement`");
409 space_outliner,
tree,
reinterpret_cast<ID *
>(cob->ob),
nullptr, parent,
TSE_SOME_ID, 0);
519static int treesort_obtype_alpha(
const void *v1,
const void *
v2)
521 const tTreeSort *x1 = v1, *x2 =
v2;
524 if (x1->idcode ==
ID_OB && x2->idcode !=
ID_OB) {
527 else if (x2->idcode ==
ID_OB && x1->idcode !=
ID_OB) {
532 if (x1->idcode ==
ID_OB && x2->idcode ==
ID_OB) {
533 if (((
Object *)x1->id)->type > ((
Object *)x2->id)->type) {
536 else if (((
Object *)x1->id)->type > ((
Object *)x2->id)->type) {
562 if (last_te ==
nullptr) {
601 for (tp = tear, skip = 0; skip < totelem; skip++, tp++) {
607 if (skip < totelem) {
630 if (last_te ==
nullptr) {
690 if (focus->
tselem !=
nullptr) {
695 if (te_new !=
nullptr) {
696 int ys_new = te_new->
ys;
697 int ys_old = focus->
ys;
699 float y_move = std::min(
float(ys_new - ys_old), -v2d->
cur.
ymax);
728 if (callback_test(te)) {
735 space_outliner, te_iter, limit, callback_test);
736 if (te_sub !=
nullptr) {
757 const float view_co_limit)
771 while (te !=
nullptr) {
773 space_outliner, te, view_co_limit, callback_test);
774 if (te_sub !=
nullptr) {
787 if (te->
parent ==
nullptr) {
865 return exclude_filter;
871 const int exclude_filter)
928 if (base ==
nullptr) {
932 if (base ==
nullptr) {
937 bool is_visible =
true;
962 is_visible = !is_visible;
994 int fn_flag = FNM_NOESCAPE;
997 fn_flag |= FNM_CASEFOLD;
1000 return fnmatch(
name, te->
name, fn_flag) == 0;
1048 const char *search_string,
1049 const int exclude_filter)
1060 space_outliner, scene, view_layer, &te->
subtree, search_string, exclude_filter);
1067 space_outliner, scene, view_layer, &te->
subtree, search_string, exclude_filter);
1085 space_outliner, scene, view_layer, &te->
subtree, search_string, exclude_filter) == 0)
1098 space_outliner, scene, view_layer, &te->
subtree, search_string, exclude_filter);
1111 const char *search_string;
1115 if (exclude_filter == 0) {
1125 search_string = search_buff;
1129 space_outliner, scene, view_layer, &space_outliner->
tree, search_string, exclude_filter);
1136 id_iter->
newid =
nullptr;
1175 "Skipping rebuild before tree was built properly, a full redraw should be "
1176 "triggered instead");
1191 space_outliner->
outlinevis, *space_outliner);
const char * BKE_collection_ui_name_get(Collection *collection)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
#define FOREACH_MAIN_ID_END
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_mempool_alloc(BLI_mempool *pool) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter) ATTR_NONNULL()
void * BLI_mempool_iterstep(BLI_mempool_iter *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_mempool * BLI_mempool_create(unsigned int esize, unsigned int elem_num, unsigned int pchunk, unsigned int flag) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
int BLI_mempool_len(const BLI_mempool *pool) ATTR_NONNULL(1)
void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1)
void BLI_rctf_translate(struct rctf *rect, float x, float y)
int char char int int int BLI_strcasecmp_natural(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char char * BLI_strncpy_ensure_pad(char *__restrict dst, const char *__restrict src, char pad, size_t dst_maxncpy) ATTR_NONNULL(1
Object groups, one object can be in many groups at once.
@ BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT
struct FreestyleLineStyle FreestyleLineStyle
#define TSE_IS_REAL_ID(_tse)
@ TSE_LIBRARY_OVERRIDE_OPERATION
@ TSE_VIEW_COLLECTION_BASE
@ TSE_LIBRARY_OVERRIDE_BASE
@ TSE_SCENE_COLLECTION_BASE
@ TSE_GPENCIL_EFFECT_BASE
@ TSE_BONE_COLLECTION_BASE
#define BASE_SELECTED(v3d, base)
#define BASE_SELECTABLE(v3d, base)
#define SO_FILTER_OB_STATE
@ SO_FILTER_OB_STATE_ACTIVE
@ SO_FILTER_NO_OB_CONTENT
@ SO_FILTER_NO_OB_GREASE_PENCIL
@ SO_FILTER_OB_STATE_SELECTABLE
@ SO_FILTER_OB_STATE_INVERSE
@ SO_FILTER_OB_STATE_SELECTED
@ SO_FILTER_OB_STATE_VISIBLE
@ SO_FILTER_NO_COLLECTION
@ SO_FILTER_NO_OB_ARMATURE
#define SO_FILTER_OB_TYPE
@ SO_FILTER_OB_SELECTABLE
struct SpaceOutliner SpaceOutliner
bool ED_outliner_support_searching(const SpaceOutliner *space_outliner)
Read Guarded memory(de)allocation.
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const void * element
ATTR_WARN_UNUSED_RESULT const BMVert * v2
SpaceOutliner & space_outliner_
static TreeElement * add_element(SpaceOutliner *space_outliner, ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true)
static std::unique_ptr< AbstractTreeDisplay > create_from_display_mode(int mode, SpaceOutliner &space_outliner)
static std::unique_ptr< AbstractTreeElement > create_from_type(int type, TreeElement &legacy_te, ID *owner_id, void *create_data)
GPU_SHADER_INTERFACE_INFO(depth_2d_update_iface).smooth(Type fragColor push_constant(Type::float2_t, "extent") .push_constant(Type source_data
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
static TreeElement * outliner_find_first_desired_element_at_y_recursive(const SpaceOutliner *space_outliner, TreeElement *te, const float limit, bool(*callback_test)(TreeElement *))
static void outliner_collections_children_sort(ListBase *lb)
static void outliner_restore_scrolling_position(SpaceOutliner *space_outliner, ARegion *region, OutlinerTreeElementFocus *focus)
bool outliner_is_collection_tree_element(const TreeElement *te)
static bool outliner_element_is_collection_or_object(TreeElement *te)
@ TE_CHILD_NOT_IN_COLLECTION
static TreeElement * outliner_extract_children_from_subtree(TreeElement *element, ListBase *parent_subtree)
void outliner_free_tree_element(TreeElement *element, ListBase *parent_subtree)
static int treesort_child_not_in_collection(const void *v1, const void *v2)
void tree_element_expand(const AbstractTreeElement &tree_element, SpaceOutliner &space_outliner)
static bool test_object_callback(TreeElement *te)
static void outliner_storage_cleanup(SpaceOutliner *space_outliner)
TreeElement * outliner_add_collection_recursive(SpaceOutliner *space_outliner, Collection *collection, TreeElement *ten)
bool outliner_requires_rebuild_on_select_or_active_change(const SpaceOutliner *space_outliner)
static int outliner_filter_subtree(SpaceOutliner *space_outliner, const Scene *scene, ViewLayer *view_layer, ListBase *lb, const char *search_string, const int exclude_filter)
TreeElement * outliner_find_item_at_y(const SpaceOutliner *space_outliner, const ListBase *tree, float view_co_y)
void outliner_free_tree(ListBase *tree)
void outliner_set_coordinates(const ARegion *region, const SpaceOutliner *space_outliner)
static bool outliner_filter_has_name(TreeElement *te, const char *name, int flags)
static int treesort_alpha(const void *v1, const void *v2)
TreeElement * outliner_find_tree_element(ListBase *lb, const TreeStoreElem *store_elem)
static void check_persistent(SpaceOutliner *space_outliner, TreeElement *te, ID *id, short type, short nr)
void outliner_cleanup_tree(SpaceOutliner *space_outliner)
static void outliner_clear_newid_from_main(Main *bmain)
static TreeElement * outliner_find_first_desired_element_at_y(const SpaceOutliner *space_outliner, const float view_co, const float view_co_limit)
BLI_INLINE void outliner_add_collection_init(TreeElement *te, Collection *collection)
BLI_INLINE void outliner_add_collection_objects(SpaceOutliner *space_outliner, ListBase *tree, Collection *collection, TreeElement *parent)
static int outliner_exclude_filter_get(const SpaceOutliner *space_outliner)
static int treesort_alpha_ob(const void *v1, const void *v2)
void outliner_build_tree(Main *mainvar, WorkSpace *workspace, Scene *scene, ViewLayer *view_layer, SpaceOutliner *space_outliner, ARegion *region)
static bool outliner_element_visible_get(const Scene *scene, ViewLayer *view_layer, TreeElement *te, const int exclude_filter)
static void outliner_store_scrolling_position(SpaceOutliner *space_outliner, ARegion *region, OutlinerTreeElementFocus *focus)
static bool test_collection_callback(TreeElement *te)
static void outliner_sort(ListBase *lb)
static void outliner_filter_tree(SpaceOutliner *space_outliner, const Scene *scene, ViewLayer *view_layer)
#define TREESTORE_ID_TYPE(_id)
#define SEARCHING_OUTLINER(sov)
#define SUPPORT_FILTER_OUTLINER(space_outliner_)
#define TSELEM_OPEN(telm, sv)
ARegionRuntimeHandle * runtime
struct FreestyleLineStyle * linestyle
struct FreestyleLineSet * next
SpaceOutliner_Runtime * runtime
struct BLI_mempool * treestore
struct FreestyleConfig freestyle_config
std::unique_ptr< treehash::TreeHash > tree_hash
std::unique_ptr< AbstractTreeDisplay > tree_display
TreeStoreElem * store_elem
std::unique_ptr< AbstractTreeElement > abstract_element
The data to build the tree from.
Establish and manage Outliner trees for different display modes.