diff --git a/index.html b/index.html
index 436e07d..15cb0c7 100644
--- a/index.html
+++ b/index.html
@@ -134,12 +134,12 @@
-
Download the minified source
- [19.5kb]
+ [19.6kb]
-
Download the uncompressed source
- [33.6kb]
+ [33.8kb]
diff --git a/src/DAT/GUI/Controller.js b/src/DAT/GUI/Controller.js
index eb06cfc..1e41a82 100644
--- a/src/DAT/GUI/Controller.js
+++ b/src/DAT/GUI/Controller.js
@@ -42,7 +42,13 @@ DAT.GUI.Controller.prototype.unlisten = function() {
};
DAT.GUI.Controller.prototype.setValue = function(n) {
- this.object[this.propertyName] = n;
+ if(this.object[this.propertyName] != undefined){
+ this.object[this.propertyName] = n;
+ }else{
+ var o = new Object();
+ o[this.propertyName] = n;
+ this.object.set(o);
+ }
if (this.changeFunction != null) {
this.changeFunction.call(this, n);
}
@@ -51,7 +57,9 @@ DAT.GUI.Controller.prototype.setValue = function(n) {
};
DAT.GUI.Controller.prototype.getValue = function() {
- return this.object[this.propertyName];
+ var val = this.object[this.propertyName];
+ if(val == undefined) this.object.get(this.propertyName);
+ return val;
};
DAT.GUI.Controller.prototype.updateDisplay = function() {
diff --git a/src/DAT/GUI/GUI.js b/src/DAT/GUI/GUI.js
index 98dac43..fa098be 100644
--- a/src/DAT/GUI/GUI.js
+++ b/src/DAT/GUI/GUI.js
@@ -307,6 +307,7 @@ DAT.GUI = function(parameters) {
}
var value = object[propertyName];
+ if(value == undefined && object.get) value = object.get(propertyName));
// Does this value exist? Is it accessible?
if (value == undefined) {