Blender V5.0
geometry_nodes_lazy_function.cc File Reference

Go to the source code of this file.

Classes

class  blender::nodes::LazyFunctionForGeometryNode
class  blender::nodes::LazyFunctionForMultiInput
class  blender::nodes::LazyFunctionForRerouteNode
class  blender::nodes::LazyFunctionForUndefinedNode
class  blender::nodes::LazyFunctionForImplicitConversion
class  blender::nodes::LazyFunctionForMutedNode
class  blender::nodes::LazyFunctionForMultiFunctionNode
class  blender::nodes::LazyFunctionForImplicitInput
class  blender::nodes::LazyFunctionForViewerNode
class  blender::nodes::LazyFunctionForViewerInputUsage
class  blender::nodes::LazyFunctionForGizmoNode
class  blender::nodes::LazyFunctionForGizmoInputsUsage
class  blender::nodes::LazyFunctionForSimulationInputsUsage
class  blender::nodes::LazyFunctionForBakeInputsUsage
class  blender::nodes::LazyFunctionForGroupNode
class  blender::nodes::LazyFunctionForSwitchSocketUsage
class  blender::nodes::LazyFunctionForEnableOutputSocketUsage
class  blender::nodes::LazyFunctionForIndexSwitchSocketUsage
class  blender::nodes::LazyFunctionForExtractingReferenceSet
class  blender::nodes::LazyFunctionForJoinReferenceSets
class  blender::nodes::LazyFunctionForSimulationZone
struct  blender::nodes::BuildGraphParams
class  blender::nodes::GeometryNodesLazyFunctionLogger
class  blender::nodes::GeometryNodesLazyFunctionSideEffectProvider
struct  blender::nodes::GeometryNodesLazyFunctionBuilder
class  blender::nodes::bNodeTreeZone
class  blender::nodes::bNodeTreeZones
struct  blender::nodes::ReferenceLifetimesInfo

Namespaces

namespace  blender
namespace  blender::nodes

Typedefs

using blender::nodes::JoinReferenceSetsCache = Map<Vector<lf::OutputSocket *>, lf::OutputSocket *>

Enumerations

enum class  blender::nodes::ReferenceSetType

Functions

static void blender::nodes::lazy_function_interface_from_node (const bNode &node, Vector< lf::Input > &r_inputs, Vector< lf::Output > &r_outputs, MutableSpan< int > r_lf_index_by_bsocket)
void blender::nodes::construct_socket_default_value (const bke::bNodeSocketType &stype, void *r_value)
void blender::nodes::set_default_value_for_output_socket (lf::Params &params, const int lf_index, const bNodeSocket &bsocket)
void blender::nodes::set_default_remaining_node_outputs (lf::Params &params, const bNode &node)
std::string blender::nodes::make_anonymous_attribute_socket_inspection_string (const bNodeSocket &socket)
std::string blender::nodes::make_anonymous_attribute_socket_inspection_string (StringRef node_name, StringRef socket_name)
static void blender::nodes::execute_multi_function_on_value_variant__single (const MultiFunction &fn, const Span< SocketValueVariant * > input_values, const Span< SocketValueVariant * > output_values, GeoNodesUserData *user_data)
static void blender::nodes::execute_multi_function_on_value_variant__field (const MultiFunction &fn, const std::shared_ptr< MultiFunction > &owned_fn, const Span< SocketValueVariant * > input_values, const Span< SocketValueVariant * > output_values)
bool blender::nodes::execute_multi_function_on_value_variant (const MultiFunction &fn, const std::shared_ptr< MultiFunction > &owned_fn, const Span< SocketValueVariant * > input_values, const Span< SocketValueVariant * > output_values, GeoNodesUserData *user_data, std::string &r_error_message)
std::optional< SocketValueVariantblender::nodes::implicitly_convert_socket_value (const bke::bNodeSocketType &from_type, const SocketValueVariant &from_value, const bke::bNodeSocketType &to_type)
const LazyFunctionblender::nodes::build_implicit_conversion_lazy_function (const bke::bNodeSocketType &from_type, const bke::bNodeSocketType &to_type, ResourceScope &scope)
static bool blender::nodes::gizmo_is_used (const GeoNodesUserData &user_data, const lf::FunctionNode &lf_gizmo_node)
bool blender::nodes::should_log_socket_values_for_context (const GeoNodesUserData &user_data, const ComputeContextHash hash)
void blender::nodes::report_from_multi_function (const mf::Context &context, NodeWarningType type, std::string message)
static bool blender::nodes::ignore_zone_bsocket (const bNodeSocket &bsocket)
void blender::nodes::initialize_zone_wrapper (const bNodeTreeZone &zone, ZoneBuildInfo &zone_info, const ZoneBodyFunction &body_fn, const bool expose_all_reference_sets, Vector< lf::Input > &r_inputs, Vector< lf::Output > &r_outputs)
std::string blender::nodes::zone_wrapper_input_name (const ZoneBuildInfo &zone_info, const bNodeTreeZone &zone, const Span< lf::Input > inputs, const int lf_socket_i)
std::string blender::nodes::zone_wrapper_output_name (const ZoneBuildInfo &zone_info, const bNodeTreeZone &zone, const Span< lf::Output > outputs, const int lf_socket_i)
static std::unique_ptr< GeometryNodesLazyFunctionGraphInfoblender::nodes::ensure_geometry_nodes_lazy_function_graph_impl (const bNodeTree &btree)
const GeometryNodesLazyFunctionGraphInfoblender::nodes::ensure_geometry_nodes_lazy_function_graph (const bNodeTree &btree)
std::optional< FoundNestedNodeIDblender::nodes::find_nested_node_id (const GeoNodesUserData &user_data, const int node_id)
static const IDblender::nodes::get_only_evaluated_id (const Depsgraph &depsgraph, const ID &id_orig)

Detailed Description

This file mainly converts a bNodeTree into a lazy-function graph, that can then be evaluated to execute geometry nodes. This generally works by creating a lazy-function for every node, which is then put into the lazy-function graph. Then the nodes in the new graph are linked based on links in the original bNodeTree. Some additional nodes are inserted for things like type conversions and multi-input sockets.

If the bNodeTree contains zones, those are turned into separate lazy-functions first. Essentially, a separate lazy-function graph is created for every zone that is than called by the parent zone or by the root graph.

Currently, lazy-functions are even created for nodes that don't strictly require it, like reroutes or muted nodes. In the future we could avoid that at the cost of additional code complexity. So far, this does not seem to be a performance issue.

Definition in file geometry_nodes_lazy_function.cc.