[Bf-blender-cvs] [2bf4d8f] object_nodes: Partial revert: need to allow pointer/mesh value nodes and constants.

Lukas Tönne noreply at git.blender.org
Thu Dec 10 12:52:06 CET 2015


Commit: 2bf4d8f1ae7893b2da1502b54210520017f4a91d
Author: Lukas Tönne
Date:   Thu Dec 10 11:51:29 2015 +0100
Branches: object_nodes
https://developer.blender.org/rB2bf4d8f1ae7893b2da1502b54210520017f4a91d

Partial revert: need to allow pointer/mesh value nodes and constants.

These are generated automatically as terminators in pass node chains.
No pointer/mesh values will be stored in instructions though, the
sockets are just dummies to ensure a consistent value node signature.

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

M	source/blender/blenvm/compile/bvm_codegen.cc
M	source/blender/blenvm/compile/bvm_nodegraph.cc

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

diff --git a/source/blender/blenvm/compile/bvm_codegen.cc b/source/blender/blenvm/compile/bvm_codegen.cc
index 9d081c0..e669f56 100644
--- a/source/blender/blenvm/compile/bvm_codegen.cc
+++ b/source/blender/blenvm/compile/bvm_codegen.cc
@@ -323,12 +323,12 @@ void BVMCompiler::push_constant(const Value *value) const
 			break;
 		}
 		case BVM_POINTER: {
-			BLI_assert(!"POINTER type can not be stored as a constant!");
+			/* POINTER type can not be stored as a constant */
 			break;
 		}
 		
 		case BVM_MESH:
-			BLI_assert(!"MESH type can not be stored as a constant!");
+			/* MESH type can not be stored as a constant */
 			break;
 	}
 }
diff --git a/source/blender/blenvm/compile/bvm_nodegraph.cc b/source/blender/blenvm/compile/bvm_nodegraph.cc
index 113e4aa..7d2647d 100644
--- a/source/blender/blenvm/compile/bvm_nodegraph.cc
+++ b/source/blender/blenvm/compile/bvm_nodegraph.cc
@@ -1068,6 +1068,8 @@ OpCode get_opcode_from_node_type(const string &node)
 	NODETYPE(VALUE_FLOAT4);
 	NODETYPE(VALUE_INT);
 	NODETYPE(VALUE_MATRIX44);
+	NODETYPE(VALUE_POINTER);
+	NODETYPE(VALUE_MESH);
 	
 	NODETYPE(FLOAT_TO_INT);
 	NODETYPE(INT_TO_FLOAT);
@@ -1234,6 +1236,14 @@ static void register_opcode_node_types()
 	nt->add_input("value", BVM_MATRIX44, matrix44::identity(), INPUT_CONSTANT);
 	nt->add_output("value", BVM_MATRIX44);
 	
+	nt = NodeGraph::add_function_node_type("VALUE_POINTER");
+	nt->add_input("value", BVM_POINTER, PointerRNA_NULL, INPUT_CONSTANT);
+	nt->add_output("value", BVM_POINTER);
+	
+	nt = NodeGraph::add_function_node_type("VALUE_MESH");
+	nt->add_input("value", BVM_MESH, __empty_mesh__, INPUT_CONSTANT);
+	nt->add_output("value", BVM_MESH);
+	
 	nt = NodeGraph::add_function_node_type("GET_ELEM_FLOAT3");
 	nt->add_input("index", BVM_INT, 0, INPUT_CONSTANT);
 	nt->add_input("value", BVM_FLOAT3, float3(0.0f, 0.0f, 0.0f));




More information about the Bf-blender-cvs mailing list