Improve script node

This commit is contained in:
luboslenco
2020-11-27 13:26:08 +01:00
parent ce0be8289d
commit 3903bb3187
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -98,7 +98,16 @@ class Uniforms {
if (MaterialParser.script_links != null) {
for (key in MaterialParser.script_links.keys()) {
var script = MaterialParser.script_links[key];
return script == "" ? 0.0 : js.Lib.eval(script);
var result = 0.0;
if (script != "") {
try {
result = js.Lib.eval(script);
}
catch(e: Dynamic) {
Log.trace(e);
}
}
return result;
}
}
return null;
+1 -1
View File
@@ -24,7 +24,7 @@ class TabScript {
ui.row([1 / 20, 1 / 20, 1 / 20, 1 / 20]);
if (ui.button(tr("Run"))) {
try {
untyped eval(hscript.text);
js.Lib.eval(hscript.text);
}
catch(e: Dynamic) {
Log.trace(e);