performance improvement

This commit is contained in:
Tanasart 2024-08-08 13:31:05 +07:00
parent ddae058fb9
commit 3c165588d3
2 changed files with 13 additions and 5 deletions

View file

@ -1219,7 +1219,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
}
var _val = valueProcess(val, nod, applyUnit, arrIndex);
return _val;
}

View file

@ -39,6 +39,8 @@
load_layout = false;
previewNode = "";
inspectingNode = "";
previewGrid = {
show : false,
snap : false,
@ -222,6 +224,9 @@
var _prev_node = PANEL_PREVIEW? PANEL_PREVIEW.getNodePreview() : noone;
_map.previewNode = _prev_node? _prev_node.node_id : noone;
var _insp_node = PANEL_INSPECTOR? PANEL_INSPECTOR.getInspecting() : noone;
_map.inspectingNode = _insp_node? _insp_node.node_id : noone;
_map.previewGrid = previewGrid;
_map.graphGrid = graphGrid;
_map.attributes = attributes;
@ -262,10 +267,7 @@
}
if(struct_has(_map, "onion_skin")) struct_override(onion_skin, _map.onion_skin);
previewNode = struct_try_get(_map, "previewNode", noone);
if(struct_has(_map, "previewGrid")) struct_override(previewGrid, _map.previewGrid);
if(struct_has(_map, "graphGrid")) struct_override(graphGrid, _map.graphGrid);
if(struct_has(_map, "attributes")) struct_override(attributes, _map.attributes);
if(struct_has(_map, "metadata")) meta.deserialize(_map.metadata);
@ -295,10 +297,17 @@
struct_foreach(_addon, function(_name, _value) { addonLoad(_name, false); });
}
previewNode = struct_try_get(_map, "previewNode", noone);
if(PANEL_PREVIEW && previewNode != "") {
var _node = nodeMap[? previewNode];
if(_node) PANEL_PREVIEW.setNodePreview(_node);
}
inspectingNode = struct_try_get(_map, "inspectingNode", noone);
if(PANEL_INSPECTOR && inspectingNode != "") {
var _node = nodeMap[? inspectingNode];
if(_node) PANEL_INSPECTOR.setInspecting(_node);
}
}
static postDeserialize = function() {