Skip to content

Commit fcff7a4

Browse files
authored
Merge pull request #15740 from linbingquan/clean-up
GLTFEXporter: Clean up
2 parents 2699194 + 3f4ddd9 commit fcff7a4

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

examples/js/exporters/GLTFExporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ THREE.GLTFExporter.prototype = {
10781078
} else {
10791079

10801080
if ( ! geometry.isBufferGeometry ) {
1081-
1081+
10821082
console.warn( 'GLTFExporter: Exporting THREE.Geometry will increase file size. Use THREE.BufferGeometry instead.' );
10831083

10841084
var geometryTemp = new THREE.BufferGeometry();

examples/js/loaders/deprecated/LegacyGLTFLoader.js

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ THREE.LegacyGLTFLoader = ( function () {
491491
};
492492

493493
var WEBGL_SIDES = {
494-
1028: THREE.BackSide, // Culling front
495-
1029: THREE.FrontSide // Culling back
494+
1028: THREE.BackSide, // Culling front
495+
1029: THREE.FrontSide // Culling back
496496
//1032: THREE.NoSide // Culling front and back, what to do?
497497
};
498498

@@ -566,8 +566,10 @@ THREE.LegacyGLTFLoader = ( function () {
566566

567567
function _each( object, callback, thisObj ) {
568568

569-
if ( !object ) {
569+
if ( ! object ) {
570+
570571
return Promise.resolve();
572+
571573
}
572574

573575
var results;
@@ -589,11 +591,11 @@ THREE.LegacyGLTFLoader = ( function () {
589591

590592
if ( value instanceof Promise ) {
591593

592-
value.then( function( key, value ) {
594+
value.then( function ( key, value ) {
593595

594596
results[ key ] = value;
595597

596-
}.bind( this, idx ));
598+
}.bind( this, idx ) );
597599

598600
} else {
599601

@@ -621,11 +623,11 @@ THREE.LegacyGLTFLoader = ( function () {
621623

622624
if ( value instanceof Promise ) {
623625

624-
value.then( function( key, value ) {
626+
value.then( function ( key, value ) {
625627

626628
results[ key ] = value;
627629

628-
}.bind( this, key ));
630+
}.bind( this, key ) );
629631

630632
} else {
631633

@@ -641,11 +643,11 @@ THREE.LegacyGLTFLoader = ( function () {
641643

642644
}
643645

644-
return Promise.all( fns ).then( function() {
646+
return Promise.all( fns ).then( function () {
645647

646648
return results;
647649

648-
});
650+
} );
649651

650652
}
651653

@@ -1210,7 +1212,7 @@ THREE.LegacyGLTFLoader = ( function () {
12101212

12111213
}
12121214

1213-
keys.forEach( function( v ) {
1215+
keys.forEach( function ( v ) {
12141216

12151217
if ( khr_material.values[ v ] !== undefined ) materialValues[ v ] = khr_material.values[ v ];
12161218

@@ -1515,21 +1517,21 @@ THREE.LegacyGLTFLoader = ( function () {
15151517

15161518
materialParams.color = new THREE.Color().fromArray( materialValues.diffuse );
15171519

1518-
} else if ( typeof( materialValues.diffuse ) === 'string' ) {
1520+
} else if ( typeof ( materialValues.diffuse ) === 'string' ) {
15191521

15201522
materialParams.map = dependencies.textures[ materialValues.diffuse ];
15211523

15221524
}
15231525

15241526
delete materialParams.diffuse;
15251527

1526-
if ( typeof( materialValues.reflective ) === 'string' ) {
1528+
if ( typeof ( materialValues.reflective ) === 'string' ) {
15271529

15281530
materialParams.envMap = dependencies.textures[ materialValues.reflective ];
15291531

15301532
}
15311533

1532-
if ( typeof( materialValues.bump ) === 'string' ) {
1534+
if ( typeof ( materialValues.bump ) === 'string' ) {
15331535

15341536
materialParams.bumpMap = dependencies.textures[ materialValues.bump ];
15351537

@@ -1547,7 +1549,7 @@ THREE.LegacyGLTFLoader = ( function () {
15471549

15481550
}
15491551

1550-
} else if ( typeof( materialValues.emission ) === 'string' ) {
1552+
} else if ( typeof ( materialValues.emission ) === 'string' ) {
15511553

15521554
if ( materialType === THREE.MeshBasicMaterial ) {
15531555

@@ -1565,7 +1567,7 @@ THREE.LegacyGLTFLoader = ( function () {
15651567

15661568
materialParams.specular = new THREE.Color().fromArray( materialValues.specular );
15671569

1568-
} else if ( typeof( materialValues.specular ) === 'string' ) {
1570+
} else if ( typeof ( materialValues.specular ) === 'string' ) {
15691571

15701572
materialParams.specularMap = dependencies.textures[ materialValues.specular ];
15711573

@@ -1670,9 +1672,9 @@ THREE.LegacyGLTFLoader = ( function () {
16701672

16711673
var parameters = json.techniques[ material.technique ].parameters || {};
16721674

1673-
for( var attributeName in parameters ) {
1675+
for ( var attributeName in parameters ) {
16741676

1675-
if ( parameters [ attributeName ][ 'semantic' ] === attributeId ) {
1677+
if ( parameters[ attributeName ][ 'semantic' ] === attributeId ) {
16761678

16771679
geometry.addAttribute( attributeName, bufferAttribute );
16781680

@@ -2217,8 +2219,10 @@ THREE.LegacyGLTFLoader = ( function () {
22172219
if ( child.material && child.material.isRawShaderMaterial ) {
22182220

22192221
child.gltfShader = new GLTFShader( child, dependencies.nodes );
2220-
child.onBeforeRender = function(renderer, scene, camera){
2221-
this.gltfShader.update(scene, camera);
2222+
child.onBeforeRender = function ( renderer, scene, camera ) {
2223+
2224+
this.gltfShader.update( scene, camera );
2225+
22222226
};
22232227

22242228
}

0 commit comments

Comments
 (0)