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

Classes

struct  FieldInferencingInterface
class  NodeDeclaration
class  SocketDeclaration
struct  SocketFieldState

Enumerations

enum class  eFieldStateSyncResult : char { 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 eFieldStateSyncResult sync_field_states (SocketFieldState &a, SocketFieldState &b)
static eFieldStateSyncResult simulation_nodes_field_state_sync (const bNode &input_node, const bNode &output_node, const MutableSpan< SocketFieldState > field_state_by_socket_id)
static eFieldStateSyncResult 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 void update_socket_states (const bNodeTree &tree, 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

◆ eFieldStateSyncResult

Result of syncing two field states.

Enumerator
NONE 
CHANGED_A 
CHANGED_B 

Definition at line 271 of file node_tree_field_inferencing.cc.

◆ InputSocketFieldType

Definition at line 29 of file NOD_node_declaration.hh.

◆ OutputSocketFieldType

Definition at line 38 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

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

Vector< const bNodeSocket * > blender::bke::node_field_inferencing::gather_input_socket_dependencies ( const OutputFieldDependency & field_dependency,
const bNode & node )
static

◆ get_dummy_field_inferencing_interface()

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

◆ get_interface_input_field_type()

◆ get_interface_output_field_dependency()

OutputFieldDependency blender::bke::node_field_inferencing::get_interface_output_field_dependency ( const bNode & node,
const bNodeSocket & socket )
static

◆ 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 120 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(), bNode::id, blender::bke::node_tree_is_registered(), and bNodeTree::runtime.

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

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

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

eFieldStateSyncResult 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
eFieldStateSyncResult flags indicating which field states have changed.

Definition at line 312 of file node_tree_field_inferencing.cc.

References NONE, and sync_field_states().

Referenced by propagate_special_data_requirements().

◆ sync_field_states()

eFieldStateSyncResult 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
eFieldStateSyncResult flags indicating which field states have changed.

Definition at line 286 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()

◆ update_socket_states()

void blender::bke::node_field_inferencing::update_socket_states ( const bNodeTree & tree,
const Span< SocketFieldState > field_state_by_socket_id )
static