Fix #108456: Missed declaration function in Shortest Edge Paths node

2ffd08e952 introduced new system to control attribute life time.
Some specific function for that system is missed in `Shortest Edge Paths`.
This pull request add this functions:
1. `reference_pass_all` for socket declarations.
2. `for_each_field_input_recursive` for field input nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/108460
This commit is contained in:
Iliya Katueshenock
2023-05-31 15:21:06 +02:00
committed by Hans Goudey
parent eae0a24afb
commit 1706ce032f

View File

@@ -17,8 +17,8 @@ static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Bool>("End Vertex").default_value(false).hide_value().supports_field();
b.add_input<decl::Float>("Edge Cost").default_value(1.0f).hide_value().supports_field();
b.add_output<decl::Int>("Next Vertex Index").field_source();
b.add_output<decl::Float>("Total Cost").field_source();
b.add_output<decl::Int>("Next Vertex Index").reference_pass_all();
b.add_output<decl::Float>("Total Cost").reference_pass_all();
}
typedef std::pair<float, int> VertPriority;
@@ -205,6 +205,12 @@ class ShortestEdgePathsCostFieldInput final : public bke::MeshFieldInput {
VArray<float>::ForContainer(std::move(cost)), ATTR_DOMAIN_POINT, domain);
}
void for_each_field_input_recursive(FunctionRef<void(const FieldInput &)> fn) const override
{
end_selection_.node().for_each_field_input_recursive(fn);
cost_.node().for_each_field_input_recursive(fn);
}
uint64_t hash() const override
{
return get_default_hash_2(end_selection_, cost_);