How do we update Tweakpane from the outside?

This issue has been tracked since 2022-09-27.

Suppose we have this:

      const input = featuresGui.addInput(currentAttrValues, paramName, {
        min: 0,
        max: 50,
        step: 1,
      });
      input.on('change', function (ev) {
        updateSomething(paramName, ev.value)
      });

Now, suppose some external code modifies currentAttrValues,

// later, somewhere else:
currentAttrValues[paramName] = 40

// ____?_____

How do we update Tweakpane so that the GUI updates to the new values?

trusktr wrote this answer on 2022-10-03

Nvm, input.refresh() does the trick. I had invalid data in my case so it seemed like it didn't do anything.

More Details About Repo
Owner Name cocopon
Repo Name tweakpane
Full Name cocopon/tweakpane
Language TypeScript
Created Date 2016-05-10
Updated Date 2023-03-17
Star Count 2603
Watcher Count 19
Fork Count 71
Issue Count 11

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date