[Bf-blender-cvs] [2781e51cda2] geometry-nodes: Fix T82762: linked but unavailable output handled incorrectly
Jacques Lucke
noreply at git.blender.org
Fri Nov 20 12:06:41 CET 2020
Commit: 2781e51cda282313e0f27d7dbe8adad9a5483ec5
Author: Jacques Lucke
Date: Fri Nov 20 12:06:26 2020 +0100
Branches: geometry-nodes
https://developer.blender.org/rB2781e51cda282313e0f27d7dbe8adad9a5483ec5
Fix T82762: linked but unavailable output handled incorrectly
===================================================================
M source/blender/modifiers/intern/MOD_nodes.cc
===================================================================
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 7aafcfbed00..38cae4f525a 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -249,6 +249,15 @@ class GeometryNodesEvaluator {
const DNode &node = socket_to_compute.node();
const bNode &bnode = *node.bnode();
+ if (!socket_to_compute.is_available()) {
+ /* If the output is not available, use a default value. */
+ const CPPType &type = *socket_cpp_type_get(*socket_to_compute.typeinfo());
+ void *buffer = allocator_.allocate(type.size(), type.alignment());
+ type.copy_to_uninitialized(type.default_value(), buffer);
+ this->forward_to_inputs(socket_to_compute, {type, buffer});
+ return;
+ }
+
/* Prepare inputs required to execute the node. */
GValueMap<StringRef> node_inputs_map{allocator_};
for (const DInputSocket *input_socket : node.inputs()) {
More information about the Bf-blender-cvs
mailing list