diff --git a/src/litegraph.js b/src/litegraph.js index d64caa9d6..8c2a10b18 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -1509,6 +1509,16 @@ for (var i in this.links) { //links is an OBJECT var link = this.links[i]; + if(!link.serialize) //weird bug I havent solved yet + { + console.warn("weird LLink bug, link info is not a LLink but a regular object"); + var link2 = new LLink(); + for(var i in link) + link2[i] = link[i]; + this.links[i] = link2; + link = link2; + } + links.push(link.serialize()); } @@ -1948,6 +1958,20 @@ return this.title || this.constructor.title; }; + /** + * sets the value of a property + * @method setProperty + * @param {String} name + * @param {*} value + */ + LGraphNode.prototype.setProperty = function(name, value) { + if(!this.properties) + this.properties = {}; + this.properties[name] = value; + if (this.onPropertyChanged) + this.onPropertyChanged(name, value); + }; + // Execution ************************* /** * sets the output data @@ -3792,6 +3816,15 @@ LGraphNode.prototype.executeAction = function(action) } }; + /** + * returns the visualy active graph (in case there are more in the stack) + * @method getCurrentGraph + * @return {LGraph} the active graph + */ + LGraphCanvas.prototype.getCurrentGraph = function() { + return this.graph; + } + /** * assigns a canvas * diff --git a/src/nodes/.gltextures.js.swp b/src/nodes/.gltextures.js.swp index f6570246d..5e286edeb 100644 Binary files a/src/nodes/.gltextures.js.swp and b/src/nodes/.gltextures.js.swp differ