Skip to content

Commit baed06f

Browse files
author
tamat
committed
minor fixes
1 parent f9d006c commit baed06f

9 files changed

Lines changed: 1806 additions & 997 deletions

File tree

build/litegraph.js

Lines changed: 538 additions & 140 deletions
Large diffs are not rendered by default.

build/litegraph.min.js

Lines changed: 729 additions & 716 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editor/js/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function enableWebGL()
102102
"js/libs/litegl.js",
103103
"../src/nodes/gltextures.js",
104104
"../src/nodes/glfx.js",
105-
"../src/nodes/shaders.js",
105+
"../src/nodes/glshaders.js",
106106
"../src/nodes/geometry.js"
107107
];
108108

src/litegraph.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8928,6 +8928,8 @@ LGraphNode.prototype.executeAction = function(action)
89288928
//value changed
89298929
if( old_value != w.value )
89308930
{
8931+
if(node.onWidgetChanged)
8932+
node.onWidgetChanged( w.name,w.value,old_value,w );
89318933
node.graph._version++;
89328934
}
89338935

@@ -9137,7 +9139,10 @@ LGraphNode.prototype.executeAction = function(action)
91379139
var entries = [];
91389140
for (var i in values) {
91399141
if (values[i]) {
9140-
entries.push({ value: values[i], content: values[i], has_submenu: true });
9142+
var name = values[i];
9143+
if(name.indexOf("::") != -1) //in case it has a namespace like "shader::math/rand" it hides the namespace
9144+
name = name.split("::")[1];
9145+
entries.push({ value: values[i], content: name, has_submenu: true });
91419146
}
91429147
}
91439148

@@ -10187,6 +10192,7 @@ LGraphNode.prototype.executeAction = function(action)
1018710192
{
1018810193
options = options || {};
1018910194
var str_value = String(value);
10195+
type = type.toLowerCase();
1019010196
if(type == "number")
1019110197
str_value = value.toFixed(3);
1019210198

@@ -10775,7 +10781,7 @@ LGraphNode.prototype.executeAction = function(action)
1077510781
}
1077610782

1077710783
if (node.getExtraMenuOptions) {
10778-
var extra = node.getExtraMenuOptions(this);
10784+
var extra = node.getExtraMenuOptions(this, options);
1077910785
if (extra) {
1078010786
extra.push(null);
1078110787
options = extra.concat(options);

src/nodes/events.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,29 @@
126126

127127
LiteGraph.registerNodeType("events/filter", FilterEvent);
128128

129+
130+
function EventBranch() {
131+
this.addInput("in", LiteGraph.ACTION);
132+
this.addInput("cond", "boolean");
133+
this.addOutput("true", LiteGraph.EVENT);
134+
this.addOutput("false", LiteGraph.EVENT);
135+
this.size = [120, 60];
136+
this._value = false;
137+
}
138+
139+
EventBranch.title = "Branch";
140+
EventBranch.desc = "If condition is true, outputs triggers true, otherwise false";
141+
142+
EventBranch.prototype.onExecute = function() {
143+
this._value = this.getInputData(1);
144+
}
145+
146+
EventBranch.prototype.onAction = function(action, param) {
147+
this.triggerSlot(this._value ? 0 : 1);
148+
}
149+
150+
LiteGraph.registerNodeType("events/branch", EventBranch);
151+
129152
//Show value inside the debug console
130153
function EventCounter() {
131154
this.addInput("inc", LiteGraph.ACTION);

0 commit comments

Comments
 (0)