diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-22 17:59:28 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-22 17:59:28 +0300 |
commit | 6bcda04d1f1cc396dcc188678997105b09231bde (patch) | |
tree | 3f83a3c86a476408f054755d651e0e6f694500cb /source/blender/functions/FN_field.hh | |
parent | 1f94b56d774440d08eb92f2a7a47b9a6a7aa7b84 (diff) |
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
Diffstat (limited to 'source/blender/functions/FN_field.hh')
-rw-r--r-- | source/blender/functions/FN_field.hh | 11 |
1 files changed, 11 insertions, 0 deletions
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<FieldOperation> Create(std::shared_ptr<const MultiFunction> function, + Vector<GField> inputs = {}) + { + return std::make_shared<FieldOperation>(FieldOperation(std::move(function), inputs)); + } + static std::shared_ptr<FieldOperation> Create(const MultiFunction &function, + Vector<GField> inputs = {}) + { + return std::make_shared<FieldOperation>(FieldOperation(function, inputs)); + } }; class FieldContext; |