Hi just calling to attention a bug with this command “MAP REBUILD ALLVISIBLE” when there are hidden sublevels on the current map. Initially we found it when changing maps after building lighting and traced it through a BSP actor being present and triggering “MAP REBUILD ALLVISIBLE” in EditorBuildUtils.cpp.
Locally we have fixed it by changing UWorld::ReInitWorld() to track hidden levels and re-add them back in. Do you see any issues with this fix?
CleanupWorld();
// Grab hidden levels about to be removed
TArray<TObjectPtr<class ULevel>> HiddenLevels;
for (auto Level : Levels)
{
if (Level && !Level->bIsVisible)
{
HiddenLevels.Add(Level);
}
}
// This clears UWorld::Levels
InitWorld(IVS);
// this only considers visible ULevels, leaving hidden ULevels now dangling
RefreshStreamingLevels();
// restore hidden ULevels back into UWorld::Levels
for (auto Level : HiddenLevels)
{
AddLevel(Level);
}
UpdateWorldComponents(false /* bRerunConstructionScripts */, false /* bCurrentLevelOnly */);
}
Thanks for the report. I was able to reproduce the issue locally in UE 5.5, 5.6 and also in a recent source build from the Main P4 stream (CL 45195475). I’ve submitted this as an engine bug in Epic’s JIRA so the team can handle this issue.
Please note that Epic ultimately determines whether the issue will be made publicly accessible and the process may take a few days. The tracking link might not work immediately.
In the meantime, your workaround looks appropriate and works in the latest build I tested as well.
I’ll go ahead and close the case now but feel free to reply if you have anything else to add.