Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/js/loaders/VRMLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ THREE.VRMLoader = ( function () {

},

setResourcePath: function ( value ) {

this.glTFLoader.setResourcePath( value );
return this;

},

setDRACOLoader: function ( dracoLoader ) {

this.glTFLoader.setDRACOLoader( dracoLoader );
Expand Down
28 changes: 25 additions & 3 deletions examples/js/loaders/deprecated/LegacyGLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,30 @@ THREE.LegacyGLTFLoader = ( function () {

var scope = this;

var path = this.path && ( typeof this.path === "string" ) ? this.path : THREE.LoaderUtils.extractUrlBase( url );
var resourcePath;

if ( this.resourcePath !== undefined ) {

resourcePath = this.resourcePath;

} else if ( this.path !== undefined ) {

resourcePath = this.path;

} else {

resourcePath = THREE.LoaderUtils.extractUrlBase( url );

}

var loader = new THREE.FileLoader( scope.manager );

loader.setPath( this.path );
loader.setResponseType( 'arraybuffer' );

loader.load( url, function ( data ) {

scope.parse( data, path, onLoad );
scope.parse( data, resourcePath, onLoad );

}, onProgress, onError );

Expand All @@ -50,6 +65,13 @@ THREE.LegacyGLTFLoader = ( function () {

},

setResourcePath: function ( value ) {

this.resourcePath = value;
return this;

},

parse: function ( data, path, callback ) {

var content;
Expand Down Expand Up @@ -80,7 +102,7 @@ THREE.LegacyGLTFLoader = ( function () {

crossOrigin: this.crossOrigin,
manager: this.manager,
path: path || this.path
path: path || this.resourcePath || ''

} );

Expand Down