From e92a6da7b84c58803489d70efedf74837ddfe4cd Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 9 Mar 2012 13:34:09 -0800 Subject: Removed asset path replacement at authortime. --- js/document/html-document.js | 6 +++--- js/lib/drawing/world.js | 23 +---------------------- js/lib/rdge/materials/bump-metal-material.js | 6 +++--- js/lib/rdge/materials/pulse-material.js | 2 +- js/lib/rdge/materials/radial-blur-material.js | 2 +- js/lib/rdge/materials/uber-material.js | 8 ++++---- 6 files changed, 13 insertions(+), 34 deletions(-) (limited to 'js') diff --git a/js/document/html-document.js b/js/document/html-document.js index aa56fd0e..f57c61ee 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -197,7 +197,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { //if (path) { //this.collectGLData(elt, this._glData, path); //} else { - this.collectGLData(elt, this._glData, "assets/"); + this.collectGLData(elt, this._glData ); //} } else { this._glData = null @@ -368,11 +368,11 @@ exports.HTMLDocument = Montage.create(TextDocument, { collectGLData: { - value: function( elt, dataArray, imagePath ) + value: function( elt, dataArray ) { if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) { - var data = elt.elementModel.shapeModel.GLWorld.export( imagePath ); + var data = elt.elementModel.shapeModel.GLWorld.export(); dataArray.push( data ); } diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index cffd0083..44c9e37d 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js @@ -727,7 +727,7 @@ World.prototype.getShapeFromPoint = function( offsetX, offsetY ) { } }; -World.prototype.export = function( imagePath ) +World.prototype.export = function() { var exportStr = "GLWorld 1.0\n"; var id = this.getCanvas().getAttribute( "data-RDGE-id" ); @@ -747,13 +747,6 @@ World.prototype.export = function( imagePath ) var exportForPublish = true; exportStr += "publish: " + exportForPublish + "\n"; - // the relative path for local assets needs to be modified to - // the path specified by argument 'imagePath'. Save that path - // so exporting functions can call newPath = world.cleansePath( oldPath ); - this._imagePath = imagePath.slice(); - var endchar = this._imagePath[this._imagePath.length-1] - if (endchar != '/') this._imagePath += '/'; - if (exportForPublish && this._useWebGL) { exportStr += "scenedata: " + this.myScene.exportJSON() + "endscene\n"; @@ -937,20 +930,6 @@ World.prototype.importSubObject = function( objStr, parentNode ) { return trNode; }; -World.prototype.cleansePath = function( url ) -{ - //this._imagePath - var searchStr = "assets/"; - var index = url.indexOf( searchStr ); - var rtnPath = url; - if (index >= 0) - { - rtnPath = url.substr( index + searchStr.length ); - rtnPath = this._imagePath + rtnPath; - } - return rtnPath; -} - if (typeof exports === "object") { exports.World = World; } \ No newline at end of file diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index 70873885..fa6f5300 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js @@ -163,9 +163,9 @@ var BumpMetalMaterial = function BumpMetalMaterial() { throw new Error( "no world in material.export, " + this.getName() ); exportStr += "lightDiff: " + this.getLightDiff() + "\n"; - exportStr += "diffuseTexture: " + world.cleansePath(this.getDiffuseTexture()) + "\n"; - exportStr += "specularTexture: " + world.cleansePath(this.getSpecularTexture()) + "\n"; - exportStr += "normalMap: " + world.cleansePath(this.getNormalTexture()) + "\n"; + exportStr += "diffuseTexture: " + this.getDiffuseTexture() + "\n"; + exportStr += "specularTexture: " + this.getSpecularTexture() + "\n"; + exportStr += "normalMap: " + this.getNormalTexture() + "\n"; // every material needs to terminate like this exportStr += "endMaterial\n"; diff --git a/js/lib/rdge/materials/pulse-material.js b/js/lib/rdge/materials/pulse-material.js index 8ad78bd4..81db36c6 100644 --- a/js/lib/rdge/materials/pulse-material.js +++ b/js/lib/rdge/materials/pulse-material.js @@ -183,7 +183,7 @@ var PulseMaterial = function PulseMaterial() { if (!world) throw new Error( "no world in material.export, " + this.getName() ); - var texMapName = world.cleansePath( this._propValues[this._propNames[0]] ); + var texMapName = this._propValues[this._propNames[0]]; exportStr += "texture: " +texMapName + "\n"; // every material needs to terminate like this diff --git a/js/lib/rdge/materials/radial-blur-material.js b/js/lib/rdge/materials/radial-blur-material.js index f23f0712..46cdda74 100644 --- a/js/lib/rdge/materials/radial-blur-material.js +++ b/js/lib/rdge/materials/radial-blur-material.js @@ -166,7 +166,7 @@ var RadialBlurMaterial = function RadialBlurMaterial() { if (!world) throw new Error( "no world in material.export, " + this.getName() ); - var texMapName = world.cleansePath( this._propValues[this._propNames[0]] ); + var texMapName = this._propValues[this._propNames[0]]; exportStr += "texture: " + texMapName + "\n"; // every material needs to terminate like this diff --git a/js/lib/rdge/materials/uber-material.js b/js/lib/rdge/materials/uber-material.js index d120ffa1..655d8e2a 100755 --- a/js/lib/rdge/materials/uber-material.js +++ b/js/lib/rdge/materials/uber-material.js @@ -457,16 +457,16 @@ var UberMaterial = function UberMaterial() { throw new Error( "no world in material.export, " + this.getName() ); if(typeof caps.diffuseMap != 'undefined') - exportStr += "diffuseMap: " + world.cleansePath(caps.diffuseMap.texture) + "\n"; + exportStr += "diffuseMap: " + caps.diffuseMap.texture + "\n"; if(typeof caps.normalMap != 'undefined') - exportStr += "normalMap: " + world.cleansePath(caps.normalMap.texture) + "\n"; + exportStr += "normalMap: " + caps.normalMap.texture + "\n"; if(typeof caps.specularMap != 'undefined') - exportStr += "specularMap: " + world.cleansePath(caps.specularMap.texture) + "\n"; + exportStr += "specularMap: " + caps.specularMap.texture + "\n"; if(typeof caps.environmentMap != 'undefined') - exportStr += "environmentMap: " + world.cleansePath(caps.environmentMap.texture) + "\n"; + exportStr += "environmentMap: " + caps.environmentMap.texture + "\n"; // every material needs to terminate like this exportStr += "endMaterial\n"; -- cgit v1.2.3