Skip to content

Commit c25c60a

Browse files
committed
ENG-8627 | code style fixes
1 parent ccdfc59 commit c25c60a

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

mfr/extensions/jsc3d/static/js/jsc3d.3ds.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ JSC3D.Autodesk3DSLoader.prototype.loadFromUrl = function(urlName) {
7777
xhr.onreadystatechange = function() {
7878
if(this.readyState == 4) {
7979
if(this.status == 200 || this.status == 0) {
80-
if(JSC3D.console)
80+
if(JSC3D.console) {
8181
JSC3D.console.logInfo('Finished loading 3DS file "' + urlName + '".');
82+
}
8283
if(self.onload) {
83-
if(self.onprogress)
84+
if(self.onprogress) {
8485
self.onprogress('Loading 3DS file ...', 1);
86+
}
8587
// if(JSC3D.PlatformInfo.browser == 'ie' && JSC3D.PlatformInfo.version >= '10') {
8688
// // asynchronously decode blob to binary string
8789
// var blobReader = new FileReader;
@@ -107,10 +109,12 @@ JSC3D.Autodesk3DSLoader.prototype.loadFromUrl = function(urlName) {
107109
}
108110
}
109111
else {
110-
if(JSC3D.console)
112+
if(JSC3D.console) {
111113
JSC3D.console.logError('Failed to load 3DS file "' + urlName + '".');
112-
if(self.onerror)
114+
}
115+
if(self.onerror) {
113116
self.onerror('Failed to load 3DS file "' + urlName + '".');
117+
}
114118
}
115119
self.request = null;
116120
}
@@ -464,14 +468,16 @@ JSC3D.Autodesk3DSLoader.prototype.parseObjectAnimation = function (reader,end) {
464468
if (name != '$$$DUMMY' && this._unfinalized_objects.hasOwnProperty(name)) {
465469
vo = this._unfinalized_objects[name];
466470
// todo vasea
467-
if(JSC3D.console)
471+
if(JSC3D.console) {
468472
JSC3D.console.logInfo('Construct object '+vo.name);
473+
}
469474
// this._cur_obj = null;
470475
obj = null;//this.constructObject(vo, pivot);
471476

472477
if (obj) {
473-
if(JSC3D.console)
478+
if(JSC3D.console) {
474479
JSC3D.console.logInfo('finished loading the object '+vo.name);
480+
}
475481
}
476482

477483
delete this._unfinalized_objects[name];
@@ -520,8 +526,9 @@ JSC3D.Autodesk3DSLoader.prototype.setupTexture = function(meshList, textureUrlNa
520526
texture.onready = function() {
521527
for(var i=0; i<meshList.length; i++)
522528
meshList[i].setTexture(this);
523-
if(self.onresource)
529+
if(self.onresource) {
524530
self.onresource(this);
531+
}
525532
};
526533

527534
texture.createFromUrl(textureUrlName);
@@ -558,8 +565,9 @@ JSC3D.Autodesk3DSLoader.prototype.parse3DS = function(scene, data) {
558565
// Can't finalize at this point, because we have to wait until the full
559566
// animation section has been parsed for any potential pivot definitions
560567

561-
if(JSC3D.console)
568+
if(JSC3D.console) {
562569
JSC3D.console.logInfo('Optimize the mesh and add it to the scene. ');
570+
}
563571

564572
//have to parse all the materials and create a mesh fdor each material
565573

@@ -583,8 +591,9 @@ JSC3D.Autodesk3DSLoader.prototype.parse3DS = function(scene, data) {
583591
let materialFaces = this._cur_obj.materialFaces || {};
584592
let sawMaterial = false;
585593
for (let materialName in materialFaces) {
586-
if (!Object.prototype.hasOwnProperty.call(materialFaces, materialName))
594+
if (!Object.prototype.hasOwnProperty.call(materialFaces, materialName)) {
587595
continue;
596+
}
588597
sawMaterial = true;
589598

590599
var currentMaterial = this._materials[materialName];
@@ -596,8 +605,9 @@ JSC3D.Autodesk3DSLoader.prototype.parse3DS = function(scene, data) {
596605
}
597606

598607
if (currentMaterial.colorMap && currentMaterial.colorMap.url) {
599-
if(JSC3D.console)
608+
if(JSC3D.console) {
600609
JSC3D.console.logInfo('set texture: ' + currentMaterial.colorMap.url);
610+
}
601611
this.setupTexture([mesh], currentMaterial.colorMap.url);
602612
}
603613
else if (currentMaterial.diffuseColor != null) {

0 commit comments

Comments
 (0)