Browse Source

explicit error for shader node class missing

Nicolas Cannasse 4 years ago
parent
commit
d6ff142abc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      hrt/shgraph/ShaderGraph.hx

+ 3 - 1
hrt/shgraph/ShaderGraph.hx

@@ -91,7 +91,9 @@ class ShaderGraph {
 
 		for (n in nodes) {
 			n.outputs = [];
-			n.instance = std.Type.createInstance(std.Type.resolveClass(n.type), []);
+			var cl = std.Type.resolveClass(n.type);
+			if( cl == null ) throw "Missing shader node "+n.type;
+			n.instance = std.Type.createInstance(cl, []);
 			n.instance.setId(n.id);
 			n.instance.loadProperties(n.properties);
 			this.nodes.set(n.id, n);