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/nodes/shader/nodes/node_shader_math.cc')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_math.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_math.cc b/source/blender/nodes/shader/nodes/node_shader_math.cc
index 51c94b10c8b..da237be273f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_math.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_math.cc
@@ -48,10 +48,13 @@ static void sh_node_math_declare(NodeDeclarationBuilder &b)
static void sh_node_math_gather_link_searches(GatherLinkSearchOpParams &params)
{
/* For now, do something very basic (only exposing "Add", and a single "Value" socket). */
- params.add_item(IFACE_("Value"), [](LinkSearchOpParams &params) {
- bNode &node = params.add_node("ShaderNodeMath");
- params.update_and_connect_available_socket(node, "Value");
- });
+ if (params.node_tree().typeinfo->validate_link(
+ static_cast<eNodeSocketDatatype>(params.other_socket().type), SOCK_FLOAT)) {
+ params.add_item(IFACE_("Value"), [](LinkSearchOpParams &params) {
+ bNode &node = params.add_node("ShaderNodeMath");
+ params.update_and_connect_available_socket(node, "Value");
+ });
+ }
}
} // namespace blender::nodes