Commit c8d1783
committed
feat(web): open a bundled scene on startup instead of an empty document
A browser tab has no command line to name a scene on, and MeshCraft's Open dialog is a path
field over Emscripten's virtual filesystem -- whose entire contents are whatever CMakeLists.txt
preloaded from test/ at build time. So the web build always came up on an empty document, which
reads as "it failed to load anything" rather than as a working editor.
Web builds now start on /test/medieval_castle.mc3.xml: 548 objects across 272 instances and 21
groups, with real textures, so the first thing the page shows exercises the renderer rather than
an empty grid. Guarded by std::filesystem::exists so a build whose preload set changes degrades
to the old empty-scene start with a message, not a failure.
Emscripten-only and only for the plain interactive start: --screenshot/--export/--benchmark each
require their own scene argument and are rejected above without one, so an empty filePath here
can only be the interactive case. Native builds are untouched.
Verified in a browser on real hardware: the scene loads ("[MeshCraft] Loaded:
/test/medieval_castle.mc3.xml"), the hierarchy fills, the Properties panel shows the
MedievalCastle document and the status bar reads 548 objects. Note for anyone testing headless:
SwiftShader cannot draw this scene at a usable rate and leaves the canvas black -- that is the
software rasteriser, not the build.1 parent 2dbcd52 commit c8d1783
1 file changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
133 | 154 | | |
134 | 155 | | |
135 | 156 | | |
| |||
0 commit comments