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