[Bf-blender-cvs] [b25aa2c7536] functions: only equal types are allowed to be linked

Jacques Lucke noreply at git.blender.org
Fri Mar 1 17:19:52 CET 2019


Commit: b25aa2c7536aed3782587bf86a6a0ea21d1df520
Author: Jacques Lucke
Date:   Fri Mar 1 15:51:40 2019 +0100
Branches: functions
https://developer.blender.org/rBb25aa2c7536aed3782587bf86a6a0ea21d1df520

only equal types are allowed to be linked

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

M	source/blender/functions/core/data_flow_graph.cpp
M	source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp

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

diff --git a/source/blender/functions/core/data_flow_graph.cpp b/source/blender/functions/core/data_flow_graph.cpp
index 60d7186e0e0..a0cfb0a6c6d 100644
--- a/source/blender/functions/core/data_flow_graph.cpp
+++ b/source/blender/functions/core/data_flow_graph.cpp
@@ -49,6 +49,7 @@ namespace FN {
 	{
 		BLI_assert(this->can_modify());
 		BLI_assert(a.node() != b.node());
+		BLI_assert(a.type() == b.type());
 		BLI_assert(a.is_input() != b.is_input());
 		BLI_assert(a.graph() == this && b.graph() == this);
 
diff --git a/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp b/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp
index 520ab245517..e6f5a43d384 100644
--- a/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp
@@ -124,6 +124,9 @@ namespace FN { namespace DataFlowNodes {
 		for (bNodeLink *blink : bLinkList(&btree->links)) {
 			Socket from = socket_map.lookup(blink->fromsock);
 			Socket to = socket_map.lookup(blink->tosock);
+			if (from.type() != to.type()) {
+				return {};
+			}
 			builder.insert_link(from, to);
 		}



More information about the Bf-blender-cvs mailing list