Geometry Nodes: use lazy-function directly for switch node #105696
@ -221,9 +221,7 @@ class GeometryNodesLazyFunctionLogger : public fn::lazy_function::GraphExecutor:
|
||||
const lf::Context &context) const override;
|
||||
};
|
||||
|
||||
namespace node_geo_switch_cc {
|
||||
std::unique_ptr<LazyFunction> get_switch_node_lazy_function(const bNode &node);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells the lazy-function graph evaluator which nodes have side effects based on the current
|
||||
|
@ -253,12 +253,18 @@ class LazyFunctionForSwitchNode : public LazyFunction {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace blender::nodes::node_geo_switch_cc
|
||||
|
||||
namespace blender::nodes {
|
||||
|
||||
std::unique_ptr<LazyFunction> get_switch_node_lazy_function(const bNode &node)
|
||||
{
|
||||
using namespace node_geo_switch_cc;
|
||||
BLI_assert(node.type == GEO_NODE_SWITCH);
|
||||
return std::make_unique<LazyFunctionForSwitchNode>(node);
|
||||
}
|
||||
} // namespace blender::nodes::node_geo_switch_cc
|
||||
|
||||
} // namespace blender::nodes
|
||||
|
||||
void register_node_type_geo_switch()
|
||||
{
|
||||
|
@ -1575,8 +1575,7 @@ struct GeometryNodesLazyFunctionGraphBuilder {
|
||||
|
||||
void handle_switch_node(const bNode &bnode)
|
||||
{
|
||||
std::unique_ptr<LazyFunction> lazy_function =
|
||||
node_geo_switch_cc::get_switch_node_lazy_function(bnode);
|
||||
std::unique_ptr<LazyFunction> lazy_function = get_switch_node_lazy_function(bnode);
|
||||
lf::FunctionNode &lf_node = lf_graph_->add_function(*lazy_function);
|
||||
lf_graph_info_->functions.append(std::move(lazy_function));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user
I'm not sure how I feel about these unity build namespaces leaking to separate files. Maybe the public function from that file should be in the
blender::nodes
namespace like other cases. Orblender::nodes::geometry
? (though that could be done elsewhere too)