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