[Bf-blender-cvs] [723c513] object_nodes: Sanity check for array count <= 0, otherwise CDDM keeps spewing warnings about empty mesh.
Lukas Tönne
noreply at git.blender.org
Tue Dec 1 11:05:13 CET 2015
Commit: 723c51313c4ce21269d5e82c02fd37b6f1f88415
Author: Lukas Tönne
Date: Tue Dec 1 11:04:24 2015 +0100
Branches: object_nodes
https://developer.blender.org/rB723c51313c4ce21269d5e82c02fd37b6f1f88415
Sanity check for array count <= 0, otherwise CDDM keeps spewing warnings about empty mesh.
===================================================================
M source/blender/blenvm/bvm/bvm_eval_mesh.h
===================================================================
diff --git a/source/blender/blenvm/bvm/bvm_eval_mesh.h b/source/blender/blenvm/bvm/bvm_eval_mesh.h
index d782d7e..1df6ed0 100644
--- a/source/blender/blenvm/bvm/bvm_eval_mesh.h
+++ b/source/blender/blenvm/bvm/bvm_eval_mesh.h
@@ -156,9 +156,10 @@ static void eval_op_mesh_array(const EvalGlobals *globals, const EvalData *data,
{
DerivedMesh *dm = stack_load_mesh(stack, offset_mesh_in);
int count = stack_load_int(stack, offset_count);
- CLAMP_MIN(count, 0);
- DerivedMesh *result = do_array(globals, data, kernel_data, stack, dm, count, fn_transform, offset_transform);
+ DerivedMesh *result = (count > 0) ?
+ do_array(globals, data, kernel_data, stack, dm, count, fn_transform, offset_transform) :
+ CDDM_new(0, 0, 0, 0, 0);
stack_store_mesh(stack, offset_mesh_out, result);
}
More information about the Bf-blender-cvs
mailing list