diff --git a/docs/api/en/loaders/AnimationLoader.html b/docs/api/en/loaders/AnimationLoader.html index 7fea709445d99c6d9e016c9d73c718d473d501be..90f3ed6fd146ce2dd61d1e6b2ec155e71b845b23 100644 --- a/docs/api/en/loaders/AnimationLoader.html +++ b/docs/api/en/loaders/AnimationLoader.html @@ -81,6 +81,14 @@ be parsed with [page:AnimationClip.parse].

+

[method:AnimationLoader setPath]( [param:String path] )

+

+ [page:String path] — Base path of the file to load.

+ + Sets the base path or URL from which to load files. This can be useful if + you are loading many animations from the same directory. +

+

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/en/loaders/AudioLoader.html b/docs/api/en/loaders/AudioLoader.html index be2dad7b3f8b86b7f691762a55e7c6c53ec22872..39cfe23c9319d8be68c83d4700805440e5ba3240 100644 --- a/docs/api/en/loaders/AudioLoader.html +++ b/docs/api/en/loaders/AudioLoader.html @@ -92,6 +92,14 @@ Begin loading from url and pass the loaded [page:String AudioBuffer] to onLoad.

+

[method:AudioLoader setPath]( [param:String path] )

+

+ [page:String path] — Base path of the file to load.

+ + Sets the base path or URL from which to load files. This can be useful if + you are loading many audios from the same directory. +

+

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/en/loaders/BufferGeometryLoader.html b/docs/api/en/loaders/BufferGeometryLoader.html index 848b06bf4a7d1160b373a03e3ad98bbc0760c267..6ff54cb87cb046a0bb957c0fa18d30e3cf836f0f 100644 --- a/docs/api/en/loaders/BufferGeometryLoader.html +++ b/docs/api/en/loaders/BufferGeometryLoader.html @@ -85,6 +85,14 @@ Parse a JSON structure and return a [page:BufferGeometry].

+

[method:BufferGeometryLoader setPath]( [param:String path] )

+

+ [page:String path] — Base path of the file to load.

+ + Sets the base path or URL from which to load files. This can be useful if + you are loading many geometries from the same directory. +

+

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/en/loaders/DataTextureLoader.html b/docs/api/en/loaders/DataTextureLoader.html index af83b27fec5d8221d138425c7daa18cb116e2a19..707914fb8c80118500f50b55d9dca44cb817a521 100644 --- a/docs/api/en/loaders/DataTextureLoader.html +++ b/docs/api/en/loaders/DataTextureLoader.html @@ -56,6 +56,14 @@ Begin loading from url and pass the loaded texture to onLoad.

+

[method:DataTextureLoader setPath]( [param:String path] )

+

+ [page:String path] — Base path of the file to load.

+ + Sets the base path or URL from which to load files. This can be useful if + you are loading many data textures from the same directory. +

+

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/en/loaders/MaterialLoader.html b/docs/api/en/loaders/MaterialLoader.html index b931c50591b351ecaabc6aa0b2df0f99ecc4447c..5f9bdf1ee2684185df8bc5858ead287168a52130 100644 --- a/docs/api/en/loaders/MaterialLoader.html +++ b/docs/api/en/loaders/MaterialLoader.html @@ -84,12 +84,18 @@ Parse a JSON structure and create a new [page:Material] of the type [page:String json.type] with parameters defined in the json object.

-

[method:null setTextures]( [param:Object textures] )

+

[method:MaterialLoader setPath]( [param:String path] )

- [page:Object textures] — object containing any textures used by the material. -

+ [page:String path] — Base path of the file to load.

+ Sets the base path or URL from which to load files. This can be useful if + you are loading many materials from the same directory. +

+

[method:MaterialLoader setTextures]( [param:Object textures] )

+

+ [page:Object textures] — object containing any textures used by the material. +

Source

