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); var _val = valueProcess(val, nod, applyUnit, arrIndex);
return _val; return _val;
} }

View File

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