Blender V5.0
blender::bke::bNodeTreeRuntime Class Reference

#include <BKE_node_runtime.hh>

Inherits blender::NonCopyable, and blender::NonMovable.

Public Attributes

uint32_t changed_flag = 0
uint32_t output_topology_hash = 0
uint8_t runtime_flag = 0
uint32_t previews_refresh_state = 0
std::unique_ptr< LoggedZoneGraphslogged_zone_graphs
NodeIDVectorSet nodes_by_id
bNodeTreeExecexecdata = nullptr
void(* progress )(void *, float progress) = nullptr
void(* stats_draw )(void *, const char *str) = nullptr
bool(* test_break )(void *) = nullptr
void(* update_draw )(void *) = nullptr
void * tbh = nullptr
void * prh = nullptr
void * sdh = nullptr
void * udh = nullptr
std::unique_ptr< nodes::FieldInferencingInterfacefield_inferencing_interface
Array< FieldSocketStatefield_states
std::unique_ptr< node_tree_reference_lifetimes::ReferenceLifetimesInforeference_lifetimes_info
std::unique_ptr< nodes::gizmos::TreeGizmoPropagationgizmo_propagation
std::unique_ptr< nodes::StructureTypeInterfacestructure_type_interface
blender::Array< nodes::socket_usage_inference::SocketUsageinferenced_socket_usage
CacheMutex inferenced_input_socket_usage_mutex
CacheMutex geometry_nodes_lazy_function_graph_info_mutex
std::unique_ptr< nodes::GeometryNodesLazyFunctionGraphInfogeometry_nodes_lazy_function_graph_info
MultiValueMap< NodeLinkKey, NodeLinkErrorlink_errors
Map< int32_t, VectorSet< std::string > > shader_node_errors
Mutex shader_node_errors_mutex
CacheMutex topology_cache_mutex
std::atomic< bool > topology_cache_exists = false
std::atomic< int > allow_use_dirty_topology_cache = 0
CacheMutex tree_zones_cache_mutex
std::shared_ptr< bNodeTreeZonestree_zones
std::shared_ptr< bNodeTreeZoneslast_valid_zones
Set< int > invalid_zone_output_node_ids
Set< const bNodeSocket * > sockets_on_active_gizmo_paths
std::unique_ptr< nodes::GeometryNodesEvalDependenciesgeometry_nodes_eval_dependencies
Map< bNodeInstanceKey, bNodePreviewpreviews
Vector< bNodeLink * > links
Vector< bNodeSocket * > sockets
Vector< bNodeSocket * > input_sockets
Vector< bNodeSocket * > output_sockets
MultiValueMap< const bNodeType *, bNode * > nodes_by_type
Vector< bNode * > toposort_left_to_right
Vector< bNode * > toposort_right_to_left
Vector< bNode * > group_nodes
bool has_available_link_cycle = false
bool has_undefined_nodes_or_sockets = false
bNodegroup_output_node = nullptr
Vector< bNode * > root_frames

Detailed Description

Runtime data for bNodeTree from the perspective of execution instructions (rather than runtime data from evaluation of the node tree). Evaluation data is not the responsibility of the node tree and should be stored elsewhere. Evaluating a node tree should be possible without changing it.

Definition at line 120 of file BKE_node_runtime.hh.

Member Data Documentation

◆ allow_use_dirty_topology_cache

std::atomic<int> blender::bke::bNodeTreeRuntime::allow_use_dirty_topology_cache = 0
mutable

Under some circumstances, it can be useful to use the cached data while editing the bNodeTree. By default, this is protected against using an assert.

Definition at line 220 of file BKE_node_runtime.hh.

◆ changed_flag

uint32_t blender::bke::bNodeTreeRuntime::changed_flag = 0

Keeps track of what changed in the node tree until the next update. Should not be changed directly, instead use the functions in BKE_node_tree_update.hh. eNodeTreeChangedFlag.

Definition at line 127 of file BKE_node_runtime.hh.

◆ execdata

bNodeTreeExec* blender::bke::bNodeTreeRuntime::execdata = nullptr

Legacy execution data.

Todo
Move this out of the node tree to improve semantic/physical separation between the node tree execution instructions and its evaluation.

Definition at line 162 of file BKE_node_runtime.hh.

◆ field_inferencing_interface

std::unique_ptr<nodes::FieldInferencingInterface> blender::bke::bNodeTreeRuntime::field_inferencing_interface

Information about how inputs and outputs of the node group interact with fields.

Definition at line 173 of file BKE_node_runtime.hh.

Referenced by blender::bke::ntree_copy_data().

◆ field_states

Array<FieldSocketState> blender::bke::bNodeTreeRuntime::field_states

Field status for every socket, accessed with #bNodeSocket::index_in_tree().

Definition at line 175 of file BKE_node_runtime.hh.

