Blender V5.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
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.hh"
18#include "BLI_mempool.hh"
19#include "BLI_string_utf8.hh"
20#include "BLI_utildefines.hh"
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
45namespace blender {
46
53#define USE_OUTLINER_DRAW_CLAMPS_SCROLL_HACK
54
55namespace ed::outliner {
56
61
63{
64 ListBaseT<wmDropBox> *lb;
65 wmKeyMap *keymap;
66
68
69 /* make sure we keep the hide flags */
71 region->v2d.scroll &= ~(V2D_SCROLL_LEFT | V2D_SCROLL_TOP); /* prevent any noise of past */
74
78 region->v2d.minzoom = region->v2d.maxzoom = 1.0f;
79
80 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_LIST, region->winx, region->winy);
81
82 /* own keymap */
83 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Outliner", SPACE_OUTLINER, RGN_TYPE_WINDOW);
85
86 /* Add dropboxes */
89}
90
91static void outliner_main_region_draw(const bContext *C, ARegion *region)
92{
93 View2D *v2d = &region->v2d;
94
95#ifdef USE_OUTLINER_DRAW_CLAMPS_SCROLL_HACK
96 const rctf v2d_cur_prev = v2d->cur;
97#endif
98
100 draw_outliner(C, true);
101
102#ifdef USE_OUTLINER_DRAW_CLAMPS_SCROLL_HACK
103 /* This happens when scrolling is clamped & occasionally when resizing the area.
104 * In practice this isn't often which is important as that would hurt performance. */
105 if (!BLI_rctf_compare(&v2d->cur, &v2d_cur_prev, FLT_EPSILON)) {
107 draw_outliner(C, false);
108 }
109#endif
110
111 /* reset view matrix */
113
115
116 /* scrollers */
117 ui::view2d_scrollers_draw(v2d, nullptr);
118}
119
120static void outliner_main_region_free(ARegion * /*region*/) {}
121
123{
124 ScrArea *area = params->area;
125 ARegion *region = params->region;
126 const wmNotifier *wmn = params->notifier;
127 SpaceOutliner *space_outliner = area->spacedata.first_as<SpaceOutliner>();
128
129 /* context changes */
130 switch (wmn->category) {
131 case NC_WINDOW:
132 switch (wmn->action) {
133 case NA_ADDED:
134 case NA_REMOVED:
135 if (space_outliner->outlinevis == SO_DATA_API) {
136 ED_region_tag_redraw(region);
137 }
138 break;
139 }
140 break;
141 case NC_WM:
142 switch (wmn->data) {
144 ED_region_tag_redraw(region);
145 break;
146 }
147 break;
148 case NC_SCENE:
149 switch (wmn->data) {
150 case ND_OB_ACTIVE:
151 case ND_OB_SELECT:
153 ED_region_tag_redraw(region);
154 }
155 else {
157 }
158 break;
159 case ND_FRAME:
160 /* Rebuilding the outliner tree is expensive and shouldn't be done when scrubbing. */
162 break;
163 case ND_OB_VISIBLE:
164 case ND_OB_RENDER:
165 case ND_MODE:
166 case ND_KEYINGSET:
168 case ND_SEQUENCER:
169 case ND_LAYER_CONTENT:
170 case ND_WORLD:
171 case ND_SCENEBROWSE:
172 ED_region_tag_redraw(region);
173 break;
174 case ND_LAYER:
175 /* Avoid rebuild if only the active collection changes */
176 if ((wmn->subtype == NS_LAYER_COLLECTION) && (wmn->action == NA_ACTIVATED)) {
178 break;
179 }
180
181 ED_region_tag_redraw(region);
182 break;
183 }
184 if (wmn->action == NA_EDITED) {
186 }
187 break;
188 case NC_OBJECT:
189 switch (wmn->data) {
190 case ND_TRANSFORM:
191 case ND_POSE:
192 /* Does not change Outliner data, but displays Override properties. */
193 if ((space_outliner->outlinevis == SO_OVERRIDES_LIBRARY) &&
195 {
197 }
198 break;
199 case ND_BONE_ACTIVE:
200 case ND_BONE_SELECT:
202 case ND_DRAW:
203 case ND_PARENT:
204 case ND_OB_SHADING:
205 ED_region_tag_redraw(region);
206 break;
207 case ND_CONSTRAINT:
208 /* all constraint actions now, for reordering */
209 ED_region_tag_redraw(region);
210 break;
211 case ND_MODIFIER:
212 /* all modifier actions now */
213 ED_region_tag_redraw(region);
214 break;
215 default:
216 /* Trigger update for NC_OBJECT itself */
217 ED_region_tag_redraw(region);
218 break;
219 }
220 break;
221 case NC_GROUP:
222 /* All actions now, TODO: check outliner view mode? */
223 ED_region_tag_redraw(region);
224 break;
225 case NC_LAMP:
226 /* For updating light icons, when changing light type */
227 if (wmn->data == ND_LIGHTING_DRAW) {
228 ED_region_tag_redraw(region);
229 }
230 break;
231 case NC_SPACE:
232 if (wmn->data == ND_SPACE_OUTLINER) {
233 ED_region_tag_redraw(region);
234 }
235 break;
236 case NC_ID:
237 if (ELEM(wmn->action, NA_RENAME, NA_ADDED, NA_REMOVED)) {
238 ED_region_tag_redraw(region);
239 }
240 break;
241 case NC_ASSET:
242 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED)) {
244 }
245 break;
246 case NC_MATERIAL:
247 switch (wmn->data) {
248 case ND_SHADING_LINKS:
250 break;
251 }
252 break;
253 case NC_GEOM:
254 switch (wmn->data) {
255 case ND_VERTEX_GROUP:
256 ED_region_tag_redraw(region);
257 break;
258 case ND_DATA:
259 if (wmn->action == NA_RENAME) {
260 ED_region_tag_redraw(region);
261 }
262 break;
263 }
264 break;
265 case NC_ANIMATION:
266 switch (wmn->data) {
267 case ND_NLA_ACTCHANGE:
268 ED_region_tag_redraw(region);
269 break;
270 case ND_KEYFRAME:
271 if (space_outliner->outlinevis != SO_ID_ORPHANS) {
272 if ((space_outliner->outlinevis == SO_DATA_API) ||
274 {
275 ED_region_tag_redraw(region);
276 }
277 else if (space_outliner->outlinevis != SO_LIBRARIES) {
279 }
280 }
281 break;
282 case ND_ANIMCHAN:
283 if (ELEM(wmn->action, NA_SELECTED, NA_RENAME)) {
284 ED_region_tag_redraw(region);
285 }
286 break;
287 case ND_NLA:
288 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED)) {
289 ED_region_tag_redraw(region);
290 }
291 break;
292 case ND_NLA_ORDER:
293 ED_region_tag_redraw(region);
294 break;
295 }
296 break;
297 case NC_GPENCIL:
299 ED_region_tag_redraw(region);
300 }
301 break;
302 case NC_SCREEN:
303 if (ELEM(wmn->data, ND_LAYOUTDELETE, ND_LAYER)) {
304 ED_region_tag_redraw(region);
305 }
306 break;
307 case NC_MASK:
308 if (ELEM(wmn->action, NA_ADDED)) {
309 ED_region_tag_redraw(region);
310 }
311 break;
312 case NC_PAINTCURVE:
313 if (ELEM(wmn->action, NA_ADDED)) {
314 ED_region_tag_redraw(region);
315 }
316 break;
317 case NC_TEXT:
318 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED)) {
319 ED_region_tag_redraw(region);
320 }
321 break;
322 case NC_NODE:
323 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED) &&
324 ELEM(space_outliner->outlinevis, SO_LIBRARIES, SO_DATA_API))
325 {
326 ED_region_tag_redraw(region);
327 }
328 break;
329 case NC_IMAGE:
330 if (ELEM(wmn->action, NA_ADDED, NA_REMOVED) &&
331 ELEM(space_outliner->outlinevis, SO_LIBRARIES, SO_DATA_API))
332 {
333 ED_region_tag_redraw(region);
334 }
335 break;
336 case NC_BRUSH:
337 if (wmn->action == NA_SELECTED) {
338 if (space_outliner->outlinevis == SO_DATA_API) {
339 ED_region_tag_redraw(region);
340 }
341 }
342 break;
343 }
344}
345
347{
348 wmMsgBus *mbus = params->message_bus;
349 ScrArea *area = params->area;
350 ARegion *region = params->region;
351 SpaceOutliner *space_outliner = area->spacedata.first_as<SpaceOutliner>();
352
353 wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
354 msg_sub_value_region_tag_redraw.owner = region;
355 msg_sub_value_region_tag_redraw.user_data = region;
356 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
357
359 WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw);
360 }
361}
362
363/* ************************ header outliner area region *********************** */
364
365/* add handlers, stuff you only do once or on area/region changes */
367{
368 ED_region_header_init(region);
369}
370
371static void outliner_header_region_draw(const bContext *C, ARegion *region)
372{
373 ED_region_header(C, region);
374}
375
376static void outliner_header_region_free(ARegion * /*region*/) {}
377
379{
380 ARegion *region = params->region;
381 const wmNotifier *wmn = params->notifier;
382
383 /* context changes */
384 switch (wmn->category) {
385 case NC_SCENE:
386 switch (wmn->data) {
387 case ND_KEYINGSET:
388 ED_region_tag_redraw(region);
389 break;
390 case ND_LAYER:
391 /* Not needed by blender itself, but requested by add-on developers. #109995 */
392 if ((wmn->subtype == NS_LAYER_COLLECTION) && (wmn->action == NA_ACTIVATED)) {
393 ED_region_tag_redraw(region);
394 }
395 break;
396 }
397 break;
398 case NC_SPACE:
399 if (wmn->data == ND_SPACE_OUTLINER) {
400 ED_region_tag_redraw(region);
401 }
402 break;
403 }
404}
405
406/* ******************** default callbacks for outliner space ***************** */
407
408static SpaceLink *outliner_create(const ScrArea * /*area*/, const Scene * /*scene*/)
409{
410 ARegion *region;
411 SpaceOutliner *space_outliner;
412
413 space_outliner = MEM_new<SpaceOutliner>("initoutliner");
414 space_outliner->runtime = MEM_new<SpaceOutliner_Runtime>(__func__);
415 space_outliner->spacetype = SPACE_OUTLINER;
416 space_outliner->filter_id_type = ID_GR;
418 space_outliner->outlinevis = SO_VIEW_LAYER;
421 space_outliner->filter = SO_FILTER_NO_VIEW_LAYERS;
422
423 /* header */
424 region = BKE_area_region_new();
425
426 BLI_addtail(&space_outliner->regionbase, region);
427 region->regiontype = RGN_TYPE_HEADER;
429
430 /* main region */
431 region = BKE_area_region_new();
432
433 BLI_addtail(&space_outliner->regionbase, region);
434 region->regiontype = RGN_TYPE_WINDOW;
435
436 return reinterpret_cast<SpaceLink *>(space_outliner);
437}
438
439/* Doesn't free the space-link itself. */
440static void outliner_free(SpaceLink *sl)
441{
442 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(sl);
443
444 outliner_free_tree(&space_outliner->runtime->tree);
445 if (space_outliner->treestore) {
446 BLI_mempool_destroy(space_outliner->treestore);
447 }
448
449 MEM_delete(space_outliner->runtime);
450}
451
452/* spacetype; init callback */
453static void outliner_init(wmWindowManager * /*wm*/, ScrArea * /*area*/) {}
454
456{
457 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(sl);
458 SpaceOutliner *space_outliner_new = MEM_new<SpaceOutliner>(__func__, *space_outliner);
459 space_outliner_new->runtime = MEM_new<SpaceOutliner_Runtime>(__func__, *space_outliner->runtime);
460
461 space_outliner_new->runtime->tree.clear_no_delete();
462 space_outliner_new->treestore = nullptr;
463
465
466 return reinterpret_cast<SpaceLink *>(space_outliner_new);
467}
468
469static void outliner_id_remap(ScrArea *area, SpaceLink *slink, const bke::id::IDRemapper &mappings)
470{
471 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(slink);
472
473 if (!space_outliner->treestore) {
474 return;
475 }
476
477 TreeStoreElem *tselem;
478 BLI_mempool_iter iter;
479 bool changed = false;
480 bool unassigned = false;
481
482 BLI_mempool_iternew(space_outliner->treestore, &iter);
483 while ((tselem = static_cast<TreeStoreElem *>(BLI_mempool_iterstep(&iter)))) {
484 switch (mappings.apply(&tselem->id, ID_REMAP_APPLY_DEFAULT)) {
486 changed = true;
487 break;
489 changed = true;
490 unassigned = true;
491 break;
494 break;
495 }
496 }
497
498 /* Note that the Outliner may not be the active editor of the area, and hence not initialized.
499 * So runtime data might not have been created yet. */
500 if (space_outliner->runtime && space_outliner->runtime->tree_hash && changed) {
501 /* rebuild hash table, because it depends on ids too */
502 /* postpone a full rebuild because this can be called many times on-free */
503 space_outliner->storeflag |= SO_TREESTORE_REBUILD;
504
505 if (unassigned) {
506 /* Redraw is needed when removing data for multiple outlines show the same data.
507 * without this, the stale data won't get fully flushed when this outliner
508 * is not the active outliner the user is interacting with. See #85976. */
509 ED_area_tag_redraw(area);
510 }
511 }
512}
513
515{
516 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(space_link);
517 if (!space_outliner->treestore) {
518 return;
519 }
520 const int data_flags = BKE_lib_query_foreachid_process_flags_get(data);
521 const bool is_readonly = (data_flags & IDWALK_READONLY) != 0;
522 const bool allow_pointer_access = (data_flags & IDWALK_NO_ORIG_POINTERS_ACCESS) == 0;
523
524 BLI_mempool_iter iter;
525 BLI_mempool_iternew(space_outliner->treestore, &iter);
526 while (TreeStoreElem *tselem = static_cast<TreeStoreElem *>(BLI_mempool_iterstep(&iter))) {
527 /* Do not try to restore non-ID pointers (drivers/sequence/etc.). */
528 if (TSE_IS_REAL_ID(tselem)) {
529 /* NOTE: Outliner ID pointers are never `IDWALK_CB_DIRECT_WEAK_LINK`, they should never
530 * enforce keeping a reference to some linked data. They do need to be explicitly ignored by
531 * writefile code though. */
532 const LibraryForeachIDCallbackFlag cb_flag =
533 IDWALK_CB_WRITEFILE_IGNORE | ((tselem->id != nullptr && allow_pointer_access &&
534 (tselem->id->flag & ID_FLAG_EMBEDDED_DATA) != 0) ?
537 BKE_LIB_FOREACHID_PROCESS_ID(data, tselem->id, cb_flag);
538 }
539 else if (!is_readonly) {
540 tselem->id = nullptr;
541 }
542 }
543 if (!is_readonly) {
544 /* rebuild hash table, because it depends on ids too */
545 space_outliner->storeflag |= SO_TREESTORE_REBUILD;
546 }
547}
548
549static void outliner_deactivate(ScrArea *area)
550{
551 /* Remove hover highlights */
552 SpaceOutliner *space_outliner = area->spacedata.first_as<SpaceOutliner>();
553 outliner_flag_set(*space_outliner, TSE_HIGHLIGHTED_ANY, false);
555}
556
558{
559 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(sl);
560 space_outliner->runtime = MEM_new<SpaceOutliner_Runtime>(__func__);
561
562 /* use #BLO_read_struct_no_us and do not free old memory avoiding double
563 * frees and use of freed memory. this could happen because of a
564 * bug fixed in revision 58959 where the treestore memory address
565 * was not unique */
566 TreeStore *ts = reinterpret_cast<TreeStore *>(space_outliner->treestore);
567 space_outliner->treestore = nullptr;
568 if (BLO_read_struct_no_us(reader, TreeStore, &ts)) {
569 TreeStoreElem *elems = ts->data;
571
572 space_outliner->treestore = BLI_mempool_create(
574 if (ts->usedelem && elems) {
575 for (int i = 0; i < ts->usedelem; i++) {
576 TreeStoreElem *new_elem = static_cast<TreeStoreElem *>(
577 BLI_mempool_alloc(space_outliner->treestore));
578 *new_elem = elems[i];
579 }
580 }
581 /* we only saved what was used */
582 space_outliner->storeflag |= SO_TREESTORE_CLEANUP; /* at first draw */
583 }
584 space_outliner->runtime->tree.clear_no_delete();
585}
586
588 ID * /*parent_id*/,
589 SpaceLink *sl)
590{
591 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(sl);
592
593 if (space_outliner->treestore) {
594 TreeStoreElem *tselem;
595 BLI_mempool_iter iter;
596
597 BLI_mempool_iternew(space_outliner->treestore, &iter);
598 while ((tselem = static_cast<TreeStoreElem *>(BLI_mempool_iterstep(&iter)))) {
599 if (!TSE_IS_REAL_ID(tselem)) {
600 tselem->id = nullptr;
601 }
602 }
603 /* rebuild hash table, because it depends on ids too */
604 space_outliner->storeflag |= SO_TREESTORE_REBUILD;
605 }
606}
607
608static void write_space_outliner(BlendWriter *writer, const SpaceOutliner *space_outliner)
609{
610 BLI_mempool *ts = space_outliner->treestore;
611 constexpr eSpaceOutliner_StoreFlag runtime_store_flags = SO_TREESTORE_CLEANUP |
613
614 if (ts) {
615 const int elems = BLI_mempool_len(ts);
616 /* linearize mempool to array */
617 TreeStoreElem *data = elems ? static_cast<TreeStoreElem *>(
618 BLI_mempool_as_arrayN(ts, "TreeStoreElem")) :
619 nullptr;
620
621 if (data) {
623 space_outliner, [](BlendStructWriter<SpaceOutliner> &struct_writer) {
624 struct_writer.shallow_data.runtime = nullptr;
625 struct_writer.shallow_data.storeflag &= ~runtime_store_flags;
626 });
627
628 /* To store #TreeStore (instead of the mempool), two unique memory addresses are needed,
629 * which can be used to identify the data on read:
630 * 1) One for the #TreeStore data itself.
631 * 2) One for the array of #TreeStoreElem's inside #TreeStore (#TreeStore.data).
632 *
633 * For 1) we just use the mempool's address (#SpaceOutliner::treestore).
634 * For 2) we don't have such a direct choice. We can't just use the array's address from
635 * above, since that may not be unique over all Outliners. So instead use an address relative
636 * to 1).
637 */
638 /* TODO the mempool could be moved to #SpaceOutliner_Runtime so that #SpaceOutliner could
639 * hold the #TreeStore directly. */
640
641 /* Address relative to the tree-store, as noted above. */
642 void *data_addr = static_cast<void *> POINTER_OFFSET(ts, sizeof(void *));
643 /* There should be plenty of memory addresses within the mempool data that we can point into,
644 * just double-check we don't potentially end up with a memory address that another DNA
645 * struct might use. Assumes BLI_mempool uses the guarded allocator. */
646 BLI_assert(MEM_allocN_len(ts) >= sizeof(void *) * 2);
647
648 TreeStore ts_flat = {0};
649 ts_flat.usedelem = elems;
650 ts_flat.totelem = elems;
651 ts_flat.data = static_cast<TreeStoreElem *>(data_addr);
652
653 writer->write_struct_at_address(ts, &ts_flat);
654 writer->write_struct_array_at_address(elems, data_addr, data);
655
656 MEM_delete(data);
657 }
658 else {
660 space_outliner, [](BlendStructWriter<SpaceOutliner> &struct_writer) {
661 struct_writer.shallow_data.treestore = nullptr;
662 struct_writer.shallow_data.runtime = nullptr;
663 struct_writer.shallow_data.storeflag &= ~runtime_store_flags;
664 });
665 }
666 }
667 else {
669 space_outliner, [](BlendStructWriter<SpaceOutliner> &struct_writer) {
670 struct_writer.shallow_data.runtime = nullptr;
671 struct_writer.shallow_data.storeflag &= ~runtime_store_flags;
672 });
673 }
674}
675
677{
678 SpaceOutliner *space_outliner = reinterpret_cast<SpaceOutliner *>(sl);
679 write_space_outliner(writer, space_outliner);
680}
681
682} // namespace ed::outliner
683
685{
686 using namespace blender::ed::outliner;
687
688 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
689 ARegionType *art;
690
691 st->spaceid = SPACE_OUTLINER;
692 STRNCPY_UTF8(st->name, "Outliner");
693 st->struct_size = sizeof(SpaceOutliner);
694
695 st->create = outliner_create;
696 st->free = outliner_free;
697 st->init = outliner_init;
698 st->duplicate = outliner_duplicate;
699 st->operatortypes = outliner_operatortypes;
700 st->keymap = outliner_keymap;
701 st->dropboxes = outliner_dropboxes;
702 st->id_remap = outliner_id_remap;
703 st->foreach_id = outliner_foreach_id;
704 st->deactivate = outliner_deactivate;
705 st->blend_read_data = outliner_space_blend_read_data;
706 st->blend_read_after_liblink = outliner_space_blend_read_after_liblink;
707 st->blend_write = outliner_space_blend_write;
708
709 /* regions: main window */
710 art = MEM_new_zeroed<ARegionType>("spacetype outliner region");
713
720 BLI_addhead(&st->regiontypes, art);
721
722 /* regions: header */
723 art = MEM_new_zeroed<ARegionType>("spacetype outliner header region");
725 art->prefsizey = HEADERY;
727
732 BLI_addhead(&st->regiontypes, art);
733
734 BKE_spacetype_register(std::move(st));
735}
736
737} // namespace blender
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
#define STRNCPY_UTF8(dst, src)
#define BLO_read_struct_array_no_us(reader, struct_name, ptr_p, array_size)
#define BLO_read_struct_no_us(reader, struct_name, ptr_p)
#define TSE_IS_REAL_ID(_tse)
#define HEADERY
#define WM_OUTLINER_SYNC_SELECT_FROM_ALL
#define Window
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define ND_SEQUENCER
Definition WM_types.hh:456
#define ND_WORLD
Definition WM_types.hh:471
#define NA_ACTIVATED
Definition WM_types.hh:640
#define NC_WINDOW
Definition WM_types.hh:388
#define NC_ID
Definition WM_types.hh:408
#define NC_NODE
Definition WM_types.hh:407
#define NC_GEOM
Definition WM_types.hh:406
#define ND_NLA_ACTCHANGE
Definition WM_types.hh:541
#define ND_DRAW
Definition WM_types.hh:502
#define NC_BRUSH
Definition WM_types.hh:398
#define ND_OB_ACTIVE
Definition WM_types.hh:459
#define NC_WM
Definition WM_types.hh:387
#define ND_DATA
Definition WM_types.hh:552
#define ND_LIGHTING_DRAW
Definition WM_types.hh:527
#define ND_RENDER_OPTIONS
Definition WM_types.hh:454
#define NC_ANIMATION
Definition WM_types.hh:401
#define ND_VERTEX_GROUP
Definition WM_types.hh:553
#define NC_PAINTCURVE
Definition WM_types.hh:409
#define NC_SCREEN
Definition WM_types.hh:390
#define ND_MODE
Definition WM_types.hh:464
#define ND_LIB_OVERRIDE_CHANGED
Definition WM_types.hh:435
#define ND_OB_SELECT
Definition WM_types.hh:461
#define ND_KEYINGSET
Definition WM_types.hh:467
#define NC_SCENE
Definition WM_types.hh:391
#define NA_ADDED
Definition WM_types.hh:636
#define ND_OB_VISIBLE
Definition WM_types.hh:462
#define ND_LAYER_CONTENT
Definition WM_types.hh:472
#define NC_GROUP
Definition WM_types.hh:396
#define ND_MODIFIER
Definition WM_types.hh:503
#define ND_POSE
Definition WM_types.hh:482
#define NA_EDITED
Definition WM_types.hh:634
#define ND_PARENT
Definition WM_types.hh:508
#define NC_TEXT
Definition WM_types.hh:399
#define NC_MATERIAL
Definition WM_types.hh:393
#define NC_LAMP
Definition WM_types.hh:395
#define NC_IMAGE
Definition WM_types.hh:397
#define ND_CONSTRAINT
Definition WM_types.hh:505
#define ND_FRAME
Definition WM_types.hh:453
#define NC_ASSET
Definition WM_types.hh:417
#define NA_REMOVED
Definition WM_types.hh:637
#define ND_NLA_ORDER
Definition WM_types.hh:543
#define NC_GPENCIL
Definition WM_types.hh:412
#define ND_NLA
Definition WM_types.hh:540
#define ND_BONE_ACTIVE
Definition WM_types.hh:483
#define ND_OB_RENDER
Definition WM_types.hh:463
#define ND_TRANSFORM
Definition WM_types.hh:475
#define ND_LAYER
Definition WM_types.hh:469
#define ND_BONE_COLLECTION
Definition WM_types.hh:515
#define NC_MASK
Definition WM_types.hh:411
#define NA_RENAME
Definition WM_types.hh:638
#define ND_BONE_SELECT
Definition WM_types.hh:491
#define ND_OB_SHADING
Definition WM_types.hh:476
#define ND_KEYFRAME
Definition WM_types.hh:537
#define NC_OBJECT
Definition WM_types.hh:392
#define ND_SCENEBROWSE
Definition WM_types.hh:451
#define ND_LAYOUTDELETE
Definition WM_types.hh:440
#define ND_ANIMCHAN
Definition WM_types.hh:539
#define ND_SHADING_LINKS
Definition WM_types.hh:522
#define NS_LAYER_COLLECTION
Definition WM_types.hh:630
#define NC_SPACE
Definition WM_types.hh:405
#define NA_SELECTED
Definition WM_types.hh:639
#define ND_SPACE_OUTLINER
Definition WM_types.hh:570
#define ELEM(...)
#define POINTER_OFFSET(v, ofs)
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
#define FLT_EPSILON
static void outliner_header_region_free(ARegion *)
static void outliner_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
static void outliner_main_region_draw(const bContext *C, ARegion *region)
static void outliner_init(wmWindowManager *, ScrArea *)
static void outliner_space_blend_write(BlendWriter *writer, SpaceLink *sl)
bool outliner_requires_rebuild_on_select_or_active_change(const SpaceOutliner *space_outliner)
static void write_space_outliner(BlendWriter *writer, const SpaceOutliner *space_outliner)
static SpaceLink * outliner_duplicate(SpaceLink *sl)
bool outliner_flag_set(SpaceOutliner &space_outliner, const eTreeStoreElem_Flag flag, const short set)
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_free_tree(ListBaseT< TreeElement > *tree)
void outliner_keymap(wmKeyConfig *keyconf)
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)
static void outliner_id_remap(ScrArea *area, SpaceLink *slink, const bke::id::IDRemapper &mappings)
void frame_buffer_clear(int colorid)
void view2d_view_restore(const bContext *C)
Definition view2d.cc:1147
void view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
Definition view2d.cc:1487
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:60
BMesh Iterators.
@ ID_REMAP_RESULT_SOURCE_UNASSIGNED
@ ID_REMAP_RESULT_SOURCE_UNAVAILABLE
@ ID_REMAP_RESULT_SOURCE_REMAPPED
@ ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE
UserDef U
Definition blender.cc:58
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
@ SO_FILTER_NO_VIEW_LAYERS
ScrArea * CTX_wm_area(const bContext *C)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:98
@ IDWALK_NO_ORIG_POINTERS_ACCESS
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:681
LibraryForeachIDFlag BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
Definition lib_query.cc:133
void ED_spacetype_outliner()
void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1)
void ED_region_draw_overflow_indication(const ScrArea *area, const ARegion *region, const rcti *mask=nullptr)
Definition area.cc:3726
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBaseT< wmEventHandler > *handlers, ListBaseT< wmDropBox > *dropboxes)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, float limit)
BMesh const char void * data
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
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
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:935
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()
ARegion * BKE_area_region_new()
Definition screen.cc:522
@ ED_KEYMAP_UI
Definition ED_screen.hh:852
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:858
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:855
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:1024
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_HORIZONTAL_HIDE
@ SO_LIB_OVERRIDE_VIEW_PROPERTIES
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
Definition screen.cc:379
@ BLI_MEMPOOL_ALLOW_ITER
void ED_region_header_init(ARegion *region)
Definition area.cc:4406
void * BLI_mempool_alloc(BLI_mempool *pool) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
@ ID_FLAG_EMBEDDED_DATA
Definition DNA_ID.h:775
@ RGN_FLAG_INDICATE_OVERFLOW
int BLI_mempool_len(const BLI_mempool *pool) ATTR_NONNULL(1)
@ ID_REMAP_APPLY_DEFAULT
LibraryForeachIDCallbackFlag
@ IDWALK_CB_WRITEFILE_IGNORE
@ IDWALK_CB_EMBEDDED_NOT_OWNING
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
Definition area.cc:394
ListBaseT< wmDropBox > * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:4391
void ED_region_tag_redraw_no_rebuild(ARegion *region)
Definition area.cc:727
size_t(*) MEM_allocN_len(const void *vmemh) ATTR_WARN_UNUSED_RESULT
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:784
void(*) message_subscribe(const wmRegionMessageSubscribeParams *params)
bContextDataCallback context
void(*) free(ARegion *)
void(*) draw(const bContext *C, ARegion *region)
void(*) listener(const wmRegionListenerParams *params)
void(*) init(wmWindowManager *wm, ARegion *region)
bke::ARegionRuntime * runtime
eRegion_Alignment alignment
eRegion_Type regiontype
void write_struct_at_address(const void *address, const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_struct_cast(const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_struct_array_at_address(const int64_t array_size, const void *address, const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
ListBaseT< SpaceLink > spacedata
eSpaceOutliner_Mode outlinevis
ed::outliner::SpaceOutliner_Runtime * runtime
eSpaceOutliner_Flag flag
eSpaceOutliner_Filter filter
eSpaceOutliner_StoreFlag storeflag
eSpaceOutliner_LibOverrideViewMode lib_override_view_mode
eSpaceOutliner_ShowRestrictFlag show_restrict_flags
struct BLI_mempool * treestore
ListBaseT< ARegion > regionbase
DNA_DEPRECATED int totelem
eView2D_KeepTot keeptot
eView2D_KeepZoom keepzoom
eView2D_Scroll scroll
eView2D_Align align
ListBaseT< wmEventHandler > handlers
std::unique_ptr< treehash::TreeHash > tree_hash
ListBaseT< ed::outliner::TreeElement > tree
std::unique_ptr< AbstractTreeDisplay > tree_display
unsigned int action
Definition WM_types.hh:371
unsigned int subtype
Definition WM_types.hh:371
unsigned int category
Definition WM_types.hh:371
unsigned int data
Definition WM_types.hh:371
Establish and manage Outliner trees for different display modes.
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value)