[Bf-blender-cvs] [fd1a206] object_nodes: Added explicit vector input socket to the procedural texture nodes.

Lukas Tönne noreply at git.blender.org
Tue Nov 24 09:43:53 CET 2015


Commit: fd1a206f929ef3f332dd6f2901cea2c2687557ff
Author: Lukas Tönne
Date:   Wed Nov 4 11:03:02 2015 +0100
Branches: object_nodes
https://developer.blender.org/rBfd1a206f929ef3f332dd6f2901cea2c2687557ff

Added explicit vector input socket to the procedural texture nodes.

===================================================================

M	source/blender/blenvm/intern/bvm_api.cc
M	source/blender/nodes/texture/nodes/node_texture_proc.c

===================================================================

diff --git a/source/blender/blenvm/intern/bvm_api.cc b/source/blender/blenvm/intern/bvm_api.cc
index 15101a7..cba6195 100644
--- a/source/blender/blenvm/intern/bvm_api.cc
+++ b/source/blender/blenvm/intern/bvm_api.cc
@@ -402,22 +402,19 @@ static void convert_tex_node(bvm::bNodeCompiler *comp, PointerRNA *bnode_ptr)
 	else if (type == "TextureNodeTexVoronoi") {
 		Tex *tex = (Tex *)bnode->storage;
 		
-		bvm::NodeInstance *node_pos = comp->add_node("TEX_COORD", "TEX_VORONOI_COORD_"+bvm::string(comp->current_node()->name));
-		
 		bvm::NodeInstance *node = comp->add_node("TEX_PROC_VORONOI", "TEX_VORONOI_"+bvm::string(comp->current_node()->name));
 		node->set_input_value("distance_metric", (int)tex->vn_distm);
 		node->set_input_value("color_type", (int)tex->vn_coltype);
 		node->set_input_value("minkowski_exponent", 2.5f);
 		node->set_input_value("nabla", 0.05f);
 		
-		node->set_input_link("position", node_pos, node_pos->type->find_output(0));
-		
-		comp->map_input_socket(2, node, "w1");
-		comp->map_input_socket(3, node, "w2");
-		comp->map_input_socket(4, node, "w3");
-		comp->map_input_socket(5, node, "w4");
-		comp->map_input_socket(6, node, "scale");
-		comp->map_input_socket(7, node, "noise_size");
+		comp->map_input_socket(0, node, "position");
+		comp->map_input_socket(3, node, "w1");
+		comp->map_input_socket(4, node, "w2");
+		comp->map_input_socket(5, node, "w3");
+		comp->map_input_socket(6, node, "w4");
+		comp->map_input_socket(7, node, "scale");
+		comp->map_input_socket(8, node, "noise_size");
 		
 		comp->map_output_socket(0, node, "color");
 		comp->map_output_socket(1, node, "normal");
diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c
index 0be5f87..fd2aa69 100644
--- a/source/blender/nodes/texture/nodes/node_texture_proc.c
+++ b/source/blender/nodes/texture/nodes/node_texture_proc.c
@@ -53,6 +53,7 @@ static bNodeSocketTemplate outputs_color_only[] = {
 /* Inputs common to all, #defined because nodes will need their own inputs too */
 #define I 2 /* count */
 #define COMMON_INPUTS \
+	{ SOCK_VECTOR, 1, "Vector", 0.0f, 0.0f, 0.0f }, \
 	{ SOCK_RGBA, 1, "Color 1", 0.0f, 0.0f, 0.0f, 1.0f }, \
 	{ SOCK_RGBA, 1, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f }




More information about the Bf-blender-cvs mailing list