seedControls now appears for all number parameters when converted into a primitive node.

This commit is contained in:
FizzleDorf 2023-04-01 14:06:02 -04:00
parent f6796a5d48
commit 27d0a8ddf6

View File

@ -167,14 +167,6 @@ app.registerExtension({
const node = LiteGraph.createNode("PrimitiveNode"); const node = LiteGraph.createNode("PrimitiveNode");
app.graph.add(node); app.graph.add(node);
<<<<<<< HEAD
<<<<<<< HEAD
=======
=======
>>>>>>> parent of ec3e40e (flyingshutter's code added, in working order)
node.widgets.addSeedControlWidget(node,node.widgets[0],"randomize");
>>>>>>> parent of ec3e40e (flyingshutter's code added, in working order)
// Calculate a position that wont directly overlap another node // Calculate a position that wont directly overlap another node
const pos = [this.pos[0] - node.size[0] - 30, this.pos[1]]; const pos = [this.pos[0] - node.size[0] - 30, this.pos[1]];
while (isNodeAtPos(pos)) { while (isNodeAtPos(pos)) {
@ -298,24 +290,14 @@ app.registerExtension({
} else { } else {
widget = this.addWidget(type, widgetName /*"value"*/, null, () => { }, {}); widget = this.addWidget(type, widgetName /*"value"*/, null, () => { }, {});
} }
<<<<<<< HEAD
} }
if (widget.type === "number") { if (widget.type === "number" && widget.name != "seed") {
addSeedControlWidget(this, widget, "fixed seed"); addSeedControlWidget(this, widget, "fixed seed");
=======
// addSeedControlWidget(node, seed.widget, "randomize");
if (widget.type === "number") {
addSeedControlWidget(this, widget, "fixed seed");
}
<<<<<<< HEAD
>>>>>>> parent of ec3e40e (flyingshutter's code added, in working order)
=======
>>>>>>> parent of ec3e40e (flyingshutter's code added, in working order)
} }
if (node?.widgets && widget) { if (node?.widgets && widget) {
const theirWidget = node.widgets.find((w) => w.name === widgetName); const theirWidget = node.widgets.find((w) => w.name === widgetName);