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

Readonly `point2d`, `point3d`, `point4d` throws an error #605

Open andrenanninga opened 4 months ago

andrenanninga commented 4 months ago

I'm trying to monitor a vector(3) in my project, but I'm getting errors when setting readonly: true in my binding. I don't have much experience with this library yet so possibly I'm just using it wrong...

const pane = new Pane();
const PARAMS = {
  offset: {x: 50, y: 25},
};
pane.addBinding(PARAMS, 'offset', { readonly: true });
{
    "message": "No matching controller for 'offset'",
    "name": "TpError",
    "stack": "Error: No matching controller for 'offset'\n    at new TpError (https://tweakpane.github.io/docs/assets/tweakpane.js:85:22)\n    at PluginPool.createBinding (https://tweakpane.github.io/docs/assets/tweakpane.js:7290:15)\n    at RackApi.addBinding (https://tweakpane.github.io/docs/assets/tweakpane.js:1694:31)\n    at Pane.addBinding (https://tweakpane.github.io/docs/assets/tweakpane.js:2210:30)\n    at <anonymous>:4:6",
    "type": "nomatchingcontroller"
}
lolik9l commented 3 months ago

I have the same problem...

cocopon commented 3 months ago

I have not yet implemented 2D/3D point monitoring because I was unsure about the demand for them.

lolik9l commented 3 months ago

It would be cool to have it work, so for example I would like to use this to output the actual position of a 3D model (vector3) in my scene. This will definitely be helpful :)