From 7c4e4497e98c71993fa041ec52eb37644f5d589d Mon Sep 17 00:00:00 2001 From: asagi4 <130366179+asagi4@users.noreply.github.com> Date: Wed, 12 Apr 2023 21:29:21 +0300 Subject: [PATCH] Properly find the source widget --- web/extensions/core/widgetInputs.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index ba08190ee..b2a572dd0 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -221,7 +221,10 @@ app.registerExtension({ if (widgetName) { const widget = node.widgets.find((w) => w.name === widgetName); if (widget) { - widget.value = this.widgets[linkInfo.origin_slot].value; + // the first widget matching a slot in the primitive should hold the value, as they're kept + // sorted. If this is undefined, something weird is going on. + const sourcewidget = this.widgets.find((w) => w.primitiveSlot === linkInfo.origin_slot); + widget.value = sourcewidget.value; if (widget.callback) { widget.callback(widget.value, app.canvas, node, app.canvas.graph_mouse, {}); }