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
2 changes: 1 addition & 1 deletion docs/api/loaders/CubeTextureLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h3>[property:String crossOrigin]</h3>
<p>
If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
attribute of the image to the value of *crossOrigin*,
prior to starting the load. Default is *"Anonymous"*.
prior to starting the load. Default is *"anonymous"*.
</p>

<h3>[property:LoadingManager manager]</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/loaders/ImageLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2>Properties</h2>
<h3>[property:String crossOrigin]</h3>
<p>
If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
attribute of the image to the value of *crossOrigin*, prior to starting the load. Default is *"Anonymous"*.
attribute of the image to the value of *crossOrigin*, prior to starting the load. Default is *"anonymous"*.
</p>

<h3>[property:LoadingManager manager]</h3>
Expand Down
1 change: 1 addition & 0 deletions docs/api/loaders/Loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ <h3>[property:Function onLoadComplete]</h3>
<h3>[property:string crossOrigin]</h3>
<p>
The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is *"anonymous"*.
</p>

<h2>Methods</h2>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/loaders/TextureLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2>Properties</h2>
<h3>[property:String crossOrigin]</h3>
<p>
If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
attribute of the image to the value of *crossOrigin*, prior to starting the load. Default is *"Anonymous"*.
attribute of the image to the value of *crossOrigin*, prior to starting the load. Default is *"anonymous"*.
</p>


Expand Down
13 changes: 7 additions & 6 deletions docs/examples/loaders/MTLLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Func
</p>


<h3>[method:null setPath]( [param:String path] )</h3>
<h3>[method:MTLLoader setPath]( [param:String path] )</h3>
<p>
[page:String path] — required<br />
</p>
Expand All @@ -53,7 +53,7 @@ <h3>[method:null setPath]( [param:String path] )</h3>
</p>


<h3>[method:null setTexturePath]( [param:String path] )</h3>
<h3>[method:MTLLoader setTexturePath]( [param:String path] )</h3>
<p>
[page:String path] — required<br />
</p>
Expand All @@ -62,16 +62,17 @@ <h3>[method:null setTexturePath]( [param:String path] )</h3>
</p>


<h3>[method:null setCrossOrigin]( [param:boolean useCrossOrigin] )</h3>
<h3>[method:MTLLoader setCrossOrigin]( [param:String value] )</h3>
<p>
[page:boolean useCrossOrigin] — required<br />
[page:String value] — required<br />
</p>
<p>
Set to true if you need to load textures from a different origin.
If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
attribute of the image to the value of *crossOrigin*, prior to starting the load. Default is *"anonymous"*.
</p>