◆ geometry_nodes_eval_dependencies

std::unique_ptr<nodes::GeometryNodesEvalDependencies> blender::bke::bNodeTreeRuntime::geometry_nodes_eval_dependencies

Cache of dependencies used by the node tree itself. Does not account for data that's passed into the node tree from the outside. NOTE: The node tree may reference additional data-blocks besides the ones included here. But those are not used when the node tree is evaluated by Geometry Nodes.

Definition at line 244 of file BKE_node_runtime.hh.

◆ geometry_nodes_lazy_function_graph_info

std::unique_ptr<nodes::GeometryNodesLazyFunctionGraphInfo> blender::bke::bNodeTreeRuntime::geometry_nodes_lazy_function_graph_info

Definition at line 195 of file BKE_node_runtime.hh.

◆ geometry_nodes_lazy_function_graph_info_mutex

CacheMutex blender::bke::bNodeTreeRuntime::geometry_nodes_lazy_function_graph_info_mutex

For geometry nodes, a lazy function graph with some additional info is cached. This is used to evaluate the node group. Caching it here allows us to reuse the preprocessed node tree in case its used multiple times.

Definition at line 193 of file BKE_node_runtime.hh.

◆ gizmo_propagation

std::unique_ptr<nodes::gizmos::TreeGizmoPropagation> blender::bke::bNodeTreeRuntime::gizmo_propagation

Definition at line 178 of file BKE_node_runtime.hh.

◆ group_nodes

Vector<bNode *> blender::bke::bNodeTreeRuntime::group_nodes

◆ group_output_node

bNode* blender::bke::bNodeTreeRuntime::group_output_node = nullptr

◆ has_available_link_cycle

bool blender::bke::bNodeTreeRuntime::has_available_link_cycle = false

Definition at line 261 of file BKE_node_runtime.hh.

◆ has_undefined_nodes_or_sockets

bool blender::bke::bNodeTreeRuntime::has_undefined_nodes_or_sockets = false

◆ inferenced_input_socket_usage_mutex

CacheMutex blender::bke::bNodeTreeRuntime::inferenced_input_socket_usage_mutex

Definition at line 186 of file BKE_node_runtime.hh.

◆ inferenced_socket_usage

blender::Array<nodes::socket_usage_inference::SocketUsage> blender::bke::bNodeTreeRuntime::inferenced_socket_usage

Indexed by #bNodeSocket::index_in_tree(). Contains information about whether the socket is used or visible.

Definition at line 185 of file BKE_node_runtime.hh.

◆ input_sockets

◆ invalid_zone_output_node_ids

Set<int> blender::bke::bNodeTreeRuntime::invalid_zone_output_node_ids

Definition at line 230 of file BKE_node_runtime.hh.

◆ last_valid_zones

std::shared_ptr<bNodeTreeZones> blender::bke::bNodeTreeRuntime::last_valid_zones

Same as tree_zones, but may not be valid anymore. This is used for drawing errors when the zone detection failed.

Definition at line 229 of file BKE_node_runtime.hh.

◆ link_errors

MultiValueMap<NodeLinkKey, NodeLinkError> blender::bke::bNodeTreeRuntime::link_errors

Stores information about invalid links. This information is then displayed to the user. This is updated in #update_link_validation and is valid during drawing code.

Definition at line 201 of file BKE_node_runtime.hh.

◆ links

Vector<bNodeLink *> blender::bke::bNodeTreeRuntime::links

Only valid when #topology_cache_is_dirty is false.

Definition at line 253 of file BKE_node_runtime.hh.

Referenced by blender::bke::node_tree_runtime::update_directly_linked_links_and_sockets(), and blender::bke::node_tree_runtime::update_link_vector().

◆ logged_zone_graphs

std::unique_ptr<LoggedZoneGraphs> blender::bke::bNodeTreeRuntime::logged_zone_graphs

Allows logging zone graphs purely for debugging purposes.

Definition at line 147 of file BKE_node_runtime.hh.

◆ nodes_by_id

◆ nodes_by_type

MultiValueMap<const bNodeType *, bNode *> blender::bke::bNodeTreeRuntime::nodes_by_type

◆ output_sockets

Vector<bNodeSocket *> blender::bke::bNodeTreeRuntime::output_sockets

◆ output_topology_hash

uint32_t blender::bke::bNodeTreeRuntime::output_topology_hash = 0

A hash of the topology of the node tree leading up to the outputs. This is used to determine of the node tree changed in a way that requires updating geometry nodes or shaders.

Definition at line 132 of file BKE_node_runtime.hh.

◆ previews

Map<bNodeInstanceKey, bNodePreview> blender::bke::bNodeTreeRuntime::previews

Node previews for the compositor. Only available in base node trees (e.g. scene->compositing_node_group).

