Blender V5.0
blender::bke::node_field_inferencing Namespace Reference

Classes

struct  SocketFieldState
struct  FieldInferencingInterface
class  NodeDeclaration
class  OutputFieldDependency
class  SocketDeclaration

Enumerations

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

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.

◆ InputSocketFieldType

enum class blender::nodes::InputSocketFieldType : int8_t
strong

Definition at line 34 of file NOD_node_declaration.hh.

◆ OutputSocketFieldType

enum class blender::nodes::OutputSocketFieldType : int8_t
strong

Definition at line 43 of file NOD_node_declaration.hh.

Function Documentation

◆ all_dangling_reroutes()

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

◆ calc_socket_states()

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()

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()

◆ get_interface_input_field_type()

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()

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(), i, bNode::id, blender::Span< T >::index_range(), bNode::inputs, blender::bke::node_tree_is_registered(), bNode::outputs, bNodeTree::runtime, and blender::Span< T >::size().

Referenced by prepare_inferencing_interfaces().

◆ is_field_socket_type()

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

◆ prepare_inferencing_interfaces()

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

Definition at line 699 of file node_tree_field_inferencing.cc.

References get_node_field_inferencing_interface(), and i.

Referenced by update_field_inferencing().

◆ propagate_data_requirements_from_right_to_left()

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()

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()

◆ repeat_field_state_sync()

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()

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 i, NONE, and sync_field_states().

Referenced by propagate_special_data_requirements().

◆ sync_field_states()

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, if(), NONE, and sync_field_states().

Referenced by repeat_field_state_sync(), simulation_nodes_field_state_sync(), and sync_field_states().

◆ update_field_inferencing()