fixing serialize link

This commit is contained in:
tamat
2019-04-29 20:29:42 +02:00
parent 9883f93dd6
commit 305beae7e0
2 changed files with 33 additions and 0 deletions

View File

@@ -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
*

Binary file not shown.