Skip to content

Commit 4885b4c

Browse files
committed
Editor: Clean up
1 parent 72b446c commit 4885b4c

File tree

5 files changed

+51
-62
lines changed

5 files changed

+51
-62
lines changed

editor/css/main.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ textarea, input { outline: none; } /* osx */
7878

7979
.TabbedPanel .Tabs .Tab {
8080
padding: 10px;
81-
vertical-align: middle;
8281
text-transform: uppercase;
8382
}
8483

@@ -240,7 +239,7 @@ textarea, input { outline: none; } /* osx */
240239
/* */
241240

242241
#outliner .Script:after {
243-
content: '{...}' /* ❮/❯ */
242+
content: '◎'
244243
}
245244

246245
/* */

editor/examples/shaders.app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"uuid": "EA781333-F3AE-470D-9110-A9724FCB42AA",
4040
"type": "IcosahedronGeometry",
4141
"radius": 1,
42-
"detail": 4
42+
"detail": 24
4343
}],
4444
"materials": [
4545
{

editor/js/Menubar.Help.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function MenubarHelp( editor ) {
2828
} );
2929
options.add( option );
3030

31+
/*
3132
// Icon
3233
3334
var option = new UIRow();
@@ -39,6 +40,7 @@ function MenubarHelp( editor ) {
3940
4041
} );
4142
options.add( option );
43+
*/
4244

4345
// About
4446

editor/js/Sidebar.Project.Renderer.js

Lines changed: 46 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -20,96 +20,89 @@ function SidebarProjectRenderer( editor ) {
2020
// Antialias
2121

2222
var antialiasRow = new UIRow();
23-
var antialiasBoolean = new UIBoolean( config.getKey( 'project/renderer/antialias' ) ).onChange( function () {
24-
25-
createRenderer();
26-
27-
} );
23+
container.add( antialiasRow );
2824

2925
antialiasRow.add( new UIText( strings.getKey( 'sidebar/project/antialias' ) ).setWidth( '90px' ) );
26+
27+
var antialiasBoolean = new UIBoolean( config.getKey( 'project/renderer/antialias' ) ).onChange( createRenderer );
3028
antialiasRow.add( antialiasBoolean );
3129

32-
container.add( antialiasRow );
30+
// Physically Correct lights
3331

34-
// Shadows
32+
var physicallyCorrectLightsRow = new UIRow();
33+
container.add( physicallyCorrectLightsRow );
3534

36-
var shadowsRow = new UIRow();
37-
var shadowsBoolean = new UIBoolean( config.getKey( 'project/renderer/shadows' ) ).onChange( function () {
35+
physicallyCorrectLightsRow.add( new UIText( strings.getKey( 'sidebar/project/physicallyCorrectLights' ) ).setWidth( '90px' ) );
3836

39-
currentRenderer.shadowMap.enabled = this.getValue();
37+
var physicallyCorrectLightsBoolean = new UIBoolean( config.getKey( 'project/renderer/physicallyCorrectLights' ) ).onChange( function () {
38+
39+
currentRenderer.physicallyCorrectLights = this.getValue();
4040
signals.rendererUpdated.dispatch();
4141

4242
} );
43+
physicallyCorrectLightsRow.add( physicallyCorrectLightsBoolean );
44+
45+
// Shadows
46+
47+
var shadowsRow = new UIRow();
48+
container.add( shadowsRow );
4349

4450
shadowsRow.add( new UIText( strings.getKey( 'sidebar/project/shadows' ) ).setWidth( '90px' ) );
51+
52+
var shadowsBoolean = new UIBoolean( config.getKey( 'project/renderer/shadows' ) ).onChange( updateShadows );
4553
shadowsRow.add( shadowsBoolean );
4654

4755
var shadowTypeSelect = new UISelect().setOptions( {
4856
0: 'Basic',
4957
1: 'PCF',
50-
2: 'PCF (Soft)',
58+
2: 'PCF Soft',
5159
// 3: 'VSM'
52-
} ).setWidth( '125px' ).onChange( function () {
53-
54-
currentRenderer.shadowMap.type = parseFloat( this.getValue() );
55-
signals.rendererUpdated.dispatch();
56-
57-
} );
60+
} ).setWidth( '125px' ).onChange( updateShadows );
5861
shadowTypeSelect.setValue( config.getKey( 'project/renderer/shadowType' ) );
59-
6062
shadowsRow.add( shadowTypeSelect );
6163

62-
container.add( shadowsRow );
63-
64-
// Physically Correct lights
64+
function updateShadows() {
6565

66-
var physicallyCorrectLightsRow = new UIRow();
67-
var physicallyCorrectLightsBoolean = new UIBoolean( config.getKey( 'project/renderer/physicallyCorrectLights' ) ).onChange( function () {
66+
currentRenderer.shadowMap.enabled = shadowsBoolean.getValue();
67+
currentRenderer.shadowMap.type = parseFloat( shadowTypeSelect.getValue() );
6868

69-
currentRenderer.physicallyCorrectLights = this.getValue();
7069
signals.rendererUpdated.dispatch();
7170

72-
} );
73-
74-
physicallyCorrectLightsRow.add( new UIText( strings.getKey( 'sidebar/project/physicallyCorrectLights' ) ).setWidth( '90px' ) );
75-
physicallyCorrectLightsRow.add( physicallyCorrectLightsBoolean );
76-
77-
container.add( physicallyCorrectLightsRow );
71+
}
7872

7973
// Tonemapping
8074

8175
var toneMappingRow = new UIRow();
76+
container.add( toneMappingRow );
77+
78+
toneMappingRow.add( new UIText( strings.getKey( 'sidebar/project/toneMapping' ) ).setWidth( '90px' ) );
79+
8280
var toneMappingSelect = new UISelect().setOptions( {
83-
0: 'None',
81+
0: 'No',
8482
1: 'Linear',
8583
2: 'Reinhard',
8684
3: 'Cineon',
8785
4: 'ACESFilmic'
88-
} ).setWidth( '120px' ).onChange( function () {
89-
90-
currentRenderer.toneMapping = parseFloat( this.getValue() );
91-
toneMappingExposure.setDisplay( currentRenderer.toneMapping === 0 ? 'none' : '' );
92-
signals.rendererUpdated.dispatch();
93-
94-
} );
86+
} ).setWidth( '120px' ).onChange( updateToneMapping );
9587
toneMappingSelect.setValue( config.getKey( 'project/renderer/toneMapping' ) );
96-
97-
toneMappingRow.add( new UIText( strings.getKey( 'sidebar/project/toneMapping' ) ).setWidth( '90px' ) );
9888
toneMappingRow.add( toneMappingSelect );
9989

