cocopon / tweakpane

:control_knobs: Compact GUI for fine-tuning parameters and monitoring value changes
https://tweakpane.github.io/docs/
MIT License
3.41k stars 85 forks source link

Question about multiple objects and arrays #610

Closed 2mik closed 3 weeks ago

2mik commented 2 months ago

Hi,

Please clarify if the following features are currently exist or not:

  1. Is it possible to display properties of multiple selected objects to change their properties by a single user action? For example, a user selects Button1 and Button2 to set their properties to the same values. If this feature not supported out of the box, may be you can share an idea how to implement it?
  2. Is it possible to add a binding to edit an array?

Thank you.

cocopon commented 3 weeks ago

Hi,

  1. There is no smart way to achieve that. For example:

    function applyObj1PropsToObj2() {
     obj2.foo = obj1.foo;
     ...
    }
    
    pane.addBinding(obj1, 'foo').on('change', () => {
     applyObj1PropsToObj2();
    });
    
    ...
  2. No, you should bind each single item if it is an object, or create a new plugin for arrays.

2mik commented 3 weeks ago

Thanks.