From 4a2c63f4bd7e3cbb8cd80655270f3184d660e51d Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 24 Sep 2021 16:42:07 +0200 Subject: Nodes: hide socket value when input is a field implicitly --- source/blender/nodes/NOD_node_declaration.hh | 1 + source/blender/nodes/geometry/nodes/node_geo_set_position.cc | 2 +- source/blender/nodes/shader/nodes/node_shader_tex_noise.cc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh index 32e63ffb2df..6780dfcad59 100644 --- a/source/blender/nodes/NOD_node_declaration.hh +++ b/source/blender/nodes/NOD_node_declaration.hh @@ -202,6 +202,7 @@ class SocketDeclarationBuilder : public BaseSocketDeclarationBuilder { /** The input supports a field and is a field by default when nothing is connected. */ Self &implicit_field() { + this->hide_value(); decl_->input_field_type_ = InputSocketFieldType::Implicit; return *(Self *)this; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc index 78bdac1b01b..be923fdccb0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc @@ -23,7 +23,7 @@ namespace blender::nodes { static void geo_node_set_position_declare(NodeDeclarationBuilder &b) { b.add_input("Geometry"); - b.add_input("Position").hide_value().implicit_field(); + b.add_input("Position").implicit_field(); b.add_input("Selection").default_value(true).hide_value().supports_field(); b.add_output("Geometry"); } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc index 5bf5e0f9876..6ffc8979815 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc @@ -26,7 +26,7 @@ namespace blender::nodes { static void sh_node_tex_noise_declare(NodeDeclarationBuilder &b) { b.is_function_node(); - b.add_input("Vector").hide_value().implicit_field(); + b.add_input("Vector").implicit_field(); b.add_input("W").min(-1000.0f).max(1000.0f); b.add_input("Scale").min(-1000.0f).max(1000.0f).default_value(5.0f); b.add_input("Detail").min(0.0f).max(16.0f).default_value(2.0f); -- cgit v1.2.3