10090
var toneMappingExposure = new UINumber( config.getKey( 'project/renderer/toneMappingExposure' ) );
10191
toneMappingExposure.setDisplay( toneMappingSelect.getValue() === '0' ? 'none' : '' );
10292
toneMappingExposure.setWidth( '30px' ).setMarginLeft( '10px' );
10393
toneMappingExposure.setRange( 0, 10 );
104-
toneMappingExposure.onChange( function () {
94+
toneMappingExposure.onChange( updateToneMapping );
95+
toneMappingRow.add( toneMappingExposure );
10596

106-
currentRenderer.toneMappingExposure = this.getValue();
107-
signals.rendererUpdated.dispatch();
97+
function updateToneMapping() {
10898

109-
} );
110-
toneMappingRow.add( toneMappingExposure );
99+
toneMappingExposure.setDisplay( toneMappingSelect.getValue() === '0' ? 'none' : '' );
111100

112-
container.add( toneMappingRow );
101+
currentRenderer.toneMapping = parseFloat( toneMappingSelect.getValue() );
102+
currentRenderer.toneMappingExposure = toneMappingExposure.getValue();
103+
signals.rendererUpdated.dispatch();
104+
105+
}
113106

114107
//
115108

@@ -129,32 +122,27 @@ function SidebarProjectRenderer( editor ) {
129122

130123
createRenderer();
131124

132-
// signals
125+
126+
// Signals
133127

134128
signals.editorCleared.add( function () {
135129

136130
currentRenderer.physicallyCorrectLights = false;
137131
currentRenderer.shadowMap.enabled = true;
138-
currentRenderer.shadowMap.type = 1;
139-
currentRenderer.toneMapping = 0;
132+
currentRenderer.shadowMap.type = THREE.PCFShadowMap;
133+
currentRenderer.toneMapping = THREE.NoToneMapping;
140134
currentRenderer.toneMappingExposure = 1;
141135

142-
refreshRendererUI();
143-
144-
signals.rendererUpdated.dispatch();
145-
146-
} );
147-
148-
function refreshRendererUI() {
149-
150136
physicallyCorrectLightsBoolean.setValue( currentRenderer.physicallyCorrectLights );
151137
shadowsBoolean.setValue( currentRenderer.shadowMap.enabled );
152138
shadowTypeSelect.setValue( currentRenderer.shadowMap.type );
153139
toneMappingSelect.setValue( currentRenderer.toneMapping );
154140
toneMappingExposure.setValue( currentRenderer.toneMappingExposure );
155141
toneMappingExposure.setDisplay( currentRenderer.toneMapping === 0 ? 'none' : '' );
156142

157-
}
143+
signals.rendererUpdated.dispatch();
144+
145+
} );
158146

159147
signals.rendererUpdated.add( function () {
160148

editor/js/Sidebar.Scene.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ function SidebarScene( editor ) {
452452

453453
if ( ignoreObjectSelectedSignal === true ) return;
454454

455-
if ( object !== null ) {
455+
if ( object !== null && object.parent !== null ) {
456456

457457
let needsRefresh = false;
458458
let parent = object.parent;

0 commit comments

Comments
 (0)