aboutsummaryrefslogtreecommitdiff
path: root/js/lib/drawing/world.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/drawing/world.js')
-rwxr-xr-xjs/lib/drawing/world.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js
index 50fa735a..9a7d42de 100755
--- a/js/lib/drawing/world.js
+++ b/js/lib/drawing/world.js
@@ -414,9 +414,9 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) {
414 414
415 // start RDGE passing your runtime object, and false to indicate we don't need a an initialization state 415 // start RDGE passing your runtime object, and false to indicate we don't need a an initialization state
416 // in the case of a procedurally built scene an init state is not needed for loading data 416 // in the case of a procedurally built scene an init state is not needed for loading data
417 this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" );
417 if (this._useWebGL) { 418 if (this._useWebGL) {
418 rdgeStarted = true; 419 rdgeStarted = true;
419 this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" );
420 RDGE.globals.engine.unregisterCanvas( this._canvas ); 420 RDGE.globals.engine.unregisterCanvas( this._canvas );
421 RDGE.globals.engine.registerCanvas(this._canvas, this); 421 RDGE.globals.engine.registerCanvas(this._canvas, this);
422 RDGE.RDGEStart( this._canvas ); 422 RDGE.RDGEStart( this._canvas );
@@ -864,7 +864,7 @@ World.prototype.exportJSON = function ()
864 // would not be destructive of the data. You would be wrong... 864 // would not be destructive of the data. You would be wrong...
865 // We need to rebuild everything 865 // We need to rebuild everything
866 if (this._useWebGL) { 866 if (this._useWebGL) {
867 if (worldObj.children && (worldObj.children.length === 1)) { 867 if (worldObj.children && (worldObj.children.length >= 1)) {
868 this.rebuildTree(this._geomRoot); 868 this.rebuildTree(this._geomRoot);
869 this.restartRenderLoop(); 869 this.restartRenderLoop();
870 } 870 }
@@ -950,8 +950,11 @@ World.prototype.importJSON = function (jObj)
950 950
951 // import the objects 951 // import the objects
952 // there should be exactly one child of the parent object 952 // there should be exactly one child of the parent object
953 if (jObj.children && (jObj.children.length === 1)) 953 if (jObj.children)
954 this.importObjectsJSON( jObj.children[0] ); 954 {
955 for (var i=0; i<jObj.children.length; i++)
956 this.importObjectsJSON( jObj.children[i] );
957 }
955 else 958 else
956 throw new Error ("unrecoverable canvas import error - inconsistent root object: " + jObj.children ); 959 throw new Error ("unrecoverable canvas import error - inconsistent root object: " + jObj.children );
957 960