mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 22:37:32 +00:00
first working version of Subgraphs
This commit is contained in:
@@ -85,7 +85,7 @@ var LiteGraph = global.LiteGraph = {
|
||||
debug: false,
|
||||
catch_exceptions: true,
|
||||
throw_errors: true,
|
||||
allow_scripts: false,
|
||||
allow_scripts: false, //if set to true some nodes like Formula would be allowed to evaluate code that comes from unsafe sources (like node configuration), which could lead to exploits
|
||||
registered_node_types: {}, //nodetypes by string
|
||||
node_types_by_file_extension: {}, //used for droping files in the canvas
|
||||
Nodes: {}, //node types by classname
|
||||
@@ -167,8 +167,9 @@ var LiteGraph = global.LiteGraph = {
|
||||
* @param {Function} func
|
||||
* @param {Array} param_types [optional] an array containing the type of every parameter, otherwise parameters will accept any type
|
||||
* @param {String} return_type [optional] string with the return type, otherwise it will be generic
|
||||
* @param {Object} properties [optional] properties to be configurable
|
||||
*/
|
||||
wrapFunctionAsNode: function( name, func, param_types, return_type )
|
||||
wrapFunctionAsNode: function( name, func, param_types, return_type, properties )
|
||||
{
|
||||
var params = Array(func.length);
|
||||
var code = "";
|
||||
@@ -176,6 +177,8 @@ var LiteGraph = global.LiteGraph = {
|
||||
for(var i = 0; i < names.length; ++i)
|
||||
code += "this.addInput('"+names[i]+"',"+(param_types && param_types[i] ? "'" + param_types[i] + "'" : "0") + ");\n";
|
||||
code += "this.addOutput('out',"+( return_type ? "'" + return_type + "'" : 0 )+");\n";
|
||||
if(properties)
|
||||
code += "this.properties = " + JSON.stringify(properties) + ";\n";
|
||||
var classobj = Function(code);
|
||||
classobj.title = name.split("/").pop();
|
||||
classobj.desc = "Generated from " + func.name;
|
||||
@@ -518,8 +521,8 @@ LGraph.prototype.clear = function()
|
||||
this.catch_errors = true;
|
||||
|
||||
//subgraph_data
|
||||
this.global_inputs = {};
|
||||
this.global_outputs = {};
|
||||
this.inputs = {};
|
||||
this.outputs = {};
|
||||
|
||||
//notify canvas to redraw
|
||||
this.change();
|
||||
@@ -1254,16 +1257,20 @@ LGraph.prototype.getGroupOnPos = function(x,y)
|
||||
* @param {String} type
|
||||
* @param {*} value [optional]
|
||||
*/
|
||||
LGraph.prototype.addGlobalInput = function(name, type, value)
|
||||
LGraph.prototype.addInput = function(name, type, value)
|
||||
{
|
||||
this.global_inputs[name] = { name: name, type: type, value: value };
|
||||
var input = this.inputs[ name ];
|
||||
if( input ) //already exist
|
||||
return;
|
||||
|
||||
this.inputs[ name ] = { name: name, type: type, value: value };
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalInputAdded)
|
||||
this.onGlobalInputAdded(name, type);
|
||||
if(this.onInputAdded)
|
||||
this.onInputAdded(name, type);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1272,32 +1279,23 @@ LGraph.prototype.addGlobalInput = function(name, type, value)
|
||||
* @param {String} name
|
||||
* @param {*} data
|
||||
*/
|
||||
LGraph.prototype.setGlobalInputData = function(name, data)
|
||||
LGraph.prototype.setInputData = function(name, data)
|
||||
{
|
||||
var input = this.global_inputs[name];
|
||||
var input = this.inputs[name];
|
||||
if (!input)
|
||||
return;
|
||||
input.value = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a data to the global graph input (same as setGlobalInputData)
|
||||
* @method setInputData
|
||||
* @param {String} name
|
||||
* @param {*} data
|
||||
*/
|
||||
LGraph.prototype.setInputData = LGraph.prototype.setGlobalInputData;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the current value of a global graph input
|
||||
* @method getGlobalInputData
|
||||
* @method getInputData
|
||||
* @param {String} name
|
||||
* @return {*} the data
|
||||
*/
|
||||
LGraph.prototype.getGlobalInputData = function(name)
|
||||
LGraph.prototype.getInputData = function(name)
|
||||
{
|
||||
var input = this.global_inputs[name];
|
||||
var input = this.inputs[name];
|
||||
if (!input)
|
||||
return null;
|
||||
return input.value;
|
||||
@@ -1305,105 +1303,105 @@ LGraph.prototype.getGlobalInputData = function(name)
|
||||
|
||||
/**
|
||||
* Changes the name of a global graph input
|
||||
* @method renameGlobalInput
|
||||
* @method renameInput
|
||||
* @param {String} old_name
|
||||
* @param {String} new_name
|
||||
*/
|
||||
LGraph.prototype.renameGlobalInput = function(old_name, name)
|
||||
LGraph.prototype.renameInput = function(old_name, name)
|
||||
{
|
||||
if(name == old_name)
|
||||
return;
|
||||
|
||||
if(!this.global_inputs[old_name])
|
||||
if(!this.inputs[old_name])
|
||||
return false;
|
||||
|
||||
if(this.global_inputs[name])
|
||||
if(this.inputs[name])
|
||||
{
|
||||
console.error("there is already one input with that name");
|
||||
return false;
|
||||
}
|
||||
|
||||
this.global_inputs[name] = this.global_inputs[old_name];
|
||||
delete this.global_inputs[old_name];
|
||||
this.inputs[name] = this.inputs[old_name];
|
||||
delete this.inputs[old_name];
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalInputRenamed)
|
||||
this.onGlobalInputRenamed(old_name, name);
|
||||
if(this.onInputRenamed)
|
||||
this.onInputRenamed(old_name, name);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the type of a global graph input
|
||||
* @method changeGlobalInputType
|
||||
* @method changeInputType
|
||||
* @param {String} name
|
||||
* @param {String} type
|
||||
*/
|
||||
LGraph.prototype.changeGlobalInputType = function(name, type)
|
||||
LGraph.prototype.changeInputType = function(name, type)
|
||||
{
|
||||
if(!this.global_inputs[name])
|
||||
if(!this.inputs[name])
|
||||
return false;
|
||||
|
||||
if(this.global_inputs[name].type && this.global_inputs[name].type.toLowerCase() == type.toLowerCase() )
|
||||
if(this.inputs[name].type && this.inputs[name].type.toLowerCase() == type.toLowerCase() )
|
||||
return;
|
||||
|
||||
this.global_inputs[name].type = type;
|
||||
this.inputs[name].type = type;
|
||||
this._version++;
|
||||
if(this.onGlobalInputTypeChanged)
|
||||
this.onGlobalInputTypeChanged(name, type);
|
||||
if(this.onInputTypeChanged)
|
||||
this.onInputTypeChanged(name, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a global graph input
|
||||
* @method removeGlobalInput
|
||||
* @method removeInput
|
||||
* @param {String} name
|
||||
* @param {String} type
|
||||
*/
|
||||
LGraph.prototype.removeGlobalInput = function(name)
|
||||
LGraph.prototype.removeInput = function(name)
|
||||
{
|
||||
if(!this.global_inputs[name])
|
||||
if(!this.inputs[name])
|
||||
return false;
|
||||
|
||||
delete this.global_inputs[name];
|
||||
delete this.inputs[name];
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalInputRemoved)
|
||||
this.onGlobalInputRemoved(name);
|
||||
if(this.onInputRemoved)
|
||||
this.onInputRemoved(name);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a global graph output
|
||||
* @method addGlobalOutput
|
||||
* @method addOutput
|
||||
* @param {String} name
|
||||
* @param {String} type
|
||||
* @param {*} value
|
||||
*/
|
||||
LGraph.prototype.addGlobalOutput = function(name, type, value)
|
||||
LGraph.prototype.addOutput = function(name, type, value)
|
||||
{
|
||||
this.global_outputs[name] = { name: name, type: type, value: value };
|
||||
this.outputs[name] = { name: name, type: type, value: value };
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalOutputAdded)
|
||||
this.onGlobalOutputAdded(name, type);
|
||||
if(this.onOutputAdded)
|
||||
this.onOutputAdded(name, type);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a data to the global output
|
||||
* @method setGlobalOutputData
|
||||
* @method setOutputData
|
||||
* @param {String} name
|
||||
* @param {String} value
|
||||
*/
|
||||
LGraph.prototype.setGlobalOutputData = function(name, value)
|
||||
LGraph.prototype.setOutputData = function(name, value)
|
||||
{
|
||||
var output = this.global_outputs[ name ];
|
||||
var output = this.outputs[ name ];
|
||||
if (!output)
|
||||
return;
|
||||
output.value = value;
|
||||
@@ -1411,92 +1409,83 @@ LGraph.prototype.setGlobalOutputData = function(name, value)
|
||||
|
||||
/**
|
||||
* Returns the current value of a global graph output
|
||||
* @method getGlobalOutputData
|
||||
* @method getOutputData
|
||||
* @param {String} name
|
||||
* @return {*} the data
|
||||
*/
|
||||
LGraph.prototype.getGlobalOutputData = function(name)
|
||||
LGraph.prototype.getOutputData = function(name)
|
||||
{
|
||||
var output = this.global_outputs[name];
|
||||
var output = this.outputs[name];
|
||||
if (!output)
|
||||
return null;
|
||||
return output.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current value of a global graph output (sames as getGlobalOutputData)
|
||||
* @method getOutputData
|
||||
* @param {String} name
|
||||
* @return {*} the data
|
||||
*/
|
||||
LGraph.prototype.getOutputData = LGraph.prototype.getGlobalOutputData;
|
||||
|
||||
|
||||
/**
|
||||
* Renames a global graph output
|
||||
* @method renameGlobalOutput
|
||||
* @method renameOutput
|
||||
* @param {String} old_name
|
||||
* @param {String} new_name
|
||||
*/
|
||||
LGraph.prototype.renameGlobalOutput = function(old_name, name)
|
||||
LGraph.prototype.renameOutput = function(old_name, name)
|
||||
{
|
||||
if(!this.global_outputs[old_name])
|
||||
if(!this.outputs[old_name])
|
||||
return false;
|
||||
|
||||
if(this.global_outputs[name])
|
||||
if(this.outputs[name])
|
||||
{
|
||||
console.error("there is already one output with that name");
|
||||
return false;
|
||||
}
|
||||
|
||||
this.global_outputs[name] = this.global_outputs[old_name];
|
||||
delete this.global_outputs[old_name];
|
||||
this.outputs[name] = this.outputs[old_name];
|
||||
delete this.outputs[old_name];
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalOutputRenamed)
|
||||
this.onGlobalOutputRenamed(old_name, name);
|
||||
if(this.onOutputRenamed)
|
||||
this.onOutputRenamed(old_name, name);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the type of a global graph output
|
||||
* @method changeGlobalOutputType
|
||||
* @method changeOutputType
|
||||
* @param {String} name
|
||||
* @param {String} type
|
||||
*/
|
||||
LGraph.prototype.changeGlobalOutputType = function(name, type)
|
||||
LGraph.prototype.changeOutputType = function(name, type)
|
||||
{
|
||||
if(!this.global_outputs[name])
|
||||
if(!this.outputs[name])
|
||||
return false;
|
||||
|
||||
if(this.global_outputs[name].type && this.global_outputs[name].type.toLowerCase() == type.toLowerCase() )
|
||||
if(this.outputs[name].type && this.outputs[name].type.toLowerCase() == type.toLowerCase() )
|
||||
return;
|
||||
|
||||
this.global_outputs[name].type = type;
|
||||
this.outputs[name].type = type;
|
||||
this._version++;
|
||||
if(this.onGlobalOutputTypeChanged)
|
||||
this.onGlobalOutputTypeChanged(name, type);
|
||||
if(this.onOutputTypeChanged)
|
||||
this.onOutputTypeChanged(name, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a global graph output
|
||||
* @method removeGlobalOutput
|
||||
* @method removeOutput
|
||||
* @param {String} name
|
||||
*/
|
||||
LGraph.prototype.removeGlobalOutput = function(name)
|
||||
LGraph.prototype.removeOutput = function(name)
|
||||
{
|
||||
if(!this.global_outputs[name])
|
||||
if(!this.outputs[name])
|
||||
return false;
|
||||
delete this.global_outputs[name];
|
||||
delete this.outputs[name];
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalOutputRemoved)
|
||||
this.onGlobalOutputRemoved(name);
|
||||
if(this.onOutputRemoved)
|
||||
this.onOutputRemoved(name);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1809,7 +1798,7 @@ LiteGraph.LLink = LLink;
|
||||
+ collapsed: if it is collapsed
|
||||
|
||||
supported callbacks:
|
||||
+ onAdded: when added to graph
|
||||
+ onAdded: when added to graph (warning: this is called BEFORE the node is configured when loading)
|
||||
+ onRemoved: when removed from graph
|
||||
+ onStart: when the graph starts playing
|
||||
+ onStop: when the graph stops playing
|
||||
@@ -1828,6 +1817,7 @@ LiteGraph.LLink = LLink;
|
||||
+ onDblClick: double clicked in the node
|
||||
+ onInputDblClick: input slot double clicked (can be used to automatically create a node connected)
|
||||
+ onOutputDblClick: output slot double clicked (can be used to automatically create a node connected)
|
||||
+ onConfigure: called after the node has been configured
|
||||
+ onSerialize: to add extra info when serializing (the callback receives the object that should be filled with the data)
|
||||
+ onSelected
|
||||
+ onDeselected
|
||||
@@ -7430,6 +7420,8 @@ LGraphCanvas.prototype.prompt = function( title, value, callback, event )
|
||||
var input_html = "";
|
||||
title = title || "";
|
||||
|
||||
var modified = false;
|
||||
|
||||
var dialog = document.createElement("div");
|
||||
dialog.className = "graphdialog rounded";
|
||||
dialog.innerHTML = "<span class='name'></span> <input autofocus type='text' class='value'/><button class='rounded'>OK</button>";
|
||||
@@ -7444,7 +7436,8 @@ LGraphCanvas.prototype.prompt = function( title, value, callback, event )
|
||||
dialog.style.transform = "scale("+this.ds.scale+")";
|
||||
|
||||
dialog.addEventListener("mouseleave",function(e){
|
||||
dialog.close();
|
||||
if(!modified)
|
||||
dialog.close();
|
||||
});
|
||||
|
||||
if(that.prompt_box)
|
||||
@@ -7462,6 +7455,7 @@ LGraphCanvas.prototype.prompt = function( title, value, callback, event )
|
||||
|
||||
var input = dialog.querySelector("input");
|
||||
input.addEventListener("keydown", function(e){
|
||||
modified = true;
|
||||
if(e.keyCode == 27) //ESC
|
||||
dialog.close();
|
||||
else if(e.keyCode == 13)
|
||||
@@ -8240,7 +8234,7 @@ LGraphCanvas.prototype.processContextMenu = function( node, event )
|
||||
var dialog = that.createDialog( "<span class='name'>Name</span><input autofocus type='text'/><button>OK</button>" , options );
|
||||
var input = dialog.querySelector("input");
|
||||
if(input && slot_info){
|
||||
input.value = slot_info.label;
|
||||
input.value = slot_info.label || "";
|
||||
}
|
||||
dialog.querySelector("button").addEventListener("click",function(e){
|
||||
if(input.value)
|
||||
@@ -8846,20 +8840,23 @@ function Subgraph()
|
||||
{
|
||||
var that = this;
|
||||
this.size = [140,80];
|
||||
this.properties = { enabled: true };
|
||||
this.addInput("enabled","boolean");
|
||||
|
||||
//create inner graph
|
||||
this.subgraph = new LGraph();
|
||||
this.subgraph._subgraph_node = this;
|
||||
this.subgraph._is_subgraph = true;
|
||||
|
||||
this.subgraph.onGlobalInputAdded = this.onSubgraphNewGlobalInput.bind(this);
|
||||
this.subgraph.onGlobalInputRenamed = this.onSubgraphRenamedGlobalInput.bind(this);
|
||||
this.subgraph.onGlobalInputTypeChanged = this.onSubgraphTypeChangeGlobalInput.bind(this);
|
||||
|
||||
this.subgraph.onGlobalOutputAdded = this.onSubgraphNewGlobalOutput.bind(this);
|
||||
this.subgraph.onGlobalOutputRenamed = this.onSubgraphRenamedGlobalOutput.bind(this);
|
||||
this.subgraph.onGlobalOutputTypeChanged = this.onSubgraphTypeChangeGlobalOutput.bind(this);
|
||||
this.subgraph.onInputAdded = this.onSubgraphNewInput.bind(this);
|
||||
this.subgraph.onInputRenamed = this.onSubgraphRenamedInput.bind(this);
|
||||
this.subgraph.onInputTypeChanged = this.onSubgraphTypeChangeInput.bind(this);
|
||||
this.subgraph.onInputRemoved = this.onSubgraphRemovedInput.bind(this);
|
||||
|
||||
this.subgraph.onOutputAdded = this.onSubgraphNewOutput.bind(this);
|
||||
this.subgraph.onOutputRenamed = this.onSubgraphRenamedOutput.bind(this);
|
||||
this.subgraph.onOutputTypeChanged = this.onSubgraphTypeChangeOutput.bind(this);
|
||||
this.subgraph.onOutputRemoved = this.onSubgraphRemovedOutput.bind(this);
|
||||
}
|
||||
|
||||
Subgraph.title = "Subgraph";
|
||||
@@ -8889,7 +8886,6 @@ Subgraph.prototype.onDblClick = function(e,pos,graphcanvas)
|
||||
setTimeout(function(){ graphcanvas.openSubgraph( that.subgraph ); },10 );
|
||||
}
|
||||
|
||||
|
||||
Subgraph.prototype.onMouseDown = function(e,pos,graphcanvas)
|
||||
{
|
||||
if( !this.flags.collapsed && pos[0] > this.size[0] - LiteGraph.NODE_TITLE_HEIGHT && pos[1] < 0 )
|
||||
@@ -8899,13 +8895,43 @@ Subgraph.prototype.onMouseDown = function(e,pos,graphcanvas)
|
||||
}
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphNewGlobalInput = function(name, type)
|
||||
Subgraph.prototype.onExecute = function()
|
||||
{
|
||||
//add input to the node
|
||||
this.addInput(name, type);
|
||||
if( !this.getInputOrProperty("enabled") )
|
||||
return;
|
||||
|
||||
//send inputs to subgraph global inputs
|
||||
if(this.inputs)
|
||||
for(var i = 0; i < this.inputs.length; i++)
|
||||
{
|
||||
var input = this.inputs[i];
|
||||
var value = this.getInputData(i);
|
||||
this.subgraph.setInputData( input.name, value );
|
||||
}
|
||||
|
||||
//execute
|
||||
this.subgraph.runStep();
|
||||
|
||||
//send subgraph global outputs to outputs
|
||||
if(this.outputs)
|
||||
for(var i = 0; i < this.outputs.length; i++)
|
||||
{
|
||||
var output = this.outputs[i];
|
||||
var value = this.subgraph.getOutputData( output.name );
|
||||
this.setOutputData(i, value);
|
||||
}
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphRenamedGlobalInput = function(oldname, name)
|
||||
//**** INPUTS ***********************************
|
||||
Subgraph.prototype.onSubgraphNewInput = function(name, type)
|
||||
{
|
||||
//add input to the node
|
||||
var slot = this.findInputSlot(name);
|
||||
if(slot == -1)
|
||||
this.addInput(name, type);
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphRenamedInput = function(oldname, name)
|
||||
{
|
||||
var slot = this.findInputSlot( oldname );
|
||||
if(slot == -1)
|
||||
@@ -8914,7 +8940,7 @@ Subgraph.prototype.onSubgraphRenamedGlobalInput = function(oldname, name)
|
||||
info.name = name;
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphTypeChangeGlobalInput = function(name, type)
|
||||
Subgraph.prototype.onSubgraphTypeChangeInput = function(name, type)
|
||||
{
|
||||
var slot = this.findInputSlot( name );
|
||||
if(slot == -1)
|
||||
@@ -8923,15 +8949,23 @@ Subgraph.prototype.onSubgraphTypeChangeGlobalInput = function(name, type)
|
||||
info.type = type;
|
||||
}
|
||||
|
||||
|
||||
Subgraph.prototype.onSubgraphNewGlobalOutput = function(name, type)
|
||||
Subgraph.prototype.onSubgraphRemovedInput = function(name)
|
||||
{
|
||||
//add output to the node
|
||||
this.addOutput(name, type);
|
||||
var slot = this.findInputSlot( name );
|
||||
if(slot == -1)
|
||||
return;
|
||||
this.removeInput(slot);
|
||||
}
|
||||
|
||||
//**** OUTPUTS ***********************************
|
||||
Subgraph.prototype.onSubgraphNewOutput = function(name, type)
|
||||
{
|
||||
var slot = this.findOutputSlot(name);
|
||||
if(slot == -1)
|
||||
this.addOutput(name, type);
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphRenamedGlobalOutput = function(oldname, name)
|
||||
Subgraph.prototype.onSubgraphRenamedOutput = function(oldname, name)
|
||||
{
|
||||
var slot = this.findOutputSlot( oldname );
|
||||
if(slot == -1)
|
||||
@@ -8940,7 +8974,7 @@ Subgraph.prototype.onSubgraphRenamedGlobalOutput = function(oldname, name)
|
||||
info.name = name;
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphTypeChangeGlobalOutput = function(name, type)
|
||||
Subgraph.prototype.onSubgraphTypeChangeOutput = function(name, type)
|
||||
{
|
||||
var slot = this.findOutputSlot( name );
|
||||
if(slot == -1)
|
||||
@@ -8949,6 +8983,14 @@ Subgraph.prototype.onSubgraphTypeChangeGlobalOutput = function(name, type)
|
||||
info.type = type;
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphRemovedOutput = function(name)
|
||||
{
|
||||
var slot = this.findInputSlot( name );
|
||||
if(slot == -1)
|
||||
return;
|
||||
this.removeOutput(slot);
|
||||
}
|
||||
// *****************************************************
|
||||
|
||||
Subgraph.prototype.getExtraMenuOptions = function(graphcanvas)
|
||||
{
|
||||
@@ -8965,42 +9007,13 @@ Subgraph.prototype.onResize = function(size)
|
||||
size[1] += 20;
|
||||
}
|
||||
|
||||
Subgraph.prototype.onExecute = function()
|
||||
{
|
||||
//send inputs to subgraph global inputs
|
||||
if(this.inputs)
|
||||
for(var i = 0; i < this.inputs.length; i++)
|
||||
{
|
||||
var input = this.inputs[i];
|
||||
var value = this.getInputData(i);
|
||||
this.subgraph.setGlobalInputData( input.name, value );
|
||||
}
|
||||
|
||||
//execute
|
||||
this.subgraph.runStep();
|
||||
|
||||
//send subgraph global outputs to outputs
|
||||
if(this.outputs)
|
||||
for(var i = 0; i < this.outputs.length; i++)
|
||||
{
|
||||
var output = this.outputs[i];
|
||||
var value = this.subgraph.getGlobalOutputData( output.name );
|
||||
this.setOutputData(i, value);
|
||||
}
|
||||
}
|
||||
|
||||
Subgraph.prototype.configure = function(o)
|
||||
{
|
||||
LGraphNode.prototype.configure.call(this, o);
|
||||
//this.subgraph.configure(o.graph);
|
||||
}
|
||||
|
||||
Subgraph.prototype.serialize = function()
|
||||
{
|
||||
var data = LGraphNode.prototype.serialize.call(this);
|
||||
data.subgraph = this.subgraph.serialize();
|
||||
return data;
|
||||
}
|
||||
//no need to define node.configure, the default method detects node.subgraph and passes the object to node.subgraph.configure()
|
||||
|
||||
Subgraph.prototype.clone = function()
|
||||
{
|
||||
@@ -9013,38 +9026,31 @@ Subgraph.prototype.clone = function()
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
LiteGraph.registerNodeType("graph/subgraph", Subgraph );
|
||||
|
||||
|
||||
//Input for a subgraph
|
||||
function GlobalInput()
|
||||
function GraphInput()
|
||||
{
|
||||
this.addOutput("","");
|
||||
|
||||
//random name to avoid problems with other outputs when added
|
||||
var input_name = "input_" + (Math.random()*1000).toFixed();
|
||||
|
||||
this.addOutput(input_name, null );
|
||||
|
||||
this.properties = { name: input_name, type: null };
|
||||
|
||||
this.name_in_graph = "";
|
||||
this.properties = {};
|
||||
var that = this;
|
||||
|
||||
Object.defineProperty( this.properties, "name", {
|
||||
get: function() {
|
||||
return input_name;
|
||||
return that.name_in_graph;
|
||||
},
|
||||
set: function(v) {
|
||||
if(v == "")
|
||||
if( v == "" || v == that.name_in_graph || v == "enabled" )
|
||||
return;
|
||||
|
||||
var info = that.getOutputInfo(0);
|
||||
if(info.name == v)
|
||||
return;
|
||||
info.name = v;
|
||||
if(that.graph)
|
||||
that.graph.renameGlobalInput(input_name, v);
|
||||
input_name = v;
|
||||
if(that.name_in_graph) //already added
|
||||
that.graph.renameInput( that.name_in_graph, v );
|
||||
else
|
||||
that.graph.addInput( v, that.properties.type );
|
||||
that.name_widget.value = v;
|
||||
that.name_in_graph = v;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
@@ -9052,103 +9058,132 @@ function GlobalInput()
|
||||
Object.defineProperty( this.properties, "type", {
|
||||
get: function() { return that.outputs[0].type; },
|
||||
set: function(v) {
|
||||
that.outputs[0].type = v;
|
||||
if(that.graph)
|
||||
that.graph.changeGlobalInputType(input_name, that.outputs[0].type);
|
||||
that.outputs[0].type = v;
|
||||
if(that.name_in_graph) //already added
|
||||
that.graph.changeInputType( that.name_in_graph, that.outputs[0].type);
|
||||
that.type_widget.value = v;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
this.name_widget = this.addWidget("text","Name", this.properties.name, function(v){
|
||||
if(!v) return;
|
||||
that.properties.name = v;
|
||||
});
|
||||
this.type_widget = this.addWidget("text","Type", this.properties.type, function(v){
|
||||
v = v || "";
|
||||
that.properties.type = v;
|
||||
});
|
||||
|
||||
this.widgets_up = true;
|
||||
this.size = [180,60];
|
||||
}
|
||||
|
||||
GlobalInput.title = "Input";
|
||||
GlobalInput.desc = "Input of the graph";
|
||||
GraphInput.title = "Input";
|
||||
GraphInput.desc = "Input of the graph";
|
||||
|
||||
//When added to graph tell the graph this is a new global input
|
||||
GlobalInput.prototype.onAdded = function()
|
||||
GraphInput.prototype.getTitle = function()
|
||||
{
|
||||
this.graph.addGlobalInput( this.properties.name, this.properties.type );
|
||||
if(this.flags.collapsed)
|
||||
return this.properties.name;
|
||||
return this.title;
|
||||
}
|
||||
|
||||
GlobalInput.prototype.onExecute = function()
|
||||
GraphInput.prototype.onExecute = function()
|
||||
{
|
||||
var name = this.properties.name;
|
||||
|
||||
//read from global input
|
||||
var data = this.graph.global_inputs[name];
|
||||
if(!data) return;
|
||||
var data = this.graph.inputs[name];
|
||||
if(!data)
|
||||
return;
|
||||
|
||||
//put through output
|
||||
this.setOutputData(0,data.value);
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("graph/input", GlobalInput);
|
||||
GraphInput.prototype.onRemoved = function()
|
||||
{
|
||||
if(this.name_in_graph)
|
||||
this.graph.removeInput( this.name_in_graph );
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("graph/input", GraphInput);
|
||||
|
||||
|
||||
//Output for a subgraph
|
||||
function GlobalOutput()
|
||||
function GraphOutput()
|
||||
{
|
||||
//random name to avoid problems with other outputs when added
|
||||
var output_name = "output_" + (Math.random()*1000).toFixed();
|
||||
|
||||
this.addInput(output_name, null);
|
||||
|
||||
this._value = null;
|
||||
|
||||
this.properties = {name: output_name, type: null };
|
||||
this.addInput("","");
|
||||
|
||||
this.name_in_graph = "";
|
||||
this.properties = {};
|
||||
var that = this;
|
||||
|
||||
Object.defineProperty(this.properties, "name", {
|
||||
Object.defineProperty( this.properties, "name", {
|
||||
get: function() {
|
||||
return output_name;
|
||||
return that.name_in_graph;
|
||||
},
|
||||
set: function(v) {
|
||||
if(v == "")
|
||||
if( v == "" || v == that.name_in_graph )
|
||||
return;
|
||||
|
||||
var info = that.getInputInfo(0);
|
||||
if(info.name == v)
|
||||
return;
|
||||
info.name = v;
|
||||
if(that.graph)
|
||||
that.graph.renameGlobalOutput(output_name, v);
|
||||
output_name = v;
|
||||
if(that.name_in_graph) //already added
|
||||
that.graph.renameOutput( that.name_in_graph, v );
|
||||
else
|
||||
that.graph.addOutput( v, that.properties.type );
|
||||
that.name_widget.value = v;
|
||||
that.name_in_graph = v;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
Object.defineProperty(this.properties, "type", {
|
||||
Object.defineProperty( this.properties, "type", {
|
||||
get: function() { return that.inputs[0].type; },
|
||||
set: function(v) {
|
||||
that.inputs[0].type = v;
|
||||
if(that.graph)
|
||||
that.graph.changeGlobalInputType( output_name, that.inputs[0].type );
|
||||
if(that.name_in_graph) //already added
|
||||
that.graph.changeOutputType( that.name_in_graph, that.inputs[0].type);
|
||||
that.type_widget.value = v || "";
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
this.name_widget = this.addWidget("text","Name", this.properties.name, function(v){
|
||||
if(!v) return;
|
||||
that.properties.name = v;
|
||||
});
|
||||
this.type_widget = this.addWidget("text","Type", this.properties.type, function(v){
|
||||
v = v || "";
|
||||
that.properties.type = v;
|
||||
});
|
||||
|
||||
this.widgets_up = true;
|
||||
this.size = [180,60];
|
||||
}
|
||||
|
||||
GlobalOutput.title = "Output";
|
||||
GlobalOutput.desc = "Output of the graph";
|
||||
GraphOutput.title = "Output";
|
||||
GraphOutput.desc = "Output of the graph";
|
||||
|
||||
GlobalOutput.prototype.onAdded = function()
|
||||
{
|
||||
var name = this.graph.addGlobalOutput( this.properties.name, this.properties.type );
|
||||
}
|
||||
|
||||
GlobalOutput.prototype.getValue = function()
|
||||
{
|
||||
return this._value;
|
||||
}
|
||||
|
||||
GlobalOutput.prototype.onExecute = function()
|
||||
GraphOutput.prototype.onExecute = function()
|
||||
{
|
||||
this._value = this.getInputData(0);
|
||||
this.graph.setGlobalOutputData( this.properties.name, this._value );
|
||||
this.graph.setOutputData( this.properties.name, this._value );
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("graph/output", GlobalOutput);
|
||||
GraphOutput.prototype.onRemoved = function()
|
||||
{
|
||||
if(this.name_in_graph)
|
||||
this.graph.removeOutput( this.name_in_graph );
|
||||
}
|
||||
|
||||
GraphOutput.prototype.getTitle = function()
|
||||
{
|
||||
if(this.flags.collapsed)
|
||||
return this.properties.name;
|
||||
return this.title;
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("graph/output", GraphOutput);
|
||||
|
||||
|
||||
|
||||
@@ -9832,7 +9867,7 @@ var LiteGraph = global.LiteGraph;
|
||||
this.addOutput( "v", "boolean" );
|
||||
this.addOutput( "e", LiteGraph.EVENT );
|
||||
this.properties = { font: "", value: false };
|
||||
this.size = [124,64];
|
||||
this.size = [160,44];
|
||||
}
|
||||
|
||||
WidgetToggle.title = "Toggle";
|
||||
@@ -9846,17 +9881,19 @@ var LiteGraph = global.LiteGraph;
|
||||
var size = this.size[1] * 0.5;
|
||||
var margin = 0.25;
|
||||
var h = this.size[1] * 0.8;
|
||||
ctx.font = this.properties.font || ((size * 0.8).toFixed(0) + "px Arial");
|
||||
var w = ctx.measureText(this.title).width;
|
||||
var x = (this.size[0] - (w + size) ) * 0.5;
|
||||
|
||||
ctx.fillStyle = "#AAA";
|
||||
ctx.fillRect(10, h - size,size,size);
|
||||
ctx.fillRect(x, h - size,size,size);
|
||||
|
||||
ctx.fillStyle = this.properties.value ? "#AEF" : "#000";
|
||||
ctx.fillRect(10+size*margin,h - size + size*margin,size*(1-margin*2),size*(1-margin*2));
|
||||
ctx.fillRect(x + size*margin,h - size + size*margin,size*(1-margin*2),size*(1-margin*2) );
|
||||
|
||||
ctx.textAlign = "left";
|
||||
ctx.font = this.properties.font || ((size * 0.8).toFixed(0) + "px Arial");
|
||||
ctx.fillStyle = "#AAA";
|
||||
ctx.fillText( this.title, size + 20, h * 0.85 );
|
||||
ctx.fillText( this.title, size * 1.2 + x, h * 0.85 );
|
||||
ctx.textAlign = "left";
|
||||
}
|
||||
|
||||
@@ -11028,7 +11065,7 @@ function MathFloor()
|
||||
{
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
}
|
||||
|
||||
MathFloor.title = "Floor";
|
||||
@@ -11049,7 +11086,7 @@ function MathFrac()
|
||||
{
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
}
|
||||
|
||||
MathFrac.title = "Frac";
|
||||
@@ -11071,7 +11108,7 @@ function MathSmoothStep()
|
||||
{
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
this.properties = { A: 0, B: 1 };
|
||||
}
|
||||
|
||||
@@ -11102,7 +11139,7 @@ function MathScale()
|
||||
{
|
||||
this.addInput("in","number",{label:""});
|
||||
this.addOutput("out","number",{label:""});
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
this.addProperty( "factor", 1 );
|
||||
}
|
||||
|
||||
@@ -11124,7 +11161,7 @@ function MathAverageFilter()
|
||||
{
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
this.addProperty( "samples", 10 );
|
||||
this._values = new Float32Array(10);
|
||||
this._current = 0;
|
||||
@@ -11176,7 +11213,7 @@ function MathTendTo()
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.addProperty( "factor", 0.1 );
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
this._value = null;
|
||||
}
|
||||
|
||||
@@ -11215,7 +11252,7 @@ MathOperation.values = ["+","-","*","/","%","^"];
|
||||
MathOperation.title = "Operation";
|
||||
MathOperation.desc = "Easy math operators";
|
||||
MathOperation["@OP"] = { type:"enum", title: "operation", values: MathOperation.values };
|
||||
MathOperation.size = [100,50];
|
||||
MathOperation.size = [100,60];
|
||||
|
||||
MathOperation.prototype.getTitle = function()
|
||||
{
|
||||
@@ -11344,7 +11381,7 @@ function MathCondition()
|
||||
this.addProperty( "B", 1 );
|
||||
this.addProperty( "OP", ">", "string", { values: MathCondition.values } );
|
||||
|
||||
this.size = [60,40];
|
||||
this.size = [80,60];
|
||||
}
|
||||
|
||||
MathCondition.values = [">","<","==","!=","<=",">="];
|
||||
@@ -12356,7 +12393,14 @@ if(global.glMatrix)
|
||||
|
||||
LiteGraph.wrapFunctionAsNode("string/split",toUpperCase, ["String","String"],"Array");
|
||||
|
||||
function toFixed(a)
|
||||
{
|
||||
if(a != null && a.constructor === Number)
|
||||
return a.toFixed(this.properties.precision);
|
||||
return a;
|
||||
}
|
||||
|
||||
LiteGraph.wrapFunctionAsNode("string/toFixed", toFixed, ["Number"], "String", { precision: 0 } );
|
||||
|
||||
})(this);
|
||||
(function(global){
|
||||
|
||||
904
build/litegraph.min.js
vendored
904
build/litegraph.min.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l7219"><code>../src/litegraph.js:7219</code></a>
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l8395"><code>../src/litegraph.js:8395</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l7219"><code>../src/litegraph.js:7219</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l8395"><code>../src/litegraph.js:8395</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l405"><code>../src/litegraph.js:405</code></a>
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l438"><code>../src/litegraph.js:438</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l405"><code>../src/litegraph.js:405</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l438"><code>../src/litegraph.js:438</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_addGlobalOutput">addGlobalOutput</a>
|
||||
<a href="#method_addOutput">addOutput</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
@@ -190,16 +190,20 @@
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_changeGlobalInputType">changeGlobalInputType</a>
|
||||
<a href="#method_changeInputType">changeInputType</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_changeGlobalOutputType">changeGlobalOutputType</a>
|
||||
<a href="#method_changeOutputType">changeOutputType</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_clear">clear</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_clearTriggeredSlots">clearTriggeredSlots</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_configure">configure</a>
|
||||
@@ -232,18 +236,14 @@
|
||||
<li class="index-item method">
|
||||
<a href="#method_getFixedTime">getFixedTime</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_getGlobalInputData">getGlobalInputData</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_getGlobalOutputData">getGlobalOutputData</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_getGroupOnPos">getGroupOnPos</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_getInputData">getInputData</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_getNodeById">getNodeById</a>
|
||||
@@ -270,19 +270,23 @@
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_removeGlobalInput">removeGlobalInput</a>
|
||||
<a href="#method_removeInput">removeInput</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_removeGlobalOutput">removeGlobalOutput</a>
|
||||
<a href="#method_removeLink">removeLink</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_renameGlobalInput">renameGlobalInput</a>
|
||||
<a href="#method_removeOutput">removeOutput</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_renameGlobalOutput">renameGlobalOutput</a>
|
||||
<a href="#method_renameInput">renameInput</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_renameOutput">renameOutput</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
@@ -302,11 +306,7 @@
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_setGlobalOutputData">setGlobalOutputData</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_setInputData">setInputData</a>
|
||||
<a href="#method_setOutputData">setOutputData</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
@@ -352,7 +352,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l947"><code>../src/litegraph.js:947</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1004"><code>../src/litegraph.js:1004</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1194"><code>../src/litegraph.js:1194</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1251"><code>../src/litegraph.js:1251</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -465,8 +465,8 @@
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_addGlobalOutput" class="method item">
|
||||
<h3 class="name"><code>addGlobalOutput</code></h3>
|
||||
<div id="method_addOutput" class="method item">
|
||||
<h3 class="name"><code>addOutput</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
@@ -492,7 +492,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1323"><code>../src/litegraph.js:1323</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1375"><code>../src/litegraph.js:1375</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l827"><code>../src/litegraph.js:827</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l885"><code>../src/litegraph.js:885</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -596,7 +596,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l489"><code>../src/litegraph.js:489</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l531"><code>../src/litegraph.js:531</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -628,8 +628,8 @@
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_changeGlobalInputType" class="method item">
|
||||
<h3 class="name"><code>changeGlobalInputType</code></h3>
|
||||
<div id="method_changeInputType" class="method item">
|
||||
<h3 class="name"><code>changeInputType</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
@@ -652,7 +652,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1281"><code>../src/litegraph.js:1281</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1333"><code>../src/litegraph.js:1333</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -694,8 +694,8 @@
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_changeGlobalOutputType" class="method item">
|
||||
<h3 class="name"><code>changeGlobalOutputType</code></h3>
|
||||
<div id="method_changeOutputType" class="method item">
|
||||
<h3 class="name"><code>changeOutputType</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
@@ -718,7 +718,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1407"><code>../src/litegraph.js:1407</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1450"><code>../src/litegraph.js:1450</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -775,7 +775,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l435"><code>../src/litegraph.js:435</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l468"><code>../src/litegraph.js:468</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -790,6 +790,37 @@
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_clearTriggeredSlots" class="method item">
|
||||
<h3 class="name"><code>clearTriggeredSlots</code></h3>
|
||||
|
||||
<span class="paren">()</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1533"><code>../src/litegraph.js:1533</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>clears the triggered slot animation in all links (stop visual animation)</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_configure" class="method item">
|
||||
<h3 class="name"><code>configure</code></h3>
|
||||
@@ -815,7 +846,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1542"><code>../src/litegraph.js:1542</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1619"><code>../src/litegraph.js:1619</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -880,7 +911,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l508"><code>../src/litegraph.js:508</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l550"><code>../src/litegraph.js:550</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -936,7 +967,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1105"><code>../src/litegraph.js:1105</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1162"><code>../src/litegraph.js:1162</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1002,7 +1033,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1138"><code>../src/litegraph.js:1138</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1195"><code>../src/litegraph.js:1195</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1068,7 +1099,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1121"><code>../src/litegraph.js:1121</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1178"><code>../src/litegraph.js:1178</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1128,7 +1159,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l790"><code>../src/litegraph.js:790</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l848"><code>../src/litegraph.js:848</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1172,7 +1203,7 @@ It doesnt include the node itself</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l892"><code>../src/litegraph.js:892</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l950"><code>../src/litegraph.js:950</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1216,7 +1247,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l881"><code>../src/litegraph.js:881</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l939"><code>../src/litegraph.js:939</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1240,136 +1271,6 @@ if the nodes are using graphical actions</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_getGlobalInputData" class="method item">
|
||||
<h3 class="name"><code>getGlobalInputData</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>name</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
<span class="returns-inline">
|
||||
<span class="type"></span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1236"><code>../src/litegraph.js:1236</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the current value of a global graph input</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">name</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="returns">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<div class="returns-description">
|
||||
<span class="type"></span>:
|
||||
<p>the data</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_getGlobalOutputData" class="method item">
|
||||
<h3 class="name"><code>getGlobalOutputData</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>name</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
<span class="returns-inline">
|
||||
<span class="type"></span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1356"><code>../src/litegraph.js:1356</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the current value of a global graph output</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">name</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="returns">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<div class="returns-description">
|
||||
<span class="type"></span>:
|
||||
<p>the data</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_getGroupOnPos" class="method item">
|
||||
<h3 class="name"><code>getGroupOnPos</code></h3>
|
||||
@@ -1398,7 +1299,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1174"><code>../src/litegraph.js:1174</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1231"><code>../src/litegraph.js:1231</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1450,6 +1351,71 @@ if the nodes are using graphical actions</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_getInputData" class="method item">
|
||||
<h3 class="name"><code>getInputData</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>name</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
<span class="returns-inline">
|
||||
<span class="type"></span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1288"><code>../src/litegraph.js:1288</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the current value of a global graph input</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">name</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="returns">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<div class="returns-description">
|
||||
<span class="type"></span>:
|
||||
<p>the data</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_getNodeById" class="method item">
|
||||
<h3 class="name"><code>getNodeById</code></h3>
|
||||
@@ -1472,7 +1438,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1092"><code>../src/litegraph.js:1092</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1149"><code>../src/litegraph.js:1149</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1534,7 +1500,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1154"><code>../src/litegraph.js:1154</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1211"><code>../src/litegraph.js:1211</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1622,7 +1588,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1370"><code>../src/litegraph.js:1370</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1408"><code>../src/litegraph.js:1408</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1630,7 +1596,7 @@ if the nodes are using graphical actions</p>
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Returns the current value of a global graph output (sames as getGlobalOutputData)</p>
|
||||
<p>Returns the current value of a global graph output</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1681,7 +1647,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l871"><code>../src/litegraph.js:871</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l929"><code>../src/litegraph.js:929</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1721,7 +1687,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1471"><code>../src/litegraph.js:1471</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1514"><code>../src/litegraph.js:1514</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1758,7 +1724,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1011"><code>../src/litegraph.js:1011</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1068"><code>../src/litegraph.js:1068</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1791,8 +1757,8 @@ if the nodes are using graphical actions</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_removeGlobalInput" class="method item">
|
||||
<h3 class="name"><code>removeGlobalInput</code></h3>
|
||||
<div id="method_removeInput" class="method item">
|
||||
<h3 class="name"><code>removeInput</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
@@ -1815,7 +1781,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1301"><code>../src/litegraph.js:1301</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1353"><code>../src/litegraph.js:1353</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1857,8 +1823,61 @@ if the nodes are using graphical actions</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_removeGlobalOutput" class="method item">
|
||||
<h3 class="name"><code>removeGlobalOutput</code></h3>
|
||||
<div id="method_removeLink" class="method item">
|
||||
<h3 class="name"><code>removeLink</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>link_id</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1565"><code>../src/litegraph.js:1565</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Destroys a link</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">link_id</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_removeOutput" class="method item">
|
||||
<h3 class="name"><code>removeOutput</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
@@ -1878,7 +1897,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1427"><code>../src/litegraph.js:1427</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1470"><code>../src/litegraph.js:1470</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1910,8 +1929,8 @@ if the nodes are using graphical actions</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_renameGlobalInput" class="method item">
|
||||
<h3 class="name"><code>renameGlobalInput</code></h3>
|
||||
<div id="method_renameInput" class="method item">
|
||||
<h3 class="name"><code>renameInput</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
@@ -1934,7 +1953,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1250"><code>../src/litegraph.js:1250</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1302"><code>../src/litegraph.js:1302</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1976,8 +1995,8 @@ if the nodes are using graphical actions</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_renameGlobalOutput" class="method item">
|
||||
<h3 class="name"><code>renameGlobalOutput</code></h3>
|
||||
<div id="method_renameOutput" class="method item">
|
||||
<h3 class="name"><code>renameOutput</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
@@ -2000,7 +2019,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1379"><code>../src/litegraph.js:1379</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1422"><code>../src/litegraph.js:1422</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2063,7 +2082,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l576"><code>../src/litegraph.js:576</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l634"><code>../src/litegraph.js:634</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2120,7 +2139,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l904"><code>../src/litegraph.js:904</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l962"><code>../src/litegraph.js:962</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2182,7 +2201,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1506"><code>../src/litegraph.js:1506</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1582"><code>../src/litegraph.js:1582</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2231,7 +2250,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1213"><code>../src/litegraph.js:1213</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1274"><code>../src/litegraph.js:1274</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2273,8 +2292,8 @@ if the nodes are using graphical actions</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_setGlobalOutputData" class="method item">
|
||||
<h3 class="name"><code>setGlobalOutputData</code></h3>
|
||||
<div id="method_setOutputData" class="method item">
|
||||
<h3 class="name"><code>setOutputData</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
@@ -2297,7 +2316,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1342"><code>../src/litegraph.js:1342</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1394"><code>../src/litegraph.js:1394</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2338,72 +2357,6 @@ if the nodes are using graphical actions</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_setInputData" class="method item">
|
||||
<h3 class="name"><code>setInputData</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>name</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>data</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1227"><code>../src/litegraph.js:1227</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Assign a data to the global graph input (same as setGlobalInputData)</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">name</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">data</code>
|
||||
<span class="type"></span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_start" class="method item">
|
||||
<h3 class="name"><code>start</code></h3>
|
||||
@@ -2426,7 +2379,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l525"><code>../src/litegraph.js:525</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l567"><code>../src/litegraph.js:567</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2448,7 +2401,7 @@ if the nodes are using graphical actions</p>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>amount of milliseconds between executions, default is 1</p>
|
||||
<p>amount of milliseconds between executions, if 0 then it renders to the monitor refresh rate</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -2474,7 +2427,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l554"><code>../src/litegraph.js:554</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l609"><code>../src/litegraph.js:609</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2505,7 +2458,7 @@ if the nodes are using graphical actions</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l658"><code>../src/litegraph.js:658</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l716"><code>../src/litegraph.js:716</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l3624"><code>../src/litegraph.js:3624</code></a>
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l4164"><code>../src/litegraph.js:4164</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3624"><code>../src/litegraph.js:3624</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4164"><code>../src/litegraph.js:4164</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4730"><code>../src/litegraph.js:4730</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5319"><code>../src/litegraph.js:5319</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -429,7 +429,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3498"><code>../src/litegraph.js:3498</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4038"><code>../src/litegraph.js:4038</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4816"><code>../src/litegraph.js:4816</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5403"><code>../src/litegraph.js:5403</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -491,7 +491,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4719"><code>../src/litegraph.js:4719</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5308"><code>../src/litegraph.js:5308</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -522,7 +522,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3306"><code>../src/litegraph.js:3306</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3837"><code>../src/litegraph.js:3837</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3406"><code>../src/litegraph.js:3406</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3938"><code>../src/litegraph.js:3938</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4849"><code>../src/litegraph.js:4849</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5436"><code>../src/litegraph.js:5436</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -638,7 +638,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4798"><code>../src/litegraph.js:4798</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5387"><code>../src/litegraph.js:5387</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -646,7 +646,7 @@
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>converts a coordinate in graphcanvas space to canvas2D space (NAME IS CONFUSION, SHOULD BE THE OTHER WAY AROUND)</p>
|
||||
<p>converts a coordinate from Canvas2D coordinates to graph space</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -669,7 +669,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4786"><code>../src/litegraph.js:4786</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5378"><code>../src/litegraph.js:5378</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -677,7 +677,7 @@
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>converts a coordinate in canvas2D space to graphcanvas space (NAME IS CONFUSION, SHOULD BE THE OTHER WAY AROUND)</p>
|
||||
<p>converts a coordinate from graph coordinates to canvas2D coordinates</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -700,7 +700,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4702"><code>../src/litegraph.js:4702</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5291"><code>../src/litegraph.js:5291</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -731,7 +731,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4679"><code>../src/litegraph.js:4679</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5268"><code>../src/litegraph.js:5268</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -762,7 +762,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4653"><code>../src/litegraph.js:4653</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5242"><code>../src/litegraph.js:5242</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -793,7 +793,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4874"><code>../src/litegraph.js:4874</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5461"><code>../src/litegraph.js:5461</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -824,7 +824,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5064"><code>../src/litegraph.js:5064</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5659"><code>../src/litegraph.js:5659</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -855,7 +855,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5639"><code>../src/litegraph.js:5639</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l6311"><code>../src/litegraph.js:6311</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -887,7 +887,7 @@ OPTIMIZE THIS: precatch connections position instead of recomputing them every t
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4905"><code>../src/litegraph.js:4905</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5488"><code>../src/litegraph.js:5488</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -918,7 +918,7 @@ OPTIMIZE THIS: precatch connections position instead of recomputing them every t
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5990"><code>../src/litegraph.js:5990</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l6924"><code>../src/litegraph.js:6924</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -949,7 +949,7 @@ OPTIMIZE THIS: precatch connections position instead of recomputing them every t
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5196"><code>../src/litegraph.js:5196</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5807"><code>../src/litegraph.js:5807</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -980,7 +980,7 @@ OPTIMIZE THIS: precatch connections position instead of recomputing them every t
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5467"><code>../src/litegraph.js:5467</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l6115"><code>../src/litegraph.js:6115</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1011,7 +1011,7 @@ OPTIMIZE THIS: precatch connections position instead of recomputing them every t
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5815"><code>../src/litegraph.js:5815</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l6663"><code>../src/litegraph.js:6663</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1042,7 +1042,7 @@ OPTIMIZE THIS: precatch connections position instead of recomputing them every t
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3598"><code>../src/litegraph.js:3598</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4138"><code>../src/litegraph.js:4138</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1077,7 +1077,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3640"><code>../src/litegraph.js:3640</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4180"><code>../src/litegraph.js:4180</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1117,7 +1117,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4296"><code>../src/litegraph.js:4296</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4876"><code>../src/litegraph.js:4876</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1148,7 +1148,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4308"><code>../src/litegraph.js:4308</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4888"><code>../src/litegraph.js:4888</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1185,7 +1185,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3379"><code>../src/litegraph.js:3379</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3911"><code>../src/litegraph.js:3911</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1232,7 +1232,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4485"><code>../src/litegraph.js:4485</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5074"><code>../src/litegraph.js:5074</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1263,7 +1263,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4332"><code>../src/litegraph.js:4332</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4917"><code>../src/litegraph.js:4917</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1294,7 +1294,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3921"><code>../src/litegraph.js:3921</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4501"><code>../src/litegraph.js:4501</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1325,7 +1325,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4112"><code>../src/litegraph.js:4112</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4675"><code>../src/litegraph.js:4675</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1356,7 +1356,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4263"><code>../src/litegraph.js:4263</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4847"><code>../src/litegraph.js:4847</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1387,7 +1387,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5911"><code>../src/litegraph.js:5911</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l6813"><code>../src/litegraph.js:6813</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1418,7 +1418,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5038"><code>../src/litegraph.js:5038</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5632"><code>../src/litegraph.js:5632</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1437,7 +1437,37 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div id="method_renderLink" class="method item">
|
||||
<h3 class="name"><code>renderLink</code></h3>
|
||||
|
||||
<span class="paren">()</span>
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>a</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>b</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>link</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>skip_border</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>flow</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>color</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>start_dir</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>end_dir</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>num_sublines</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -1449,7 +1479,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l5694"><code>../src/litegraph.js:5694</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l6398"><code>../src/litegraph.js:6398</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1461,6 +1491,111 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">a</code>
|
||||
<span class="type">Vec2</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>start pos</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">b</code>
|
||||
<span class="type">Vec2</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>end pos</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">link</code>
|
||||
<span class="type">Object</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>the link object with all the link info</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">skip_border</code>
|
||||
<span class="type">Boolean</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>ignore the shadow of the link</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">flow</code>
|
||||
<span class="type">Boolean</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>show flow animation (for events)</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">color</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>the color for the link</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">start_dir</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>the direction enum</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">end_dir</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>the direction enum</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">num_sublines</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>number of sublines (useful to represent vec3 or rgb)</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -1480,7 +1615,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l6035"><code>../src/litegraph.js:6035</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l6979"><code>../src/litegraph.js:6979</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1511,7 +1646,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4603"><code>../src/litegraph.js:4603</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5192"><code>../src/litegraph.js:5192</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1542,7 +1677,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4615"><code>../src/litegraph.js:4615</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5204"><code>../src/litegraph.js:5204</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1573,7 +1708,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4829"><code>../src/litegraph.js:4829</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5416"><code>../src/litegraph.js:5416</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1610,7 +1745,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3423"><code>../src/litegraph.js:3423</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3961"><code>../src/litegraph.js:3961</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1664,7 +1799,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3348"><code>../src/litegraph.js:3348</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3880"><code>../src/litegraph.js:3880</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1711,7 +1846,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l4758"><code>../src/litegraph.js:4758</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l5347"><code>../src/litegraph.js:5347</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1742,7 +1877,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3654"><code>../src/litegraph.js:3654</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4194"><code>../src/litegraph.js:4194</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1773,7 +1908,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3678"><code>../src/litegraph.js:3678</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4218"><code>../src/litegraph.js:4218</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1804,7 +1939,7 @@ this is useful if you plant to render 3D objects inside your nodes, it uses lite
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l6058"><code>../src/litegraph.js:6058</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l7002"><code>../src/litegraph.js:7002</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1836,7 +1971,7 @@ this feature was designed when graphs where meant to create user interfaces</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3550"><code>../src/litegraph.js:3550</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l4090"><code>../src/litegraph.js:4090</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l1692"><code>../src/litegraph.js:1692</code></a>
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l1830"><code>../src/litegraph.js:1830</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -140,6 +140,10 @@
|
||||
<li class="index-item method">
|
||||
<a href="#method_addWidget">addWidget</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_clearTriggeredSlot">clearTriggeredSlot</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_collapse">collapse</a>
|
||||
@@ -188,6 +192,10 @@
|
||||
<li class="index-item method">
|
||||
<a href="#method_getInputDataByName">getInputDataByName</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_getInputDataType">getInputDataType</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_getInputInfo">getInputInfo</a>
|
||||
@@ -256,6 +264,10 @@
|
||||
<li class="index-item method">
|
||||
<a href="#method_setOutputData">setOutputData</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_setOutputDataType">setOutputDataType</a>
|
||||
|
||||
</li>
|
||||
<li class="index-item method">
|
||||
<a href="#method_toString">toString</a>
|
||||
@@ -309,7 +321,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2434"><code>../src/litegraph.js:2434</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2665"><code>../src/litegraph.js:2665</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -401,7 +413,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2371"><code>../src/litegraph.js:2371</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2590"><code>../src/litegraph.js:2590</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -476,7 +488,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2395"><code>../src/litegraph.js:2395</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2615"><code>../src/litegraph.js:2615</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -536,7 +548,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2309"><code>../src/litegraph.js:2309</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2511"><code>../src/litegraph.js:2511</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -611,7 +623,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2332"><code>../src/litegraph.js:2332</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2535"><code>../src/litegraph.js:2535</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -674,7 +686,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2283"><code>../src/litegraph.js:2283</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2485"><code>../src/litegraph.js:2485</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -744,7 +756,7 @@
|
||||
<span class="paren">()</span>
|
||||
|
||||
<span class="returns-inline">
|
||||
<span class="type">Float32Array4</span>
|
||||
<span class="type">Object</span>
|
||||
</span>
|
||||
|
||||
|
||||
@@ -756,7 +768,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2510"><code>../src/litegraph.js:2510</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2753"><code>../src/litegraph.js:2753</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -773,13 +785,81 @@
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<div class="returns-description">
|
||||
<span class="type">Float32Array4</span>:
|
||||
<p>the total size</p>
|
||||
<span class="type">Object</span>:
|
||||
<p>the created widget</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_clearTriggeredSlot" class="method item">
|
||||
<h3 class="name"><code>clearTriggeredSlot</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>slot</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>link_id</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2453"><code>../src/litegraph.js:2453</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>clears the trigger slot animation</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">slot</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>the index of the output slot</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">link_id</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>[optional] in case you want to trigger and specific output link in a slot</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_collapse" class="method item">
|
||||
<h3 class="name"><code>collapse</code></h3>
|
||||
@@ -796,7 +876,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3072"><code>../src/litegraph.js:3072</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3390"><code>../src/litegraph.js:3390</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -836,7 +916,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2455"><code>../src/litegraph.js:2455</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2686"><code>../src/litegraph.js:2686</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -892,7 +972,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1744"><code>../src/litegraph.js:1744</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1881"><code>../src/litegraph.js:1881</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -926,7 +1006,7 @@
|
||||
</div>
|
||||
|
||||
<span class="returns-inline">
|
||||
<span class="type">Boolean</span>
|
||||
<span class="type">Object</span>
|
||||
</span>
|
||||
|
||||
|
||||
@@ -938,7 +1018,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2640"><code>../src/litegraph.js:2640</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2899"><code>../src/litegraph.js:2899</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -994,8 +1074,8 @@
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<div class="returns-description">
|
||||
<span class="type">Boolean</span>:
|
||||
<p>if it was connected succesfully</p>
|
||||
<span class="type">Object</span>:
|
||||
<p>the link_info is created, otherwise null</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1026,7 +1106,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2870"><code>../src/litegraph.js:2870</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3132"><code>../src/litegraph.js:3132</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1095,7 +1175,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2768"><code>../src/litegraph.js:2768</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3024"><code>../src/litegraph.js:3024</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1172,7 +1252,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2609"><code>../src/litegraph.js:2609</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2868"><code>../src/litegraph.js:2868</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1238,7 +1318,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2625"><code>../src/litegraph.js:2625</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2884"><code>../src/litegraph.js:2884</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1298,7 +1378,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2538"><code>../src/litegraph.js:2538</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2791"><code>../src/litegraph.js:2791</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1335,6 +1415,9 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<li class="arg">
|
||||
<code>slot</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>out</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
@@ -1351,7 +1434,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2939"><code>../src/litegraph.js:2939</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3206"><code>../src/litegraph.js:3206</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1389,6 +1472,17 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">out</code>
|
||||
<span class="type">Vec2</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>[optional] a place to store the output, to free garbage</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1431,7 +1525,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1991"><code>../src/litegraph.js:1991</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2129"><code>../src/litegraph.js:2129</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1510,7 +1604,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2027"><code>../src/litegraph.js:2027</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2191"><code>../src/litegraph.js:2191</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1561,6 +1655,71 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_getInputDataType" class="method item">
|
||||
<h3 class="name"><code>getInputDataType</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>slot</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
<span class="returns-inline">
|
||||
<span class="type">String</span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2165"><code>../src/litegraph.js:2165</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Retrieves the input data type (in case this supports multiple input types)</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">slot</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="returns">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<div class="returns-description">
|
||||
<span class="type">String</span>:
|
||||
<p>datatype in string format</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_getInputInfo" class="method item">
|
||||
<h3 class="name"><code>getInputInfo</code></h3>
|
||||
@@ -1586,7 +1745,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2056"><code>../src/litegraph.js:2056</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2220"><code>../src/litegraph.js:2220</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1651,7 +1810,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2071"><code>../src/litegraph.js:2071</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2235"><code>../src/litegraph.js:2235</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1716,7 +1875,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2093"><code>../src/litegraph.js:2093</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2257"><code>../src/litegraph.js:2257</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1781,7 +1940,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2117"><code>../src/litegraph.js:2117</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2284"><code>../src/litegraph.js:2284</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1846,7 +2005,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2135"><code>../src/litegraph.js:2135</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2302"><code>../src/litegraph.js:2302</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1911,7 +2070,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2180"><code>../src/litegraph.js:2180</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2347"><code>../src/litegraph.js:2347</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1977,7 +2136,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2578"><code>../src/litegraph.js:2578</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2836"><code>../src/litegraph.js:2836</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2043,7 +2202,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1942"><code>../src/litegraph.js:1942</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2051"><code>../src/litegraph.js:2051</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2077,7 +2236,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2164"><code>../src/litegraph.js:2164</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2331"><code>../src/litegraph.js:2331</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2124,7 +2283,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2043"><code>../src/litegraph.js:2043</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2207"><code>../src/litegraph.js:2207</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2187,7 +2346,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2151"><code>../src/litegraph.js:2151</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2318"><code>../src/litegraph.js:2318</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2253,7 +2412,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2554"><code>../src/litegraph.js:2554</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2810"><code>../src/litegraph.js:2810</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2317,7 +2476,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l3088"><code>../src/litegraph.js:3088</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l3406"><code>../src/litegraph.js:3406</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2354,7 +2513,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2420"><code>../src/litegraph.js:2420</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2641"><code>../src/litegraph.js:2641</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2407,7 +2566,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2357"><code>../src/litegraph.js:2357</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2561"><code>../src/litegraph.js:2561</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2454,7 +2613,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1848"><code>../src/litegraph.js:1848</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l1949"><code>../src/litegraph.js:1949</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2494,7 +2653,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1955"><code>../src/litegraph.js:1955</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2064"><code>../src/litegraph.js:2064</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2535,6 +2694,72 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_setOutputDataType" class="method item">
|
||||
<h3 class="name"><code>setOutputDataType</code></h3>
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
<li class="arg">
|
||||
<code>slot</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>datatype</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2100"><code>../src/litegraph.js:2100</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>sets the output data type, useful when you want to be able to overwrite the data type</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
<li class="param">
|
||||
<code class="param-name">slot</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">datatype</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="method_toString" class="method item">
|
||||
<h3 class="name"><code>toString</code></h3>
|
||||
@@ -2551,7 +2776,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l1930"><code>../src/litegraph.js:1930</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2039"><code>../src/litegraph.js:2039</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2591,7 +2816,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2213"><code>../src/litegraph.js:2213</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2380"><code>../src/litegraph.js:2380</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2645,6 +2870,9 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<li class="arg">
|
||||
<code>param</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>link_id</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
@@ -2658,7 +2886,7 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l2236"><code>../src/litegraph.js:2236</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l2403"><code>../src/litegraph.js:2403</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2695,6 +2923,17 @@ bounding is: [topleft_cornerx, topleft_cornery, width, height]</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">link_id</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>[optional] in case you want to trigger and specific output link in a slot</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l18"><code>../src/litegraph.js:18</code></a>
|
||||
Defined in: <a href="../files/.._src_litegraph.js.html#l6"><code>../src/litegraph.js:6</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l18"><code>../src/litegraph.js:18</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l6"><code>../src/litegraph.js:6</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l179"><code>../src/litegraph.js:179</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l193"><code>../src/litegraph.js:193</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l197"><code>../src/litegraph.js:197</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l211"><code>../src/litegraph.js:211</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l240"><code>../src/litegraph.js:240</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l270"><code>../src/litegraph.js:270</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l253"><code>../src/litegraph.js:253</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l281"><code>../src/litegraph.js:281</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l281"><code>../src/litegraph.js:281</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l309"><code>../src/litegraph.js:309</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -519,7 +519,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l82"><code>../src/litegraph.js:82</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l93"><code>../src/litegraph.js:93</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -580,6 +580,9 @@
|
||||
<li class="arg">
|
||||
<code>return_type</code>
|
||||
</li>
|
||||
<li class="arg">
|
||||
<code>properties</code>
|
||||
</li>
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
@@ -593,7 +596,7 @@
|
||||
<div class="meta">
|
||||
<p>
|
||||
Defined in
|
||||
<a href="../files/.._src_litegraph.js.html#l149"><code>../src/litegraph.js:149</code></a>
|
||||
<a href="../files/.._src_litegraph.js.html#l160"><code>../src/litegraph.js:160</code></a>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -653,6 +656,17 @@ Useful to wrap simple methods that do not require properties, and that only proc
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="param">
|
||||
<code class="param-name">properties</code>
|
||||
<span class="type">Object</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>[optional] properties to be configurable</p>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
477
doc/data.json
477
doc/data.json
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
192
src/litegraph.js
192
src/litegraph.js
@@ -83,7 +83,7 @@ var LiteGraph = global.LiteGraph = {
|
||||
debug: false,
|
||||
catch_exceptions: true,
|
||||
throw_errors: true,
|
||||
allow_scripts: false,
|
||||
allow_scripts: false, //if set to true some nodes like Formula would be allowed to evaluate code that comes from unsafe sources (like node configuration), which could lead to exploits
|
||||
registered_node_types: {}, //nodetypes by string
|
||||
node_types_by_file_extension: {}, //used for droping files in the canvas
|
||||
Nodes: {}, //node types by classname
|
||||
@@ -165,8 +165,9 @@ var LiteGraph = global.LiteGraph = {
|
||||
* @param {Function} func
|
||||
* @param {Array} param_types [optional] an array containing the type of every parameter, otherwise parameters will accept any type
|
||||
* @param {String} return_type [optional] string with the return type, otherwise it will be generic
|
||||
* @param {Object} properties [optional] properties to be configurable
|
||||
*/
|
||||
wrapFunctionAsNode: function( name, func, param_types, return_type )
|
||||
wrapFunctionAsNode: function( name, func, param_types, return_type, properties )
|
||||
{
|
||||
var params = Array(func.length);
|
||||
var code = "";
|
||||
@@ -174,6 +175,8 @@ var LiteGraph = global.LiteGraph = {
|
||||
for(var i = 0; i < names.length; ++i)
|
||||
code += "this.addInput('"+names[i]+"',"+(param_types && param_types[i] ? "'" + param_types[i] + "'" : "0") + ");\n";
|
||||
code += "this.addOutput('out',"+( return_type ? "'" + return_type + "'" : 0 )+");\n";
|
||||
if(properties)
|
||||
code += "this.properties = " + JSON.stringify(properties) + ";\n";
|
||||
var classobj = Function(code);
|
||||
classobj.title = name.split("/").pop();
|
||||
classobj.desc = "Generated from " + func.name;
|
||||
@@ -516,8 +519,8 @@ LGraph.prototype.clear = function()
|
||||
this.catch_errors = true;
|
||||
|
||||
//subgraph_data
|
||||
this.global_inputs = {};
|
||||
this.global_outputs = {};
|
||||
this.inputs = {};
|
||||
this.outputs = {};
|
||||
|
||||
//notify canvas to redraw
|
||||
this.change();
|
||||
@@ -1252,16 +1255,20 @@ LGraph.prototype.getGroupOnPos = function(x,y)
|
||||
* @param {String} type
|
||||
* @param {*} value [optional]
|
||||
*/
|
||||
LGraph.prototype.addGlobalInput = function(name, type, value)
|
||||
LGraph.prototype.addInput = function(name, type, value)
|
||||
{
|
||||
this.global_inputs[name] = { name: name, type: type, value: value };
|
||||
var input = this.inputs[ name ];
|
||||
if( input ) //already exist
|
||||
return;
|
||||
|
||||
this.inputs[ name ] = { name: name, type: type, value: value };
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalInputAdded)
|
||||
this.onGlobalInputAdded(name, type);
|
||||
if(this.onInputAdded)
|
||||
this.onInputAdded(name, type);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1270,32 +1277,23 @@ LGraph.prototype.addGlobalInput = function(name, type, value)
|
||||
* @param {String} name
|
||||
* @param {*} data
|
||||
*/
|
||||
LGraph.prototype.setGlobalInputData = function(name, data)
|
||||
LGraph.prototype.setInputData = function(name, data)
|
||||
{
|
||||
var input = this.global_inputs[name];
|
||||
var input = this.inputs[name];
|
||||
if (!input)
|
||||
return;
|
||||
input.value = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a data to the global graph input (same as setGlobalInputData)
|
||||
* @method setInputData
|
||||
* @param {String} name
|
||||
* @param {*} data
|
||||
*/
|
||||
LGraph.prototype.setInputData = LGraph.prototype.setGlobalInputData;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the current value of a global graph input
|
||||
* @method getGlobalInputData
|
||||
* @method getInputData
|
||||
* @param {String} name
|
||||
* @return {*} the data
|
||||
*/
|
||||
LGraph.prototype.getGlobalInputData = function(name)
|
||||
LGraph.prototype.getInputData = function(name)
|
||||
{
|
||||
var input = this.global_inputs[name];
|
||||
var input = this.inputs[name];
|
||||
if (!input)
|
||||
return null;
|
||||
return input.value;
|
||||
@@ -1303,105 +1301,105 @@ LGraph.prototype.getGlobalInputData = function(name)
|
||||
|
||||
/**
|
||||
* Changes the name of a global graph input
|
||||
* @method renameGlobalInput
|
||||
* @method renameInput
|
||||
* @param {String} old_name
|
||||
* @param {String} new_name
|
||||
*/
|
||||
LGraph.prototype.renameGlobalInput = function(old_name, name)
|
||||
LGraph.prototype.renameInput = function(old_name, name)
|
||||
{
|
||||
if(name == old_name)
|
||||
return;
|
||||
|
||||
if(!this.global_inputs[old_name])
|
||||
if(!this.inputs[old_name])
|
||||
return false;
|
||||
|
||||
if(this.global_inputs[name])
|
||||
if(this.inputs[name])
|
||||
{
|
||||
console.error("there is already one input with that name");
|
||||
return false;
|
||||
}
|
||||
|
||||
this.global_inputs[name] = this.global_inputs[old_name];
|
||||
delete this.global_inputs[old_name];
|
||||
this.inputs[name] = this.inputs[old_name];
|
||||
delete this.inputs[old_name];
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalInputRenamed)
|
||||
this.onGlobalInputRenamed(old_name, name);
|
||||
if(this.onInputRenamed)
|
||||
this.onInputRenamed(old_name, name);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the type of a global graph input
|
||||
* @method changeGlobalInputType
|
||||
* @method changeInputType
|
||||
* @param {String} name
|
||||
* @param {String} type
|
||||
*/
|
||||
LGraph.prototype.changeGlobalInputType = function(name, type)
|
||||
LGraph.prototype.changeInputType = function(name, type)
|
||||
{
|
||||
if(!this.global_inputs[name])
|
||||
if(!this.inputs[name])
|
||||
return false;
|
||||
|
||||
if(this.global_inputs[name].type && this.global_inputs[name].type.toLowerCase() == type.toLowerCase() )
|
||||
if(this.inputs[name].type && this.inputs[name].type.toLowerCase() == type.toLowerCase() )
|
||||
return;
|
||||
|
||||
this.global_inputs[name].type = type;
|
||||
this.inputs[name].type = type;
|
||||
this._version++;
|
||||
if(this.onGlobalInputTypeChanged)
|
||||
this.onGlobalInputTypeChanged(name, type);
|
||||
if(this.onInputTypeChanged)
|
||||
this.onInputTypeChanged(name, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a global graph input
|
||||
* @method removeGlobalInput
|
||||
* @method removeInput
|
||||
* @param {String} name
|
||||
* @param {String} type
|
||||
*/
|
||||
LGraph.prototype.removeGlobalInput = function(name)
|
||||
LGraph.prototype.removeInput = function(name)
|
||||
{
|
||||
if(!this.global_inputs[name])
|
||||
if(!this.inputs[name])
|
||||
return false;
|
||||
|
||||
delete this.global_inputs[name];
|
||||
delete this.inputs[name];
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalInputRemoved)
|
||||
this.onGlobalInputRemoved(name);
|
||||
if(this.onInputRemoved)
|
||||
this.onInputRemoved(name);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a global graph output
|
||||
* @method addGlobalOutput
|
||||
* @method addOutput
|
||||
* @param {String} name
|
||||
* @param {String} type
|
||||
* @param {*} value
|
||||
*/
|
||||
LGraph.prototype.addGlobalOutput = function(name, type, value)
|
||||
LGraph.prototype.addOutput = function(name, type, value)
|
||||
{
|
||||
this.global_outputs[name] = { name: name, type: type, value: value };
|
||||
this.outputs[name] = { name: name, type: type, value: value };
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalOutputAdded)
|
||||
this.onGlobalOutputAdded(name, type);
|
||||
if(this.onOutputAdded)
|
||||
this.onOutputAdded(name, type);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a data to the global output
|
||||
* @method setGlobalOutputData
|
||||
* @method setOutputData
|
||||
* @param {String} name
|
||||
* @param {String} value
|
||||
*/
|
||||
LGraph.prototype.setGlobalOutputData = function(name, value)
|
||||
LGraph.prototype.setOutputData = function(name, value)
|
||||
{
|
||||
var output = this.global_outputs[ name ];
|
||||
var output = this.outputs[ name ];
|
||||
if (!output)
|
||||
return;
|
||||
output.value = value;
|
||||
@@ -1409,92 +1407,83 @@ LGraph.prototype.setGlobalOutputData = function(name, value)
|
||||
|
||||
/**
|
||||
* Returns the current value of a global graph output
|
||||
* @method getGlobalOutputData
|
||||
* @method getOutputData
|
||||
* @param {String} name
|
||||
* @return {*} the data
|
||||
*/
|
||||
LGraph.prototype.getGlobalOutputData = function(name)
|
||||
LGraph.prototype.getOutputData = function(name)
|
||||
{
|
||||
var output = this.global_outputs[name];
|
||||
var output = this.outputs[name];
|
||||
if (!output)
|
||||
return null;
|
||||
return output.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current value of a global graph output (sames as getGlobalOutputData)
|
||||
* @method getOutputData
|
||||
* @param {String} name
|
||||
* @return {*} the data
|
||||
*/
|
||||
LGraph.prototype.getOutputData = LGraph.prototype.getGlobalOutputData;
|
||||
|
||||
|
||||
/**
|
||||
* Renames a global graph output
|
||||
* @method renameGlobalOutput
|
||||
* @method renameOutput
|
||||
* @param {String} old_name
|
||||
* @param {String} new_name
|
||||
*/
|
||||
LGraph.prototype.renameGlobalOutput = function(old_name, name)
|
||||
LGraph.prototype.renameOutput = function(old_name, name)
|
||||
{
|
||||
if(!this.global_outputs[old_name])
|
||||
if(!this.outputs[old_name])
|
||||
return false;
|
||||
|
||||
if(this.global_outputs[name])
|
||||
if(this.outputs[name])
|
||||
{
|
||||
console.error("there is already one output with that name");
|
||||
return false;
|
||||
}
|
||||
|
||||
this.global_outputs[name] = this.global_outputs[old_name];
|
||||
delete this.global_outputs[old_name];
|
||||
this.outputs[name] = this.outputs[old_name];
|
||||
delete this.outputs[old_name];
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalOutputRenamed)
|
||||
this.onGlobalOutputRenamed(old_name, name);
|
||||
if(this.onOutputRenamed)
|
||||
this.onOutputRenamed(old_name, name);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the type of a global graph output
|
||||
* @method changeGlobalOutputType
|
||||
* @method changeOutputType
|
||||
* @param {String} name
|
||||
* @param {String} type
|
||||
*/
|
||||
LGraph.prototype.changeGlobalOutputType = function(name, type)
|
||||
LGraph.prototype.changeOutputType = function(name, type)
|
||||
{
|
||||
if(!this.global_outputs[name])
|
||||
if(!this.outputs[name])
|
||||
return false;
|
||||
|
||||
if(this.global_outputs[name].type && this.global_outputs[name].type.toLowerCase() == type.toLowerCase() )
|
||||
if(this.outputs[name].type && this.outputs[name].type.toLowerCase() == type.toLowerCase() )
|
||||
return;
|
||||
|
||||
this.global_outputs[name].type = type;
|
||||
this.outputs[name].type = type;
|
||||
this._version++;
|
||||
if(this.onGlobalOutputTypeChanged)
|
||||
this.onGlobalOutputTypeChanged(name, type);
|
||||
if(this.onOutputTypeChanged)
|
||||
this.onOutputTypeChanged(name, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a global graph output
|
||||
* @method removeGlobalOutput
|
||||
* @method removeOutput
|
||||
* @param {String} name
|
||||
*/
|
||||
LGraph.prototype.removeGlobalOutput = function(name)
|
||||
LGraph.prototype.removeOutput = function(name)
|
||||
{
|
||||
if(!this.global_outputs[name])
|
||||
if(!this.outputs[name])
|
||||
return false;
|
||||
delete this.global_outputs[name];
|
||||
delete this.outputs[name];
|
||||
this._version++;
|
||||
|
||||
if(this.onGlobalOutputRemoved)
|
||||
this.onGlobalOutputRemoved(name);
|
||||
if(this.onOutputRemoved)
|
||||
this.onOutputRemoved(name);
|
||||
|
||||
if(this.onGlobalsChange)
|
||||
this.onGlobalsChange();
|
||||
if(this.onInputsOutputsChange)
|
||||
this.onInputsOutputsChange();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1807,7 +1796,7 @@ LiteGraph.LLink = LLink;
|
||||
+ collapsed: if it is collapsed
|
||||
|
||||
supported callbacks:
|
||||
+ onAdded: when added to graph
|
||||
+ onAdded: when added to graph (warning: this is called BEFORE the node is configured when loading)
|
||||
+ onRemoved: when removed from graph
|
||||
+ onStart: when the graph starts playing
|
||||
+ onStop: when the graph stops playing
|
||||
@@ -1826,6 +1815,7 @@ LiteGraph.LLink = LLink;
|
||||
+ onDblClick: double clicked in the node
|
||||
+ onInputDblClick: input slot double clicked (can be used to automatically create a node connected)
|
||||
+ onOutputDblClick: output slot double clicked (can be used to automatically create a node connected)
|
||||
+ onConfigure: called after the node has been configured
|
||||
+ onSerialize: to add extra info when serializing (the callback receives the object that should be filled with the data)
|
||||
+ onSelected
|
||||
+ onDeselected
|
||||
@@ -7428,6 +7418,8 @@ LGraphCanvas.prototype.prompt = function( title, value, callback, event )
|
||||
var input_html = "";
|
||||
title = title || "";
|
||||
|
||||
var modified = false;
|
||||
|
||||
var dialog = document.createElement("div");
|
||||
dialog.className = "graphdialog rounded";
|
||||
dialog.innerHTML = "<span class='name'></span> <input autofocus type='text' class='value'/><button class='rounded'>OK</button>";
|
||||
@@ -7442,7 +7434,8 @@ LGraphCanvas.prototype.prompt = function( title, value, callback, event )
|
||||
dialog.style.transform = "scale("+this.ds.scale+")";
|
||||
|
||||
dialog.addEventListener("mouseleave",function(e){
|
||||
dialog.close();
|
||||
if(!modified)
|
||||
dialog.close();
|
||||
});
|
||||
|
||||
if(that.prompt_box)
|
||||
@@ -7460,6 +7453,7 @@ LGraphCanvas.prototype.prompt = function( title, value, callback, event )
|
||||
|
||||
var input = dialog.querySelector("input");
|
||||
input.addEventListener("keydown", function(e){
|
||||
modified = true;
|
||||
if(e.keyCode == 27) //ESC
|
||||
dialog.close();
|
||||
else if(e.keyCode == 13)
|
||||
@@ -8238,7 +8232,7 @@ LGraphCanvas.prototype.processContextMenu = function( node, event )
|
||||
var dialog = that.createDialog( "<span class='name'>Name</span><input autofocus type='text'/><button>OK</button>" , options );
|
||||
var input = dialog.querySelector("input");
|
||||
if(input && slot_info){
|
||||
input.value = slot_info.label;
|
||||
input.value = slot_info.label || "";
|
||||
}
|
||||
dialog.querySelector("button").addEventListener("click",function(e){
|
||||
if(input.value)
|
||||
|
||||
@@ -26,20 +26,23 @@ function Subgraph()
|
||||
{
|
||||
var that = this;
|
||||
this.size = [140,80];
|
||||
this.properties = { enabled: true };
|
||||
this.addInput("enabled","boolean");
|
||||
|
||||
//create inner graph
|
||||
this.subgraph = new LGraph();
|
||||
this.subgraph._subgraph_node = this;
|
||||
this.subgraph._is_subgraph = true;
|
||||
|
||||
this.subgraph.onGlobalInputAdded = this.onSubgraphNewGlobalInput.bind(this);
|
||||
this.subgraph.onGlobalInputRenamed = this.onSubgraphRenamedGlobalInput.bind(this);
|
||||
this.subgraph.onGlobalInputTypeChanged = this.onSubgraphTypeChangeGlobalInput.bind(this);
|
||||
|
||||
this.subgraph.onGlobalOutputAdded = this.onSubgraphNewGlobalOutput.bind(this);
|
||||
this.subgraph.onGlobalOutputRenamed = this.onSubgraphRenamedGlobalOutput.bind(this);
|
||||
this.subgraph.onGlobalOutputTypeChanged = this.onSubgraphTypeChangeGlobalOutput.bind(this);
|
||||
this.subgraph.onInputAdded = this.onSubgraphNewInput.bind(this);
|
||||
this.subgraph.onInputRenamed = this.onSubgraphRenamedInput.bind(this);
|
||||
this.subgraph.onInputTypeChanged = this.onSubgraphTypeChangeInput.bind(this);
|
||||
this.subgraph.onInputRemoved = this.onSubgraphRemovedInput.bind(this);
|
||||
|
||||
this.subgraph.onOutputAdded = this.onSubgraphNewOutput.bind(this);
|
||||
this.subgraph.onOutputRenamed = this.onSubgraphRenamedOutput.bind(this);
|
||||
this.subgraph.onOutputTypeChanged = this.onSubgraphTypeChangeOutput.bind(this);
|
||||
this.subgraph.onOutputRemoved = this.onSubgraphRemovedOutput.bind(this);
|
||||
}
|
||||
|
||||
Subgraph.title = "Subgraph";
|
||||
@@ -69,7 +72,6 @@ Subgraph.prototype.onDblClick = function(e,pos,graphcanvas)
|
||||
setTimeout(function(){ graphcanvas.openSubgraph( that.subgraph ); },10 );
|
||||
}
|
||||
|
||||
|
||||
Subgraph.prototype.onMouseDown = function(e,pos,graphcanvas)
|
||||
{
|
||||
if( !this.flags.collapsed && pos[0] > this.size[0] - LiteGraph.NODE_TITLE_HEIGHT && pos[1] < 0 )
|
||||
@@ -79,13 +81,43 @@ Subgraph.prototype.onMouseDown = function(e,pos,graphcanvas)
|
||||
}
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphNewGlobalInput = function(name, type)
|
||||
Subgraph.prototype.onExecute = function()
|
||||
{
|
||||
//add input to the node
|
||||
this.addInput(name, type);
|
||||
if( !this.getInputOrProperty("enabled") )
|
||||
return;
|
||||
|
||||
//send inputs to subgraph global inputs
|
||||
if(this.inputs)
|
||||
for(var i = 0; i < this.inputs.length; i++)
|
||||
{
|
||||
var input = this.inputs[i];
|
||||
var value = this.getInputData(i);
|
||||
this.subgraph.setInputData( input.name, value );
|
||||
}
|
||||
|
||||
//execute
|
||||
this.subgraph.runStep();
|
||||
|
||||
//send subgraph global outputs to outputs
|
||||
if(this.outputs)
|
||||
for(var i = 0; i < this.outputs.length; i++)
|
||||
{
|
||||
var output = this.outputs[i];
|
||||
var value = this.subgraph.getOutputData( output.name );
|
||||
this.setOutputData(i, value);
|
||||
}
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphRenamedGlobalInput = function(oldname, name)
|
||||
//**** INPUTS ***********************************
|
||||
Subgraph.prototype.onSubgraphNewInput = function(name, type)
|
||||
{
|
||||
//add input to the node
|
||||
var slot = this.findInputSlot(name);
|
||||
if(slot == -1)
|
||||
this.addInput(name, type);
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphRenamedInput = function(oldname, name)
|
||||
{
|
||||
var slot = this.findInputSlot( oldname );
|
||||
if(slot == -1)
|
||||
@@ -94,7 +126,7 @@ Subgraph.prototype.onSubgraphRenamedGlobalInput = function(oldname, name)
|
||||
info.name = name;
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphTypeChangeGlobalInput = function(name, type)
|
||||
Subgraph.prototype.onSubgraphTypeChangeInput = function(name, type)
|
||||
{
|
||||
var slot = this.findInputSlot( name );
|
||||
if(slot == -1)
|
||||
@@ -103,15 +135,23 @@ Subgraph.prototype.onSubgraphTypeChangeGlobalInput = function(name, type)
|
||||
info.type = type;
|
||||
}
|
||||
|
||||
|
||||
Subgraph.prototype.onSubgraphNewGlobalOutput = function(name, type)
|
||||
Subgraph.prototype.onSubgraphRemovedInput = function(name)
|
||||
{
|
||||
//add output to the node
|
||||
this.addOutput(name, type);
|
||||
var slot = this.findInputSlot( name );
|
||||
if(slot == -1)
|
||||
return;
|
||||
this.removeInput(slot);
|
||||
}
|
||||
|
||||
//**** OUTPUTS ***********************************
|
||||
Subgraph.prototype.onSubgraphNewOutput = function(name, type)
|
||||
{
|
||||
var slot = this.findOutputSlot(name);
|
||||
if(slot == -1)
|
||||
this.addOutput(name, type);
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphRenamedGlobalOutput = function(oldname, name)
|
||||
Subgraph.prototype.onSubgraphRenamedOutput = function(oldname, name)
|
||||
{
|
||||
var slot = this.findOutputSlot( oldname );
|
||||
if(slot == -1)
|
||||
@@ -120,7 +160,7 @@ Subgraph.prototype.onSubgraphRenamedGlobalOutput = function(oldname, name)
|
||||
info.name = name;
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphTypeChangeGlobalOutput = function(name, type)
|
||||
Subgraph.prototype.onSubgraphTypeChangeOutput = function(name, type)
|
||||
{
|
||||
var slot = this.findOutputSlot( name );
|
||||
if(slot == -1)
|
||||
@@ -129,6 +169,14 @@ Subgraph.prototype.onSubgraphTypeChangeGlobalOutput = function(name, type)
|
||||
info.type = type;
|
||||
}
|
||||
|
||||
Subgraph.prototype.onSubgraphRemovedOutput = function(name)
|
||||
{
|
||||
var slot = this.findInputSlot( name );
|
||||
if(slot == -1)
|
||||
return;
|
||||
this.removeOutput(slot);
|
||||
}
|
||||
// *****************************************************
|
||||
|
||||
Subgraph.prototype.getExtraMenuOptions = function(graphcanvas)
|
||||
{
|
||||
@@ -145,42 +193,13 @@ Subgraph.prototype.onResize = function(size)
|
||||
size[1] += 20;
|
||||
}
|
||||
|
||||
Subgraph.prototype.onExecute = function()
|
||||
{
|
||||
//send inputs to subgraph global inputs
|
||||
if(this.inputs)
|
||||
for(var i = 0; i < this.inputs.length; i++)
|
||||
{
|
||||
var input = this.inputs[i];
|
||||
var value = this.getInputData(i);
|
||||
this.subgraph.setGlobalInputData( input.name, value );
|
||||
}
|
||||
|
||||
//execute
|
||||
this.subgraph.runStep();
|
||||
|
||||
//send subgraph global outputs to outputs
|
||||
if(this.outputs)
|
||||
for(var i = 0; i < this.outputs.length; i++)
|
||||
{
|
||||
var output = this.outputs[i];
|
||||
var value = this.subgraph.getGlobalOutputData( output.name );
|
||||
this.setOutputData(i, value);
|
||||
}
|
||||
}
|
||||
|
||||
Subgraph.prototype.configure = function(o)
|
||||
{
|
||||
LGraphNode.prototype.configure.call(this, o);
|
||||
//this.subgraph.configure(o.graph);
|
||||
}
|
||||
|
||||
Subgraph.prototype.serialize = function()
|
||||
{
|
||||
var data = LGraphNode.prototype.serialize.call(this);
|
||||
data.subgraph = this.subgraph.serialize();
|
||||
return data;
|
||||
}
|
||||
//no need to define node.configure, the default method detects node.subgraph and passes the object to node.subgraph.configure()
|
||||
|
||||
Subgraph.prototype.clone = function()
|
||||
{
|
||||
@@ -193,38 +212,31 @@ Subgraph.prototype.clone = function()
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
LiteGraph.registerNodeType("graph/subgraph", Subgraph );
|
||||
|
||||
|
||||
//Input for a subgraph
|
||||
function GlobalInput()
|
||||
function GraphInput()
|
||||
{
|
||||
this.addOutput("","");
|
||||
|
||||
//random name to avoid problems with other outputs when added
|
||||
var input_name = "input_" + (Math.random()*1000).toFixed();
|
||||
|
||||
this.addOutput(input_name, null );
|
||||
|
||||
this.properties = { name: input_name, type: null };
|
||||
|
||||
this.name_in_graph = "";
|
||||
this.properties = {};
|
||||
var that = this;
|
||||
|
||||
Object.defineProperty( this.properties, "name", {
|
||||
get: function() {
|
||||
return input_name;
|
||||
return that.name_in_graph;
|
||||
},
|
||||
set: function(v) {
|
||||
if(v == "")
|
||||
if( v == "" || v == that.name_in_graph || v == "enabled" )
|
||||
return;
|
||||
|
||||
var info = that.getOutputInfo(0);
|
||||
if(info.name == v)
|
||||
return;
|
||||
info.name = v;
|
||||
if(that.graph)
|
||||
that.graph.renameGlobalInput(input_name, v);
|
||||
input_name = v;
|
||||
if(that.name_in_graph) //already added
|
||||
that.graph.renameInput( that.name_in_graph, v );
|
||||
else
|
||||
that.graph.addInput( v, that.properties.type );
|
||||
that.name_widget.value = v;
|
||||
that.name_in_graph = v;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
@@ -232,103 +244,132 @@ function GlobalInput()
|
||||
Object.defineProperty( this.properties, "type", {
|
||||
get: function() { return that.outputs[0].type; },
|
||||
set: function(v) {
|
||||
that.outputs[0].type = v;
|
||||
if(that.graph)
|
||||
that.graph.changeGlobalInputType(input_name, that.outputs[0].type);
|
||||
that.outputs[0].type = v;
|
||||
if(that.name_in_graph) //already added
|
||||
that.graph.changeInputType( that.name_in_graph, that.outputs[0].type);
|
||||
that.type_widget.value = v;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
this.name_widget = this.addWidget("text","Name", this.properties.name, function(v){
|
||||
if(!v) return;
|
||||
that.properties.name = v;
|
||||
});
|
||||
this.type_widget = this.addWidget("text","Type", this.properties.type, function(v){
|
||||
v = v || "";
|
||||
that.properties.type = v;
|
||||
});
|
||||
|
||||
this.widgets_up = true;
|
||||
this.size = [180,60];
|
||||
}
|
||||
|
||||
GlobalInput.title = "Input";
|
||||
GlobalInput.desc = "Input of the graph";
|
||||
GraphInput.title = "Input";
|
||||
GraphInput.desc = "Input of the graph";
|
||||
|
||||
//When added to graph tell the graph this is a new global input
|
||||
GlobalInput.prototype.onAdded = function()
|
||||
GraphInput.prototype.getTitle = function()
|
||||
{
|
||||
this.graph.addGlobalInput( this.properties.name, this.properties.type );
|
||||
if(this.flags.collapsed)
|
||||
return this.properties.name;
|
||||
return this.title;
|
||||
}
|
||||
|
||||
GlobalInput.prototype.onExecute = function()
|
||||
GraphInput.prototype.onExecute = function()
|
||||
{
|
||||
var name = this.properties.name;
|
||||
|
||||
//read from global input
|
||||
var data = this.graph.global_inputs[name];
|
||||
if(!data) return;
|
||||
var data = this.graph.inputs[name];
|
||||
if(!data)
|
||||
return;
|
||||
|
||||
//put through output
|
||||
this.setOutputData(0,data.value);
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("graph/input", GlobalInput);
|
||||
GraphInput.prototype.onRemoved = function()
|
||||
{
|
||||
if(this.name_in_graph)
|
||||
this.graph.removeInput( this.name_in_graph );
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("graph/input", GraphInput);
|
||||
|
||||
|
||||
//Output for a subgraph
|
||||
function GlobalOutput()
|
||||
function GraphOutput()
|
||||
{
|
||||
//random name to avoid problems with other outputs when added
|
||||
var output_name = "output_" + (Math.random()*1000).toFixed();
|
||||
|
||||
this.addInput(output_name, null);
|
||||
|
||||
this._value = null;
|
||||
|
||||
this.properties = {name: output_name, type: null };
|
||||
this.addInput("","");
|
||||
|
||||
this.name_in_graph = "";
|
||||
this.properties = {};
|
||||
var that = this;
|
||||
|
||||
Object.defineProperty(this.properties, "name", {
|
||||
Object.defineProperty( this.properties, "name", {
|
||||
get: function() {
|
||||
return output_name;
|
||||
return that.name_in_graph;
|
||||
},
|
||||
set: function(v) {
|
||||
if(v == "")
|
||||
if( v == "" || v == that.name_in_graph )
|
||||
return;
|
||||
|
||||
var info = that.getInputInfo(0);
|
||||
if(info.name == v)
|
||||
return;
|
||||
info.name = v;
|
||||
if(that.graph)
|
||||
that.graph.renameGlobalOutput(output_name, v);
|
||||
output_name = v;
|
||||
if(that.name_in_graph) //already added
|
||||
that.graph.renameOutput( that.name_in_graph, v );
|
||||
else
|
||||
that.graph.addOutput( v, that.properties.type );
|
||||
that.name_widget.value = v;
|
||||
that.name_in_graph = v;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
Object.defineProperty(this.properties, "type", {
|
||||
Object.defineProperty( this.properties, "type", {
|
||||
get: function() { return that.inputs[0].type; },
|
||||
set: function(v) {
|
||||
that.inputs[0].type = v;
|
||||
if(that.graph)
|
||||
that.graph.changeGlobalInputType( output_name, that.inputs[0].type );
|
||||
if(that.name_in_graph) //already added
|
||||
that.graph.changeOutputType( that.name_in_graph, that.inputs[0].type);
|
||||
that.type_widget.value = v || "";
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
this.name_widget = this.addWidget("text","Name", this.properties.name, function(v){
|
||||
if(!v) return;
|
||||
that.properties.name = v;
|
||||
});
|
||||
this.type_widget = this.addWidget("text","Type", this.properties.type, function(v){
|
||||
v = v || "";
|
||||
that.properties.type = v;
|
||||
});
|
||||
|
||||
this.widgets_up = true;
|
||||
this.size = [180,60];
|
||||
}
|
||||
|
||||
GlobalOutput.title = "Output";
|
||||
GlobalOutput.desc = "Output of the graph";
|
||||
GraphOutput.title = "Output";
|
||||
GraphOutput.desc = "Output of the graph";
|
||||
|
||||
GlobalOutput.prototype.onAdded = function()
|
||||
{
|
||||
var name = this.graph.addGlobalOutput( this.properties.name, this.properties.type );
|
||||
}
|
||||
|
||||
GlobalOutput.prototype.getValue = function()
|
||||
{
|
||||
return this._value;
|
||||
}
|
||||
|
||||
GlobalOutput.prototype.onExecute = function()
|
||||
GraphOutput.prototype.onExecute = function()
|
||||
{
|
||||
this._value = this.getInputData(0);
|
||||
this.graph.setGlobalOutputData( this.properties.name, this._value );
|
||||
this.graph.setOutputData( this.properties.name, this._value );
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("graph/output", GlobalOutput);
|
||||
GraphOutput.prototype.onRemoved = function()
|
||||
{
|
||||
if(this.name_in_graph)
|
||||
this.graph.removeOutput( this.name_in_graph );
|
||||
}
|
||||
|
||||
GraphOutput.prototype.getTitle = function()
|
||||
{
|
||||
if(this.flags.collapsed)
|
||||
return this.properties.name;
|
||||
return this.title;
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType("graph/output", GraphOutput);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ var LiteGraph = global.LiteGraph;
|
||||
this.addOutput( "v", "boolean" );
|
||||
this.addOutput( "e", LiteGraph.EVENT );
|
||||
this.properties = { font: "", value: false };
|
||||
this.size = [124,64];
|
||||
this.size = [160,44];
|
||||
}
|
||||
|
||||
WidgetToggle.title = "Toggle";
|
||||
@@ -80,17 +80,19 @@ var LiteGraph = global.LiteGraph;
|
||||
var size = this.size[1] * 0.5;
|
||||
var margin = 0.25;
|
||||
var h = this.size[1] * 0.8;
|
||||
ctx.font = this.properties.font || ((size * 0.8).toFixed(0) + "px Arial");
|
||||
var w = ctx.measureText(this.title).width;
|
||||
var x = (this.size[0] - (w + size) ) * 0.5;
|
||||
|
||||
ctx.fillStyle = "#AAA";
|
||||
ctx.fillRect(10, h - size,size,size);
|
||||
ctx.fillRect(x, h - size,size,size);
|
||||
|
||||
ctx.fillStyle = this.properties.value ? "#AEF" : "#000";
|
||||
ctx.fillRect(10+size*margin,h - size + size*margin,size*(1-margin*2),size*(1-margin*2));
|
||||
ctx.fillRect(x + size*margin,h - size + size*margin,size*(1-margin*2),size*(1-margin*2) );
|
||||
|
||||
ctx.textAlign = "left";
|
||||
ctx.font = this.properties.font || ((size * 0.8).toFixed(0) + "px Arial");
|
||||
ctx.fillStyle = "#AAA";
|
||||
ctx.fillText( this.title, size + 20, h * 0.85 );
|
||||
ctx.fillText( this.title, size * 1.2 + x, h * 0.85 );
|
||||
ctx.textAlign = "left";
|
||||
}
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ function MathFloor()
|
||||
{
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
}
|
||||
|
||||
MathFloor.title = "Floor";
|
||||
@@ -425,7 +425,7 @@ function MathFrac()
|
||||
{
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
}
|
||||
|
||||
MathFrac.title = "Frac";
|
||||
@@ -447,7 +447,7 @@ function MathSmoothStep()
|
||||
{
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
this.properties = { A: 0, B: 1 };
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ function MathScale()
|
||||
{
|
||||
this.addInput("in","number",{label:""});
|
||||
this.addOutput("out","number",{label:""});
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
this.addProperty( "factor", 1 );
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ function MathAverageFilter()
|
||||
{
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
this.addProperty( "samples", 10 );
|
||||
this._values = new Float32Array(10);
|
||||
this._current = 0;
|
||||
@@ -552,7 +552,7 @@ function MathTendTo()
|
||||
this.addInput("in","number");
|
||||
this.addOutput("out","number");
|
||||
this.addProperty( "factor", 0.1 );
|
||||
this.size = [60,20];
|
||||
this.size = [80,30];
|
||||
this._value = null;
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ MathOperation.values = ["+","-","*","/","%","^"];
|
||||
MathOperation.title = "Operation";
|
||||
MathOperation.desc = "Easy math operators";
|
||||
MathOperation["@OP"] = { type:"enum", title: "operation", values: MathOperation.values };
|
||||
MathOperation.size = [100,50];
|
||||
MathOperation.size = [100,60];
|
||||
|
||||
MathOperation.prototype.getTitle = function()
|
||||
{
|
||||
@@ -720,7 +720,7 @@ function MathCondition()
|
||||
this.addProperty( "B", 1 );
|
||||
this.addProperty( "OP", ">", "string", { values: MathCondition.values } );
|
||||
|
||||
this.size = [60,40];
|
||||
this.size = [80,60];
|
||||
}
|
||||
|
||||
MathCondition.values = [">","<","==","!=","<=",">="];
|
||||
|
||||
@@ -55,6 +55,13 @@
|
||||
|
||||
LiteGraph.wrapFunctionAsNode("string/split",toUpperCase, ["String","String"],"Array");
|
||||
|
||||
function toFixed(a)
|
||||
{
|
||||
if(a != null && a.constructor === Number)
|
||||
return a.toFixed(this.properties.precision);
|
||||
return a;
|
||||
}
|
||||
|
||||
LiteGraph.wrapFunctionAsNode("string/toFixed", toFixed, ["Number"], "String", { precision: 0 } );
|
||||
|
||||
})(this);
|
||||
Reference in New Issue
Block a user