Переглянути джерело

Don't check cycles on load in shadergraph

Clément Espeute 11 місяців тому
батько
коміт
6a3ab091d4
1 змінених файлів з 3 додано та 3 видалено
  1. 3 3
      hrt/shgraph/ShaderGraph.hx

+ 3 - 3
hrt/shgraph/ShaderGraph.hx

@@ -716,7 +716,7 @@ class Graph {
 		}
 		}
 
 
 		for (e in edges) {
 		for (e in edges) {
-			addEdge(e);
+			addEdge(e, false);
 		}
 		}
 	}
 	}
 
 
@@ -761,7 +761,7 @@ class Graph {
 		return true;
 		return true;
 	}
 	}
 
 
-	public function addEdge(edge : Edge) {
+	public function addEdge(edge : Edge, checkCycles: Bool = true) {
 		var node = this.nodes.get(edge.inputNodeId);
 		var node = this.nodes.get(edge.inputNodeId);
 		var output = this.nodes.get(edge.outputNodeId);
 		var output = this.nodes.get(edge.outputNodeId);
 
 
@@ -800,7 +800,7 @@ class Graph {
 		node.connections[inputId] = {from: output, outputId: outputId};
 		node.connections[inputId] = {from: output, outputId: outputId};
 
 
 		#if editor
 		#if editor
-		if (hasCycle()){
+		if (checkCycles && hasCycle()){
 			removeEdge(edge.inputNodeId, inputId, false);
 			removeEdge(edge.inputNodeId, inputId, false);
 			return false;
 			return false;
 		}
 		}