Prechádzať zdrojové kódy

Don't check cycles on load in shadergraph

Clément Espeute 11 mesiacov pred
rodič
commit
6a3ab091d4
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      hrt/shgraph/ShaderGraph.hx

+ 3 - 3
hrt/shgraph/ShaderGraph.hx

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