Blender V5.3
blender::ed::outliner::TreeElementAddParams Struct Reference

#include <tree_display.hh>

Public Attributes

ListBaseT< TreeElement > * lb = nullptr
TreeElement * parent = nullptr
int64_t index = 0
ID * owner_id = nullptr
bool expand = true
const void * persistent_ptr = nullptr

Detailed Description

The non type specific parameters of #AbstractTreeDisplay::add_element(). Grouped into a struct so the type safe overload can take the element type's own construction data as a trailing parameter pack. All of them have a sensible default, so simple cases can just pass {}.

Definition at line 76 of file tree_display.hh.

Member Data Documentation

◆ expand

bool blender::ed::outliner::TreeElementAddParams::expand = true

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 when not all too relevant.

Definition at line 101 of file tree_display.hh.

Referenced by blender::ed::outliner::AbstractTreeDisplay::add_element_impl().

◆ index

int64_t blender::ed::outliner::TreeElementAddParams::index = 0

Index for data arrays. Part of the tree-store identity of the element, to preserve state over rebuilds and file loads.

Definition at line 88 of file tree_display.hh.

Referenced by blender::ed::outliner::AbstractTreeDisplay::add_element_impl().

◆ lb

ListBaseT<TreeElement>* blender::ed::outliner::TreeElementAddParams::lb = nullptr

The sub-tree to add the new element to. If null, the sub-tree of parent is used.

Definition at line 78 of file tree_display.hh.

Referenced by blender::ed::outliner::AbstractTreeDisplay::add_element_impl().

◆ owner_id

ID* blender::ed::outliner::TreeElementAddParams::owner_id = nullptr

The ID owning the data this element represents, for element types that don't get it passed as construction data (e.g. TreeElementAnimData, which is constructed from the AnimData alone). Types that can derive it from their own construction data define a static owner_id() instead, and callers don't have to repeat it, see #AbstractTreeDisplay::add_element().

Definition at line 95 of file tree_display.hh.

Referenced by blender::ed::outliner::AbstractTreeDisplay::add_element().

◆ parent

TreeElement* blender::ed::outliner::TreeElementAddParams::parent = nullptr

The parent of the new element. When adding through #AbstractTreeElement::add_element(), null means the element it's called on will be used as parent.

Definition at line 83 of file tree_display.hh.

Referenced by blender::ed::outliner::AbstractTreeDisplay::add_element_impl().

◆ persistent_ptr

const void* blender::ed::outliner::TreeElementAddParams::persistent_ptr = nullptr

The tree-store identity for element types that have no owner ID, and no construction data to derive one from (e.g. TreeElementIDBase). Only needed if the element type does not define owner_id(), see #AbstractTreeDisplay::add_element().

Note
This is stored in #TreeStoreElem.id, which is an ID *. It does not have to point to an actual ID (yikes!), it is only ever compared, never dereferenced. Of course identifying the element over rebuilds won't work for volatile data (like stack variables) and neither will it work over file loads for non-DNA data.

Definition at line 112 of file tree_display.hh.

Referenced by blender::ed::outliner::detail::element_persistent_ptr().


The documentation for this struct was generated from the following file: