Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit 3992e4d

Browse files
committed
Add renderer constant enums, and change EnumValueElement to only emit a change event, rather than an app-specific command due to lacking context
1 parent ecc01e5 commit 3992e4d

3 files changed

Lines changed: 23 additions & 10 deletions

File tree

src/app/constants.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ const ConstantTypes = {
195195
'LinearFilter',
196196
'LinearMipMapNearestFilter',
197197
],
198+
toneMapping: [
199+
'NoToneMapping',
200+
'LinearToneMapping',
201+
'ReinhardToneMapping',
202+
'Uncharted2ToneMapping',
203+
'CineonToneMapping',
204+
'ACESFilmicToneMapping',
205+
],
206+
shadowMap: [
207+
'BasicShadowMap',
208+
'PCFShadowMap',
209+
'PCFSoftShadowMap',
210+
'VSMShadowMap',
211+
],
198212
};
199213

200214
// Copy some over since the constant type is found

src/app/data/renderers.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const PBR = {
1515
// @TODO
1616
name: 'Output Encoding',
1717
prop: 'outputEncoding',
18-
type: 'enum'
18+
type: 'enum',
19+
enumType: 'encoding',
1920
}]
2021
};
2122

@@ -27,6 +28,7 @@ const ToneMapping = {
2728
name: 'Type',
2829
prop: 'toneMapping',
2930
type: 'enum',
31+
enumType: 'toneMapping',
3032
}, {
3133
name: 'Exposure',
3234
prop: 'toneMappingExposure',
@@ -52,7 +54,8 @@ const ShadowMap = {
5254
// @TODO enum
5355
name: 'Shadow Type',
5456
prop: 'shadowMap.type',
55-
type: 'enum'
57+
type: 'enum',
58+
enumType: 'shadowMap',
5659
}],
5760
};
5861

src/app/elements/values/EnumValueElement.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,10 @@ ${ChromeSelectStyle}
5959
const value = +selected.value;
6060

6161
if (value !== null) {
62-
this.dispatchEvent(new CustomEvent('command', { detail: {
63-
type: 'update-property',
64-
65-
uuid: this.uuid,
66-
property: this.type,
67-
dataType: 'enum',
68-
value,
69-
},
62+
this.dispatchEvent(new CustomEvent('change', {
63+
detail: {
64+
value,
65+
},
7066
bubbles: true,
7167
composed: true,
7268
}));

0 commit comments

Comments
 (0)