@@ -77,11 +77,13 @@ JSC3D.Autodesk3DSLoader.prototype.loadFromUrl = function(urlName) {
77
77
xhr . onreadystatechange = function ( ) {
78
78
if ( this . readyState == 4 ) {
79
79
if ( this . status == 200 || this . status == 0 ) {
80
- if ( JSC3D . console )
80
+ if ( JSC3D . console ) {
81
81
JSC3D . console . logInfo ( 'Finished loading 3DS file "' + urlName + '".' ) ;
82
+ }
82
83
if ( self . onload ) {
83
- if ( self . onprogress )
84
+ if ( self . onprogress ) {
84
85
self . onprogress ( 'Loading 3DS file ...' , 1 ) ;
86
+ }
85
87
// if(JSC3D.PlatformInfo.browser == 'ie' && JSC3D.PlatformInfo.version >= '10') {
86
88
// // asynchronously decode blob to binary string
87
89
// var blobReader = new FileReader;
@@ -107,10 +109,12 @@ JSC3D.Autodesk3DSLoader.prototype.loadFromUrl = function(urlName) {
107
109
}
108
110
}
109
111
else {
110
- if ( JSC3D . console )
112
+ if ( JSC3D . console ) {
111
113
JSC3D . console . logError ( 'Failed to load 3DS file "' + urlName + '".' ) ;
112
- if ( self . onerror )
114
+ }
115
+ if ( self . onerror ) {
113
116
self . onerror ( 'Failed to load 3DS file "' + urlName + '".' ) ;
117
+ }
114
118
}
115
119
self . request = null ;
116
120
}
@@ -464,14 +468,16 @@ JSC3D.Autodesk3DSLoader.prototype.parseObjectAnimation = function (reader,end) {
464
468
if ( name != '$$$DUMMY' && this . _unfinalized_objects . hasOwnProperty ( name ) ) {
465
469
vo = this . _unfinalized_objects [ name ] ;
466
470
// todo vasea
467
- if ( JSC3D . console )
471
+ if ( JSC3D . console ) {
468
472
JSC3D . console . logInfo ( 'Construct object ' + vo . name ) ;
473
+ }
469
474
// this._cur_obj = null;
470
475
obj = null ; //this.constructObject(vo, pivot);
471
476
472
477
if ( obj ) {
473
- if ( JSC3D . console )
478
+ if ( JSC3D . console ) {
474
479
JSC3D . console . logInfo ( 'finished loading the object ' + vo . name ) ;
480
+ }
475
481
}
476
482
477
483
delete this . _unfinalized_objects [ name ] ;
@@ -520,8 +526,9 @@ JSC3D.Autodesk3DSLoader.prototype.setupTexture = function(meshList, textureUrlNa
520
526
texture . onready = function ( ) {
521
527
for ( var i = 0 ; i < meshList . length ; i ++ )
522
528
meshList [ i ] . setTexture ( this ) ;
523
- if ( self . onresource )
529
+ if ( self . onresource ) {
524
530
self . onresource ( this ) ;
531
+ }
525
532
} ;
526
533
527
534
texture . createFromUrl ( textureUrlName ) ;
@@ -558,8 +565,9 @@ JSC3D.Autodesk3DSLoader.prototype.parse3DS = function(scene, data) {
558
565
// Can't finalize at this point, because we have to wait until the full
559
566
// animation section has been parsed for any potential pivot definitions
560
567
561
- if ( JSC3D . console )
568
+ if ( JSC3D . console ) {
562
569
JSC3D . console . logInfo ( 'Optimize the mesh and add it to the scene. ' ) ;
570
+ }
563
571
564
572
//have to parse all the materials and create a mesh fdor each material
565
573
@@ -583,8 +591,9 @@ JSC3D.Autodesk3DSLoader.prototype.parse3DS = function(scene, data) {
583
591
let materialFaces = this . _cur_obj . materialFaces || { } ;
584
592
let sawMaterial = false ;
585
593
for ( let materialName in materialFaces ) {
586
- if ( ! Object . prototype . hasOwnProperty . call ( materialFaces , materialName ) )
594
+ if ( ! Object . prototype . hasOwnProperty . call ( materialFaces , materialName ) ) {
587
595
continue ;
596
+ }
588
597
sawMaterial = true ;
589
598
590
599
var currentMaterial = this . _materials [ materialName ] ;
@@ -596,8 +605,9 @@ JSC3D.Autodesk3DSLoader.prototype.parse3DS = function(scene, data) {
596
605
}
597
606
598
607
if ( currentMaterial . colorMap && currentMaterial . colorMap . url ) {
599
- if ( JSC3D . console )
608
+ if ( JSC3D . console ) {
600
609
JSC3D . console . logInfo ( 'set texture: ' + currentMaterial . colorMap . url ) ;
610
+ }
601
611
this . setupTexture ( [ mesh ] , currentMaterial . colorMap . url ) ;
602
612
}
603
613
else if ( currentMaterial . diffuseColor != null ) {
0 commit comments