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/geometry/nodes/node_geo_attribute_color_ramp.cc')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc27
1 files changed, 11 insertions, 16 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
index c5740395dfb..aae906f2e5e 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
@@ -23,17 +23,15 @@
#include "node_geometry_util.hh"
-static bNodeSocketTemplate geo_node_attribute_color_ramp_in[] = {
- {SOCK_GEOMETRY, N_("Geometry")},
- {SOCK_STRING, N_("Attribute")},
- {SOCK_STRING, N_("Result")},
- {-1, ""},
-};
-
-static bNodeSocketTemplate geo_node_attribute_color_ramp_out[] = {
- {SOCK_GEOMETRY, N_("Geometry")},
- {-1, ""},
-};
+namespace blender::nodes {
+
+static void geo_node_attribute_color_ramp_declare(NodeDeclarationBuilder &b)
+{
+ b.add_input<decl::Geometry>("Geometry");
+ b.add_input<decl::String>("Attribute");
+ b.add_input<decl::String>("Result");
+ b.add_output<decl::Geometry>("Geometry");
+}
static void geo_node_attribute_color_ramp_layout(uiLayout *layout,
bContext *UNUSED(C),
@@ -42,8 +40,6 @@ static void geo_node_attribute_color_ramp_layout(uiLayout *layout,
uiTemplateColorRamp(layout, ptr, "color_ramp", false);
}
-namespace blender::nodes {
-
static void geo_node_attribute_color_ramp_init(bNodeTree *UNUSED(ntree), bNode *node)
{
NodeAttributeColorRamp *node_storage = (NodeAttributeColorRamp *)MEM_callocN(
@@ -131,13 +127,12 @@ void register_node_type_geo_attribute_color_ramp()
geo_node_type_base(
&ntype, GEO_NODE_ATTRIBUTE_COLOR_RAMP, "Attribute Color Ramp", NODE_CLASS_ATTRIBUTE, 0);
- node_type_socket_templates(
- &ntype, geo_node_attribute_color_ramp_in, geo_node_attribute_color_ramp_out);
node_type_storage(
&ntype, "NodeAttributeColorRamp", node_free_standard_storage, node_copy_standard_storage);
node_type_init(&ntype, blender::nodes::geo_node_attribute_color_ramp_init);
node_type_size_preset(&ntype, NODE_SIZE_LARGE);
+ ntype.declare = blender::nodes::geo_node_attribute_color_ramp_declare;
ntype.geometry_node_execute = blender::nodes::geo_node_attribute_color_ramp_exec;
- ntype.draw_buttons = geo_node_attribute_color_ramp_layout;
+ ntype.draw_buttons = blender::nodes::geo_node_attribute_color_ramp_layout;
nodeRegisterType(&ntype);
}