[Bf-blender-cvs] [4ca0309] object_nodes: Renamed the FUNCTION input value type to EXPRESSION for clarity.

Lukas Tönne noreply at git.blender.org
Sun Jan 3 09:56:22 CET 2016


Commit: 4ca0309f13ea2aa1077dc3c2af5fab0be33b588b
Author: Lukas Tönne
Date:   Fri Jan 1 14:37:08 2016 +0100
Branches: object_nodes
https://developer.blender.org/rB4ca0309f13ea2aa1077dc3c2af5fab0be33b588b

Renamed the FUNCTION input value type to EXPRESSION for clarity.

'Function' is a more general term, the input is specifically an
'expression' because it returns a single value.

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

M	source/blender/blenvm/BVM_types.h
M	source/blender/blenvm/compile/bvm_codegen.cc
M	source/blender/blenvm/compile/bvm_nodegraph.cc
M	source/blender/blenvm/compile/bvm_nodegraph.h
M	source/blender/makesrna/intern/rna_blenvm.c

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

diff --git a/source/blender/blenvm/BVM_types.h b/source/blender/blenvm/BVM_types.h
index cdafc5a..e76e647 100644
--- a/source/blender/blenvm/BVM_types.h
+++ b/source/blender/blenvm/BVM_types.h
@@ -56,7 +56,7 @@ typedef enum BVMBufferType {
 typedef enum BVMInputValueType {
 	INPUT_CONSTANT,
 	INPUT_VARIABLE,
-	INPUT_FUNCTION,
+	INPUT_EXPRESSION,
 } BVMInputValueType;
 
 typedef enum BVMOutputValueType {
diff --git a/source/blender/blenvm/compile/bvm_codegen.cc b/source/blender/blenvm/compile/bvm_codegen.cc
index 3bf5b82..d1704ee 100644
--- a/source/blender/blenvm/compile/bvm_codegen.cc
+++ b/source/blender/blenvm/compile/bvm_codegen.cc
@@ -122,7 +122,7 @@ void BVMCompiler::resolve_basic_block_symbols(const NodeGraph &graph, BVMCompile
 			if (node.is_input_constant(i)) {
 				/* stored directly in the instructions list after creating values */
 			}
-			else if (node.is_input_function(i)) {
+			else if (node.is_input_expression(i)) {
 				BasicBlock &func_block = basic_block_map.at(key);
 				
 				/* initialize local arguments */
@@ -184,7 +184,7 @@ void BVMCompiler::graph_node_append(const NodeInstance *node,
 		const NodeInput *socket = node->type->find_input(i);
 		const NodeInstance *link_node = node->find_input_link_node(i);
 		
-		if (socket->value_type == INPUT_FUNCTION) {
+		if (socket->value_type == INPUT_EXPRESSION) {
 			BasicBlock &block = basic_block_map[node->input(i)];
 			
 			if (link_node) {
@@ -525,7 +525,7 @@ int BVMCompiler::codegen_basic_block(const BVMCompiler::BasicBlock &block,
 			const NodeInput *input = node.type->find_input(i);
 			ConstSocketPair key(&node, input->name);
 			
-			if (node.is_input_constant(i) || node.is_input_function(i)) {
+			if (node.is_input_constant(i) || node.is_input_expression(i)) {
 				/* stored directly in instructions */
 			}
 			else if (node.has_input_link(i)) {
@@ -570,7 +570,7 @@ int BVMCompiler::codegen_basic_block(const BVMCompiler::BasicBlock &block,
 					push_constant(value);
 				}
 				else {
-					if (node.is_input_function(i)) {
+					if (node.is_input_expression(i)) {
 						const BasicBlock &block = basic_block_map.at(key);
 						push_jump_address(block.entry_point);
 					}
@@ -591,7 +591,7 @@ int BVMCompiler::codegen_basic_block(const BVMCompiler::BasicBlock &block,
 		for (int i = 0; i < node.num_inputs(); ++i) {
 			const NodeInput *input = node.type->find_input(i);
 			
-			if (node.is_input_constant(i) || node.is_input_function(i)) {
+			if (node.is_input_constant(i) || node.is_input_expression(i)) {
 				/* pass */
 			}
 			else if (node.has_input_link(i)) {
diff --git a/source/blender/blenvm/compile/bvm_nodegraph.cc b/source/blender/blenvm/compile/bvm_nodegraph.cc
index 67f2dc0..c4cd174 100644
--- a/source/blender/blenvm/compile/bvm_nodegraph.cc
+++ b/source/blender/blenvm/compile/bvm_nodegraph.cc
@@ -216,7 +216,7 @@ const NodeInput *NodeType::add_input(const string &name,
 {
 	BLI_assert(!find_input(name));
 	/* function inputs only allowed for kernel nodes */
-	BLI_assert(m_is_kernel_node || value_type != INPUT_FUNCTION);
+	BLI_assert(m_is_kernel_node || value_type != INPUT_EXPRESSION);
 	m_inputs.push_back(NodeInput(name, typedesc, default_value, value_type));
 	return &m_inputs.back();
 }
@@ -421,16 +421,16 @@ bool NodeInstance::is_input_constant(int index) const
 	return socket ? socket->value_type == INPUT_CONSTANT : false;
 }
 
-bool NodeInstance::is_input_function(const string &name) const
+bool NodeInstance::is_input_expression(const string &name) const
 {
 	const NodeInput *socket = type->find_input(name);
-	return socket ? socket->value_type == INPUT_FUNCTION : false;
+	return socket ? socket->value_type == INPUT_EXPRESSION : false;
 }
 
-bool NodeInstance::is_input_function(int index) const
+bool NodeInstance::is_input_expression(int index) const
 {
 	const NodeInput *socket = type->find_input(index);
-	return socket ? socket->value_type == INPUT_FUNCTION : false;
+	return socket ? socket->value_type == INPUT_EXPRESSION : false;
 }
 
 /* ------------------------------------------------------------------------- */
@@ -1282,13 +1282,13 @@ static void register_opcode_node_types()
 	nt = NodeGraph::add_kernel_node_type("MESH_ARRAY");
 	nt->add_input("mesh_in", TYPE_MESH, __empty_mesh__);
 	nt->add_input("count", TYPE_INT, 1);
-	nt->add_input("transform", TYPE_MATRIX44, matrix44::identity(), INPUT_FUNCTION);
+	nt->add_input("transform", TYPE_MATRIX44, matrix44::identity(), INPUT_EXPRESSION);
 	nt->add_output("mesh_out", TYPE_MESH);
 	nt->add_output("iteration", TYPE_INT, OUTPUT_LOCAL);
 	
 	nt = NodeGraph::add_kernel_node_type("MESH_DISPLACE");
 	nt->add_input("mesh_in", TYPE_MESH, __empty_mesh__);
-	nt->add_input("vector", TYPE_FLOAT3, float3(0.0f, 0.0f, 0.0f), INPUT_FUNCTION);
+	nt->add_input("vector", TYPE_FLOAT3, float3(0.0f, 0.0f, 0.0f), INPUT_EXPRESSION);
 	nt->add_output("mesh_out", TYPE_MESH);
 	nt->add_output("element.index", TYPE_FLOAT3, OUTPUT_LOCAL);
 	nt->add_output("element.location", TYPE_FLOAT3, OUTPUT_LOCAL);
diff --git a/source/blender/blenvm/compile/bvm_nodegraph.h b/source/blender/blenvm/compile/bvm_nodegraph.h
index 98bbce2..422fb6c 100644
--- a/source/blender/blenvm/compile/bvm_nodegraph.h
+++ b/source/blender/blenvm/compile/bvm_nodegraph.h
@@ -253,8 +253,8 @@ struct NodeInstance {
 	bool has_input_value(int index) const;
 	bool is_input_constant(const string &name) const;
 	bool is_input_constant(int index) const;
-	bool is_input_function(const string &name) const;
-	bool is_input_function(int index) const;
+	bool is_input_expression(const string &name) const;
+	bool is_input_expression(int index) const;
 	
 	const NodeType *type;
 	string name;
diff --git a/source/blender/makesrna/intern/rna_blenvm.c b/source/blender/makesrna/intern/rna_blenvm.c
index f8de052..1ff12b4 100644
--- a/source/blender/makesrna/intern/rna_blenvm.c
+++ b/source/blender/makesrna/intern/rna_blenvm.c
@@ -317,7 +317,7 @@ static void rna_def_bvm_node_input(BlenderRNA *brna)
 	static EnumPropertyItem value_type_items[] = {
 	    {INPUT_CONSTANT, "CONSTANT", 0, "Constant", "Fixed value that must be defined at compile time"},
 	    {INPUT_VARIABLE, "VARIABLE", 0, "Variable", "Variable value from another node can be used"},
-	    {INPUT_FUNCTION, "FUNCTION", 0, "Function", "Value is calculated for each element"},
+	    {INPUT_EXPRESSION, "EXPRESSION", 0, "Expression", "Value is calculated for each element"},
 	    {0, NULL, 0, NULL, NULL}
 	};




More information about the Bf-blender-cvs mailing list