Definition at line 250 of file BKE_node_runtime.hh.

Referenced by blender::bke::ntree_copy_data().

◆ previews_refresh_state

uint32_t blender::bke::bNodeTreeRuntime::previews_refresh_state = 0

Contains a number increased for each node-tree update. Store a state variable in the NestedTreePreviews structure to compare if they differ.

Definition at line 144 of file BKE_node_runtime.hh.

◆ prh

void * blender::bke::bNodeTreeRuntime::prh = nullptr

Definition at line 168 of file BKE_node_runtime.hh.

◆ progress

void(* blender::bke::bNodeTreeRuntime::progress) (void *, float progress) = nullptr

Definition at line 163 of file BKE_node_runtime.hh.

◆ reference_lifetimes_info

std::unique_ptr<node_tree_reference_lifetimes::ReferenceLifetimesInfo> blender::bke::bNodeTreeRuntime::reference_lifetimes_info

Information about usage of anonymous attributes within the group.

Definition at line 177 of file BKE_node_runtime.hh.

Referenced by blender::bke::ntree_copy_data().

◆ root_frames

Vector<bNode *> blender::bke::bNodeTreeRuntime::root_frames

◆ runtime_flag

uint8_t blender::bke::bNodeTreeRuntime::runtime_flag = 0

Used to cache run-time information of the node tree. eNodeTreeRuntimeFlag.

Definition at line 138 of file BKE_node_runtime.hh.

◆ sdh

void * blender::bke::bNodeTreeRuntime::sdh = nullptr

Definition at line 168 of file BKE_node_runtime.hh.

◆ shader_node_errors

Map<int32_t, VectorSet<std::string> > blender::bke::bNodeTreeRuntime::shader_node_errors

Error messages for shading nodes. Those don't have more contextual information yet. Maps bNode::identifier to error messages.

Definition at line 207 of file BKE_node_runtime.hh.

◆ shader_node_errors_mutex

Mutex blender::bke::bNodeTreeRuntime::shader_node_errors_mutex

Definition at line 208 of file BKE_node_runtime.hh.

◆ sockets

Vector<bNodeSocket *> blender::bke::bNodeTreeRuntime::sockets

◆ sockets_on_active_gizmo_paths

Set<const bNodeSocket *> blender::bke::bNodeTreeRuntime::sockets_on_active_gizmo_paths

The stored sockets are drawn using a special link to indicate that there is a gizmo. This is only valid during node editor drawing.

Definition at line 236 of file BKE_node_runtime.hh.

◆ stats_draw

void(* blender::bke::bNodeTreeRuntime::stats_draw) (void *, const char *str) = nullptr
Warning
may be called by different threads

Definition at line 165 of file BKE_node_runtime.hh.

◆ structure_type_interface

std::unique_ptr<nodes::StructureTypeInterface> blender::bke::bNodeTreeRuntime::structure_type_interface

Definition at line 179 of file BKE_node_runtime.hh.

Referenced by blender::bke::ntree_copy_data().

◆ tbh

void* blender::bke::bNodeTreeRuntime::tbh = nullptr

Definition at line 168 of file BKE_node_runtime.hh.

◆ test_break

bool(* blender::bke::bNodeTreeRuntime::test_break) (void *) = nullptr

Definition at line 166 of file BKE_node_runtime.hh.

◆ topology_cache_exists

std::atomic<bool> blender::bke::bNodeTreeRuntime::topology_cache_exists = false

◆ topology_cache_mutex

CacheMutex blender::bke::bNodeTreeRuntime::topology_cache_mutex

Protects access to all topology cache variables below. This is necessary so that the cache can be updated on a const bNodeTree.

Definition at line 214 of file BKE_node_runtime.hh.

Referenced by blender::bke::node_tree_runtime::ensure_topology_cache().

◆ toposort_left_to_right

Vector<bNode *> blender::bke::bNodeTreeRuntime::toposort_left_to_right

Definition at line 258 of file BKE_node_runtime.hh.

◆ toposort_right_to_left

Vector<bNode *> blender::bke::bNodeTreeRuntime::toposort_right_to_left

◆ tree_zones

std::shared_ptr<bNodeTreeZones> blender::bke::bNodeTreeRuntime::tree_zones

Definition at line 223 of file BKE_node_runtime.hh.

◆ tree_zones_cache_mutex

CacheMutex blender::bke::bNodeTreeRuntime::tree_zones_cache_mutex

Definition at line 222 of file BKE_node_runtime.hh.

◆ udh

void * blender::bke::bNodeTreeRuntime::udh = nullptr

Definition at line 168 of file BKE_node_runtime.hh.

◆ update_draw

void(* blender::bke::bNodeTreeRuntime::update_draw) (void *) = nullptr

Definition at line 167 of file BKE_node_runtime.hh.


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