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:
authorJulian Eisel <julian@blender.org>2021-03-05 20:01:31 +0300
committerJulian Eisel <julian@blender.org>2021-03-05 20:07:35 +0300
commit3a907e742507dde9b26eb5f531c18ad00b0e2ab6 (patch)
tree032dc8633d90171785cb1446e49cd626404649ed /source/blender/editors/space_outliner/outliner_tree.c
parentae005393dce4746c0ee97887ea1a81281a1f726f (diff)
Outliner: Barebones to port IDs to new Outliner tree-element code design
Continuation of work in 2e221de4ceee and 249e4df110e0 . This prepares things so we can start porting the individual ID types to the new code design. I already added some code for library IDs, because they need some special handling during construction, which I didn't want to break. The `AbstractTreeElement::isExpandValid()` check can be removed once types were ported and can be assumed to have a proper `expand()` implemenation. Also makes `TreeElementGPencilLayer` `final` which I forgot in e0442a955bad.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tree.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 3696ef8dbce..f109efbaa2b 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -992,6 +992,11 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
else if (type == TSE_ID_BASE) {
/* pass */
}
+ else if (type == TSE_SOME_ID) {
+ if (!te->type) {
+ BLI_assert(!"Expected this ID type to be ported to new Outliner tree-element design");
+ }
+ }
else {
/* Other cases must be caught above. */
BLI_assert(TSE_IS_REAL_ID(tselem));
@@ -1006,7 +1011,7 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
te->idcode = GS(id->name);
}
- if (te->type) {
+ if (te->type && outliner_tree_element_type_is_expand_valid(te->type)) {
outliner_tree_element_type_expand(te->type, space_outliner);
}
else if (type == TSE_SOME_ID) {