From 5984788e17ea958bcf4c10b8e8bf201d4ce07f98 Mon Sep 17 00:00:00 2001 From: tamat Date: Tue, 20 Nov 2018 16:42:51 +0100 Subject: [PATCH] removed the node.data field, now you must use onSerialize and onConfigure --- build/litegraph.js | 2 -- build/litegraph.min.js | 8 ++++---- src/litegraph.js | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/build/litegraph.js b/build/litegraph.js index 5c4a5569c..b76fa788f 100644 --- a/build/litegraph.js +++ b/build/litegraph.js @@ -1767,7 +1767,6 @@ LGraphNode.prototype._ctor = function( title ) this.properties = {}; //for the values this.properties_info = []; //for the info - this.data = null; //persistent local data this.flags = {}; } @@ -1888,7 +1887,6 @@ LGraphNode.prototype.serialize = function() type: this.type, pos: this.pos, size: this.size, - data: this.data, flags: LiteGraph.cloneObject(this.flags), mode: this.mode }; diff --git a/build/litegraph.min.js b/build/litegraph.min.js index 289479abb..71baa588a 100755 --- a/build/litegraph.min.js +++ b/build/litegraph.min.js @@ -41,10 +41,10 @@ this._version++;this.sendActionToCanvas("onConnectionChange")};h.prototype.isLiv [],c=0,g=this._nodes.length;ca.length||(this._pos[0]=a[0],this._pos[1]=a[1])},get:function(){return this._pos},enumerable:!0});this.id=-1;this.type=null;this.inputs=[];this.outputs=[];this.connections=[];this.properties={};this.properties_info=[];this.data=null;this.flags={}};f.prototype.configure=function(a){this.graph&&this.graph._version++;for(var c in a)if("console"!= -c)if("properties"==c)for(var g in a.properties){if(this.properties[g]=a.properties[g],this.onPropertyChanged)this.onPropertyChanged(g,a.properties[g])}else null!=a[c]&&("object"==typeof a[c]?this[c]&&this[c].configure?this[c].configure(a[c]):this[c]=l.cloneObject(a[c],this[c]):this[c]=a[c]);a.title||(this.title=this.constructor.title);if(this.onConnectionsChange){if(this.inputs)for(var b=0;ba.length||(this._pos[0]=a[0],this._pos[1]=a[1])},get:function(){return this._pos},enumerable:!0});this.id=-1;this.type=null;this.inputs=[];this.outputs=[];this.connections=[];this.properties={};this.properties_info=[];this.flags={}};f.prototype.configure=function(a){this.graph&&this.graph._version++;for(var c in a)if("console"!=c)if("properties"== +c)for(var g in a.properties){if(this.properties[g]=a.properties[g],this.onPropertyChanged)this.onPropertyChanged(g,a.properties[g])}else null!=a[c]&&("object"==typeof a[c]?this[c]&&this[c].configure?this[c].configure(a[c]):this[c]=l.cloneObject(a[c],this[c]):this[c]=a[c]);a.title||(this.title=this.constructor.title);if(this.onConnectionsChange){if(this.inputs)for(var b=0;b=this.outputs.length)){var g=this.outputs[a];if(g&&(g._data=c,this.outputs[a].links))for(g=0;g=this.inputs.length||null==this.inputs[a].link)){var g=this.graph.links[this.inputs[a].link];if(!g)return null;if(!c)return g.data;var b=this.graph.getNodeById(g.origin_id);if(!b)return g.data;if(b.updateOutputData)b.updateOutputData(g.origin_slot);else if(b.onExecute)b.onExecute();return g.data}};f.prototype.getInputDataByName=function(a,c){var g=this.findInputSlot(a);return-1==g?null:this.getInputData(g,c)};f.prototype.isInputConnected= diff --git a/src/litegraph.js b/src/litegraph.js index 0168598a0..83b21925c 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -1765,7 +1765,6 @@ LGraphNode.prototype._ctor = function( title ) this.properties = {}; //for the values this.properties_info = []; //for the info - this.data = null; //persistent local data this.flags = {}; } @@ -1886,7 +1885,6 @@ LGraphNode.prototype.serialize = function() type: this.type, pos: this.pos, size: this.size, - data: this.data, flags: LiteGraph.cloneObject(this.flags), mode: this.mode };