Whitelist Bakery runtime components so Bakery-baked worlds keep their lightmaps#915
Merged
dooly123 merged 1 commit intoJul 2, 2026
Conversation
Bakery-baked worlds ship an ftLightmapsStorage MonoBehaviour (on the !ftraceLightmaps object) that re-applies baked lightmaps into LightmapSettings and sets each renderer's lightmapIndex/lightmapScaleOffset at scene load. On world load ContentPoliceControl was stripping it (and the other Bakery scene components) as unapproved MonoBehaviours, and ftLightmapsStorage.OnDestroy then tore down the lightmaps it had just applied - leaving broken/partial baked lighting plus a "not approved and will be removed" error. Add the Bakery runtime components to SceneContentPoliceSelector (the World selector) so Bakery-baked worlds keep their lighting. These components only manipulate lightmap/renderer/shader-keyword state; no file/network I/O, reflection, or AddComponent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug: Bakery-baked worlds load with broken/partial baked lighting, and the console logs
MonoBehaviour ftLightmapsStorage is not approved and will be removed. Bakes and builds clean; only wrong once the world bundle is loaded.Cause: Bakery ships a runtime
ftLightmapsStorage(on!ftraceLightmaps) that re-applies the baked lightmaps intoLightmapSettingsand sets each renderer'slightmapIndex/lightmapScaleOffsetat scene load.ContentPoliceControl.ContentControlDestroyImmediates any sceneMonoBehaviourwhose type isn't in the WorldContentPoliceSelector;ftLightmapsStorageisn't listed, so it's stripped — and itsOnDestroy(ftLightmaps.UnloadScene) then tears down the lightmap array it had already applied.Fix: Add Bakery's runtime scene components to
SceneContentPoliceSelector(the World selector) so they survive the content scrub. They only touch lightmap/renderer/shader-keyword state — no file/network I/O, reflection, orAddComponent.