Blender V4.5
blender::bke::node_field_inferencing Namespace Reference

Classes

struct  SocketFieldState
 

Enumerations

enum class  FieldStateSyncResult : int8_t { NONE = 0 , CHANGED_A = (1 << 0) , CHANGED_B = (1 << 1) }
 

Functions

bool update_field_inferencing (const bNodeTree &tree)
 
static bool is_field_socket_type (const bNodeSocket &socket)
 
static bool all_dangling_reroutes (const Span< const bNodeSocket * > sockets)
 
static InputSocketFieldType get_interface_input_field_type (const bNode &node, const bNodeSocket &socket)
 
static OutputFieldDependency get_interface_output_field_dependency (const bNode &node, const bNodeSocket &socket)
 
static const FieldInferencingInterfaceget_dummy_field_inferencing_interface (const bNode &node, ResourceScope &scope)
 
static const FieldInferencingInterfaceget_node_field_inferencing_interface (const bNode &node, ResourceScope &scope)
 
static Vector< const bNodeSocket * > gather_input_socket_dependencies (const OutputFieldDependency &field_dependency, const bNode &node)
 
static OutputFieldDependency find_group_output_dependencies (const bNodeSocket &group_output_socket, const Span< const FieldInferencingInterface * > interface_by_node, const Span< SocketFieldState > field_state_by_socket_id)
 
static FieldStateSyncResult sync_field_states (SocketFieldState &a, SocketFieldState &b)
 
static FieldStateSyncResult simulation_nodes_field_state_sync (const bNode &input_node, const bNode &output_node, const MutableSpan< SocketFieldState > field_state_by_socket_id)
 
static FieldStateSyncResult repeat_field_state_sync (const bNode &input_node, const bNode &output_node, const MutableSpan< SocketFieldState > field_state_by_socket_id)
 
static bool propagate_special_data_requirements (const bNodeTree &tree, const bNode &node, const MutableSpan< SocketFieldState > field_state_by_socket_id)
 
static void propagate_data_requirements_from_right_to_left (const bNodeTree &tree, const Span< const FieldInferencingInterface * > interface_by_node, const MutableSpan< SocketFieldState > field_state_by_socket_id)
 
static void determine_group_input_states (const bNodeTree &tree, FieldInferencingInterface &new_inferencing_interface, const MutableSpan< SocketFieldState > field_state_by_socket_id)
 
static void propagate_field_status_from_left_to_right (const bNodeTree &tree, const Span< const FieldInferencingInterface * > interface_by_node, const MutableSpan< SocketFieldState > field_state_by_socket_id)
 
static void determine_group_output_states (const bNodeTree &tree, FieldInferencingInterface &new_inferencing_interface, const Span< const FieldInferencingInterface * > interface_by_node, const Span< SocketFieldState > field_state_by_socket_id)
 
static Array< FieldSocketStatecalc_socket_states (const Span< SocketFieldState > field_state_by_socket_id)
 
static void prepare_inferencing_interfaces (const Span< const bNode * > nodes, MutableSpan< const FieldInferencingInterface * > interface_by_node, ResourceScope &scope)
 

Enumeration Type Documentation

◆ FieldStateSyncResult

Result of syncing two field states.

Enumerator
NONE 
CHANGED_A 
CHANGED_B 

Definition at line 277 of file node_tree_field_inferencing.cc.

Function Documentation

◆ all_dangling_reroutes()

static bool blender::bke::node_field_inferencing::all_dangling_reroutes ( const Span< const bNodeSocket * > sockets)
static

◆ calc_socket_states()

static Array< FieldSocketState > blender::bke::node_field_inferencing::calc_socket_states ( const Span< SocketFieldState > field_state_by_socket_id)
static

◆ determine_group_input_states()

◆ determine_group_output_states()

static void blender::bke::node_field_inferencing::determine_group_output_states ( const bNodeTree & tree,
FieldInferencingInterface & new_inferencing_interface,
const Span< const FieldInferencingInterface * > interface_by_node,
const Span< SocketFieldState > field_state_by_socket_id )
static

