From af641d0912d9cfafb71ad4d7ea3b9910080c9e5e Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 2 Sep 2021 16:13:44 -0500 Subject: Add "Index" node --- source/blender/functions/FN_field.hh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/functions') diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh index 744345fd339..d639b355ab9 100644 --- a/source/blender/functions/FN_field.hh +++ b/source/blender/functions/FN_field.hh @@ -266,6 +266,8 @@ class FieldEvaluator : NonMovable, NonCopyable { private: struct OutputPointerInfo { void *dst = nullptr; + /* When a destination virtual array is provided for an input, this is + * unnecessary, otherwise this is used to construct the required virtual array. */ void (*set)(void *dst, const GVArray &varray, ResourceScope &scope) = nullptr; }; @@ -297,7 +299,7 @@ class FieldEvaluator : NonMovable, NonCopyable { return field_index; } - /** Same as above but typed. */ + /** Same as #add_with_destination but typed. */ template int add_with_destination(Field field, VMutableArray &dst) { GVMutableArray &generic_dst_hint = scope_.construct>( @@ -309,6 +311,7 @@ class FieldEvaluator : NonMovable, NonCopyable { * \param field: Field to add to the evaluator. * \param varray_ptr: Once #evaluate is called, the resulting virtual array will be will be * assigned to the given position. + * \return Index of the field in the evaluator which can be used in the #get_evaluated methods. */ template int add(Field field, const VArray **varray_ptr) { @@ -322,7 +325,7 @@ class FieldEvaluator : NonMovable, NonCopyable { } /** - * \return Index of the field in the evaluator. Can be used in the #get_evaluated methods. + * \return Index of the field in the evaluator which can be used in the #get_evaluated methods. */ int add(GField field) { @@ -337,7 +340,7 @@ class FieldEvaluator : NonMovable, NonCopyable { */ void evaluate() { - BLI_assert_msg(!is_evaluated_, "Cannot evaluate twice."); + BLI_assert_msg(!is_evaluated_, "Cannot evaluate fields twice."); Array fields(fields_to_evaluate_.size()); for (const int i : fields_to_evaluate_.index_range()) { fields[i] = &fields_to_evaluate_[i]; -- cgit v1.2.3