diff options
Diffstat (limited to 'source/blender/nodes/NOD_node_declaration.hh')
-rw-r--r-- | source/blender/nodes/NOD_node_declaration.hh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh index 4e78f6c1142..42755b2e8dd 100644 --- a/source/blender/nodes/NOD_node_declaration.hh +++ b/source/blender/nodes/NOD_node_declaration.hh @@ -88,6 +88,18 @@ class SocketDeclaration { InputSocketFieldType input_field_type_ = InputSocketFieldType::None; OutputFieldDependency output_field_dependency_; + /** The priority of the input for determining the domain of the node. See + * realtime_compositor::InputDescriptor for more information. */ + int compositor_domain_priority_ = 0; + + /** This input shouldn't be realized on the operation domain of the node. See + * realtime_compositor::InputDescriptor for more information. */ + bool compositor_skip_realization_ = false; + + /** This input expects a single value and can't operate on non-single values. See + * realtime_compositor::InputDescriptor for more information. */ + bool compositor_expects_single_value_ = false; + /** Utility method to make the socket available if there is a straightforward way to do so. */ std::function<void(bNode &)> make_available_fn_; @@ -124,6 +136,10 @@ class SocketDeclaration { InputSocketFieldType input_field_type() const; const OutputFieldDependency &output_field_dependency() const; + int compositor_domain_priority() const; + bool compositor_skip_realization() const; + bool compositor_expects_single_value() const; + protected: void set_common_flags(bNodeSocket &socket) const; bool matches_common_data(const bNodeSocket &socket) const; @@ -238,6 +254,30 @@ class SocketDeclarationBuilder : public BaseSocketDeclarationBuilder { return *(Self *)this; } + /** The priority of the input for determining the domain of the node. See + * realtime_compositor::InputDescriptor for more information. */ + Self &compositor_domain_priority(int priority) + { + decl_->compositor_domain_priority_ = priority; + return *(Self *)this; + } + + /** This input shouldn't be realized on the operation domain of the node. See + * realtime_compositor::InputDescriptor for more information. */ + Self &compositor_skip_realization(bool value = true) + { + decl_->compositor_skip_realization_ = value; + return *(Self *)this; + } + + /** This input expects a single value and can't operate on non-single values. See + * realtime_compositor::InputDescriptor for more information. */ + Self &compositor_expects_single_value(bool value = true) + { + decl_->compositor_expects_single_value_ = value; + return *(Self *)this; + } + /** * Pass a function that sets properties on the node required to make the corresponding socket * available, if it is not available on the default state of the node. The function is allowed to @@ -428,6 +468,21 @@ inline const OutputFieldDependency &SocketDeclaration::output_field_dependency() return output_field_dependency_; } +inline int SocketDeclaration::compositor_domain_priority() const +{ + return compositor_domain_priority_; +} + +inline bool SocketDeclaration::compositor_skip_realization() const +{ + return compositor_skip_realization_; +} + +inline bool SocketDeclaration::compositor_expects_single_value() const +{ + return compositor_expects_single_value_; +} + inline void SocketDeclaration::make_available(bNode &node) const { if (make_available_fn_) { |