Blender  V3.3
Classes | Namespaces
tree_element_overrides.cc File Reference
#include "BKE_collection.h"
#include "BKE_lib_override.h"
#include "BLI_function_ref.hh"
#include "BLI_listbase_wrapper.hh"
#include "BLI_map.hh"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_space_types.h"
#include "RNA_access.h"
#include "RNA_path.h"
#include "../outliner_intern.hh"
#include "tree_element_label.hh"
#include "tree_element_overrides.hh"

Go to the source code of this file.

Classes

class  blender::ed::outliner::OverrideRNAPathTreeBuilder
 

Namespaces

 blender
 
 blender::ed
 
 blender::ed::outliner
 

Functions

Base Element

Represents an ID that has overridden properties. The expanding will invoke building of tree elements for the full RNA path of the property.

static void blender::ed::outliner::iterate_properties_to_display (ID &id, const bool show_system_overrides, FunctionRef< void(TreeElementOverridesData &data)> fn)
 
Helper to build a hierarchy from an RNA path.

Builds a nice hierarchy representing the nested structs of the override property's RNA path using UI names and icons. For example animation_visualization_mothion_path.frame_end becomes:

  • Animation Visualization

Paths are merged so that each RNA sub-path is only represented once in the tree. So there is some finicky path building going on to create a path -> tree-element map.

This is more complicated than you'd think it needs to be. Mostly because of RNA collection overrides:

  • A single override may add (and in future remove) multiple collection items. So all operations of the override have to be considered.
  • The order of collection items may matter (e.g. for modifiers), so if collection items are added/removed, we want to show all other collection items too, in the right order.
  • If the override is inside some collection item, the collection item has to be built, but the RNA path iterator doesn't
static BIFIconID blender::ed::outliner::get_property_icon (PointerRNA &ptr, PropertyRNA &prop)