From 6bcda04d1f1cc396dcc188678997105b09231bde Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 22 Jul 2022 09:59:28 -0500 Subject: Geometry Nodes: Port sample curves node to new data-block Use the newer more generic sampling and interpolation functions developed recently (ab444a80a280) instead of the `CurveEval` type. Functions are split up a bit more internally, to allow a separate mode for supplying the curve index directly in the future (T92474). In one basic test, the performance seems mostly unchanged from 3.1. Differential Revision: https://developer.blender.org/D14621 --- source/blender/functions/FN_field.hh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/functions/FN_field.hh') diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh index a8136d06c5f..bc42cab8db5 100644 --- a/source/blender/functions/FN_field.hh +++ b/source/blender/functions/FN_field.hh @@ -221,6 +221,17 @@ class FieldOperation : public FieldNode { const MultiFunction &multi_function() const; const CPPType &output_cpp_type(int output_index) const override; + + static std::shared_ptr Create(std::shared_ptr function, + Vector inputs = {}) + { + return std::make_shared(FieldOperation(std::move(function), inputs)); + } + static std::shared_ptr Create(const MultiFunction &function, + Vector inputs = {}) + { + return std::make_shared(FieldOperation(function, inputs)); + } }; class FieldContext; -- cgit v1.2.3