Blender V4.3
blender::nodes::DerivedNodeTree Class Reference

#include <NOD_derived_node_tree.hh>

Public Member Functions

 DerivedNodeTree (const bNodeTree &btree)
 
 ~DerivedNodeTree ()
 
const DTreeContextactive_context () const
 
bool has_link_cycles () const
 
bool has_undefined_nodes_or_sockets () const
 
void foreach_node (FunctionRef< void(DNode)> callback) const
 
std::string to_dot () const
 
#DerivedNodeTree Inline Methods
const DTreeContextroot_context () const
 
Span< const bNodeTree * > used_btrees () const
 

Detailed Description

Definition at line 179 of file NOD_derived_node_tree.hh.

Constructor & Destructor Documentation

◆ DerivedNodeTree()

blender::nodes::DerivedNodeTree::DerivedNodeTree ( const bNodeTree & btree)

Construct a new derived node tree for a given root node tree. The generated derived node tree does not own the used node tree refs (so that those can be used by others as well). The caller has to make sure that the node tree refs added to #node_tree_refs live at least as long as the derived node tree.

Definition at line 11 of file derived_node_tree.cc.

References blender::bke::NODE_INSTANCE_KEY_BASE.

◆ ~DerivedNodeTree()

blender::nodes::DerivedNodeTree::~DerivedNodeTree ( )

Definition at line 49 of file derived_node_tree.cc.

Member Function Documentation

◆ active_context()

const DTreeContext & blender::nodes::DerivedNodeTree::active_context ( ) const

Returns the active context for the node tree. The active context represents the node tree currently being edited. In most cases, that would be the top level node tree itself, but in the case where the user is editing the node tree of a node group, the active context would be a representation of the node tree of that node group. Note that the context also stores the group node that the user selected to edit the node tree, so the context fully represents a particular instance of the node group.

Definition at line 344 of file derived_node_tree.cc.

References blender::nodes::find_active_context_recursive(), blender::bke::NODE_INSTANCE_KEY_NONE, root_context(), and bNodeInstanceKey::value.

◆ foreach_node()

void blender::nodes::DerivedNodeTree::foreach_node ( FunctionRef< void(DNode)> callback) const

Calls the given callback on all nodes in the (possibly nested) derived node tree.

Definition at line 83 of file derived_node_tree.cc.

References callback.

Referenced by to_dot().

◆ has_link_cycles()

bool blender::nodes::DerivedNodeTree::has_link_cycles ( ) const
Returns
True when there is a link cycle. Unavailable sockets are ignored.

Definition at line 63 of file derived_node_tree.cc.

◆ has_undefined_nodes_or_sockets()

bool blender::nodes::DerivedNodeTree::has_undefined_nodes_or_sockets ( ) const

Definition at line 73 of file derived_node_tree.cc.

◆ root_context()

const DTreeContext & blender::nodes::DerivedNodeTree::root_context ( ) const
inline

Definition at line 437 of file NOD_derived_node_tree.hh.

Referenced by active_context().

◆ to_dot()

◆ used_btrees()

Span< const bNodeTree * > blender::nodes::DerivedNodeTree::used_btrees ( ) const
inline

Definition at line 442 of file NOD_derived_node_tree.hh.


The documentation for this class was generated from the following files: