Commit 4c8a285
PathByFilePicker
Summary:
When glxf is {"keyString":"src","type":"string","value":"./audio/violin.ogg"}, how does it parse?
It calls mapGLXFDataToProps which simply does props["src"] = fieldData.value → props["src"] = "./audio/violin.ogg". The "type":"string" is ignored.
How to make it support {"keyString":"src","type":"PathByFilePicker","value":"./audio/violin.ogg"} as a string?
It already works. Looking at the actual GLXF file at
Composition.glxf
, this is exactly what's already being produced and parsed:
"src": {
"keyString": "src",
"type": "PathByFilePicker",
"value": "./audio/violin.ogg"
}
The runtime parser extracts "./audio/violin.ogg" as a string value from fieldData.value — the "type": "PathByFilePicker" is treated identically to "type": "String" because the runtime code never checks the GLXF type field (except for Enum, where it checks the component schema type, not the GLXF type).
Reviewed By: felixtrz
Differential Revision: D93434772
fbshipit-source-id: bb76704c43d8891ed4690a405e92c0593f4b67bd1 parent 47742e8 commit 4c8a285
File tree
6 files changed
+23
-12
lines changed- packages
- core
- src/audio
- starter-assets/starter-template
- metaspatial-ar/components
- metaspatial-vr/components
- vite-plugin-metaspatial/src/discover-components
6 files changed
+23
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | | - | |
| 41 | + | |
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | | - | |
| 41 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments