70 space_outliner->
storeflag &= ~SO_TREESTORE_CLEANUP;
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,
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);
257 persistent_dataptr =
static_cast<ID *
>(((
PointerRNA *)create_data)->data);
265 persistent_dataptr =
nullptr;
267 else if (persistent_dataptr ==
nullptr) {
355 "Expected this ID type to be ported to new Outliner tree-element design");
363 "Expected override types to be ported to new Outliner tree-element design");
369 "Element type should use `AbstractTreeElement` to for correct initialization "
370 "of its `TreeElement` data");
385 BLI_assert_msg(
false,
"Element type should use `AbstractTreeElement`");
406 space_outliner,
tree,
reinterpret_cast<ID *
>(cob->ob),
nullptr, parent,
TSE_SOME_ID, 0);
516static int treesort_obtype_alpha(
const void *v1,
const void *
v2)
518 const tTreeSort *x1 = v1, *x2 =
v2;
521 if (x1->idcode ==
ID_OB && x2->idcode !=
ID_OB) {
524 else if (x2->idcode ==
ID_OB && x1->idcode !=
ID_OB) {
529 if (x1->idcode ==
ID_OB && x2->idcode ==
ID_OB) {
530 if (((
Object *)x1->id)->type > ((
Object *)x2->id)->type) {
533 else if (((
Object *)x1->id)->type > ((
Object *)x2->id)->type) {
559 if (last_te ==
nullptr) {
599 for (tp = tear, skip = 0; skip < totelem; skip++, tp++) {
605 if (skip < totelem) {
628 if (last_te ==
nullptr) {
687 View2D *v2d = ®ion->v2d;
689 if (focus->tselem !=
nullptr) {
694 if (te_new !=
nullptr) {
695 int ys_new = te_new->
ys;
696 int ys_old = focus->ys;
698 float y_move = std::min(
float(ys_new - ys_old), -v2d->
cur.
ymax);
727 if (callback_test(te)) {
734 space_outliner, te_iter, limit, callback_test);
735 if (te_sub !=
nullptr) {
756 const float view_co_limit)
770 while (te !=
nullptr) {
772 space_outliner, te, view_co_limit, callback_test);
773 if (te_sub !=
nullptr) {
786 if (te->
parent ==
nullptr) {
813 float limit = region->v2d.cur.ymin;
818 space_outliner, region->v2d.cur.ymax, limit);
825 focus->tselem =
nullptr;
831 int exclude_filter = space_outliner->
filter & ~SO_FILTER_OB_STATE;
837 exclude_filter &= ~SO_FILTER_SEARCH;
864 return exclude_filter;
870 const int exclude_filter)
927 if (base ==
nullptr) {
931 if (base ==
nullptr) {
936 bool is_visible =
true;
961 is_visible = !is_visible;
993 int fn_flag = FNM_NOESCAPE;
996 fn_flag |= FNM_CASEFOLD;
999 return fnmatch(name, te->
name, fn_flag) == 0;
1047 const char *search_string,
1048 const int exclude_filter)
1059 space_outliner, scene, view_layer, &te->
subtree, search_string, exclude_filter);
1066 space_outliner, scene, view_layer, &te->
subtree, search_string, exclude_filter);
1080 tselem->
flag &= ~TSE_SEARCHMATCH;
1084 space_outliner, scene, view_layer, &te->
subtree, search_string, exclude_filter) == 0)
1097 space_outliner, scene, view_layer, &te->
subtree, search_string, exclude_filter);
1110 char *search_string;
1114 if (exclude_filter == 0) {
1124 search_string = search_buff;
1128 space_outliner, scene, view_layer, &space_outliner->
tree, search_string, exclude_filter);
1135 id_iter->
newid =
nullptr;
1167 space_outliner->
storeflag &= ~SO_TREESTORE_REBUILD;
1171 "Skipping rebuild before tree was built properly, a full redraw should be "
1172 "triggered instead");
1187 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)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct 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
#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
Read Guarded memory(de)allocation.
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)
FreestyleLineStyle linestyle
GPU_SHADER_INTERFACE_INFO(depth_2d_update_iface, "").smooth(Type fragColor push_constant(Type::VEC2, "extent") .push_constant(Type source_data
void *(* MEM_mallocN)(size_t len, 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)
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_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, SpaceOutliner *space_outliner, ARegion *region)
void outliner_set_coordinates(const ARegion *region, const SpaceOutliner *space_outliner)
static bool outliner_filter_has_name(TreeElement *te, const char *name, int flags)
@ TE_CHILD_NOT_IN_COLLECTION
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)
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)
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.