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:
authorJulian Eisel <julian@blender.org>2021-11-04 16:50:48 +0300
committerJulian Eisel <julian@blender.org>2021-11-04 16:50:48 +0300
commit8eff1eca52f2be8df077811a4c16e49b5e799a1e (patch)
tree9765f189364988ce63d497763134e8f53f709363 /source/blender/nodes
parentc641107c9580d684d78898bb676ec5dddcad17f5 (diff)
parentbe4478d1f8b6c75b50c951f02cf0116f78e68d6d (diff)
Merge remote-tracking branch 'origin/blender-v3.0-release'
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/NOD_math_functions.hh2
-rw-r--r--source/blender/nodes/NOD_node_declaration.hh13
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_curves.cc2
3 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/nodes/NOD_math_functions.hh b/source/blender/nodes/NOD_math_functions.hh
index 9443be820d1..86ff8cab3e9 100644
--- a/source/blender/nodes/NOD_math_functions.hh
+++ b/source/blender/nodes/NOD_math_functions.hh
@@ -193,7 +193,7 @@ inline bool try_dispatch_float_math_fl_fl_fl_to_fl(const int operation, Callback
case NODE_MATH_SMOOTH_MIN:
return dispatch([](float a, float b, float c) { return smoothminf(a, b, c); });
case NODE_MATH_SMOOTH_MAX:
- return dispatch([](float a, float b, float c) { return -smoothminf(-a, -b, -c); });
+ return dispatch([](float a, float b, float c) { return -smoothminf(-a, -b, c); });
case NODE_MATH_WRAP:
return dispatch([](float a, float b, float c) { return wrapf(a, b, c); });
}
diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh
index 1481e69c00e..e9f2996bb30 100644
--- a/source/blender/nodes/NOD_node_declaration.hh
+++ b/source/blender/nodes/NOD_node_declaration.hh
@@ -89,6 +89,7 @@ class SocketDeclaration {
bool is_multi_input_ = false;
bool no_mute_links_ = false;
bool is_attribute_name_ = false;
+ bool is_default_link_socket_ = false;
InputSocketFieldType input_field_type_ = InputSocketFieldType::None;
OutputFieldDependency output_field_dependency_;
@@ -107,6 +108,7 @@ class SocketDeclaration {
StringRefNull description() const;
StringRefNull identifier() const;
bool is_attribute_name() const;
+ bool is_default_link_socket() const;
InputSocketFieldType input_field_type() const;
const OutputFieldDependency &output_field_dependency() const;
@@ -171,6 +173,12 @@ class SocketDeclarationBuilder : public BaseSocketDeclarationBuilder {
return *(Self *)this;
}
+ Self &is_default_link_socket(bool value = true)
+ {
+ decl_->is_default_link_socket_ = value;
+ return *(Self *)this;
+ }
+
/** The input socket allows passing in a field. */
Self &supports_field()
{
@@ -363,6 +371,11 @@ inline bool SocketDeclaration::is_attribute_name() const
return is_attribute_name_;
}
+inline bool SocketDeclaration::is_default_link_socket() const
+{
+ return is_default_link_socket_;
+}
+
inline InputSocketFieldType SocketDeclaration::input_field_type() const
{
return input_field_type_;
diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.cc b/source/blender/nodes/shader/nodes/node_shader_curves.cc
index f8f0ee97eae..7ce5150bf85 100644
--- a/source/blender/nodes/shader/nodes/node_shader_curves.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_curves.cc
@@ -357,7 +357,7 @@ static void sh_node_curve_float_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.default_value(1.0f)
.subtype(PROP_FACTOR);
- b.add_input<decl::Float>(N_("Value")).default_value(1.0f);
+ b.add_input<decl::Float>(N_("Value")).default_value(1.0f).is_default_link_socket();
b.add_output<decl::Float>(N_("Value"));
};