◆ find_group_output_dependencies()

◆ gather_input_socket_dependencies()

◆ get_dummy_field_inferencing_interface()

static const FieldInferencingInterface & blender::bke::node_field_inferencing::get_dummy_field_inferencing_interface ( const bNode & node,
ResourceScope & scope )
static

◆ get_interface_input_field_type()

static InputSocketFieldType blender::bke::node_field_inferencing::get_interface_input_field_type ( const bNode & node,
const bNodeSocket & socket )
static

◆ get_interface_output_field_dependency()

◆ get_node_field_inferencing_interface()

static const FieldInferencingInterface & blender::bke::node_field_inferencing::get_node_field_inferencing_interface ( const bNode & node,
ResourceScope & scope )
static

Retrieves information about how the node interacts with fields. In the future, this information can be stored in the node declaration. This would allow this function to return a reference, making it more efficient.

Definition at line 121 of file node_tree_field_inferencing.cc.

References BLI_assert_unreachable, blender::ResourceScope::construct(), get_dummy_field_inferencing_interface(), get_interface_input_field_type(), get_interface_output_field_dependency(), bNodeTree::id, blender::Span< T >::index_range(), node, blender::bke::node_tree_is_registered(), bNodeTree::runtime, and blender::Span< T >::size().

Referenced by prepare_inferencing_interfaces().

◆ is_field_socket_type()

static bool blender::bke::node_field_inferencing::is_field_socket_type ( const bNodeSocket & socket)
static

◆ prepare_inferencing_interfaces()

static void blender::bke::node_field_inferencing::prepare_inferencing_interfaces ( const Span< const bNode * > nodes,
MutableSpan< const FieldInferencingInterface * > interface_by_node,
ResourceScope & scope )
static

◆ propagate_data_requirements_from_right_to_left()

static void blender::bke::node_field_inferencing::propagate_data_requirements_from_right_to_left ( const bNodeTree & tree,
const Span< const FieldInferencingInterface * > interface_by_node,
const MutableSpan< SocketFieldState > field_state_by_socket_id )
static

◆ propagate_field_status_from_left_to_right()

static void blender::bke::node_field_inferencing::propagate_field_status_from_left_to_right ( const bNodeTree & tree,
const Span< const FieldInferencingInterface * > interface_by_node,
const MutableSpan< SocketFieldState > field_state_by_socket_id )
static

◆ propagate_special_data_requirements()

static bool blender::bke::node_field_inferencing::propagate_special_data_requirements ( const bNodeTree & tree,
const bNode & node,
const MutableSpan< SocketFieldState > field_state_by_socket_id )
static

◆ repeat_field_state_sync()

static FieldStateSyncResult blender::bke::node_field_inferencing::repeat_field_state_sync ( const bNode & input_node,
const bNode & output_node,
const MutableSpan< SocketFieldState > field_state_by_socket_id )
static

◆ simulation_nodes_field_state_sync()

static FieldStateSyncResult blender::bke::node_field_inferencing::simulation_nodes_field_state_sync ( const bNode & input_node,
const bNode & output_node,
const MutableSpan< SocketFieldState > field_state_by_socket_id )
static

Compare field states of simulation nodes sockets and select the most compatible. Afterwards all field states will be the same.

Returns
FieldStateSyncResult flags indicating which field states have changed.

Definition at line 318 of file node_tree_field_inferencing.cc.

References NONE, and sync_field_states().

Referenced by propagate_special_data_requirements().

◆ sync_field_states()

static FieldStateSyncResult blender::bke::node_field_inferencing::sync_field_states ( SocketFieldState & a,
SocketFieldState & b )
static

Compare both field states and select the most compatible. Afterwards both field states will be the same.

Returns
FieldStateSyncResult flags indicating which field states have changed.

Definition at line 292 of file node_tree_field_inferencing.cc.

References b, CHANGED_A, CHANGED_B, and NONE.

Referenced by repeat_field_state_sync(), and simulation_nodes_field_state_sync().

◆ update_field_inferencing()