[Bf-blender-cvs] [70e84dc] object_nodes: Use default node input value for constants.
Lukas Tönne
noreply at git.blender.org
Wed Dec 23 14:46:04 CET 2015
Commit: 70e84dc17ade114fcc4d303d23fbd1407e0734a9
Author: Lukas Tönne
Date: Wed Dec 23 14:37:27 2015 +0100
Branches: object_nodes
https://developer.blender.org/rB70e84dc17ade114fcc4d303d23fbd1407e0734a9
Use default node input value for constants.
===================================================================
M source/blender/blenvm/compile/bvm_codegen.cc
===================================================================
diff --git a/source/blender/blenvm/compile/bvm_codegen.cc b/source/blender/blenvm/compile/bvm_codegen.cc
index 7c18b0e..9244521 100644
--- a/source/blender/blenvm/compile/bvm_codegen.cc
+++ b/source/blender/blenvm/compile/bvm_codegen.cc
@@ -297,6 +297,7 @@ void BVMCompiler::push_string(const char *s) const
void BVMCompiler::push_constant(const Value *value) const
{
+ BLI_assert(value != NULL);
switch (value->typedesc().base_type) {
case BVM_FLOAT: {
float f = 0.0f;
@@ -564,6 +565,8 @@ int BVMCompiler::codegen_function(const BVMCompiler::FunctionInfo &func,
if (node.is_input_constant(i)) {
Value *value = node.find_input_value(i);
+ if (!value)
+ value = node.type->find_input(i)->default_value;
push_constant(value);
}
else {
More information about the Bf-blender-cvs
mailing list