Refactor: Simplify outliner tree element creation using member function
With this, display modes and tree elements can add an element through the tree-display object used for building the tree for this display mode. This means we no longer have to pass the `SpaceOutliner` object around, and we avoid boilerplate. Further such simplifications to the tree element creations are planned and are easier now. Also note that this centralizes the use of `SpaceOutliner`, so we can more easily make tree-display and tree-element objects independent from it. This could be useful for unit testing, for example.
This commit is contained in:
@@ -210,7 +210,7 @@ static void outliner_add_line_styles(SpaceOutliner *space_outliner,
|
||||
continue;
|
||||
}
|
||||
linestyle->id.tag &= ~LIB_TAG_DOIT;
|
||||
outliner_add_element(
|
||||
AbstractTreeDisplay::add_element(
|
||||
space_outliner, lb, reinterpret_cast<ID *>(linestyle), nullptr, te, TSE_SOME_ID, 0);
|
||||
}
|
||||
}
|
||||
@@ -218,14 +218,31 @@ static void outliner_add_line_styles(SpaceOutliner *space_outliner,
|
||||
}
|
||||
#endif
|
||||
|
||||
TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
|
||||
ListBase *lb,
|
||||
ID *owner_id,
|
||||
void *create_data,
|
||||
TreeElement *parent,
|
||||
short type,
|
||||
short index,
|
||||
const bool expand)
|
||||
TreeElement *AbstractTreeDisplay::add_element(SpaceOutliner *space_outliner,
|
||||
ListBase *lb,
|
||||
ID *owner_id,
|
||||
void *create_data,
|
||||
TreeElement *parent,
|
||||
short type,
|
||||
short index,
|
||||
const bool expand)
|
||||
{
|
||||
if (!space_outliner->runtime || !space_outliner->runtime->tree_display) {
|
||||
BLI_assert_unreachable();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return space_outliner->runtime->tree_display->add_element(
|
||||
lb, owner_id, create_data, parent, type, index, expand);
|
||||
}
|
||||
|
||||
TreeElement *AbstractTreeDisplay::add_element(ListBase *lb,
|
||||
ID *owner_id,
|
||||
void *create_data,
|
||||
TreeElement *parent,
|
||||
short type,
|
||||
short index,
|
||||
const bool expand)
|
||||
{
|
||||
/* Pointer to store in #TreeStoreElem.id to identify the element over rebuilds and reconstruct it
|
||||
* on file read. */
|
||||
@@ -259,11 +276,11 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
|
||||
/* add to the visual tree */
|
||||
BLI_addtail(lb, te);
|
||||
/* add to the storage */
|
||||
check_persistent(space_outliner, te, persistent_dataptr, type, index);
|
||||
check_persistent(&space_outliner_, te, persistent_dataptr, type, index);
|
||||
TreeStoreElem *tselem = TREESTORE(te);
|
||||
|
||||
/* if we are searching for something expand to see child elements */
|
||||
if (SEARCHING_OUTLINER(space_outliner)) {
|
||||
if (SEARCHING_OUTLINER(&space_outliner_)) {
|
||||
tselem->flag |= TSE_CHILDSEARCH;
|
||||
}
|
||||
|
||||
@@ -276,6 +293,9 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
|
||||
if (te->abstract_element) {
|
||||
/* Element types ported to the new design are expected to have their name set at this point! */
|
||||
BLI_assert(te->name != nullptr);
|
||||
|
||||
/* Let the new element inherit the tree display that creates this current tree. */
|
||||
te->abstract_element->display_ = this;
|
||||
}
|
||||
|
||||
if (ELEM(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
|
||||
@@ -354,7 +374,7 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
|
||||
/* Pass */
|
||||
}
|
||||
else if (te->abstract_element) {
|
||||
tree_element_expand(*te->abstract_element, *space_outliner);
|
||||
tree_element_expand(*te->abstract_element, space_outliner_);
|
||||
}
|
||||
/* Only #TSE_ID_BASE isn't ported to use the abstract elements design yet. */
|
||||
else if (!ELEM(type, TSE_ID_BASE)) {
|
||||
@@ -378,7 +398,7 @@ BLI_INLINE void outliner_add_collection_objects(SpaceOutliner *space_outliner,
|
||||
TreeElement *parent)
|
||||
{
|
||||
LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) {
|
||||
outliner_add_element(
|
||||
AbstractTreeDisplay::add_element(
|
||||
space_outliner, tree, reinterpret_cast<ID *>(cob->ob), nullptr, parent, TSE_SOME_ID, 0);
|
||||
}
|
||||
}
|
||||
@@ -390,7 +410,7 @@ TreeElement *outliner_add_collection_recursive(SpaceOutliner *space_outliner,
|
||||
outliner_add_collection_init(ten, collection);
|
||||
|
||||
LISTBASE_FOREACH (CollectionChild *, child, &collection->children) {
|
||||
outliner_add_element(
|
||||
AbstractTreeDisplay::add_element(
|
||||
space_outliner, &ten->subtree, &child->collection->id, nullptr, ten, TSE_SOME_ID, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,18 @@ class AbstractTreeDisplay {
|
||||
static std::unique_ptr<AbstractTreeDisplay> create_from_display_mode(
|
||||
int /*eSpaceOutliner_Mode*/ mode, SpaceOutliner &space_outliner);
|
||||
|
||||
/** Static version of the function below, which can be called by helper functions/classes that
|
||||
* have access to the #SpaceOutliner instance but not the tree-display directly. Should be
|
||||
* avoided and instead use the tree-display. */
|
||||
static TreeElement *add_element(SpaceOutliner *space_outliner,
|
||||
ListBase *lb,
|
||||
ID *owner_id,
|
||||
void *create_data,
|
||||
TreeElement *parent,
|
||||
short type,
|
||||
short index,
|
||||
const bool expand = true);
|
||||
|
||||
/**
|
||||
* Build a tree for this display mode with the Blender context data given in \a source_data and
|
||||
* the view settings in \a space_outliner.
|
||||
@@ -93,6 +105,33 @@ class AbstractTreeDisplay {
|
||||
*/
|
||||
virtual bool is_lazy_built() const;
|
||||
|
||||
/**
|
||||
* \note If child items are only added to the tree if the item is open, the `TSE_` type _must_ be
|
||||
* added to #outliner_element_needs_rebuild_on_open_change().
|
||||
*
|
||||
* \param owner_id: The ID owning the represented data (or the ID itself if the element
|
||||
* represents an ID directly). This is crucial to recognize tree elements over
|
||||
* rebuilds, so that state like opened and selected is preserved. If this is not
|
||||
* null, the \a create_data pointer will be used instead, refer to its
|
||||
* description.
|
||||
* \param create_data: Data passed to the constructor of the corresponding #AbstractTreeElement
|
||||
* sub-type. If \a owner_id is not set, this pointer will be stored in an
|
||||
* attempt to identify the element over rebuilds, so that state like opened
|
||||
* and selected is preserved. Of course that won't work for volatile data
|
||||
* (like stack variables).
|
||||
* \param expand: If true, the element may add its own sub-tree. E.g. objects will list their
|
||||
* animation data, object data, constraints, modifiers, ... This often adds visual
|
||||
* noise, and can be expensive to add in big scenes. So prefer setting this to
|
||||
* false.
|
||||
*/
|
||||
TreeElement *add_element(ListBase *lb,
|
||||
ID *owner_id,
|
||||
void *create_data,
|
||||
TreeElement *parent,
|
||||
short type,
|
||||
short index,
|
||||
const bool expand = true);
|
||||
|
||||
protected:
|
||||
/** All derived classes will need a handle to this, so storing it in the base for convenience. */
|
||||
SpaceOutliner &space_outliner_;
|
||||
@@ -199,7 +238,7 @@ class TreeDisplaySequencer final : public AbstractTreeDisplay {
|
||||
* Helped function to put duplicate sequence in the same tree.
|
||||
*/
|
||||
SequenceAddOp need_add_seq_dup(Sequence *seq) const;
|
||||
void add_seq_dup(Sequence *seq, TreeElement *te, short index) const;
|
||||
void add_seq_dup(Sequence *seq, TreeElement *te, short index);
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -31,8 +31,7 @@ ListBase TreeDisplayDataAPI::build_tree(const TreeSourceData &source_data)
|
||||
PointerRNA mainptr;
|
||||
RNA_main_pointer_create(source_data.bmain, &mainptr);
|
||||
|
||||
TreeElement *te = outliner_add_element(
|
||||
&space_outliner_, &tree, nullptr, (void *)&mainptr, nullptr, TSE_RNA_STRUCT, -1);
|
||||
TreeElement *te = add_element(&tree, nullptr, (void *)&mainptr, nullptr, TSE_RNA_STRUCT, -1);
|
||||
|
||||
/* On first view open parent data elements */
|
||||
const int show_opened = !space_outliner_.treestore ||
|
||||
|
||||
@@ -137,17 +137,10 @@ TreeElement *TreeDisplayLibraries::add_library_contents(Main &mainvar, ListBase
|
||||
if (!tenlib) {
|
||||
/* Create library tree element on demand, depending if there are any data-blocks. */
|
||||
if (lib) {
|
||||
tenlib = outliner_add_element(&space_outliner_,
|
||||
&lb,
|
||||
reinterpret_cast<ID *>(lib),
|
||||
nullptr,
|
||||
nullptr,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
tenlib = add_element(&lb, reinterpret_cast<ID *>(lib), nullptr, nullptr, TSE_SOME_ID, 0);
|
||||
}
|
||||
else {
|
||||
tenlib = outliner_add_element(
|
||||
&space_outliner_, &lb, nullptr, &mainvar, nullptr, TSE_ID_BASE, 0);
|
||||
tenlib = add_element(&lb, nullptr, &mainvar, nullptr, TSE_ID_BASE, 0);
|
||||
tenlib->name = IFACE_("Current File");
|
||||
}
|
||||
}
|
||||
@@ -160,21 +153,15 @@ TreeElement *TreeDisplayLibraries::add_library_contents(Main &mainvar, ListBase
|
||||
ten = tenlib;
|
||||
}
|
||||
else {
|
||||
ten = outliner_add_element(&space_outliner_,
|
||||
&tenlib->subtree,
|
||||
reinterpret_cast<ID *>(lib),
|
||||
nullptr,
|
||||
nullptr,
|
||||
TSE_ID_BASE,
|
||||
a);
|
||||
ten = add_element(
|
||||
&tenlib->subtree, reinterpret_cast<ID *>(lib), nullptr, nullptr, TSE_ID_BASE, a);
|
||||
ten->directdata = lbarray[a];
|
||||
ten->name = outliner_idcode_to_plural(GS(id->name));
|
||||
}
|
||||
|
||||
for (ID *id : List<ID>(lbarray[a])) {
|
||||
if (library_id_filter_poll(lib, id)) {
|
||||
outliner_add_element(
|
||||
&space_outliner_, &ten->subtree, id, nullptr, ten, TSE_SOME_ID, 0);
|
||||
add_element(&ten->subtree, id, nullptr, ten, TSE_SOME_ID, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,7 @@ ListBase TreeDisplayIDOrphans::build_tree(const TreeSourceData &source_data)
|
||||
TreeElement *te = nullptr;
|
||||
if (!filter_id_type) {
|
||||
ID *id = (ID *)lbarray[a]->first;
|
||||
te = outliner_add_element(
|
||||
&space_outliner_, &tree, nullptr, lbarray[a], nullptr, TSE_ID_BASE, 0);
|
||||
te = add_element(&tree, nullptr, lbarray[a], nullptr, TSE_ID_BASE, 0);
|
||||
te->directdata = lbarray[a];
|
||||
te->name = outliner_idcode_to_plural(GS(id->name));
|
||||
}
|
||||
@@ -67,8 +66,7 @@ ListBase TreeDisplayIDOrphans::build_tree(const TreeSourceData &source_data)
|
||||
/* Add the orphaned data-blocks - these will not be added with any subtrees attached. */
|
||||
for (ID *id : List<ID>(lbarray[a])) {
|
||||
if (ID_REAL_USERS(id) <= 0) {
|
||||
outliner_add_element(
|
||||
&space_outliner_, (te) ? &te->subtree : &tree, id, nullptr, te, TSE_SOME_ID, 0);
|
||||
add_element((te) ? &te->subtree : &tree, id, nullptr, te, TSE_SOME_ID, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ ListBase TreeDisplayOverrideLibraryHierarchies::build_tree(const TreeSourceData
|
||||
ListBase tree = {nullptr};
|
||||
|
||||
/* First step: Build "Current File" hierarchy. */
|
||||
TreeElement *current_file_te = outliner_add_element(
|
||||
TreeElement *current_file_te = AbstractTreeDisplay::add_element(
|
||||
&space_outliner_, &tree, nullptr, source_data.bmain, nullptr, TSE_ID_BASE, -1);
|
||||
current_file_te->name = IFACE_("Current File");
|
||||
AbstractTreeElement::uncollapse_by_default(current_file_te);
|
||||
@@ -49,13 +49,13 @@ ListBase TreeDisplayOverrideLibraryHierarchies::build_tree(const TreeSourceData
|
||||
|
||||
/* Add dummy child if there's nothing to display. */
|
||||
if (BLI_listbase_is_empty(¤t_file_te->subtree)) {
|
||||
TreeElement *dummy_te = outliner_add_element(&space_outliner_,
|
||||
¤t_file_te->subtree,
|
||||
nullptr,
|
||||
nullptr,
|
||||
current_file_te,
|
||||
TSE_ID_BASE,
|
||||
0);
|
||||
TreeElement *dummy_te = AbstractTreeDisplay::add_element(&space_outliner_,
|
||||
¤t_file_te->subtree,
|
||||
nullptr,
|
||||
nullptr,
|
||||
current_file_te,
|
||||
TSE_ID_BASE,
|
||||
0);
|
||||
dummy_te->name = IFACE_("No Library Overrides");
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ ListBase TreeDisplayOverrideLibraryHierarchies::build_tree(const TreeSourceData
|
||||
for (Library *lib = (Library *)source_data.bmain->libraries.first; lib;
|
||||
lib = (Library *)lib->id.next)
|
||||
{
|
||||
TreeElement *tenlib = outliner_add_element(
|
||||
TreeElement *tenlib = AbstractTreeDisplay::add_element(
|
||||
&space_outliner_, &tree, reinterpret_cast<ID *>(lib), nullptr, nullptr, TSE_SOME_ID, 0);
|
||||
build_hierarchy_for_lib_or_main(source_data.bmain, *tenlib, lib);
|
||||
}
|
||||
@@ -149,25 +149,25 @@ ListBase TreeDisplayOverrideLibraryHierarchies::build_hierarchy_for_lib_or_main(
|
||||
}
|
||||
|
||||
TreeElement *new_base_te = id_base_te_map.lookup_or_add_cb(GS(iter_id->name), [&]() {
|
||||
TreeElement *new_te = outliner_add_element(&space_outliner_,
|
||||
&parent_te.subtree,
|
||||
reinterpret_cast<ID *>(lib),
|
||||
bmain,
|
||||
&parent_te,
|
||||
TSE_ID_BASE,
|
||||
base_index++);
|
||||
TreeElement *new_te = AbstractTreeDisplay::add_element(&space_outliner_,
|
||||
&parent_te.subtree,
|
||||
reinterpret_cast<ID *>(lib),
|
||||
bmain,
|
||||
&parent_te,
|
||||
TSE_ID_BASE,
|
||||
base_index++);
|
||||
new_te->name = outliner_idcode_to_plural(GS(iter_id->name));
|
||||
return new_te;
|
||||
});
|
||||
|
||||
TreeElement *new_id_te = outliner_add_element(&space_outliner_,
|
||||
&new_base_te->subtree,
|
||||
iter_id,
|
||||
nullptr,
|
||||
new_base_te,
|
||||
TSE_SOME_ID,
|
||||
0,
|
||||
false);
|
||||
TreeElement *new_id_te = AbstractTreeDisplay::add_element(&space_outliner_,
|
||||
&new_base_te->subtree,
|
||||
iter_id,
|
||||
nullptr,
|
||||
new_base_te,
|
||||
TSE_SOME_ID,
|
||||
0,
|
||||
false);
|
||||
|
||||
builder.build_hierarchy_for_ID(*iter_id, *new_id_te);
|
||||
}
|
||||
@@ -234,14 +234,14 @@ void OverrideIDHierarchyBuilder::build_hierarchy_for_ID_recursive(const ID &pare
|
||||
return FOREACH_BREAK;
|
||||
}
|
||||
|
||||
TreeElement *new_te = outliner_add_element(&space_outliner_,
|
||||
&te_to_expand.subtree,
|
||||
&id,
|
||||
nullptr,
|
||||
&te_to_expand,
|
||||
TSE_SOME_ID,
|
||||
0,
|
||||
false);
|
||||
TreeElement *new_te = AbstractTreeDisplay::add_element(&space_outliner_,
|
||||
&te_to_expand.subtree,
|
||||
&id,
|
||||
nullptr,
|
||||
&te_to_expand,
|
||||
TSE_SOME_ID,
|
||||
0,
|
||||
false);
|
||||
|
||||
build_data.sibling_ids.add(&id);
|
||||
|
||||
|
||||
@@ -87,8 +87,7 @@ ListBase TreeDisplayOverrideLibraryProperties::add_library_contents(Main &mainva
|
||||
ListBase *lb_to_expand = &tree;
|
||||
|
||||
if (!filter_id_type) {
|
||||
id_base_te = outliner_add_element(
|
||||
&space_outliner_, &tree, nullptr, lbarray[a], nullptr, TSE_ID_BASE, 0);
|
||||
id_base_te = add_element(&tree, nullptr, lbarray[a], nullptr, TSE_ID_BASE, 0);
|
||||
id_base_te->directdata = lbarray[a];
|
||||
id_base_te->name = outliner_idcode_to_plural(GS(id->name));
|
||||
|
||||
@@ -97,8 +96,8 @@ ListBase TreeDisplayOverrideLibraryProperties::add_library_contents(Main &mainva
|
||||
|
||||
for (ID *id : List<ID>(lbarray[a])) {
|
||||
if (ID_IS_OVERRIDE_LIBRARY_REAL(id) && !ID_IS_LINKED(id)) {
|
||||
TreeElement *override_tree_element = outliner_add_element(
|
||||
&space_outliner_, lb_to_expand, id, nullptr, id_base_te, TSE_LIBRARY_OVERRIDE_BASE, 0);
|
||||
TreeElement *override_tree_element = add_element(
|
||||
lb_to_expand, id, nullptr, id_base_te, TSE_LIBRARY_OVERRIDE_BASE, 0);
|
||||
|
||||
if (BLI_listbase_is_empty(&override_tree_element->subtree)) {
|
||||
outliner_free_tree_element(override_tree_element, lb_to_expand);
|
||||
|
||||
@@ -42,8 +42,7 @@ ListBase TreeDisplayScenes::build_tree(const TreeSourceData &source_data)
|
||||
|
||||
for (ID *id : List<ID>(source_data.bmain->scenes)) {
|
||||
Scene *scene = reinterpret_cast<Scene *>(id);
|
||||
TreeElement *te = outliner_add_element(
|
||||
&space_outliner_, &tree, reinterpret_cast<ID *>(scene), nullptr, nullptr, TSE_SOME_ID, 0);
|
||||
TreeElement *te = add_element(&tree, id, nullptr, nullptr, TSE_SOME_ID, 0);
|
||||
TreeStoreElem *tselem = TREESTORE(te);
|
||||
|
||||
/* New scene elements open by default */
|
||||
|
||||
@@ -42,11 +42,10 @@ ListBase TreeDisplaySequencer::build_tree(const TreeSourceData &source_data)
|
||||
for (Sequence *seq : List<Sequence>(ed->seqbasep)) {
|
||||
SequenceAddOp op = need_add_seq_dup(seq);
|
||||
if (op == SEQUENCE_DUPLICATE_NONE) {
|
||||
outliner_add_element(&space_outliner_, &tree, nullptr, seq, nullptr, TSE_SEQUENCE, 0);
|
||||
add_element(&tree, nullptr, seq, nullptr, TSE_SEQUENCE, 0);
|
||||
}
|
||||
else if (op == SEQUENCE_DUPLICATE_ADD) {
|
||||
TreeElement *te = outliner_add_element(
|
||||
&space_outliner_, &tree, nullptr, seq, nullptr, TSE_SEQUENCE_DUP, 0);
|
||||
TreeElement *te = add_element(&tree, nullptr, seq, nullptr, TSE_SEQUENCE_DUP, 0);
|
||||
add_seq_dup(seq, te, 0);
|
||||
}
|
||||
}
|
||||
@@ -93,7 +92,7 @@ SequenceAddOp TreeDisplaySequencer::need_add_seq_dup(Sequence *seq) const
|
||||
return SEQUENCE_DUPLICATE_NONE;
|
||||
}
|
||||
|
||||
void TreeDisplaySequencer::add_seq_dup(Sequence *seq, TreeElement *te, short index) const
|
||||
void TreeDisplaySequencer::add_seq_dup(Sequence *seq, TreeElement *te, short index)
|
||||
{
|
||||
Sequence *p = seq;
|
||||
while (p) {
|
||||
@@ -103,8 +102,7 @@ void TreeDisplaySequencer::add_seq_dup(Sequence *seq, TreeElement *te, short ind
|
||||
}
|
||||
|
||||
if (STREQ(p->strip->stripdata->filename, seq->strip->stripdata->filename)) {
|
||||
outliner_add_element(
|
||||
&space_outliner_, &te->subtree, nullptr, (void *)p, te, TSE_SEQUENCE, index);
|
||||
add_element(&te->subtree, nullptr, (void *)p, te, TSE_SEQUENCE, index);
|
||||
}
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
@@ -80,13 +80,8 @@ ListBase TreeDisplayViewLayer::build_tree(const TreeSourceData &source_data)
|
||||
add_view_layer(*scene, tree, (TreeElement *)nullptr);
|
||||
}
|
||||
else {
|
||||
TreeElement &te_view_layer = *outliner_add_element(&space_outliner_,
|
||||
&tree,
|
||||
reinterpret_cast<ID *>(scene),
|
||||
&view_layer,
|
||||
nullptr,
|
||||
TSE_R_LAYER,
|
||||
0);
|
||||
TreeElement &te_view_layer = *add_element(
|
||||
&tree, reinterpret_cast<ID *>(scene), &view_layer, nullptr, TSE_R_LAYER, 0);
|
||||
|
||||
TreeStoreElem *tselem = TREESTORE(&te_view_layer);
|
||||
|
||||
@@ -112,13 +107,8 @@ void TreeDisplayViewLayer::add_view_layer(Scene &scene, ListBase &tree, TreeElem
|
||||
/* Show objects in the view layer. */
|
||||
BKE_view_layer_synced_ensure(&scene, view_layer_);
|
||||
for (Base *base : List<Base>(*BKE_view_layer_object_bases_get(view_layer_))) {
|
||||
TreeElement *te_object = outliner_add_element(&space_outliner_,
|
||||
&tree,
|
||||
reinterpret_cast<ID *>(base->object),
|
||||
nullptr,
|
||||
parent,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
TreeElement *te_object = add_element(
|
||||
&tree, reinterpret_cast<ID *>(base->object), nullptr, parent, TSE_SOME_ID, 0);
|
||||
te_object->directdata = base;
|
||||
}
|
||||
|
||||
@@ -128,7 +118,7 @@ void TreeDisplayViewLayer::add_view_layer(Scene &scene, ListBase &tree, TreeElem
|
||||
}
|
||||
else {
|
||||
/* Show collections in the view layer. */
|
||||
TreeElement &ten = *outliner_add_element(
|
||||
TreeElement &ten = *AbstractTreeDisplay::add_element(
|
||||
&space_outliner_, &tree, &scene.id, nullptr, parent, TSE_VIEW_COLLECTION_BASE, 0);
|
||||
TREESTORE(&ten)->flag &= ~TSE_CLOSED;
|
||||
|
||||
@@ -161,8 +151,7 @@ void TreeDisplayViewLayer::add_layer_collections_recursive(ListBase &tree,
|
||||
}
|
||||
else {
|
||||
ID *id = &lc->collection->id;
|
||||
ten = outliner_add_element(
|
||||
&space_outliner_, &tree, id, lc, &parent_ten, TSE_LAYER_COLLECTION, 0);
|
||||
ten = add_element(&tree, id, lc, &parent_ten, TSE_LAYER_COLLECTION, 0);
|
||||
|
||||
/* Open by default, except linked collections, which may contain many elements. */
|
||||
TreeStoreElem *tselem = TREESTORE(ten);
|
||||
@@ -185,13 +174,8 @@ void TreeDisplayViewLayer::add_layer_collection_objects(ListBase &tree,
|
||||
BKE_view_layer_synced_ensure(scene_, view_layer_);
|
||||
for (CollectionObject *cob : List<CollectionObject>(lc.collection->gobject)) {
|
||||
Base *base = BKE_view_layer_base_find(view_layer_, cob->ob);
|
||||
TreeElement *te_object = outliner_add_element(&space_outliner_,
|
||||
&tree,
|
||||
reinterpret_cast<ID *>(base->object),
|
||||
nullptr,
|
||||
&ten,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
TreeElement *te_object = add_element(
|
||||
&tree, reinterpret_cast<ID *>(base->object), nullptr, &ten, TSE_SOME_ID, 0);
|
||||
te_object->directdata = base;
|
||||
}
|
||||
}
|
||||
@@ -293,14 +277,15 @@ void ObjectsChildrenBuilder::make_object_parent_hierarchy_collections()
|
||||
if (!found) {
|
||||
/* We add the child in the tree even if it is not in the collection.
|
||||
* We don't expand its sub-tree though, to make it less prominent. */
|
||||
TreeElement *child_ob_tree_element = outliner_add_element(&outliner_,
|
||||
&parent_ob_tree_element->subtree,
|
||||
reinterpret_cast<ID *>(child),
|
||||
nullptr,
|
||||
parent_ob_tree_element,
|
||||
TSE_SOME_ID,
|
||||
0,
|
||||
false);
|
||||
TreeElement *child_ob_tree_element = AbstractTreeDisplay::add_element(
|
||||
&outliner_,
|
||||
&parent_ob_tree_element->subtree,
|
||||
reinterpret_cast<ID *>(child),
|
||||
nullptr,
|
||||
parent_ob_tree_element,
|
||||
TSE_SOME_ID,
|
||||
0,
|
||||
false);
|
||||
child_ob_tree_element->flag |= TE_CHILD_NOT_IN_COLLECTION;
|
||||
child_ob_tree_elements.append(child_ob_tree_element);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "BLT_translation.h"
|
||||
|
||||
#include "tree_display.hh"
|
||||
#include "tree_element_anim_data.hh"
|
||||
#include "tree_element_bone.hh"
|
||||
#include "tree_element_collection.hh"
|
||||
@@ -60,15 +61,15 @@ std::unique_ptr<AbstractTreeElement> AbstractTreeElement::create_from_type(const
|
||||
|
||||
/*
|
||||
* The following calls make an implicit assumption about what data was passed to the
|
||||
* `create_data` argument of #outliner_add_element(). The old code does this already, here we
|
||||
* just centralize it as much as possible for now. Would be nice to entirely get rid of that, no
|
||||
* more `void *`.
|
||||
* `create_data` argument of #add_element(). The old code does this already, here we just
|
||||
* centralize it as much as possible for now. Would be nice to entirely get rid of that, no more
|
||||
* `void *`.
|
||||
*
|
||||
* Once #outliner_add_element() is sufficiently simplified, it should be replaced by a C++ call.
|
||||
* It could take the derived type as template parameter (e.g. #TreeElementAnimData) and use C++
|
||||
* perfect forwarding to pass any data to the type's constructor.
|
||||
* If general Outliner code wants to access the data, they can query that through the derived
|
||||
* element type then. There's no need for `void *` anymore then.
|
||||
* Once #add_element() is sufficiently simplified, it should be replaced by a C++ call. It could
|
||||
* take the derived type as template parameter (e.g. #TreeElementAnimData) and use C++ perfect
|
||||
* forwarding to pass any data to the type's constructor. If general Outliner code wants to
|
||||
* access the data, they can query that through the derived element type then. There's no need
|
||||
* for `void *` anymore then.
|
||||
*/
|
||||
|
||||
switch (type) {
|
||||
@@ -233,6 +234,24 @@ void AbstractTreeElement::uncollapse_by_default(TreeElement *legacy_te)
|
||||
}
|
||||
}
|
||||
|
||||
TreeElement *AbstractTreeElement::add_element(ListBase *lb,
|
||||
ID *owner_id,
|
||||
void *create_data,
|
||||
TreeElement *parent,
|
||||
short type,
|
||||
short index,
|
||||
const bool expand) const
|
||||
{
|
||||
if (!display_) {
|
||||
BLI_assert_msg(false,
|
||||
"Element not registered properly through AbstractTreeDisplay::add_element(), "
|
||||
"can't expand the tree further");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return display_->add_element(lb, owner_id, create_data, parent, type, index, expand);
|
||||
}
|
||||
|
||||
void tree_element_expand(const AbstractTreeElement &tree_element, SpaceOutliner &space_outliner)
|
||||
{
|
||||
/* Most types can just expand. IDs optionally expand (hence the poll) and do additional, common
|
||||
|
||||
@@ -20,6 +20,7 @@ struct SpaceOutliner;
|
||||
|
||||
namespace blender::ed::outliner {
|
||||
|
||||
class AbstractTreeDisplay;
|
||||
struct TreeElement;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -33,6 +34,12 @@ class AbstractTreeElement {
|
||||
* replaced by AbstractTreeElement and derived types.
|
||||
*/
|
||||
TreeElement &legacy_te_;
|
||||
/**
|
||||
* Reference back to the tree display used for building this tree.
|
||||
*/
|
||||
AbstractTreeDisplay *display_;
|
||||
|
||||
friend class AbstractTreeDisplay;
|
||||
|
||||
public:
|
||||
virtual ~AbstractTreeElement() = default;
|
||||
@@ -99,34 +106,16 @@ class AbstractTreeElement {
|
||||
* Let the type add its own children.
|
||||
*/
|
||||
virtual void expand(SpaceOutliner &) const {}
|
||||
};
|
||||
|
||||
/**
|
||||
* \note If child items are only added to the tree if the item is open, the `TSE_` type _must_ be
|
||||
* added to #outliner_element_needs_rebuild_on_open_change().
|
||||
*
|
||||
* \param owner_id: The ID owning the represented data (or the ID itself if the element represents
|
||||
* an ID directly). This is crucial to recognize tree elements over rebuilds, so
|
||||
* that state like opened and selected is preserved. If this is not null, the \a
|
||||
* create_data pointer will be used instead, refer to its description.
|
||||
* \param create_data: Data passed to the constructor of the corresponding #AbstractTreeElement
|
||||
* sub-type. If \a owner_id is not set, this pointer will be stored in an
|
||||
* attempt to identify the element over rebuilds, so that state like opened and
|
||||
* selected is preserved. Of course that won't work for volatile data (like
|
||||
* stack variables).
|
||||
* \param expand: If true, the element may add its own sub-tree. E.g. objects will list their
|
||||
* animation data, object data, constraints, modifiers, ... This often adds visual
|
||||
* noise, and can be expensive to add in big scenes. So prefer setting this to
|
||||
* false.
|
||||
*/
|
||||
TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
|
||||
ListBase *lb,
|
||||
ID *owner_id,
|
||||
void *create_data,
|
||||
TreeElement *parent,
|
||||
short type,
|
||||
short index,
|
||||
const bool expand = true);
|
||||
/** See #AbstractTreeDisplay::add_element() (which this forwards to). */
|
||||
TreeElement *add_element(ListBase *lb,
|
||||
ID *owner_id,
|
||||
void *create_data,
|
||||
TreeElement *parent,
|
||||
short type,
|
||||
short index,
|
||||
const bool expand = true) const;
|
||||
};
|
||||
|
||||
void tree_element_expand(const AbstractTreeElement &tree_element, SpaceOutliner &space_outliner);
|
||||
|
||||
|
||||
@@ -29,41 +29,38 @@ TreeElementAnimData::TreeElementAnimData(TreeElement &legacy_te, AnimData &anim_
|
||||
legacy_te.directdata = &anim_data_;
|
||||
}
|
||||
|
||||
void TreeElementAnimData::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementAnimData::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
if (!anim_data_.action) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Animation data-block itself. */
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(anim_data_.action),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(anim_data_.action),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
|
||||
expand_drivers(space_outliner);
|
||||
expand_NLA_tracks(space_outliner);
|
||||
expand_drivers();
|
||||
expand_NLA_tracks();
|
||||
}
|
||||
|
||||
void TreeElementAnimData::expand_drivers(SpaceOutliner &space_outliner) const
|
||||
void TreeElementAnimData::expand_drivers() const
|
||||
{
|
||||
if (BLI_listbase_is_empty(&anim_data_.drivers)) {
|
||||
return;
|
||||
}
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, nullptr, &anim_data_, &legacy_te_, TSE_DRIVER_BASE, 0);
|
||||
add_element(&legacy_te_.subtree, nullptr, &anim_data_, &legacy_te_, TSE_DRIVER_BASE, 0);
|
||||
}
|
||||
|
||||
void TreeElementAnimData::expand_NLA_tracks(SpaceOutliner &space_outliner) const
|
||||
void TreeElementAnimData::expand_NLA_tracks() const
|
||||
{
|
||||
if (BLI_listbase_is_empty(&anim_data_.nla_tracks)) {
|
||||
return;
|
||||
}
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, nullptr, &anim_data_, &legacy_te_, TSE_NLA, 0);
|
||||
add_element(&legacy_te_.subtree, nullptr, &anim_data_, &legacy_te_, TSE_NLA, 0);
|
||||
}
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -21,8 +21,8 @@ class TreeElementAnimData final : public AbstractTreeElement {
|
||||
void expand(SpaceOutliner &space_outliner) const override;
|
||||
|
||||
private:
|
||||
void expand_drivers(SpaceOutliner &space_outliner) const;
|
||||
void expand_NLA_tracks(SpaceOutliner &space_outliner) const;
|
||||
void expand_drivers() const;
|
||||
void expand_NLA_tracks() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -26,20 +26,13 @@ TreeElementDeformGroupBase::TreeElementDeformGroupBase(TreeElement &legacy_te, O
|
||||
legacy_te.name = IFACE_("Vertex Groups");
|
||||
}
|
||||
|
||||
void TreeElementDeformGroupBase::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementDeformGroupBase::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
const ListBase *defbase = BKE_object_defgroup_list(&object_);
|
||||
|
||||
int index;
|
||||
LISTBASE_FOREACH_INDEX (bDeformGroup *, defgroup, defbase, index) {
|
||||
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
defgroup,
|
||||
&legacy_te_,
|
||||
TSE_DEFGROUP,
|
||||
index);
|
||||
add_element(&legacy_te_.subtree, &object_.id, defgroup, &legacy_te_, TSE_DEFGROUP, index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ TreeElementDriverBase::TreeElementDriverBase(TreeElement &legacy_te, AnimData &a
|
||||
legacy_te.name = IFACE_("Drivers");
|
||||
}
|
||||
|
||||
void TreeElementDriverBase::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementDriverBase::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
ID *lastadded = nullptr;
|
||||
|
||||
@@ -42,13 +42,7 @@ void TreeElementDriverBase::expand(SpaceOutliner &space_outliner) const
|
||||
DRIVER_TARGETS_USED_LOOPER_BEGIN (dvar) {
|
||||
if (lastadded != dtar->id) {
|
||||
/* XXX this lastadded check is rather lame, and also fails quite badly... */
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
dtar->id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, dtar->id, nullptr, &legacy_te_, TSE_LINKED_OB, 0);
|
||||
lastadded = dtar->id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,17 +27,11 @@ TreeElementGPencilEffectBase::TreeElementGPencilEffectBase(TreeElement &legacy_t
|
||||
legacy_te.name = IFACE_("Effects");
|
||||
}
|
||||
|
||||
void TreeElementGPencilEffectBase::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementGPencilEffectBase::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
int index;
|
||||
LISTBASE_FOREACH_INDEX (ShaderFxData *, fx, &object_.shader_fx, index) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
fx,
|
||||
&legacy_te_,
|
||||
TSE_GPENCIL_EFFECT,
|
||||
index);
|
||||
add_element(&legacy_te_.subtree, &object_.id, fx, &legacy_te_, TSE_GPENCIL_EFFECT, index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,16 +45,15 @@ TreeElementGPencilEffect::TreeElementGPencilEffect(TreeElement &legacy_te,
|
||||
legacy_te.directdata = &fx_;
|
||||
}
|
||||
|
||||
void TreeElementGPencilEffect::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementGPencilEffect::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
if (fx_.type == eShaderFxType_Swirl) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((SwirlShaderFxData *)(&fx_))->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((SwirlShaderFxData *)(&fx_))->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,19 +25,18 @@ TreeElementGreasePencilNode::TreeElementGreasePencilNode(TreeElement &legacy_te,
|
||||
legacy_te.name = node.name().c_str();
|
||||
}
|
||||
|
||||
void TreeElementGreasePencilNode::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementGreasePencilNode::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
if (!node_.is_group()) {
|
||||
return;
|
||||
}
|
||||
LISTBASE_FOREACH_BACKWARD (GreasePencilLayerTreeNode *, child, &node_.as_group().children) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&owner_grease_pencil_.id,
|
||||
child,
|
||||
&legacy_te_,
|
||||
TSE_GREASE_PENCIL_NODE,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
&owner_grease_pencil_.id,
|
||||
child,
|
||||
&legacy_te_,
|
||||
TSE_GREASE_PENCIL_NODE,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,20 +126,19 @@ bool TreeElementID::expand_poll(const SpaceOutliner &space_outliner) const
|
||||
return (tsepar == nullptr || tsepar->type != TSE_ID_BASE || space_outliner.filter_id_type);
|
||||
}
|
||||
|
||||
void TreeElementID::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementID::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
/* Not all IDs support animation data. Will be null then. */
|
||||
AnimData *anim_data = BKE_animdata_from_id(&id_);
|
||||
if (anim_data) {
|
||||
expand_animation_data(space_outliner, anim_data);
|
||||
expand_animation_data(anim_data);
|
||||
}
|
||||
}
|
||||
|
||||
void TreeElementID::expand_animation_data(SpaceOutliner &space_outliner, AnimData *anim_data) const
|
||||
void TreeElementID::expand_animation_data(AnimData *anim_data) const
|
||||
{
|
||||
if (outliner_animdata_test(anim_data)) {
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, &id_, anim_data, &legacy_te_, TSE_ANIM_DATA, 0);
|
||||
add_element(&legacy_te_.subtree, &id_, anim_data, &legacy_te_, TSE_ANIM_DATA, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class TreeElementID : public AbstractTreeElement {
|
||||
|
||||
protected:
|
||||
/* ID types with animation data can use this. */
|
||||
void expand_animation_data(SpaceOutliner &, AnimData *) const;
|
||||
void expand_animation_data(AnimData *) const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "BKE_armature.h"
|
||||
|
||||
#include "../outliner_intern.hh"
|
||||
#include "tree_display.hh"
|
||||
|
||||
#include "tree_element_id_armature.hh"
|
||||
|
||||
@@ -29,10 +30,10 @@ TreeElementIDArmature::TreeElementIDArmature(TreeElement &legacy_te, bArmature &
|
||||
|
||||
void TreeElementIDArmature::expand(SpaceOutliner &space_outliner) const
|
||||
{
|
||||
expand_animation_data(space_outliner, arm_.adt);
|
||||
expand_animation_data(arm_.adt);
|
||||
|
||||
if (arm_.edbo) {
|
||||
expand_edit_bones(space_outliner);
|
||||
expand_edit_bones();
|
||||
}
|
||||
else {
|
||||
/* do not extend Armature when we have posemode */
|
||||
@@ -48,12 +49,12 @@ void TreeElementIDArmature::expand(SpaceOutliner &space_outliner) const
|
||||
}
|
||||
}
|
||||
|
||||
void TreeElementIDArmature::expand_edit_bones(SpaceOutliner &space_outiner) const
|
||||
void TreeElementIDArmature::expand_edit_bones() const
|
||||
{
|
||||
int a = 0;
|
||||
LISTBASE_FOREACH_INDEX (EditBone *, ebone, arm_.edbo, a) {
|
||||
TreeElement *ten = outliner_add_element(
|
||||
&space_outiner, &legacy_te_.subtree, &arm_.id, &ebone, &legacy_te_, TSE_EBONE, a);
|
||||
TreeElement *ten = add_element(
|
||||
&legacy_te_.subtree, &arm_.id, &ebone, &legacy_te_, TSE_EBONE, a);
|
||||
ebone->temp.p = ten;
|
||||
}
|
||||
/* make hierarchy */
|
||||
@@ -81,7 +82,8 @@ static void outliner_add_bone(SpaceOutliner *space_outliner,
|
||||
TreeElement *parent,
|
||||
int *a)
|
||||
{
|
||||
TreeElement *te = outliner_add_element(space_outliner, lb, id, curBone, parent, TSE_BONE, *a);
|
||||
TreeElement *te = AbstractTreeDisplay::add_element(
|
||||
space_outliner, lb, id, curBone, parent, TSE_BONE, *a);
|
||||
|
||||
(*a)++;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class TreeElementIDArmature final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_edit_bones(SpaceOutliner &) const;
|
||||
void expand_edit_bones() const;
|
||||
void expand_bones(SpaceOutliner &) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,23 +21,22 @@ TreeElementIDCurve::TreeElementIDCurve(TreeElement &legacy_te, Curve &curve)
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDCurve::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDCurve::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
expand_animation_data(space_outliner, curve_.adt);
|
||||
expand_animation_data(curve_.adt);
|
||||
|
||||
expand_materials(space_outliner);
|
||||
expand_materials();
|
||||
}
|
||||
|
||||
void TreeElementIDCurve::expand_materials(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDCurve::expand_materials() const
|
||||
{
|
||||
for (int a = 0; a < curve_.totcol; a++) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(curve_.mat[a]),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(curve_.mat[a]),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class TreeElementIDCurve final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_materials(SpaceOutliner &) const;
|
||||
void expand_materials() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -24,19 +24,18 @@ TreeElementIDGPLegacy::TreeElementIDGPLegacy(TreeElement &legacy_te, bGPdata &gp
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDGPLegacy::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDGPLegacy::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
expand_animation_data(space_outliner, gpd_.adt);
|
||||
expand_animation_data(gpd_.adt);
|
||||
|
||||
expand_layers(space_outliner);
|
||||
expand_layers();
|
||||
}
|
||||
|
||||
void TreeElementIDGPLegacy::expand_layers(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDGPLegacy::expand_layers() const
|
||||
{
|
||||
int index = 0;
|
||||
LISTBASE_FOREACH_BACKWARD (bGPDlayer *, gpl, &gpd_.layers) {
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, &gpd_.id, gpl, &legacy_te_, TSE_GP_LAYER, index);
|
||||
add_element(&legacy_te_.subtree, &gpd_.id, gpl, &legacy_te_, TSE_GP_LAYER, index);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class TreeElementIDGPLegacy final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_layers(SpaceOutliner &) const;
|
||||
void expand_layers() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -22,25 +22,20 @@ TreeElementIDGreasePencil::TreeElementIDGreasePencil(TreeElement &legacy_te,
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDGreasePencil::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDGreasePencil::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
expand_animation_data(space_outliner, grease_pencil_.adt);
|
||||
expand_animation_data(grease_pencil_.adt);
|
||||
|
||||
expand_layer_tree(space_outliner);
|
||||
expand_layer_tree();
|
||||
}
|
||||
|
||||
void TreeElementIDGreasePencil::expand_layer_tree(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDGreasePencil::expand_layer_tree() const
|
||||
{
|
||||
LISTBASE_FOREACH_BACKWARD (
|
||||
GreasePencilLayerTreeNode *, child, &grease_pencil_.root_group().children)
|
||||
{
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&grease_pencil_.id,
|
||||
child,
|
||||
&legacy_te_,
|
||||
TSE_GREASE_PENCIL_NODE,
|
||||
0);
|
||||
add_element(
|
||||
&legacy_te_.subtree, &grease_pencil_.id, child, &legacy_te_, TSE_GREASE_PENCIL_NODE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class TreeElementIDGreasePencil final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_layer_tree(SpaceOutliner &) const;
|
||||
void expand_layer_tree() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -24,24 +24,23 @@ TreeElementIDLineStyle::TreeElementIDLineStyle(TreeElement &legacy_te,
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDLineStyle::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDLineStyle::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
expand_animation_data(space_outliner, linestyle_.adt);
|
||||
expand_animation_data(linestyle_.adt);
|
||||
|
||||
expand_textures(space_outliner);
|
||||
expand_textures();
|
||||
}
|
||||
|
||||
void TreeElementIDLineStyle::expand_textures(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDLineStyle::expand_textures() const
|
||||
{
|
||||
for (int a = 0; a < MAX_MTEX; a++) {
|
||||
if (linestyle_.mtex[a]) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>((linestyle_.mtex[a])->tex),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>((linestyle_.mtex[a])->tex),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class TreeElementIDLineStyle final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_textures(SpaceOutliner &) const;
|
||||
void expand_textures() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -21,35 +21,33 @@ TreeElementIDMesh::TreeElementIDMesh(TreeElement &legacy_te_, Mesh &mesh)
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDMesh::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDMesh::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
expand_animation_data(space_outliner, mesh_.adt);
|
||||
expand_animation_data(mesh_.adt);
|
||||
|
||||
expand_key(space_outliner);
|
||||
expand_materials(space_outliner);
|
||||
expand_key();
|
||||
expand_materials();
|
||||
}
|
||||
|
||||
void TreeElementIDMesh::expand_key(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDMesh::expand_key() const
|
||||
{
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(mesh_.key),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(mesh_.key),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
}
|
||||
|
||||
void TreeElementIDMesh::expand_materials(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDMesh::expand_materials() const
|
||||
{
|
||||
for (int a = 0; a < mesh_.totcol; a++) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(mesh_.mat[a]),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(mesh_.mat[a]),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ class TreeElementIDMesh final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_key(SpaceOutliner &) const;
|
||||
void expand_materials(SpaceOutliner &) const;
|
||||
void expand_key() const;
|
||||
void expand_materials() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -21,23 +21,22 @@ TreeElementIDMetaBall::TreeElementIDMetaBall(TreeElement &legacy_te, MetaBall &m
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDMetaBall::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDMetaBall::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
expand_animation_data(space_outliner, metaball_.adt);
|
||||
expand_animation_data(metaball_.adt);
|
||||
|
||||
expand_materials(space_outliner);
|
||||
expand_materials();
|
||||
}
|
||||
|
||||
void TreeElementIDMetaBall::expand_materials(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDMetaBall::expand_materials() const
|
||||
{
|
||||
for (int a = 0; a < metaball_.totcol; a++) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(metaball_.mat[a]),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(metaball_.mat[a]),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class TreeElementIDMetaBall final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_materials(SpaceOutliner &) const;
|
||||
void expand_materials() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -33,132 +33,95 @@ TreeElementIDObject::TreeElementIDObject(TreeElement &legacy_te, Object &object)
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
/* tuck pointer back in object, to construct hierarchy */
|
||||
object_.id.newid = (ID *)(&legacy_te_);
|
||||
|
||||
expand_animation_data(space_outliner, object_.adt);
|
||||
expand_animation_data(object_.adt);
|
||||
|
||||
expand_data(space_outliner);
|
||||
expand_pose(space_outliner);
|
||||
expand_materials(space_outliner);
|
||||
expand_constraints(space_outliner);
|
||||
expand_modifiers(space_outliner);
|
||||
expand_gpencil_modifiers(space_outliner);
|
||||
expand_gpencil_effects(space_outliner);
|
||||
expand_vertex_groups(space_outliner);
|
||||
expand_duplicated_group(space_outliner);
|
||||
expand_data();
|
||||
expand_pose();
|
||||
expand_materials();
|
||||
expand_constraints();
|
||||
expand_modifiers();
|
||||
expand_gpencil_modifiers();
|
||||
expand_gpencil_effects();
|
||||
expand_vertex_groups();
|
||||
expand_duplicated_group();
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_data(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_data() const
|
||||
{
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
static_cast<ID *>(object_.data),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
add_element(
|
||||
&legacy_te_.subtree, static_cast<ID *>(object_.data), nullptr, &legacy_te_, TSE_SOME_ID, 0);
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_pose(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_pose() const
|
||||
{
|
||||
if (!object_.pose) {
|
||||
return;
|
||||
}
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, &object_.id, nullptr, &legacy_te_, TSE_POSE_BASE, 0);
|
||||
add_element(&legacy_te_.subtree, &object_.id, nullptr, &legacy_te_, TSE_POSE_BASE, 0);
|
||||
|
||||
/* Pose Groups */
|
||||
if (!BLI_listbase_is_empty(&object_.pose->agroups)) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_POSEGRP_BASE,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, &object_.id, nullptr, &legacy_te_, TSE_POSEGRP_BASE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_materials(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_materials() const
|
||||
{
|
||||
for (int a = 0; a < object_.totcol; a++) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(object_.mat[a]),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(object_.mat[a]),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
a);
|
||||
}
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_constraints(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_constraints() const
|
||||
{
|
||||
if (BLI_listbase_is_empty(&object_.constraints)) {
|
||||
return;
|
||||
}
|
||||
TreeElement *tenla = outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_CONSTRAINT_BASE,
|
||||
0);
|
||||
TreeElement *tenla = add_element(
|
||||
&legacy_te_.subtree, &object_.id, nullptr, &legacy_te_, TSE_CONSTRAINT_BASE, 0);
|
||||
|
||||
int index;
|
||||
LISTBASE_FOREACH_INDEX (bConstraint *, con, &object_.constraints, index) {
|
||||
outliner_add_element(
|
||||
&space_outliner, &tenla->subtree, &object_.id, con, tenla, TSE_CONSTRAINT, index);
|
||||
add_element(&tenla->subtree, &object_.id, con, tenla, TSE_CONSTRAINT, index);
|
||||
/* possible add all other types links? */
|
||||
}
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_modifiers(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_modifiers() const
|
||||
{
|
||||
if (BLI_listbase_is_empty(&object_.modifiers)) {
|
||||
return;
|
||||
}
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_MODIFIER_BASE,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, &object_.id, nullptr, &legacy_te_, TSE_MODIFIER_BASE, 0);
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_gpencil_modifiers(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_gpencil_modifiers() const
|
||||
{
|
||||
if (BLI_listbase_is_empty(&object_.greasepencil_modifiers)) {
|
||||
return;
|
||||
}
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_MODIFIER_BASE,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, &object_.id, nullptr, &legacy_te_, TSE_MODIFIER_BASE, 0);
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_gpencil_effects(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_gpencil_effects() const
|
||||
{
|
||||
if (BLI_listbase_is_empty(&object_.shader_fx)) {
|
||||
return;
|
||||
}
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_GPENCIL_EFFECT_BASE,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, &object_.id, nullptr, &legacy_te_, TSE_GPENCIL_EFFECT_BASE, 0);
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_vertex_groups(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_vertex_groups() const
|
||||
{
|
||||
if (!ELEM(object_.type, OB_MESH, OB_GPENCIL_LEGACY, OB_LATTICE)) {
|
||||
return;
|
||||
@@ -167,25 +130,18 @@ void TreeElementIDObject::expand_vertex_groups(SpaceOutliner &space_outliner) co
|
||||
if (BLI_listbase_is_empty(defbase)) {
|
||||
return;
|
||||
}
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_DEFGROUP_BASE,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, &object_.id, nullptr, &legacy_te_, TSE_DEFGROUP_BASE, 0);
|
||||
}
|
||||
|
||||
void TreeElementIDObject::expand_duplicated_group(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDObject::expand_duplicated_group() const
|
||||
{
|
||||
if (object_.instance_collection && (object_.transflag & OB_DUPLICOLLECTION)) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(object_.instance_collection),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(object_.instance_collection),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@ class TreeElementIDObject final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_data(SpaceOutliner &) const;
|
||||
void expand_pose(SpaceOutliner &) const;
|
||||
void expand_materials(SpaceOutliner &) const;
|
||||
void expand_constraints(SpaceOutliner &) const;
|
||||
void expand_modifiers(SpaceOutliner &) const;
|
||||
void expand_gpencil_modifiers(SpaceOutliner &) const;
|
||||
void expand_gpencil_effects(SpaceOutliner &) const;
|
||||
void expand_vertex_groups(SpaceOutliner &) const;
|
||||
void expand_duplicated_group(SpaceOutliner &) const;
|
||||
void expand_data() const;
|
||||
void expand_pose() const;
|
||||
void expand_materials() const;
|
||||
void expand_constraints() const;
|
||||
void expand_modifiers() const;
|
||||
void expand_gpencil_modifiers() const;
|
||||
void expand_gpencil_effects() const;
|
||||
void expand_vertex_groups() const;
|
||||
void expand_duplicated_group() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -21,53 +21,39 @@ TreeElementIDScene::TreeElementIDScene(TreeElement &legacy_te, Scene &scene)
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDScene::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDScene::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
expand_view_layers(space_outliner);
|
||||
expand_world(space_outliner);
|
||||
expand_collections(space_outliner);
|
||||
expand_objects(space_outliner);
|
||||
expand_view_layers();
|
||||
expand_world();
|
||||
expand_collections();
|
||||
expand_objects();
|
||||
|
||||
expand_animation_data(space_outliner, scene_.adt);
|
||||
expand_animation_data(scene_.adt);
|
||||
}
|
||||
|
||||
void TreeElementIDScene::expand_view_layers(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDScene::expand_view_layers() const
|
||||
{
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, &scene_.id, nullptr, &legacy_te_, TSE_R_LAYER_BASE, 0);
|
||||
add_element(&legacy_te_.subtree, &scene_.id, nullptr, &legacy_te_, TSE_R_LAYER_BASE, 0);
|
||||
}
|
||||
|
||||
void TreeElementIDScene::expand_world(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDScene::expand_world() const
|
||||
{
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(scene_.world),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(scene_.world),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
}
|
||||
|
||||
void TreeElementIDScene::expand_collections(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDScene::expand_collections() const
|
||||
{
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&scene_.id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SCENE_COLLECTION_BASE,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, &scene_.id, nullptr, &legacy_te_, TSE_SCENE_COLLECTION_BASE, 0);
|
||||
}
|
||||
|
||||
void TreeElementIDScene::expand_objects(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDScene::expand_objects() const
|
||||
{
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&scene_.id,
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SCENE_OBJECTS_BASE,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, &scene_.id, nullptr, &legacy_te_, TSE_SCENE_OBJECTS_BASE, 0);
|
||||
}
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -21,10 +21,10 @@ class TreeElementIDScene final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_view_layers(SpaceOutliner &) const;
|
||||
void expand_world(SpaceOutliner &) const;
|
||||
void expand_collections(SpaceOutliner &) const;
|
||||
void expand_objects(SpaceOutliner &) const;
|
||||
void expand_view_layers() const;
|
||||
void expand_world() const;
|
||||
void expand_collections() const;
|
||||
void expand_objects() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -21,22 +21,21 @@ TreeElementIDTexture::TreeElementIDTexture(TreeElement &legacy_te, Tex &texture)
|
||||
{
|
||||
}
|
||||
|
||||
void TreeElementIDTexture::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDTexture::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
expand_animation_data(space_outliner, texture_.adt);
|
||||
expand_animation_data(texture_.adt);
|
||||
|
||||
expand_image(space_outliner);
|
||||
expand_image();
|
||||
}
|
||||
|
||||
void TreeElementIDTexture::expand_image(SpaceOutliner &space_outliner) const
|
||||
void TreeElementIDTexture::expand_image() const
|
||||
{
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(texture_.ima),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(texture_.ima),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
}
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -21,7 +21,7 @@ class TreeElementIDTexture final : public TreeElementID {
|
||||
void expand(SpaceOutliner &) const override;
|
||||
|
||||
private:
|
||||
void expand_image(SpaceOutliner &) const;
|
||||
void expand_image() const;
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
||||
@@ -27,30 +27,18 @@ TreeElementModifierBase::TreeElementModifierBase(TreeElement &legacy_te, Object
|
||||
legacy_te.name = IFACE_("Modifiers");
|
||||
}
|
||||
|
||||
void TreeElementModifierBase::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementModifierBase::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
int index;
|
||||
LISTBASE_FOREACH_INDEX (ModifierData *, md, &object_.modifiers, index) {
|
||||
ModifierDataStoreElem md_store(md);
|
||||
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
&md_store,
|
||||
&legacy_te_,
|
||||
TSE_MODIFIER,
|
||||
index);
|
||||
add_element(&legacy_te_.subtree, &object_.id, &md_store, &legacy_te_, TSE_MODIFIER, index);
|
||||
}
|
||||
LISTBASE_FOREACH_INDEX (GpencilModifierData *, md, &object_.greasepencil_modifiers, index) {
|
||||
ModifierDataStoreElem md_store(md);
|
||||
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
&md_store,
|
||||
&legacy_te_,
|
||||
TSE_MODIFIER,
|
||||
index);
|
||||
add_element(&legacy_te_.subtree, &object_.id, &md_store, &legacy_te_, TSE_MODIFIER, index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,86 +57,73 @@ TreeElementModifier::TreeElementModifier(TreeElement &legacy_te,
|
||||
}
|
||||
}
|
||||
|
||||
void TreeElementModifier::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementModifier::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
if (md_.type == MODIFIER_TYPE) {
|
||||
ModifierData *md = md_.md;
|
||||
if (md->type == eModifierType_Lattice) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((LatticeModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((LatticeModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
}
|
||||
else if (md->type == eModifierType_Curve) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((CurveModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((CurveModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
}
|
||||
else if (md->type == eModifierType_Armature) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((ArmatureModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((ArmatureModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
}
|
||||
else if (md->type == eModifierType_Hook) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((HookModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((HookModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
}
|
||||
else if (md->type == eModifierType_ParticleSystem) {
|
||||
ParticleSystem *psys = ((ParticleSystemModifierData *)md)->psys;
|
||||
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
psys,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_PSYS,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, &object_.id, psys, &legacy_te_, TSE_LINKED_PSYS, 0);
|
||||
}
|
||||
}
|
||||
if (md_.type == GPENCIL_MODIFIER_TYPE) {
|
||||
GpencilModifierData *md = md_.gp_md;
|
||||
if (md->type == eGpencilModifierType_Armature) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((ArmatureGpencilModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((ArmatureGpencilModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
}
|
||||
else if (md->type == eGpencilModifierType_Hook) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((HookGpencilModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((HookGpencilModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
}
|
||||
else if (md->type == eGpencilModifierType_Lattice) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((LatticeGpencilModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(((LatticeGpencilModifierData *)md)->object),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_LINKED_OB,
|
||||
0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,12 +28,11 @@ TreeElementNLA::TreeElementNLA(TreeElement &legacy_te, AnimData &anim_data)
|
||||
legacy_te.directdata = &anim_data;
|
||||
}
|
||||
|
||||
void TreeElementNLA::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementNLA::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
int a = 0;
|
||||
for (NlaTrack *nlt : ListBaseWrapper<NlaTrack>(anim_data_.nla_tracks)) {
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, nullptr, nlt, &legacy_te_, TSE_NLA_TRACK, a);
|
||||
add_element(&legacy_te_.subtree, nullptr, nlt, &legacy_te_, TSE_NLA_TRACK, a);
|
||||
a++;
|
||||
}
|
||||
}
|
||||
@@ -47,17 +46,16 @@ TreeElementNLATrack::TreeElementNLATrack(TreeElement &legacy_te, NlaTrack &track
|
||||
legacy_te.name = track.name;
|
||||
}
|
||||
|
||||
void TreeElementNLATrack::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementNLATrack::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
int a = 0;
|
||||
for (NlaStrip *strip : ListBaseWrapper<NlaStrip>(track_.strips)) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(strip->act),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_NLA_ACTION,
|
||||
a);
|
||||
add_element(&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(strip->act),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_NLA_ACTION,
|
||||
a);
|
||||
a++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "../outliner_intern.hh"
|
||||
|
||||
#include "tree_display.hh"
|
||||
#include "tree_element_label.hh"
|
||||
#include "tree_element_overrides.hh"
|
||||
|
||||
@@ -376,13 +377,13 @@ void OverrideRNAPathTreeBuilder::build_path(TreeElement &parent,
|
||||
* values), so the element may already be present. At this point they are displayed as a single
|
||||
* property in the tree, so don't add it multiple times here. */
|
||||
else if (!path_te_map.contains(override_data.override_property.rna_path)) {
|
||||
outliner_add_element(&space_outliner_,
|
||||
&te_to_expand->subtree,
|
||||
&override_data.id,
|
||||
&override_data,
|
||||
te_to_expand,
|
||||
TSE_LIBRARY_OVERRIDE,
|
||||
index++);
|
||||
AbstractTreeDisplay::add_element(&space_outliner_,
|
||||
&te_to_expand->subtree,
|
||||
&override_data.id,
|
||||
&override_data,
|
||||
te_to_expand,
|
||||
TSE_LIBRARY_OVERRIDE,
|
||||
index++);
|
||||
}
|
||||
|
||||
MEM_delete(elem_path);
|
||||
@@ -433,14 +434,14 @@ void OverrideRNAPathTreeBuilder::ensure_entire_collection(
|
||||
TreeElementOverridesData override_op_data = override_data;
|
||||
override_op_data.operation = item_operation;
|
||||
|
||||
current_te = outliner_add_element(&space_outliner_,
|
||||
&te_to_expand.subtree,
|
||||
&override_op_data.id,
|
||||
/* Element will store a copy. */
|
||||
&override_op_data,
|
||||
&te_to_expand,
|
||||
TSE_LIBRARY_OVERRIDE_OPERATION,
|
||||
index++);
|
||||
current_te = AbstractTreeDisplay::add_element(&space_outliner_,
|
||||
&te_to_expand.subtree,
|
||||
&override_op_data.id,
|
||||
/* Element will store a copy. */
|
||||
&override_op_data,
|
||||
&te_to_expand,
|
||||
TSE_LIBRARY_OVERRIDE_OPERATION,
|
||||
index++);
|
||||
}
|
||||
else {
|
||||
current_te = &ensure_label_element_for_ptr(te_to_expand, coll_item_path, itemptr, index);
|
||||
@@ -477,14 +478,14 @@ TreeElement &OverrideRNAPathTreeBuilder::ensure_label_element_for_prop(
|
||||
TreeElement &parent, StringRef elem_path, PointerRNA &ptr, PropertyRNA &prop, short &index)
|
||||
{
|
||||
return *path_te_map.lookup_or_add_cb(elem_path, [&]() {
|
||||
TreeElement *new_te = outliner_add_element(&space_outliner_,
|
||||
&parent.subtree,
|
||||
nullptr,
|
||||
(void *)RNA_property_ui_name(&prop),
|
||||
&parent,
|
||||
TSE_GENERIC_LABEL,
|
||||
index++,
|
||||
false);
|
||||
TreeElement *new_te = AbstractTreeDisplay::add_element(&space_outliner_,
|
||||
&parent.subtree,
|
||||
nullptr,
|
||||
(void *)RNA_property_ui_name(&prop),
|
||||
&parent,
|
||||
TSE_GENERIC_LABEL,
|
||||
index++,
|
||||
false);
|
||||
TreeElementLabel *te_label = tree_element_cast<TreeElementLabel>(new_te);
|
||||
|
||||
te_label->set_icon(get_property_icon(ptr, prop));
|
||||
@@ -500,7 +501,7 @@ TreeElement &OverrideRNAPathTreeBuilder::ensure_label_element_for_ptr(TreeElemen
|
||||
return *path_te_map.lookup_or_add_cb(elem_path, [&]() {
|
||||
const char *dyn_name = RNA_struct_name_get_alloc(&ptr, nullptr, 0, nullptr);
|
||||
|
||||
TreeElement *new_te = outliner_add_element(
|
||||
TreeElement *new_te = AbstractTreeDisplay::add_element(
|
||||
&space_outliner_,
|
||||
&parent.subtree,
|
||||
nullptr,
|
||||
|
||||
@@ -28,7 +28,7 @@ TreeElementPoseBase::TreeElementPoseBase(TreeElement &legacy_te, Object &object)
|
||||
legacy_te.name = IFACE_("Pose");
|
||||
}
|
||||
|
||||
void TreeElementPoseBase::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementPoseBase::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
bArmature *arm = static_cast<bArmature *>(object_.data);
|
||||
|
||||
@@ -37,29 +37,18 @@ void TreeElementPoseBase::expand(SpaceOutliner &space_outliner) const
|
||||
int const_index = 1000; /* ensure unique id for bone constraints */
|
||||
int a;
|
||||
LISTBASE_FOREACH_INDEX (bPoseChannel *, pchan, &object_.pose->chanbase, a) {
|
||||
TreeElement *ten = outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
&object_.id,
|
||||
pchan,
|
||||
&legacy_te_,
|
||||
TSE_POSE_CHANNEL,
|
||||
a);
|
||||
TreeElement *ten = add_element(
|
||||
&legacy_te_.subtree, &object_.id, pchan, &legacy_te_, TSE_POSE_CHANNEL, a);
|
||||
pchan->temp = (void *)ten;
|
||||
|
||||
if (!BLI_listbase_is_empty(&pchan->constraints)) {
|
||||
/* Object *target; */
|
||||
TreeElement *tenla1 = outliner_add_element(
|
||||
&space_outliner, &ten->subtree, &object_.id, nullptr, ten, TSE_CONSTRAINT_BASE, 0);
|
||||
TreeElement *tenla1 = add_element(
|
||||
&ten->subtree, &object_.id, nullptr, ten, TSE_CONSTRAINT_BASE, 0);
|
||||
/* char *str; */
|
||||
|
||||
LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&tenla1->subtree,
|
||||
&object_.id,
|
||||
con,
|
||||
tenla1,
|
||||
TSE_CONSTRAINT,
|
||||
const_index);
|
||||
add_element(&tenla1->subtree, &object_.id, con, tenla1, TSE_CONSTRAINT, const_index);
|
||||
/* possible add all other types links? */
|
||||
}
|
||||
const_index++;
|
||||
|
||||
@@ -27,12 +27,11 @@ TreeElementPoseGroupBase::TreeElementPoseGroupBase(TreeElement &legacy_te, Objec
|
||||
legacy_te.name = IFACE_("Bone Groups");
|
||||
}
|
||||
|
||||
void TreeElementPoseGroupBase::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementPoseGroupBase::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
int index;
|
||||
LISTBASE_FOREACH_INDEX (bActionGroup *, agrp, &object_.pose->agroups, index) {
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, &object_.id, agrp, &legacy_te_, TSE_POSEGRP, index);
|
||||
add_element(&legacy_te_.subtree, &object_.id, agrp, &legacy_te_, TSE_POSEGRP, index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,13 +115,7 @@ void TreeElementRNAStruct::expand(SpaceOutliner &space_outliner) const
|
||||
PointerRNA propptr;
|
||||
RNA_property_collection_lookup_int(&ptr, iterprop, index, &propptr);
|
||||
if (!(RNA_property_flag(static_cast<PropertyRNA *>(propptr.data)) & PROP_HIDDEN)) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
ptr.owner_id,
|
||||
&ptr,
|
||||
&legacy_te_,
|
||||
TSE_RNA_PROPERTY,
|
||||
index);
|
||||
add_element(&legacy_te_.subtree, ptr.owner_id, &ptr, &legacy_te_, TSE_RNA_PROPERTY, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,13 +164,7 @@ void TreeElementRNAProperty::expand(SpaceOutliner &space_outliner) const
|
||||
|
||||
if (pptr.data) {
|
||||
if (TSELEM_OPEN(&tselem, &space_outliner)) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
pptr.owner_id,
|
||||
&pptr,
|
||||
&legacy_te_,
|
||||
TSE_RNA_STRUCT,
|
||||
-1);
|
||||
add_element(&legacy_te_.subtree, pptr.owner_id, &pptr, &legacy_te_, TSE_RNA_STRUCT, -1);
|
||||
}
|
||||
else {
|
||||
legacy_te_.flag |= TE_PRETEND_HAS_CHILDREN;
|
||||
@@ -191,13 +179,7 @@ void TreeElementRNAProperty::expand(SpaceOutliner &space_outliner) const
|
||||
for (int index = 0; index < tot; index++) {
|
||||
PointerRNA pptr;
|
||||
RNA_property_collection_lookup_int(&rna_ptr, rna_prop_, index, &pptr);
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
pptr.owner_id,
|
||||
&pptr,
|
||||
&legacy_te_,
|
||||
TSE_RNA_STRUCT,
|
||||
index);
|
||||
add_element(&legacy_te_.subtree, pptr.owner_id, &pptr, &legacy_te_, TSE_RNA_STRUCT, index);
|
||||
}
|
||||
}
|
||||
else if (tot) {
|
||||
@@ -210,13 +192,12 @@ void TreeElementRNAProperty::expand(SpaceOutliner &space_outliner) const
|
||||
|
||||
if (TSELEM_OPEN(&tselem, &space_outliner)) {
|
||||
for (int index = 0; index < tot; index++) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
rna_ptr.owner_id,
|
||||
&rna_ptr,
|
||||
&legacy_te_,
|
||||
TSE_RNA_ARRAY_ELEM,
|
||||
index);
|
||||
add_element(&legacy_te_.subtree,
|
||||
rna_ptr.owner_id,
|
||||
&rna_ptr,
|
||||
&legacy_te_,
|
||||
TSE_RNA_ARRAY_ELEM,
|
||||
index);
|
||||
}
|
||||
}
|
||||
else if (tot) {
|
||||
|
||||
@@ -28,16 +28,11 @@ TreeElementSceneObjectsBase::TreeElementSceneObjectsBase(TreeElement &legacy_te,
|
||||
legacy_te.name = IFACE_("Objects");
|
||||
}
|
||||
|
||||
void TreeElementSceneObjectsBase::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementSceneObjectsBase::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
FOREACH_SCENE_OBJECT_BEGIN (&scene_, ob) {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
reinterpret_cast<ID *>(ob),
|
||||
nullptr,
|
||||
&legacy_te_,
|
||||
TSE_SOME_ID,
|
||||
0);
|
||||
add_element(
|
||||
&legacy_te_.subtree, reinterpret_cast<ID *>(ob), nullptr, &legacy_te_, TSE_SOME_ID, 0);
|
||||
}
|
||||
FOREACH_SCENE_OBJECT_END;
|
||||
outliner_make_object_parent_hierarchy(&legacy_te_.subtree);
|
||||
|
||||
@@ -30,7 +30,7 @@ bool TreeElementSequence::expand_poll(const SpaceOutliner & /*space_outliner*/)
|
||||
return !(sequence_.type & SEQ_TYPE_EFFECT);
|
||||
}
|
||||
|
||||
void TreeElementSequence::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementSequence::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
/*
|
||||
* This work like the sequence.
|
||||
@@ -40,18 +40,11 @@ void TreeElementSequence::expand(SpaceOutliner &space_outliner) const
|
||||
|
||||
if (sequence_.type == SEQ_TYPE_META) {
|
||||
LISTBASE_FOREACH (Sequence *, child, &sequence_.seqbase) {
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, nullptr, child, &legacy_te_, TSE_SEQUENCE, 0);
|
||||
add_element(&legacy_te_.subtree, nullptr, child, &legacy_te_, TSE_SEQUENCE, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
outliner_add_element(&space_outliner,
|
||||
&legacy_te_.subtree,
|
||||
nullptr,
|
||||
sequence_.strip,
|
||||
&legacy_te_,
|
||||
TSE_SEQ_STRIP,
|
||||
0);
|
||||
add_element(&legacy_te_.subtree, nullptr, sequence_.strip, &legacy_te_, TSE_SEQ_STRIP, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,11 +27,10 @@ TreeElementViewLayerBase::TreeElementViewLayerBase(TreeElement &legacy_te, Scene
|
||||
legacy_te_.name = IFACE_("View Layers");
|
||||
}
|
||||
|
||||
void TreeElementViewLayerBase::expand(SpaceOutliner &space_outliner) const
|
||||
void TreeElementViewLayerBase::expand(SpaceOutliner & /*space_outliner*/) const
|
||||
{
|
||||
for (auto *view_layer : ListBaseWrapper<ViewLayer>(scene_.view_layers)) {
|
||||
outliner_add_element(
|
||||
&space_outliner, &legacy_te_.subtree, &scene_.id, view_layer, &legacy_te_, TSE_R_LAYER, 0);
|
||||
add_element(&legacy_te_.subtree, &scene_.id, view_layer, &legacy_te_, TSE_R_LAYER, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user