Blender V5.0
space_outliner.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9/* Allow using deprecated functionality for .blend file I/O. */
10#define DNA_DEPRECATED_ALLOW
11
12#include <cfloat>
13#include <cstring>
14
15#include "MEM_guardedalloc.h"
16
17#include "BLI_listbase.h"
18#include "BLI_mempool.h"
19#include "BLI_string_utf8.h"
20#include "BLI_utildefines.h"
21
22#include "BKE_context.hh"
23#include "BKE_lib_query.hh"
24#include "BKE_lib_remap.hh"
26#include "BKE_screen.hh"
27
28#include "ED_screen.hh"
29#include "ED_space_api.hh"
30
31#include "WM_api.hh"
32#include "WM_message.hh"
33#include "WM_types.hh"
34
35#include "DNA_scene_types.h"
36
37#include "UI_resources.hh"
38#include "UI_view2d.hh"
39
40#include "BLO_read_write.hh"
41
42#include "outliner_intern.hh"
43#include "tree/tree_display.hh"
44
51#define USE_OUTLINER_DRAW_CLAMPS_SCROLL_HACK
52
53namespace blender::ed::outliner {
54
55SpaceOutliner_Runtime::SpaceOutliner_Runtime(const SpaceOutliner_Runtime & /*other*/)
57{
58}
59
61{
62 ListBase *lb;
63 wmKeyMap *keymap;
64
66
67 /* make sure we keep the hide flags */
69 region->v2d.scroll &= ~(V2D_SCROLL_LEFT | V2D_SCROLL_TOP); /* prevent any noise of past */
72
76 region->v2d.minzoom = region->v2d.maxzoom = 1.0f;
77
78 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
79
80 /* own keymap */
81 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Outliner", SPACE_OUTLINER, RGN_TYPE_WINDOW);
82 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
83
84 /* Add dropboxes */
86 WM_event_add_dropbox_handler(&region->runtime->handlers, lb);
87}
88
89static void outliner_main_region_draw(const bContext *C, ARegion *region)
90{
91 View2D *v2d = &region->v2d;
92
93#ifdef USE_OUTLINER_DRAW_CLAMPS_SCROLL_HACK
94 const rctf v2d_cur_prev = v2d->cur;
95#endif
96
98 draw_outliner(C, true);
99
100#ifdef USE_OUTLINER_DRAW_CLAMPS_SCROLL_HACK
101 /* This happens when scrolling is clamped & occasionally when resizing the area.
102 * In practice this isn't often which is important as that would hurt performance. */
103 if (!BLI_rctf_compare(&v2d->cur, &v2d_cur_prev, FLT_EPSILON)) {
105 draw_outliner(C, false);
106 }
107#endif
108
109 /* reset view matrix */
111
113
114 /* scrollers */
115 UI_view2d_scrollers_draw(v2d, nullptr);
116}
117
118static void outliner_main_region_free(ARegion * /*region*/) {}
119
121{
122 ScrArea *area = params->area;
123 ARegion *region = params->region;
124 const wmNotifier *wmn = params->notifier;
125 SpaceOutliner *space_outliner = static_cast<SpaceOutliner *>(area->spacedata.first);
126
127 /* context changes */
128 switch (wmn->category) {
129 case NC_WINDOW:
130 switch (wmn->action) {
131 case NA_ADDED:
132 case NA_REMOVED:
133 if (space_outliner->outlinevis == SO_DATA_API) {
134 ED_region_tag_redraw(region);
135 }
136 break;
137 }
138 break;
139 case NC_WM:
140 switch (wmn->data) {
142 ED_region_tag_redraw(region);
143 break;
144 }
145 break;
146 case NC_SCENE:
147 switch (wmn->data) {
148 case ND_OB_ACTIVE:
149 case ND_OB_SELECT:
151 ED_region_tag_redraw(region);
152 }
153 else {
155 }
156 break;
157 case ND_FRAME:
158 /* Rebuilding the outliner tree is expensive and shouldn't be done when scrubbing. */
160 break;
161 case ND_OB_VISIBLE:
162 case ND_OB_RENDER:
163 case ND_MODE:
164 case ND_KEYINGSET:
166 case ND_SEQUENCER:
167 case ND_LAYER_CONTENT:
168 case ND_WORLD:
169 case ND_SCENEBROWSE:
170 ED_region_tag_redraw(region);
171 break;
172 case ND_LAYER:
173 /* Avoid rebuild if only the active collection changes */
174 if ((wmn->subtype == NS_LAYER_COLLECTION) && (wmn->action == NA_ACTIVATED)) {
176 break;
177 }
178
179 ED_region_tag_redraw(region);
180 break;
181 }
182 if (wmn->action == NA_EDITED) {
184 }
185 break;
186 case NC_OBJECT:
187 switch (wmn->data) {
188 case ND_TRANSFORM:
190 break;
191 case ND_BONE_ACTIVE:
192 case ND_BONE_SELECT:
194 case ND_DRAW:
195 case ND_PARENT:
196 case ND_OB_SHADING:
197 ED_region_tag_redraw(region);
198 break;
199 case ND_CONSTRAINT:
200 /* all constraint actions now, for reordering */
201 ED_region_tag_redraw(region);
202 break;
203 case ND_MODIFIER:
204 /* all modifier actions now */
205 ED_region_tag_redraw(region);
206 break;
207 default:
208 /* Trigger update for NC_OBJECT itself */
209 ED_region_tag_redraw(region);
210 break;
211 }
212 break;
213 case NC_GROUP:
214 /* All actions now, TODO: check outliner view mode? */
215 ED_region_tag_redraw(region);
216 break;
217 case NC_LAMP:
218 /* For updating light icons, when changing light type */
219 if (wmn->data == ND_LIGHTING_DRAW) {
220 ED_region_tag_redraw(region);
221 }
222 break;
223 case NC_SPACE:
224 if (wmn->data == ND_SPACE_OUTLINER) {
225 ED_region_tag_redraw(region);
226 }
227 break;
228 case NC_ID:
229 if (ELEM(wmn->action, NA_RENAME, NA_ADDED, NA_REMOVED)) {
230 ED_region_tag_redraw(region);
231 }
232 break;
233 case NC_ASSET:
234 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED)) {
236 }
237 break;
238 case NC_MATERIAL:
239 switch (wmn->data) {
240 case ND_SHADING_LINKS:
242 break;
243 }
244 break;
245 case NC_GEOM:
246 switch (wmn->data) {
247 case ND_VERTEX_GROUP:
248 ED_region_tag_redraw(region);
249 break;
250 case ND_DATA:
251 if (wmn->action == NA_RENAME) {
252 ED_region_tag_redraw(region);
253 }
254 break;
255 }
256 break;
257 case NC_ANIMATION:
258 switch (wmn->data) {
259 case ND_NLA_ACTCHANGE:
260 case ND_KEYFRAME:
261 ED_region_tag_redraw(region);
262 break;
263 case ND_ANIMCHAN:
264 if (ELEM(wmn->action, NA_SELECTED, NA_RENAME)) {
265 ED_region_tag_redraw(region);
266 }
267 break;
268 case ND_NLA:
269 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED)) {
270 ED_region_tag_redraw(region);
271 }
272 break;
273 case ND_NLA_ORDER:
274 ED_region_tag_redraw(region);
275 break;
276 }
277 break;
278 case NC_GPENCIL:
280 ED_region_tag_redraw(region);
281 }
282 break;
283 case NC_SCREEN:
284 if (ELEM(wmn->data, ND_LAYOUTDELETE, ND_LAYER)) {
285 ED_region_tag_redraw(region);
286 }
287 break;
288 case NC_MASK:
289 if (ELEM(wmn->action, NA_ADDED)) {
290 ED_region_tag_redraw(region);
291 }
292 break;
293 case NC_PAINTCURVE:
294 if (ELEM(wmn->action, NA_ADDED)) {
295 ED_region_tag_redraw(region);
296 }
297 break;
298 case NC_TEXT:
299 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED)) {
300 ED_region_tag_redraw(region);
301 }
302 break;
303 case NC_NODE:
304 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED) &&
305 ELEM(space_outliner->outlinevis, SO_LIBRARIES, SO_DATA_API))
306 {
307 ED_region_tag_redraw(region);
308 }
309 break;
310 case NC_IMAGE:
311 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED) &&
312 ELEM(space_outliner->outlinevis, SO_LIBRARIES, SO_DATA_API))
313 {
314 ED_region_tag_redraw(region);
315 }
316 break;
317 }
318}
319
321{
322 wmMsgBus *mbus = params->message_bus;
323 ScrArea *area = params->area;
324 ARegion *region = params->region;
325 SpaceOutliner *space_outliner = static_cast<SpaceOutliner *>(area->spacedata.first);
326
327 wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
328 msg_sub_value_region_tag_redraw.owner = region;
329 msg_sub_value_region_tag_redraw.user_data = region;
330 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
331
333 WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw);
334 }
335}
336
337/* ************************ header outliner area region *********************** */
338
339/* add handlers, stuff you only do once or on area/region changes */
341{
342 ED_region_header_init(region);
343}
344
345static void outliner_header_region_draw(const bContext *C, ARegion *region)
346{
347 ED_region_header(C, region);
348}
349
350static void outliner_header_region_free(ARegion * /*region*/) {}
351
353{
354 ARegion *region = params->region;
355 const wmNotifier *wmn = params->notifier;
356
357 /* context changes */
358 switch (wmn->category) {
359 case NC_SCENE:
360 switch (wmn->data) {
361 case ND_KEYINGSET:
362 ED_region_tag_redraw(region);
363 break;
364 case ND_LAYER:
365 /* Not needed by blender itself, but requested by add-on developers. #109995 */
366 if ((wmn->subtype == NS_LAYER_COLLECTION) && (wmn->action == NA_ACTIVATED)) {
367 ED_region_tag_redraw(region);
368 }
369 break;
370 }
371 break;
372 case NC_SPACE:
373 if (wmn->data == ND_SPACE_OUTLINER) {
374 ED_region_tag_redraw(region);
375 }
376 break;
377 }
378}
379
380/* ******************** default callbacks for outliner space ***************** */
381
382static SpaceLink *outliner_create(const ScrArea * /*area*/, const Scene * /*scene*/)
383{
384 ARegion *region;
385 SpaceOutliner *space_outliner;
386
387 space_outliner = MEM_callocN<SpaceOutliner>("initoutliner");
388 space_outliner->spacetype = SPACE_OUTLINER;
389 space_outliner->filter_id_type = ID_GR;
391 space_outliner->outlinevis = SO_VIEW_LAYER;
393 space_outliner->flag = SO_SYNC_SELECT | SO_MODE_COLUMN;
394 space_outliner->filter = SO_FILTER_NO_VIEW_LAYERS;
395
396 /* header */
397 region = BKE_area_region_new();
398
399 BLI_addtail(&space_outliner->regionbase, region);
400 region->regiontype = RGN_TYPE_HEADER;
402
403 /* main region */
404 region = BKE_area_region_new();
405
406 BLI_addtail(&space_outliner->regionbase, region);
407 region->regiontype = RGN_TYPE_WINDOW;
408
409 return (SpaceLink *)space_outliner;
410}
411
412/* Doesn't free the space-link itself. */
413static void outliner_free(SpaceLink *sl)
414{
415 SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
416
417 outliner_free_tree(&space_outliner->tree);
418 if (space_outliner->treestore) {
419 BLI_mempool_destroy(space_outliner->treestore);
420 }
421
422 MEM_delete(space_outliner->runtime);
423}
424
425/* spacetype; init callback */
426static void outliner_init(wmWindowManager * /*wm*/, ScrArea *area)
427{
428 SpaceOutliner *space_outliner = static_cast<SpaceOutliner *>(area->spacedata.first);
429
430 if (space_outliner->runtime == nullptr) {
431 space_outliner->runtime = MEM_new<SpaceOutliner_Runtime>("SpaceOutliner_Runtime");
432 }
433}
434
436{
437 SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
438 SpaceOutliner *space_outliner_new = MEM_dupallocN<SpaceOutliner>(__func__, *space_outliner);
439
440 BLI_listbase_clear(&space_outliner_new->tree);
441 space_outliner_new->treestore = nullptr;
442
444
445 if (space_outliner->runtime) {
446 /* Copy constructor handles details. */
447 space_outliner_new->runtime = MEM_new<SpaceOutliner_Runtime>("SpaceOutliner_runtime dup",
448 *space_outliner->runtime);
449 }
450
451 return (SpaceLink *)space_outliner_new;
452}
453
454static void outliner_id_remap(ScrArea *area,
455 SpaceLink *slink,
456 const blender::bke::id::IDRemapper &mappings)
457{
458 SpaceOutliner *space_outliner = (SpaceOutliner *)slink;
459
460 if (!space_outliner->treestore) {
461 return;
462 }
463
464 TreeStoreElem *tselem;
465 BLI_mempool_iter iter;
466 bool changed = false;
467 bool unassigned = false;
468
469 BLI_mempool_iternew(space_outliner->treestore, &iter);
470 while ((tselem = static_cast<TreeStoreElem *>(BLI_mempool_iterstep(&iter)))) {
471 switch (mappings.apply(&tselem->id, ID_REMAP_APPLY_DEFAULT)) {
473 changed = true;
474 break;
476 changed = true;
477 unassigned = true;
478 break;
481 break;
482 }
483 }
484
485 /* Note that the Outliner may not be the active editor of the area, and hence not initialized.
486 * So runtime data might not have been created yet. */
487 if (space_outliner->runtime && space_outliner->runtime->tree_hash && changed) {
488 /* rebuild hash table, because it depends on ids too */
489 /* postpone a full rebuild because this can be called many times on-free */
490 space_outliner->storeflag |= SO_TREESTORE_REBUILD;
491
492 if (unassigned) {
493 /* Redraw is needed when removing data for multiple outlines show the same data.
494 * without this, the stale data won't get fully flushed when this outliner
495 * is not the active outliner the user is interacting with. See #85976. */
496 ED_area_tag_redraw(area);
497 }
498 }
499}
500
502{
503 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(space_link);
504 if (!space_outliner->treestore) {
505 return;
506 }
507 const int data_flags = BKE_lib_query_foreachid_process_flags_get(data);
508 const bool is_readonly = (data_flags & IDWALK_READONLY) != 0;
509 const bool allow_pointer_access = (data_flags & IDWALK_NO_ORIG_POINTERS_ACCESS) == 0;
510
511 BLI_mempool_iter iter;
512 BLI_mempool_iternew(space_outliner->treestore, &iter);
513 while (TreeStoreElem *tselem = static_cast<TreeStoreElem *>(BLI_mempool_iterstep(&iter))) {
514 /* Do not try to restore non-ID pointers (drivers/sequence/etc.). */
515 if (TSE_IS_REAL_ID(tselem)) {
516 /* NOTE: Outliner ID pointers are never `IDWALK_CB_DIRECT_WEAK_LINK`, they should never
517 * enforce keeping a reference to some linked data. They do need to be explicitely ignored by
518 * writefile code though. */
519 const LibraryForeachIDCallbackFlag cb_flag =
520 IDWALK_CB_WRITEFILE_IGNORE | ((tselem->id != nullptr && allow_pointer_access &&
521 (tselem->id->flag & ID_FLAG_EMBEDDED_DATA) != 0) ?
524 BKE_LIB_FOREACHID_PROCESS_ID(data, tselem->id, cb_flag);
525 }
526 else if (!is_readonly) {
527 tselem->id = nullptr;
528 }
529 }
530 if (!is_readonly) {
531 /* rebuild hash table, because it depends on ids too */
532 space_outliner->storeflag |= SO_TREESTORE_REBUILD;
533 }
534}
535
536static void outliner_deactivate(ScrArea *area)
537{
538 /* Remove hover highlights */
539 SpaceOutliner *space_outliner = static_cast<SpaceOutliner *>(area->spacedata.first);
540 outliner_flag_set(*space_outliner, TSE_HIGHLIGHTED_ANY, false);
542}
543
545{
546 SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
547
548 /* use #BLO_read_get_new_data_address_no_us and do not free old memory avoiding double
549 * frees and use of freed memory. this could happen because of a
550 * bug fixed in revision 58959 where the treestore memory address
551 * was not unique */
552 TreeStore *ts = static_cast<TreeStore *>(
553 BLO_read_get_new_data_address_no_us(reader, space_outliner->treestore, sizeof(TreeStore)));
554 space_outliner->treestore = nullptr;
555 if (ts) {
557 reader, ts->data, sizeof(TreeStoreElem) * ts->usedelem));
558
559 space_outliner->treestore = BLI_mempool_create(
561 if (ts->usedelem && elems) {
562 for (int i = 0; i < ts->usedelem; i++) {
563 TreeStoreElem *new_elem = static_cast<TreeStoreElem *>(
564 BLI_mempool_alloc(space_outliner->treestore));
565 *new_elem = elems[i];
566 }
567 }
568 /* we only saved what was used */
569 space_outliner->storeflag |= SO_TREESTORE_CLEANUP; /* at first draw */
570 }
571 BLI_listbase_clear(&space_outliner->tree);
572 space_outliner->runtime = nullptr;
573}
574
576 ID * /*parent_id*/,
577 SpaceLink *sl)
578{
579 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(sl);
580
581 if (space_outliner->treestore) {
582 TreeStoreElem *tselem;
583 BLI_mempool_iter iter;
584
585 BLI_mempool_iternew(space_outliner->treestore, &iter);
586 while ((tselem = static_cast<TreeStoreElem *>(BLI_mempool_iterstep(&iter)))) {
587 if (!TSE_IS_REAL_ID(tselem)) {
588 tselem->id = nullptr;
589 }
590 }
591 /* rebuild hash table, because it depends on ids too */
592 space_outliner->storeflag |= SO_TREESTORE_REBUILD;
593 }
594}
595
596static void write_space_outliner(BlendWriter *writer, const SpaceOutliner *space_outliner)
597{
598 BLI_mempool *ts = space_outliner->treestore;
599
600 if (ts) {
601 const int elems = BLI_mempool_len(ts);
602 /* linearize mempool to array */
603 TreeStoreElem *data = elems ? static_cast<TreeStoreElem *>(
604 BLI_mempool_as_arrayN(ts, "TreeStoreElem")) :
605 nullptr;
606
607 if (data) {
608 BLO_write_struct(writer, SpaceOutliner, space_outliner);
609
610 /* To store #TreeStore (instead of the mempool), two unique memory addresses are needed,
611 * which can be used to identify the data on read:
612 * 1) One for the #TreeStore data itself.
613 * 2) One for the array of #TreeStoreElem's inside #TreeStore (#TreeStore.data).
614 *
615 * For 1) we just use the mempool's address (#SpaceOutliner::treestore).
616 * For 2) we don't have such a direct choice. We can't just use the array's address from
617 * above, since that may not be unique over all Outliners. So instead use an address relative
618 * to 1).
619 */
620 /* TODO the mempool could be moved to #SpaceOutliner_Runtime so that #SpaceOutliner could
621 * hold the #TreeStore directly. */
622
623 /* Address relative to the tree-store, as noted above. */
624 void *data_addr = (void *)POINTER_OFFSET(ts, sizeof(void *));
625 /* There should be plenty of memory addresses within the mempool data that we can point into,
626 * just double-check we don't potentially end up with a memory address that another DNA
627 * struct might use. Assumes BLI_mempool uses the guarded allocator. */
628 BLI_assert(MEM_allocN_len(ts) >= sizeof(void *) * 2);
629
630 TreeStore ts_flat = {0};
631 ts_flat.usedelem = elems;
632 ts_flat.totelem = elems;
633 ts_flat.data = static_cast<TreeStoreElem *>(data_addr);
634
635 BLO_write_struct_at_address(writer, TreeStore, ts, &ts_flat);
636 BLO_write_struct_array_at_address(writer, TreeStoreElem, elems, data_addr, data);
637
639 }
640 else {
641 SpaceOutliner space_outliner_flat = *space_outliner;
642 space_outliner_flat.treestore = nullptr;
643 BLO_write_struct_at_address(writer, SpaceOutliner, space_outliner, &space_outliner_flat);
644 }
645 }
646 else {
647 BLO_write_struct(writer, SpaceOutliner, space_outliner);
648 }
649}
650
652{
653 SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
654 write_space_outliner(writer, space_outliner);
655}
656
657} // namespace blender::ed::outliner
658
660{
661 using namespace blender::ed::outliner;
662
663 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
664 ARegionType *art;
665
666 st->spaceid = SPACE_OUTLINER;
667 STRNCPY_UTF8(st->name, "Outliner");
668
669 st->create = outliner_create;
670 st->free = outliner_free;
671 st->init = outliner_init;
672 st->duplicate = outliner_duplicate;
673 st->operatortypes = outliner_operatortypes;
674 st->keymap = outliner_keymap;
675 st->dropboxes = outliner_dropboxes;
676 st->id_remap = outliner_id_remap;
677 st->foreach_id = outliner_foreach_id;
678 st->deactivate = outliner_deactivate;
679 st->blend_read_data = outliner_space_blend_read_data;
680 st->blend_read_after_liblink = outliner_space_blend_read_after_liblink;
681 st->blend_write = outliner_space_blend_write;
682
683 /* regions: main window */
684 art = MEM_callocN<ARegionType>("spacetype outliner region");
687
694 BLI_addhead(&st->regiontypes, art);
695
696 /* regions: header */
697 art = MEM_callocN<ARegionType>("spacetype outliner header region");
699 art->prefsizey = HEADERY;
701
706 BLI_addhead(&st->regiontypes, art);
707
708 BKE_spacetype_register(std::move(st));
709}
ScrArea * CTX_wm_area(const bContext *C)
LibraryForeachIDCallbackFlag
@ IDWALK_CB_WRITEFILE_IGNORE
@ IDWALK_CB_EMBEDDED_NOT_OWNING
@ IDWALK_CB_NOP
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
LibraryForeachIDFlag BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
Definition lib_query.cc:129
@ IDWALK_READONLY
@ IDWALK_NO_ORIG_POINTERS_ACCESS
@ ID_REMAP_RESULT_SOURCE_REMAPPED
@ ID_REMAP_RESULT_SOURCE_UNASSIGNED
@ ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE
@ ID_REMAP_RESULT_SOURCE_UNAVAILABLE
@ ID_REMAP_APPLY_DEFAULT
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
Definition screen.cc:282
ARegion * BKE_area_region_new()
Definition screen.cc:387
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:846
#define BLI_assert(a)
Definition BLI_assert.h:46
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:91
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()
void void * BLI_mempool_as_arrayN(BLI_mempool *pool, const char *allocstr) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
@ BLI_MEMPOOL_ALLOW_ITER
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)
bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, float limit)
#define STRNCPY_UTF8(dst, src)
#define ELEM(...)
#define POINTER_OFFSET(v, ofs)
void * BLO_read_get_new_data_address_no_us(BlendDataReader *reader, const void *old_address, size_t expected_size)
Definition readfile.cc:5703
#define BLO_write_struct_array_at_address(writer, struct_name, array_size, address, data_ptr)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_write_struct_at_address(writer, struct_name, address, data_ptr)
@ ID_FLAG_EMBEDDED_DATA
Definition DNA_ID.h:774
@ ID_GR
#define TSE_IS_REAL_ID(_tse)
@ TSE_HIGHLIGHTED_ANY
#define HEADERY
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_TOP
@ RGN_TYPE_WINDOW
@ RGN_TYPE_HEADER
@ RGN_FLAG_INDICATE_OVERFLOW
@ SPACE_OUTLINER
@ SO_RESTRICT_HIDE
@ SO_RESTRICT_RENDER
@ SO_RESTRICT_ENABLE
@ SO_FILTER_NO_VIEW_LAYERS
@ SO_SYNC_SELECT
@ SO_MODE_COLUMN
@ SO_TREESTORE_CLEANUP
@ SO_TREESTORE_REBUILD
@ SO_OVERRIDES_LIBRARY
@ SO_DATA_API
@ SO_LIBRARIES
@ SO_VIEW_LAYER
@ SO_SCENES
@ USER_HEADER_BOTTOM
@ V2D_KEEPTOT_STRICT
@ V2D_LIMITZOOM
@ V2D_LOCKZOOM_X
@ V2D_KEEPASPECT
@ V2D_LOCKZOOM_Y
@ V2D_SCROLL_LEFT
@ V2D_SCROLL_HORIZONTAL_HIDE
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_TOP
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_ALIGN_NO_NEG_X
@ V2D_ALIGN_NO_POS_Y
#define WM_OUTLINER_SYNC_SELECT_FROM_ALL
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:693
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:3935
void ED_region_header_init(ARegion *region)
Definition area.cc:3950
void ED_region_tag_redraw_no_rebuild(ARegion *region)
Definition area.cc:638
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:618
@ ED_KEYMAP_UI
Definition ED_screen.hh:758
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:764
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:761
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
Definition area.cc:361
void ED_region_draw_overflow_indication(const ScrArea *area, ARegion *region, rcti *mask=nullptr)
Definition area.cc:3417
void ED_spacetype_outliner()
#define Window
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
@ TH_BACK
void UI_ThemeClearColor(int colorid)
void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
Definition view2d.cc:1504
void UI_view2d_view_restore(const bContext *C)
Definition view2d.cc:1162
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
Definition view2d.cc:221
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:35
#define ND_SEQUENCER
Definition WM_types.hh:437
#define ND_WORLD
Definition WM_types.hh:452
#define NA_ACTIVATED
Definition WM_types.hh:590
#define NC_WINDOW
Definition WM_types.hh:375
#define NC_ID
Definition WM_types.hh:395
#define NC_NODE
Definition WM_types.hh:394
#define NC_GEOM
Definition WM_types.hh:393
#define ND_NLA_ACTCHANGE
Definition WM_types.hh:498
#define ND_DRAW
Definition WM_types.hh:461
#define ND_OB_ACTIVE
Definition WM_types.hh:440
#define NC_WM
Definition WM_types.hh:374
#define ND_DATA
Definition WM_types.hh:509
#define ND_LIGHTING_DRAW
Definition WM_types.hh:484
#define ND_RENDER_OPTIONS
Definition WM_types.hh:435
#define NC_ANIMATION
Definition WM_types.hh:388
#define ND_VERTEX_GROUP
Definition WM_types.hh:510
#define NC_PAINTCURVE
Definition WM_types.hh:396
#define NC_SCREEN
Definition WM_types.hh:377
#define ND_MODE
Definition WM_types.hh:445
#define ND_LIB_OVERRIDE_CHANGED
Definition WM_types.hh:419
#define ND_OB_SELECT
Definition WM_types.hh:442
#define ND_KEYINGSET
Definition WM_types.hh:448
#define NC_SCENE
Definition WM_types.hh:378
#define NA_ADDED
Definition WM_types.hh:586
#define ND_OB_VISIBLE
Definition WM_types.hh:443
#define ND_LAYER_CONTENT
Definition WM_types.hh:453
#define NC_GROUP
Definition WM_types.hh:383
#define ND_MODIFIER
Definition WM_types.hh:462
#define NA_EDITED
Definition WM_types.hh:584
#define ND_PARENT
Definition WM_types.hh:467
#define NC_TEXT
Definition WM_types.hh:386
#define NC_MATERIAL
Definition WM_types.hh:380
#define NC_LAMP
Definition WM_types.hh:382
#define NC_IMAGE
Definition WM_types.hh:384
#define ND_CONSTRAINT
Definition WM_types.hh:464
#define ND_FRAME
Definition WM_types.hh:434
#define NC_ASSET
Definition WM_types.hh:404
#define NA_REMOVED
Definition WM_types.hh:587
#define ND_NLA_ORDER
Definition WM_types.hh:500
#define NC_GPENCIL
Definition WM_types.hh:399
#define ND_NLA
Definition WM_types.hh:497
#define ND_BONE_ACTIVE
Definition WM_types.hh:459
#define ND_OB_RENDER
Definition WM_types.hh:444
#define ND_TRANSFORM
Definition WM_types.hh:456
#define ND_LAYER
Definition WM_types.hh:450
#define ND_BONE_COLLECTION
Definition WM_types.hh:474
#define NC_MASK
Definition WM_types.hh:398
#define NA_RENAME
Definition WM_types.hh:588
#define ND_BONE_SELECT
Definition WM_types.hh:460
#define ND_OB_SHADING
Definition WM_types.hh:457
#define ND_KEYFRAME
Definition WM_types.hh:494
#define NC_OBJECT
Definition WM_types.hh:379
#define ND_SCENEBROWSE
Definition WM_types.hh:432
#define ND_LAYOUTDELETE
Definition WM_types.hh:423
#define ND_ANIMCHAN
Definition WM_types.hh:496
#define ND_SHADING_LINKS
Definition WM_types.hh:479
#define NS_LAYER_COLLECTION
Definition WM_types.hh:580
#define NC_SPACE
Definition WM_types.hh:392
#define NA_SELECTED
Definition WM_types.hh:589
#define ND_SPACE_OUTLINER
Definition WM_types.hh:527
#define U
BMesh const char void * data
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void * MEM_dupallocN(const void *vmemh)
Definition mallocn.cc:143
size_t(* MEM_allocN_len)(const void *vmemh)
Definition mallocn.cc:36
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
static void outliner_header_region_free(ARegion *)
static void outliner_init(wmWindowManager *, ScrArea *area)
static void outliner_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
static void outliner_main_region_draw(const bContext *C, ARegion *region)
static void outliner_space_blend_write(BlendWriter *writer, SpaceLink *sl)
bool outliner_flag_set(const SpaceOutliner &space_outliner, const short flag, const short set)
bool outliner_requires_rebuild_on_select_or_active_change(const SpaceOutliner *space_outliner)
static void write_space_outliner(BlendWriter *writer, const SpaceOutliner *space_outliner)
void outliner_free_tree(ListBase *tree)
static SpaceLink * outliner_duplicate(SpaceLink *sl)
static void outliner_space_blend_read_after_liblink(BlendLibReader *, ID *, SpaceLink *sl)
static void outliner_header_region_listener(const wmRegionListenerParams *params)
static void outliner_space_blend_read_data(BlendDataReader *reader, SpaceLink *sl)
static void outliner_header_region_init(wmWindowManager *, ARegion *region)
int outliner_main_region_context(const bContext *C, const char *member, bContextDataResult *result)
static void outliner_free(SpaceLink *sl)
static void outliner_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
static void outliner_main_region_listener(const wmRegionListenerParams *params)
static SpaceLink * outliner_create(const ScrArea *, const Scene *)
void outliner_keymap(wmKeyConfig *keyconf)
static void outliner_id_remap(ScrArea *area, SpaceLink *slink, const blender::bke::id::IDRemapper &mappings)
static void outliner_main_region_init(wmWindowManager *wm, ARegion *region)
static void outliner_deactivate(ScrArea *area)
static void outliner_header_region_draw(const bContext *C, ARegion *region)
static void outliner_main_region_free(ARegion *)
void draw_outliner(const bContext *C, bool do_rebuild)
void(* free)(ARegion *)
void(* message_subscribe)(const wmRegionMessageSubscribeParams *params)
void(* listener)(const wmRegionListenerParams *params)
bContextDataCallback context
void(* draw)(const bContext *C, ARegion *region)
void(* init)(wmWindowManager *wm, ARegion *region)
ARegionRuntimeHandle * runtime
Definition DNA_ID.h:414
void * first
ListBase spacedata
SpaceOutliner_Runtime * runtime
struct BLI_mempool * treestore
TreeStoreElem * data
float minzoom
short keeptot
short keepzoom
float maxzoom
std::unique_ptr< treehash::TreeHash > tree_hash
std::unique_ptr< AbstractTreeDisplay > tree_display
unsigned int data
Definition WM_types.hh:358
unsigned int action
Definition WM_types.hh:358
unsigned int category
Definition WM_types.hh:358
unsigned int subtype
Definition WM_types.hh:358
i
Definition text_draw.cc:230
Establish and manage Outliner trees for different display modes.
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:895
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value)