Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/functions/FN_field.hh')
-rw-r--r--source/blender/functions/FN_field.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh
index a8136d06c5f..ca12f407e49 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;
@@ -554,6 +565,17 @@ template<typename T> struct ValueOrField {
}
return this->value;
}
+
+ friend std::ostream &operator<<(std::ostream &stream, const ValueOrField<T> &value_or_field)
+ {
+ if (value_or_field.field) {
+ stream << "ValueOrField<T>";
+ }
+ else {
+ stream << value_or_field.value;
+ }
+ return stream;
+ }
};
/** \} */