<h3>[method:null setMaterialOptions]( [param:Object options] )</h3>
<h3>[method:MTLLoader setMaterialOptions]( [param:Object options] )</h3>
<p>
[page:Object options] — required
<ul>
Expand Down
5 changes: 4 additions & 1 deletion examples/js/loaders/AssimpJSONLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ THREE.AssimpJSONLoader.prototype = {

constructor: THREE.AssimpJSONLoader,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

Expand Down Expand Up @@ -67,6 +67,7 @@ THREE.AssimpJSONLoader.prototype = {
setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

Expand Down Expand Up @@ -221,8 +222,10 @@ THREE.AssimpJSONLoader.prototype = {

case '$mat.opacity':
if ( value < 1 ) {

material.opacity = value;
material.transparent = true;

}
break;

Expand Down
7 changes: 4 additions & 3 deletions examples/js/loaders/AssimpLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ THREE.AssimpLoader.prototype = {

constructor: THREE.AssimpLoader,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

Expand All @@ -34,6 +34,7 @@ THREE.AssimpLoader.prototype = {
setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

Expand Down Expand Up @@ -1129,7 +1130,7 @@ THREE.AssimpLoader.prototype = {
}

if ( ! key ) {

return null;

} else if ( nextKey ) {
Expand All @@ -1150,7 +1151,7 @@ THREE.AssimpLoader.prototype = {
var l = T / dT;

return lerp( key.mValue.toTHREE(), nextKey.mValue.toTHREE(), l );

}

}
Expand Down
5 changes: 4 additions & 1 deletion examples/js/loaders/BinaryLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ THREE.BinaryLoader.prototype = {

constructor: THREE.BinaryLoader,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

// Load models generated by slim OBJ converter with BINARY option (converter_obj_three_slim.py -t binary)
// - binary models consist of two files: JS and BIN
Expand Down Expand Up @@ -66,18 +66,21 @@ THREE.BinaryLoader.prototype = {
setBinaryPath: function ( value ) {

this.binaryPath = value;
return this;

},

setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

setTexturePath: function ( value ) {

this.texturePath = value;
return this;

},

Expand Down
4 changes: 3 additions & 1 deletion examples/js/loaders/ColladaLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ THREE.ColladaLoader.prototype = {

constructor: THREE.ColladaLoader,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

Expand All @@ -33,6 +33,7 @@ THREE.ColladaLoader.prototype = {
setPath: function ( value ) {

this.path = value;
return this;

},

Expand All @@ -49,6 +50,7 @@ THREE.ColladaLoader.prototype = {
setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

Expand Down
12 changes: 2 additions & 10 deletions examples/js/loaders/DRACOLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ THREE.DRACOLoader.prototype = {
var loader = new THREE.FileLoader(scope.manager);
loader.setPath(this.path);
loader.setResponseType('arraybuffer');
if (this.crossOrigin !== undefined) {
loader.crossOrigin = this.crossOrigin;
}
loader.load(url, function(blob) {
scope.decodeDracoFile(blob, onLoad);
}, onProgress, onError);
Expand All @@ -55,11 +52,6 @@ THREE.DRACOLoader.prototype = {
return this;
},

setCrossOrigin: function(value) {
this.crossOrigin = value;
return this;
},

setVerbosity: function(level) {
this.verbosity = level;
return this;
Expand Down Expand Up @@ -146,7 +138,7 @@ THREE.DRACOLoader.prototype = {
},

addAttributeToGeometry: function(dracoDecoder, decoder, dracoGeometry,
attributeName, attributeType, attribute,
attributeName, attributeType, attribute,
geometry, geometryBuffer) {
if (attribute.ptr === 0) {
var errorMsg = 'THREE.DRACOLoader: No attribute ' + attributeName;
Expand Down Expand Up @@ -224,7 +216,7 @@ THREE.DRACOLoader.prototype = {
throw new Error( errorMsg );

}

// Copy data from decoder.
for (var i = 0; i < numValues; i++) {
geometryBuffer[attributeName][i] = attributeData.GetValue(i);
Expand Down
13 changes: 12 additions & 1 deletion examples/js/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

Object.assign( THREE.FBXLoader.prototype, {

crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

var self = this;
Expand Down Expand Up @@ -63,6 +65,13 @@

},

setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

parse: function ( FBXBuffer, resourceDirectory ) {

var FBXTree;
Expand Down Expand Up @@ -93,9 +102,11 @@

// console.log( FBXTree );

var textureLoader = new THREE.TextureLoader( this.manager ).setPath( resourceDirectory ).setCrossOrigin( this.crossOrigin );

var connections = parseConnections( FBXTree );
var images = parseImages( FBXTree );
var textures = parseTextures( FBXTree, new THREE.TextureLoader( this.manager ).setPath( resourceDirectory ), images, connections );
var textures = parseTextures( FBXTree, textureLoader, images, connections );
var materials = parseMaterials( FBXTree, textures, connections );
var deformers = parseDeformers( FBXTree, connections );
var geometryMap = parseGeometries( FBXTree, connections, deformers );
Expand Down
2 changes: 1 addition & 1 deletion examples/js/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ THREE.GLTFLoader = ( function () {

constructor: GLTFLoader,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/js/loaders/LoaderSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ THREE.LoaderSupport.WorkerDirector = (function () {

this.maxQueueSize = MAX_QUEUE_SIZE ;
this.maxWebWorkers = MAX_WEB_WORKER;
this.crossOrigin = null;
this.crossOrigin = 'anonymous';

if ( ! Validator.isValid( classDef ) ) throw 'Provided invalid classDef: ' + classDef;

Expand Down
8 changes: 4 additions & 4 deletions examples/js/loaders/MMDLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ THREE.MMDLoader = ( function () {

constructor: MMDLoader,

crossOrigin: undefined,
crossOrigin: 'anonymous',

/**
* @param {string} value
Expand Down Expand Up @@ -329,7 +329,7 @@ THREE.MMDLoader = ( function () {

constructor: MeshBuilder,

crossOrigin: undefined,
crossOrigin: 'anonymous',

/**
* @param {string} crossOrigin
Expand Down Expand Up @@ -876,7 +876,7 @@ THREE.MMDLoader = ( function () {

constructor: MaterialBuilder,

crossOrigin: undefined,
crossOrigin: 'anonymous',

texturePath: undefined,

Expand Down Expand Up @@ -946,7 +946,7 @@ THREE.MMDLoader = ( function () {
params.shininess = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )
params.transparent = params.opacity !== 1.0;

//
//

params.skinning = geometry.bones.length > 0 ? true : false;
params.morphTargets = geometry.morphTargets.length > 0 ? true : false;
Expand Down
3 changes: 2 additions & 1 deletion examples/js/loaders/MTLLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ THREE.MTLLoader.MaterialCreator.prototype = {

constructor: THREE.MTLLoader.MaterialCreator,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

Expand Down
3 changes: 2 additions & 1 deletion examples/js/loaders/VRMLLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THREE.VRMLLoader.prototype = {

recordingFieldname: null,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

Expand All @@ -44,6 +44,7 @@ THREE.VRMLLoader.prototype = {
setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

Expand Down
2 changes: 1 addition & 1 deletion examples/js/loaders/VRMLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THREE.VRMLoader = ( function () {

constructor: VRMLoader,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

Expand Down
3 changes: 2 additions & 1 deletion examples/js/loaders/deprecated/LegacyGLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ THREE.LegacyGLTFLoader = ( function () {

constructor: LegacyGLTFLoader,

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

Expand All @@ -40,6 +40,7 @@ THREE.LegacyGLTFLoader = ( function () {
setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

Expand Down
2 changes: 1 addition & 1 deletion src/loaders/CubeTextureLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function CubeTextureLoader( manager ) {

Object.assign( CubeTextureLoader.prototype, {

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( urls, onLoad, onProgress, onError ) {

Expand Down
2 changes: 1 addition & 1 deletion src/loaders/ImageLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function ImageLoader( manager ) {

Object.assign( ImageLoader.prototype, {

crossOrigin: 'Anonymous',
crossOrigin: 'anonymous',

load: function ( url, onLoad, onProgress, onError ) {

Expand Down
Loading