Skip to content

Commit 57271fa

Browse files
committed
Editor: Sidebar.Material clean up.
1 parent 6eb38b4 commit 57271fa

1 file changed

Lines changed: 9 additions & 69 deletions

File tree

editor/js/Sidebar.Material.js

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,6 @@ Sidebar.Material = function ( editor ) {
66

77
var signals = editor.signals;
88

9-
var materialClasses = {
10-
11-
'LineBasicMaterial': THREE.LineBasicMaterial,
12-
'LineDashedMaterial': THREE.LineDashedMaterial,
13-
'MeshBasicMaterial': THREE.MeshBasicMaterial,
14-
'MeshDepthMaterial': THREE.MeshDepthMaterial,
15-
'MeshFaceMaterial': THREE.MeshFaceMaterial,
16-
'MeshLambertMaterial': THREE.MeshLambertMaterial,
17-
'MeshNormalMaterial': THREE.MeshNormalMaterial,
18-
'MeshPhongMaterial': THREE.MeshPhongMaterial,
19-
'PointCloudMaterial': THREE.PointCloudMaterial,
20-
'ShaderMaterial': THREE.ShaderMaterial,
21-
'SpriteMaterial': THREE.SpriteMaterial,
22-
'SpriteCanvasMaterial': THREE.SpriteCanvasMaterial,
23-
'Material': THREE.Material
24-
25-
};
26-
279
var container = new UI.CollapsiblePanel();
2810
container.setCollapsed( editor.config.getKey( 'ui/sidebar/material/collapsed' ) );
2911
container.onCollapsedChange( function ( boolean ) {
@@ -77,7 +59,6 @@ Sidebar.Material = function ( editor ) {
7759
'LineDashedMaterial': 'LineDashedMaterial',
7860
'MeshBasicMaterial': 'MeshBasicMaterial',
7961
'MeshDepthMaterial': 'MeshDepthMaterial',
80-
'MeshFaceMaterial': 'MeshFaceMaterial',
8162
'MeshLambertMaterial': 'MeshLambertMaterial',
8263
'MeshNormalMaterial': 'MeshNormalMaterial',
8364
'MeshPhongMaterial': 'MeshPhongMaterial',
@@ -214,18 +195,6 @@ Sidebar.Material = function ( editor ) {
214195

215196
container.add( materialAlphaMapRow );
216197

217-
// light map
218-
219-
var materialLightMapRow = new UI.Panel();
220-
var materialLightMapEnabled = new UI.Checkbox( false ).onChange( update );
221-
var materialLightMap = new UI.Texture().onChange( update );
222-
223-
materialLightMapRow.add( new UI.Text( 'Light Map' ).setWidth( '90px' ) );
224-
materialLightMapRow.add( materialLightMapEnabled );
225-
materialLightMapRow.add( materialLightMap );
226-
227-
container.add( materialLightMapRow );
228-
229198
// bump map
230199

231200
var materialBumpMapRow = new UI.Panel();
@@ -411,9 +380,9 @@ Sidebar.Material = function ( editor ) {
411380

412381
}
413382

414-
if ( material instanceof materialClasses[ materialClass.getValue() ] === false ) {
383+
if ( material instanceof THREE[ materialClass.getValue() ] === false ) {
415384

416-
material = new materialClasses[ materialClass.getValue() ]();
385+
material = new THREE[ materialClass.getValue() ]();
417386
object.material = material;
418387

419388
}
@@ -519,25 +488,6 @@ Sidebar.Material = function ( editor ) {
519488

520489
}
521490

522-
/*
523-
if ( material.lightMap !== undefined ) {
524-
525-
var lightMapEnabled = materialLightMapEnabled.getValue() === true;
526-
527-
if ( objectHasUvs ) {
528-
529-
material.lightMap = lightMapEnabled ? materialLightMap.getValue() : null;
530-
material.needsUpdate = true;
531-
532-
} else {
533-
534-
if ( lightMapEnabled ) textureWarning = true;
535-
536-
}
537-
538-
}
539-
*/
540-
541491
if ( material.bumpMap !== undefined ) {
542492

543493
var bumpMapEnabled = materialBumpMapEnabled.getValue() === true;
@@ -706,7 +656,6 @@ Sidebar.Material = function ( editor ) {
706656
'skinning': materialSkinningRow,
707657
'map': materialMapRow,
708658
'alphaMap': materialAlphaMapRow,
709-
'lightMap': materialLightMapRow,
710659
'bumpMap': materialBumpMapRow,
711660
'normalMap': materialNormalMapRow,
712661
'specularMap': materialSpecularMapRow,
@@ -823,15 +772,6 @@ Sidebar.Material = function ( editor ) {
823772

824773
}
825774

826-
/*
827-
if ( material.lightMap !== undefined ) {
828-
829-
materialLightMapEnabled.setValue( material.lightMap !== null );
830-
materialLightMap.setValue( material.lightMap );
831-
832-
}
833-
*/
834-
835775
if ( material.bumpMap !== undefined ) {
836776

837777
materialBumpMapEnabled.setValue( material.bumpMap !== null );
@@ -862,18 +802,18 @@ Sidebar.Material = function ( editor ) {
862802

863803
}
864804

865-
if ( material.aoMap !== undefined ) {
805+
if ( material.lightMap !== undefined ) {
866806

867-
materialAOMapEnabled.setValue( material.aoMap !== null );
868-
materialAOMap.setValue( material.aoMap );
869-
materialAOScale.setValue( material.aoMapIntensity );
807+
materialLightMapEnabled.setValue( material.lightMap !== null );
808+
materialLightMap.setValue( material.lightMap );
870809

871810
}
872811

873-
if ( material.lightMap !== undefined ) {
812+
if ( material.aoMap !== undefined ) {
874813

875-
materialLightMapEnabled.setValue( material.lightMap !== null );
876-
materialLightMap.setValue( material.lightMap );
814+
materialAOMapEnabled.setValue( material.aoMap !== null );
815+
materialAOMap.setValue( material.aoMap );
816+
materialAOScale.setValue( material.aoMapIntensity );
877817

878818
}
879819

0 commit comments

Comments
 (0)