I would like to refresh the dat.gui menu with new values. I have loaded a model and display in folder the name of the objects inside a gui folder.
How can I display the new
It's easy when I have read the source code of dat.gui:
https://github.com/dataarts/dat.gui/blob/master/src/dat/controllers/Controller.js#L36
As you see, this.object = object
, this
is a controller you add, and object
is what you need to change. Here is example code:
var gui = new dat.GUI();
// init a controller
var controller = gui.add(object, 'property');
// update a controller
controller.object = newObject;