diff --git a/src/loaders/AnimationLoader.js b/src/loaders/AnimationLoader.js index 0e3ab97c346be0e1dd8200269d6dc4c091d58dd8..161ebf9446744b13da4ad5a8bf41df109e25d4bd 100644 --- a/src/loaders/AnimationLoader.js +++ b/src/loaders/AnimationLoader.js @@ -19,6 +19,7 @@ Object.assign( AnimationLoader.prototype, { var scope = this; var loader = new FileLoader( scope.manager ); + loader.setPath( scope.path ); loader.load( url, function ( text ) { onLoad( scope.parse( JSON.parse( text ) ) ); @@ -41,6 +42,13 @@ Object.assign( AnimationLoader.prototype, { onLoad( animations ); + }, + + setPath: function ( value ) { + + this.path = value; + return this; + } } ); diff --git a/src/loaders/AudioLoader.js b/src/loaders/AudioLoader.js index a182ddc8e759306e27299a7831ad208551d23102..b9a5d610b86a9b18a894e492be0369b5646530ce 100644 --- a/src/loaders/AudioLoader.js +++ b/src/loaders/AudioLoader.js @@ -18,6 +18,7 @@ Object.assign( AudioLoader.prototype, { var loader = new FileLoader( this.manager ); loader.setResponseType( 'arraybuffer' ); + loader.setPath( this.path ); loader.load( url, function ( buffer ) { // Create a copy of the buffer. The `decodeAudioData` method @@ -33,6 +34,13 @@ Object.assign( AudioLoader.prototype, { }, onProgress, onError ); + }, + + setPath: function ( value ) { + + this.path = value; + return this; + } } ); diff --git a/src/loaders/BufferGeometryLoader.js b/src/loaders/BufferGeometryLoader.js index 2c6b4b2905ffc01217f8d8347fb9b128581b3f98..381c2248b5f2f82c96071c072dac78dca183ac3a 100644 --- a/src/loaders/BufferGeometryLoader.js +++ b/src/loaders/BufferGeometryLoader.js @@ -22,6 +22,7 @@ Object.assign( BufferGeometryLoader.prototype, { var scope = this; var loader = new FileLoader( scope.manager ); + loader.setPath( scope.path ); loader.load( url, function ( text ) { onLoad( scope.parse( JSON.parse( text ) ) ); @@ -86,6 +87,13 @@ Object.assign( BufferGeometryLoader.prototype, { return geometry; + }, + + setPath: function ( value ) { + + this.path = value; + return this; + } } ); diff --git a/src/loaders/DataTextureLoader.js b/src/loaders/DataTextureLoader.js index 96770a0a2b4e6a8a15a0efcac224cc2ccb2daad5..49f4d90ec80bec26c29b6e6d2a17e95cfc37131f 100644 --- a/src/loaders/DataTextureLoader.js +++ b/src/loaders/DataTextureLoader.js @@ -28,7 +28,7 @@ Object.assign( DataTextureLoader.prototype, { var loader = new FileLoader( this.manager ); loader.setResponseType( 'arraybuffer' ); - + loader.setPath( this.path ); loader.load( url, function ( buffer ) { var texData = scope._parser( buffer ); @@ -87,6 +87,13 @@ Object.assign( DataTextureLoader.prototype, { return texture; + }, + + setPath: function ( value ) { + + this.path = value; + return this; + } } ); diff --git a/src/loaders/MaterialLoader.js b/src/loaders/MaterialLoader.js index 97d8e9031f3c55fb41ccb5c517a747a771060881..fbd754060a861260a6b28047e87e0ec751cf30a1 100644 --- a/src/loaders/MaterialLoader.js +++ b/src/loaders/MaterialLoader.js @@ -25,6 +25,7 @@ Object.assign( MaterialLoader.prototype, { var scope = this; var loader = new FileLoader( scope.manager ); + loader.setPath( scope.path ); loader.load( url, function ( text ) { onLoad( scope.parse( JSON.parse( text ) ) ); @@ -33,12 +34,6 @@ Object.assign( MaterialLoader.prototype, { }, - setTextures: function ( value ) { - - this.textures = value; - - }, - parse: function ( json ) { var textures = this.textures; @@ -219,6 +214,20 @@ Object.assign( MaterialLoader.prototype, { return material; + }, + + setPath: function ( value ) { + + this.path = value; + return this; + + }, + + setTextures: function ( value ) { + + this.textures = value; + return this; + } } );