I have a dynamic dat.gui interface where I add controls, but the "save settings" feature doesn't seem to recognize them.
var mygui = new dat.GUI();
mygui.remember(mygui);
// Example of adding a control in the standard way
mygui.control1 = 0.0;
var control = mygui.add(mygui, 'control1', -1, 1);
// Adding controls dynamically
var myArray = ['control2', 'control3'];
var controls = [];
for (x in myArray) {
controls[myArray[x]] = 0.0;
var newControl = mygui.add(controls, myArray[x], -1, 1);
}
All controls function correctly, but when I click the gear icon, the settings JSON only includes the first control, or any added controls using the standard method:
{
"preset": "Default",
"closed": false,
"remembered": {
"Default": {
"0": {
"control1": 0.5,
}
}
},
"folders": {}
}
It seems like the remember() functionality is getting confused, any suggestions on how to fix this?