Outliner: Port view collection base elements to new tree-element code design #111230
|
@ -82,6 +82,7 @@ set(SRC
|
|||
tree/tree_element_rna.cc
|
||||
tree/tree_element_scene_objects.cc
|
||||
tree/tree_element_seq.cc
|
||||
tree/tree_element_view_collection.cc
|
||||
tree/tree_element_view_layer.cc
|
||||
tree/tree_iterator.cc
|
||||
|
||||
|
@ -124,6 +125,7 @@ set(SRC
|
|||
tree/tree_element_rna.hh
|
||||
tree/tree_element_scene_objects.hh
|
||||
tree/tree_element_seq.hh
|
||||
tree/tree_element_view_collection.hh
|
||||
tree/tree_element_view_layer.hh
|
||||
tree/tree_iterator.hh
|
||||
)
|
||||
|
|
|
@ -428,7 +428,8 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
|
|||
TSE_MODIFIER_BASE,
|
||||
TSE_GREASE_PENCIL_NODE,
|
||||
TSE_LINKED_OB,
|
||||
TSE_LAYER_COLLECTION))
|
||||
TSE_VIEW_COLLECTION_BASE) ||
|
||||
ELEM(type, TSE_LAYER_COLLECTION))
|
||||
{
|
||||
BLI_assert_msg(false, "Element type should already use new AbstractTreeElement design");
|
||||
}
|
||||
|
|
|
@ -120,7 +120,6 @@ void TreeDisplayViewLayer::add_view_layer(Scene &scene, ListBase &tree, TreeElem
|
|||
/* Show collections in the view layer. */
|
||||
TreeElement &ten = *outliner_add_element(
|
||||
&space_outliner_, &tree, &scene, parent, TSE_VIEW_COLLECTION_BASE, 0);
|
||||
ten.name = IFACE_("Scene Collection");
|
||||
TREESTORE(&ten)->flag &= ~TSE_CLOSED;
|
||||
|
||||
/* First layer collection is for master collection, don't show it. */
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "tree_element_rna.hh"
|
||||
#include "tree_element_scene_objects.hh"
|
||||
#include "tree_element_seq.hh"
|
||||
#include "tree_element_view_collection.hh"
|
||||
#include "tree_element_view_layer.hh"
|
||||
|
||||
#include "../outliner_intern.hh"
|
||||
|
@ -179,6 +180,9 @@ std::unique_ptr<AbstractTreeElement> AbstractTreeElement::createFromType(const i
|
|||
}
|
||||
case TSE_LINKED_OB:
|
||||
return std::make_unique<TreeElementLinkedObject>(legacy_te, *static_cast<ID *>(idv));
|
||||
case TSE_VIEW_COLLECTION_BASE:
|
||||
return std::make_unique<TreeElementViewCollectionBase>(legacy_te,
|
||||
*static_cast<Scene *>(idv));
|
||||
case TSE_LAYER_COLLECTION:
|
||||
return std::make_unique<TreeElementLayerCollection>(legacy_te,
|
||||
*static_cast<LayerCollection *>(idv));
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup spoutliner
|
||||
*/
|
||||
|
||||
#include "DNA_outliner_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
#include "BLT_translation.h"
|
||||
|
||||
#include "../outliner_intern.hh"
|
||||
|
||||
#include "tree_element_view_collection.hh"
|
||||
|
||||
namespace blender::ed::outliner {
|
||||
|
||||
TreeElementViewCollectionBase::TreeElementViewCollectionBase(TreeElement &legacy_te, Scene &scene)
|
||||
: AbstractTreeElement(legacy_te), scene_(scene)
|
||||
{
|
||||
BLI_assert(legacy_te.store_elem->type == TSE_VIEW_COLLECTION_BASE);
|
||||
legacy_te.name = IFACE_("Scene Collection");
|
||||
}
|
||||
|
||||
} // namespace blender::ed::outliner
|
|
@ -0,0 +1,22 @@
|
|||
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
/** \file
|
||||
* \ingroup spoutliner
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "tree_element.hh"
|
||||
|
||||
namespace blender::ed::outliner {
|
||||
|
||||
class TreeElementViewCollectionBase final : public AbstractTreeElement {
|
||||
Scene &scene_;
|
||||
|
||||
public:
|
||||
TreeElementViewCollectionBase(TreeElement &legacy_te, Scene &scene);
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
Loading…
Reference in New Issue