Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.cc2
-rw-r--r--source/blender/editors/space_outliner/outliner_dragdrop.cc33
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.cc20
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.cc2
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.hh2
-rw-r--r--source/blender/editors/space_outliner/outliner_select.cc2
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.cc118
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.cc2
-rw-r--r--source/blender/editors/space_outliner/tree/tree_display.cc8
-rw-r--r--source/blender/editors/space_outliner/tree/tree_display_override_library.cc5
-rw-r--r--source/blender/editors/space_outliner/tree/tree_element.hh4
-rw-r--r--source/blender/editors/space_outliner/tree/tree_element_id.cc2
12 files changed, 139 insertions, 61 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc
index 765661aa9d5..f38f6c2855d 100644
--- a/source/blender/editors/space_outliner/outliner_collections.cc
+++ b/source/blender/editors/space_outliner/outliner_collections.cc
@@ -1071,7 +1071,7 @@ static int collection_isolate_exec(bContext *C, wmOperator *op)
static int collection_isolate_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
PropertyRNA *prop = RNA_struct_find_property(op->ptr, "extend");
- if (!RNA_property_is_set(op->ptr, prop) && (event->shift)) {
+ if (!RNA_property_is_set(op->ptr, prop) && (event->modifier & KM_SHIFT)) {
RNA_property_boolean_set(op->ptr, prop, true);
}
return collection_isolate_exec(C, op);
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.cc b/source/blender/editors/space_outliner/outliner_dragdrop.cc
index 0d8ee76d2f0..edd2e5f304f 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.cc
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.cc
@@ -319,7 +319,7 @@ static bool parent_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
}
if (!allow_parenting_without_modifier_key(space_outliner)) {
- if (!event->shift) {
+ if ((event->modifier & KM_SHIFT) == 0) {
return false;
}
}
@@ -417,8 +417,12 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
ListBase *lb = reinterpret_cast<ListBase *>(event->customdata);
wmDrag *drag = reinterpret_cast<wmDrag *>(lb->first);
- parent_drop_set_parents(
- C, op->reports, reinterpret_cast<wmDragID *>(drag->ids.first), par, PAR_OBJECT, event->alt);
+ parent_drop_set_parents(C,
+ op->reports,
+ reinterpret_cast<wmDragID *>(drag->ids.first),
+ par,
+ PAR_OBJECT,
+ event->modifier & KM_ALT);
return OPERATOR_FINISHED;
}
@@ -446,7 +450,7 @@ static bool parent_clear_poll(bContext *C, wmDrag *drag, const wmEvent *event)
SpaceOutliner *space_outliner = CTX_wm_space_outliner(C);
if (!allow_parenting_without_modifier_key(space_outliner)) {
- if (!event->shift) {
+ if ((event->modifier & KM_SHIFT) == 0) {
return false;
}
}
@@ -471,7 +475,7 @@ static bool parent_clear_poll(bContext *C, wmDrag *drag, const wmEvent *event)
case ID_OB:
return ELEM(tselem->type, TSE_MODIFIER_BASE, TSE_CONSTRAINT_BASE);
case ID_GR:
- return event->shift || ELEM(tselem->type, TSE_LIBRARY_OVERRIDE_BASE);
+ return (event->modifier & KM_SHIFT) || ELEM(tselem->type, TSE_LIBRARY_OVERRIDE_BASE);
default:
return true;
}
@@ -496,7 +500,8 @@ static int parent_clear_invoke(bContext *C, wmOperator *UNUSED(op), const wmEven
if (GS(drag_id->id->name) == ID_OB) {
Object *object = (Object *)drag_id->id;
- ED_object_parent_clear(object, event->alt ? CLEAR_PARENT_KEEP_TRANSFORM : CLEAR_PARENT_ALL);
+ ED_object_parent_clear(
+ object, (event->modifier & KM_ALT) ? CLEAR_PARENT_KEEP_TRANSFORM : CLEAR_PARENT_ALL);
}
}
@@ -1166,10 +1171,11 @@ static bool collection_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event
&space_outliner->tree, TSE_HIGHLIGHTED_ANY | TSE_DRAG_ANY, false);
CollectionDrop data;
- if (!event->shift && collection_drop_init(C, drag, event->xy, event->ctrl, &data)) {
+ if (((event->modifier & KM_SHIFT) == 0) &&
+ collection_drop_init(C, drag, event->xy, event->modifier & KM_CTRL, &data)) {
TreeElement *te = data.te;
TreeStoreElem *tselem = TREESTORE(te);
- if (!data.from || event->ctrl) {
+ if (!data.from || event->modifier & KM_CTRL) {
tselem->flag |= TSE_DRAG_INTO;
changed = true;
}
@@ -1210,9 +1216,10 @@ static char *collection_drop_tooltip(bContext *C,
const wmEvent *event = win ? win->eventstate : nullptr;
CollectionDrop data;
- if (event && !event->shift && collection_drop_init(C, drag, xy, event->ctrl, &data)) {
+ if (event && ((event->modifier & KM_SHIFT) == 0) &&
+ collection_drop_init(C, drag, xy, event->modifier & KM_CTRL, &data)) {
TreeElement *te = data.te;
- if (!data.from || event->ctrl) {
+ if (!data.from || event->modifier & KM_CTRL) {
return BLI_strdup(TIP_("Link inside Collection"));
}
switch (data.insert_type) {
@@ -1263,7 +1270,7 @@ static int collection_drop_invoke(bContext *C, wmOperator *UNUSED(op), const wmE
wmDrag *drag = reinterpret_cast<wmDrag *>(lb->first);
CollectionDrop data;
- if (!collection_drop_init(C, drag, event->xy, event->ctrl, &data)) {
+ if (!collection_drop_init(C, drag, event->xy, event->modifier & KM_CTRL, &data)) {
return OPERATOR_CANCELLED;
}
@@ -1291,7 +1298,9 @@ static int collection_drop_invoke(bContext *C, wmOperator *UNUSED(op), const wmE
LISTBASE_FOREACH (wmDragID *, drag_id, &drag->ids) {
/* Ctrl enables linking, so we don't need a from collection then. */
- Collection *from = (event->ctrl) ? nullptr : collection_parent_from_ID(drag_id->from_parent);
+ Collection *from = (event->modifier & KM_CTRL) ?
+ nullptr :
+ collection_parent_from_ID(drag_id->from_parent);
if (GS(drag_id->id->name) == ID_OB) {
/* Move/link object into collection. */
diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc
index dd7ca128282..2da416c8671 100644
--- a/source/blender/editors/space_outliner/outliner_draw.cc
+++ b/source/blender/editors/space_outliner/outliner_draw.cc
@@ -166,7 +166,7 @@ static void restrictbutton_bone_visibility_fn(bContext *C, void *poin, void *UNU
{
Bone *bone = (Bone *)poin;
- if (CTX_wm_window(C)->eventstate->shift) {
+ if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) {
restrictbutton_recursive_bone(bone, BONE_HIDDEN_P, (bone->flag & BONE_HIDDEN_P) != 0);
}
}
@@ -178,7 +178,7 @@ static void restrictbutton_bone_select_fn(bContext *C, void *UNUSED(poin), void
bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
}
- if (CTX_wm_window(C)->eventstate->shift) {
+ if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) {
restrictbutton_recursive_bone(bone, BONE_UNSELECTABLE, (bone->flag & BONE_UNSELECTABLE) != 0);
}
@@ -194,7 +194,7 @@ static void restrictbutton_ebone_select_fn(bContext *C, void *poin, void *poin2)
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
}
- if (CTX_wm_window(C)->eventstate->shift) {
+ if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) {
restrictbutton_recursive_ebone(
arm, ebone, BONE_UNSELECTABLE, (ebone->flag & BONE_UNSELECTABLE) != 0);
}
@@ -210,7 +210,7 @@ static void restrictbutton_ebone_visibility_fn(bContext *C, void *poin, void *po
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
}
- if (CTX_wm_window(C)->eventstate->shift) {
+ if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) {
restrictbutton_recursive_ebone(arm, ebone, BONE_HIDDEN_A, (ebone->flag & BONE_HIDDEN_A) != 0);
}
@@ -250,7 +250,7 @@ static void outliner_object_set_flag_recursive_fn(bContext *C,
ViewLayer *view_layer = CTX_data_view_layer(C);
PointerRNA ptr;
- bool extend = (win->eventstate->shift != 0);
+ bool extend = (win->eventstate->modifier & KM_SHIFT);
if (!extend) {
return;
@@ -571,8 +571,8 @@ static void outliner_collection_set_flag_recursive_fn(bContext *C,
ViewLayer *view_layer = CTX_data_view_layer(C);
PointerRNA ptr;
- bool do_isolate = (win->eventstate->ctrl != 0);
- bool extend = (win->eventstate->shift != 0);
+ bool do_isolate = (win->eventstate->modifier & KM_CTRL);
+ bool extend = (win->eventstate->modifier & KM_SHIFT);
if (!ELEM(true, do_isolate, extend)) {
return;
@@ -2043,7 +2043,7 @@ static void outliner_mode_toggle_fn(bContext *C, void *tselem_poin, void *UNUSED
const bool object_data_shared = (ob->data == tvc.obact->data);
wmWindow *win = CTX_wm_window(C);
- const bool do_extend = win->eventstate->ctrl != 0 && !object_data_shared;
+ const bool do_extend = (win->eventstate->modifier & KM_CTRL) && !object_data_shared;
outliner_item_mode_toggle(C, &tvc, te, do_extend);
}
@@ -2592,7 +2592,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
case OB_CAMERA:
data.icon = ICON_OUTLINER_OB_CAMERA;
break;
- case OB_CURVE:
+ case OB_CURVES_LEGACY:
data.icon = ICON_OUTLINER_OB_CURVE;
break;
case OB_MBALL:
@@ -2655,7 +2655,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
case ID_ME:
data.icon = ICON_OUTLINER_DATA_MESH;
break;
- case ID_CU:
+ case ID_CU_LEGACY:
data.icon = ICON_OUTLINER_DATA_CURVE;
break;
case ID_MB:
diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc
index a6ac2a5a1f3..6916f5fe502 100644
--- a/source/blender/editors/space_outliner/outliner_edit.cc
+++ b/source/blender/editors/space_outliner/outliner_edit.cc
@@ -240,7 +240,7 @@ static int outliner_item_openclose_invoke(bContext *C, wmOperator *op, const wmE
outliner_tag_redraw_avoid_rebuild_on_open_change(space_outliner, region);
/* Only toggle once for single click toggling */
- if (event->type == LEFTMOUSE) {
+ if ((event->type == LEFTMOUSE) && (event->val != KM_CLICK_DRAG)) {
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_outliner/outliner_intern.hh b/source/blender/editors/space_outliner/outliner_intern.hh
index bba4bac0e37..0516758e887 100644
--- a/source/blender/editors/space_outliner/outliner_intern.hh
+++ b/source/blender/editors/space_outliner/outliner_intern.hh
@@ -108,7 +108,7 @@ typedef struct TreeElementIcon {
ID_LI, \
ID_OB, \
ID_ME, \
- ID_CU, \
+ ID_CU_LEGACY, \
ID_MB, \
ID_NT, \
ID_MA, \
diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc
index df10ce002c3..c6b9d9577b5 100644
--- a/source/blender/editors/space_outliner/outliner_select.cc
+++ b/source/blender/editors/space_outliner/outliner_select.cc
@@ -1171,7 +1171,7 @@ static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreE
context = BCONTEXT_OBJECT;
break;
case ID_ME:
- case ID_CU:
+ case ID_CU_LEGACY:
case ID_MB:
case ID_IM:
case ID_LT:
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index 18c37e08eff..8fcf967bce8 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -117,7 +117,7 @@ static void get_element_operation_type(
break;
case ID_ME:
- case ID_CU:
+ case ID_CU_LEGACY:
case ID_MB:
case ID_LT:
case ID_LA:
@@ -236,7 +236,7 @@ static void unlink_material_fn(bContext *UNUSED(C),
totcol = me->totcol;
matar = me->mat;
}
- else if (GS(tsep->id->name) == ID_CU) {
+ else if (GS(tsep->id->name) == ID_CU_LEGACY) {
Curve *cu = (Curve *)tsep->id;
totcol = cu->totcol;
matar = cu->mat;
@@ -766,29 +766,37 @@ static void id_override_library_create_fn(bContext *C,
void *user_data)
{
BLI_assert(TSE_IS_REAL_ID(tselem));
- ID *id_root = tselem->id;
+
+ /* We can only safely apply this operation on one item at a time, so only do it on the active
+ * one. */
+ if ((tselem->flag & TSE_ACTIVE) == 0) {
+ return;
+ }
+
+ ID *id_root_reference = tselem->id;
OutlinerLibOverrideData *data = reinterpret_cast<OutlinerLibOverrideData *>(user_data);
const bool do_hierarchy = data->do_hierarchy;
bool success = false;
- ID *id_reference = nullptr;
+ ID *id_instance_hint = nullptr;
bool is_override_instancing_object = false;
if (tsep != nullptr && tsep->type == TSE_SOME_ID && tsep->id != nullptr &&
GS(tsep->id->name) == ID_OB && !ID_IS_OVERRIDE_LIBRARY(tsep->id)) {
Object *ob = (Object *)tsep->id;
- if (ob->type == OB_EMPTY && &ob->instance_collection->id == id_root) {
- BLI_assert(GS(id_root->name) == ID_GR);
+ if (ob->type == OB_EMPTY && &ob->instance_collection->id == id_root_reference) {
+ BLI_assert(GS(id_root_reference->name) == ID_GR);
/* Empty instantiating the collection we override, we need to pass it to BKE overriding code
* for proper handling. */
- id_reference = tsep->id;
+ id_instance_hint = tsep->id;
is_override_instancing_object = true;
}
}
- if (ID_IS_OVERRIDABLE_LIBRARY(id_root) || (ID_IS_LINKED(id_root) && do_hierarchy)) {
+ if (ID_IS_OVERRIDABLE_LIBRARY(id_root_reference) ||
+ (ID_IS_LINKED(id_root_reference) && do_hierarchy)) {
Main *bmain = CTX_data_main(C);
- id_root->tag |= LIB_TAG_DOIT;
+ id_root_reference->tag |= LIB_TAG_DOIT;
/* For now, remap all local usages of linked ID to local override one here. */
ID *id_iter;
@@ -804,38 +812,100 @@ static void id_override_library_create_fn(bContext *C,
if (do_hierarchy) {
/* Tag all linked parents in tree hierarchy to be also overridden. */
+ ID *id_hierarchy_root_reference = id_root_reference;
while ((te = te->parent) != nullptr) {
if (!TSE_IS_REAL_ID(te->store_elem)) {
continue;
}
- if (!ID_IS_LINKED(te->store_elem->id)) {
+
+ /* Tentative hierarchy root. */
+ ID *id_current_hierarchy_root = te->store_elem->id;
+
+ /* If the parent ID is from a different library than the reference root one, we are done
+ * with upwards tree processing in any case. */
+ if (id_current_hierarchy_root->lib != id_root_reference->lib) {
+ if (ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id_current_hierarchy_root)) {
+ /* Virtual overrides (i.e. embedded IDs), we can simply keep processing their parent to
+ * get an actual real override. */
+ continue;
+ }
+
+ /* If the parent ID is already an override, and is valid (i.e. local override), we can
+ * access its hierarchy root directly. */
+ if (!ID_IS_LINKED(id_current_hierarchy_root) &&
+ ID_IS_OVERRIDE_LIBRARY_REAL(id_current_hierarchy_root) &&
+ id_current_hierarchy_root->override_library->reference->lib ==
+ id_root_reference->lib) {
+ id_hierarchy_root_reference =
+ id_current_hierarchy_root->override_library->hierarchy_root;
+ BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(id_hierarchy_root_reference));
+ break;
+ }
+
+ if (ID_IS_LINKED(id_current_hierarchy_root)) {
+ /* No local 'anchor' was found for the hierarchy to override, do not proceed, as this
+ * would most likely generate invisible/confusing/hard to use and manage overrides. */
+ BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
+ BKE_reportf(reports,
+ RPT_WARNING,
+ "Invalid anchor ('%s') found, needed to create library override from "
+ "data-block '%s'",
+ id_current_hierarchy_root->name,
+ id_root_reference->name);
+ return;
+ }
+
+ /* In all other cases, `id_current_hierarchy_root` cannot be a valid hierarchy root, so
+ * current `id_hierarchy_root_reference` is our best candidate. */
+
break;
}
+
/* If some element in the tree needs to be overridden, but its ID is not overridable,
* abort. */
- if (!ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(te->store_elem->id)) {
+ if (!ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(id_current_hierarchy_root)) {
BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
BKE_reportf(reports,
RPT_WARNING,
"Could not create library override from data-block '%s', one of its parents "
"is not overridable ('%s')",
- id_root->name,
- te->store_elem->id->name);
+ id_root_reference->name,
+ id_current_hierarchy_root->name);
return;
}
- te->store_elem->id->tag |= LIB_TAG_DOIT;
+ id_current_hierarchy_root->tag |= LIB_TAG_DOIT;
+ id_hierarchy_root_reference = id_current_hierarchy_root;
+ }
+
+ /* That case can happen when linked data is a complex mix involving several libraries and/or
+ * linked overrides. E.g. a mix of overrides from one library, and indirectly linked data
+ * from another library. Do not try to support such cases for now. */
+ if (!((id_hierarchy_root_reference->lib == id_root_reference->lib) ||
+ (!ID_IS_LINKED(id_hierarchy_root_reference) &&
+ ID_IS_OVERRIDE_LIBRARY_REAL(id_hierarchy_root_reference) &&
+ id_hierarchy_root_reference->override_library->reference->lib ==
+ id_root_reference->lib))) {
+ BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
+ BKE_reportf(reports,
+ RPT_WARNING,
+ "Invalid hierarchy root ('%s') found, needed to create library override from "
+ "data-block '%s'",
+ id_hierarchy_root_reference->name,
+ id_root_reference->name);
+ return;
}
success = BKE_lib_override_library_create(bmain,
CTX_data_scene(C),
CTX_data_view_layer(C),
nullptr,
- id_root,
- id_reference,
+ id_root_reference,
+ id_hierarchy_root_reference,
+ id_instance_hint,
nullptr);
}
- else if (ID_IS_OVERRIDABLE_LIBRARY(id_root)) {
- success = BKE_lib_override_library_create_from_id(bmain, id_root, true) != nullptr;
+ else if (ID_IS_OVERRIDABLE_LIBRARY(id_root_reference)) {
+ success = BKE_lib_override_library_create_from_id(bmain, id_root_reference, true) != nullptr;
/* Cleanup. */
BKE_main_id_newptr_and_tag_clear(bmain);
@@ -845,14 +915,14 @@ static void id_override_library_create_fn(bContext *C,
/* Remove the instance empty from this scene, the items now have an overridden collection
* instead. */
if (success && is_override_instancing_object) {
- ED_object_base_free_and_unlink(bmain, scene, (Object *)id_reference);
+ ED_object_base_free_and_unlink(bmain, scene, (Object *)id_instance_hint);
}
}
if (!success) {
BKE_reportf(reports,
RPT_WARNING,
"Could not create library override from data-block '%s'",
- id_root->name);
+ id_root_reference->name);
}
}
@@ -1770,13 +1840,15 @@ static const EnumPropertyItem prop_id_op_types[] = {
{OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE,
"OVERRIDE_LIBRARY_CREATE",
0,
- "Make Library Override",
- "Make a local override of this linked data-block"},
+ "Make Library Override Single",
+ "Make a single, out-of-hierarchy local override of this linked data-block - only applies to "
+ "active Outliner item"},
{OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY,
"OVERRIDE_LIBRARY_CREATE_HIERARCHY",
0,
"Make Library Override Hierarchy",
- "Make a local override of this linked data-block, and its hierarchy of dependencies"},
+ "Make a local override of this linked data-block, and its hierarchy of dependencies - only "
+ "applies to active Outliner item"},
{OUTLINER_IDOP_OVERRIDE_LIBRARY_RESET,
"OVERRIDE_LIBRARY_RESET",
0,
diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc
index 1605d5874ae..06a5918f25c 100644
--- a/source/blender/editors/space_outliner/outliner_tree.cc
+++ b/source/blender/editors/space_outliner/outliner_tree.cc
@@ -579,7 +579,7 @@ static void outliner_add_id_contents(SpaceOutliner *space_outliner,
* would require going over all tfaces, sort images in use. etc... */
break;
}
- case ID_CU: {
+ case ID_CU_LEGACY: {
Curve *cu = (Curve *)id;
if (outliner_animdata_test(cu->adt)) {
diff --git a/source/blender/editors/space_outliner/tree/tree_display.cc b/source/blender/editors/space_outliner/tree/tree_display.cc
index 6b68f1ee4a4..f9141dffd6a 100644
--- a/source/blender/editors/space_outliner/tree/tree_display.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display.cc
@@ -7,6 +7,8 @@
#include "DNA_listBase.h"
#include "DNA_space_types.h"
+#include "BLI_utildefines.h"
+
#include "tree_display.hh"
using namespace blender::ed::outliner;
@@ -30,11 +32,11 @@ std::unique_ptr<AbstractTreeDisplay> AbstractTreeDisplay::createFromDisplayMode(
case SO_OVERRIDES_LIBRARY:
return std::make_unique<TreeDisplayOverrideLibrary>(space_outliner);
case SO_VIEW_LAYER:
- /* FIXME(Julian): this should not be the default! Return nullptr and handle that as valid
- * case. */
- default:
return std::make_unique<TreeDisplayViewLayer>(space_outliner);
}
+
+ BLI_assert_unreachable();
+ return nullptr;
}
bool AbstractTreeDisplay::hasWarnings() const
diff --git a/source/blender/editors/space_outliner/tree/tree_display_override_library.cc b/source/blender/editors/space_outliner/tree/tree_display_override_library.cc
index 43d67ee106d..f94727ba356 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_override_library.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_override_library.cc
@@ -23,11 +23,6 @@
namespace blender::ed::outliner {
/* Convenience/readability. */
-/* Convenience/readability. */
-/* Convenience/readability. */
-/* Convenience/readability. */
-/* Convenience/readability. */
-/* Convenience/readability. */
template<typename T> using List = ListBaseWrapper<T>;
TreeDisplayOverrideLibrary::TreeDisplayOverrideLibrary(SpaceOutliner &space_outliner)
diff --git a/source/blender/editors/space_outliner/tree/tree_element.hh b/source/blender/editors/space_outliner/tree/tree_element.hh
index 996f51eee82..2fbc86705b9 100644
--- a/source/blender/editors/space_outliner/tree/tree_element.hh
+++ b/source/blender/editors/space_outliner/tree/tree_element.hh
@@ -89,8 +89,8 @@ void tree_element_expand(const AbstractTreeElement &tree_element, SpaceOutliner
/**
* Get actual warning data of a tree element, if any.
*
- * \param r_icon The icon to display as warning.
- * \param r_message The message to display as warning.
+ * \param r_icon: The icon to display as warning.
+ * \param r_message: The message to display as warning.
* \return true if there is a warning, false otherwise.
*/
bool tree_element_warnings_get(struct TreeElement *te, int *r_icon, const char **r_message);
diff --git a/source/blender/editors/space_outliner/tree/tree_element_id.cc b/source/blender/editors/space_outliner/tree/tree_element_id.cc
index e126b024d52..64c73f57107 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_id.cc
+++ b/source/blender/editors/space_outliner/tree/tree_element_id.cc
@@ -34,7 +34,7 @@ std::unique_ptr<TreeElementID> TreeElementID::createFromID(TreeElement &legacy_t
return std::make_unique<TreeElementIDScene>(legacy_te, (Scene &)id);
case ID_OB:
case ID_ME:
- case ID_CU:
+ case ID_CU_LEGACY:
case ID_MB:
case ID_MA:
case ID_TE: