Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(bake-scene): a scene of prefab instances is refused, not crashed on

esengine6ee4f83b58c4
diff --git a/pipeline/bin/estella.mjs b/pipeline/bin/estella.mjs
index 3eb300ef5..7ba7e85ce 100644
--- a/pipeline/bin/estella.mjs
+++ b/pipeline/bin/estella.mjs
@@ -203,6 +203,12 @@ async function bakeScene(baker, meta, sceneFile, check) {
+ ' transforms only the editor resolves — bake it there instead.');
return 1;
}
+ const instances = (scene.entities ?? []).filter((e) => typeof e.prefab === 'string');
+ if (instances.length > 0) {
+ console.error(`bake-scene: ${rel} has ${instances.length} prefab instance(s), whose contents`
+ + ' only the editor expands — bake it there instead.');
+ return 1;
+ }
// The scene's own knobs, where it states them. Absent leaves the bake at its
// defaults, which is what every scene got before the component existed.