Attached actors do not return to LevelInstance space at the end of LevelInstance editing, and bounds contains level instance offset location. This results in huge bounds.
My workaround is:
void FLevelUtils::ApplyEditorTransform(const ULevelStreaming* StreamingLevel, bool bDoPostEditMove, AActor* Actor) { check(StreamingLevel); if (ULevel* LoadedLevel = StreamingLevel->GetLoadedLevel()) { FApplyLevelTransformParams TransformParams(LoadedLevel, StreamingLevel->LevelTransform); #if 1 //workaround // Move parent actor instead of child actor USceneComponent* RootComponent = Actor->GetRootComponent(); if (RootComponent && RootComponent->GetAttachParent()) { while( RootComponent->GetAttachParent() ) { RootComponent = RootComponent->GetAttachParent(); } Actor = RootComponent->GetOwner(); } #endif TransformParams.Actor = Actor; TransformParams.bDoPostEditMove = bDoPostEditMove; ApplyLevelTransform(TransformParams); } } void FLevelUtils::RemoveEditorTransform(const ULevelStreaming* StreamingLevel, bool bDoPostEditMove, AActor* Actor) { check(StreamingLevel); if (ULevel* LoadedLevel = StreamingLevel->GetLoadedLevel()) { const FTransform InverseTransform = StreamingLevel->LevelTransform.Inverse(); FApplyLevelTransformParams TransformParams(LoadedLevel, InverseTransform); #if 1 //workaround USceneComponent* RootComponent = Actor->GetRootComponent(); if (RootComponent && RootComponent->GetAttachParent()) { while( RootComponent->GetAttachParent() ) { RootComponent = RootComponent->GetAttachParent(); } Actor = RootComponent->GetOwner(); } #endif TransformParams.Actor = Actor; TransformParams.bDoPostEditMove = bDoPostEditMove; ApplyLevelTransform(TransformParams); } }
[Link Removed]is the repro project.
The actor cluster promoted to a higher grid level than expected, significantly increasing stream out distance.
You can also see promoted actors in StremingGeneration log (Saved\WorldPartition*.log)
How does TextureRenderTarget2D get TArray<uint8> type data?
Why does the REMOVE method of map container remove elements have memory leaks?
How do I set a material as a post-processing material?
How to delete some elements correctly when deleting an array loop?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
What is the difference between Camera and CineCamera?
How does TArray loop correctly remove elements in blueprints?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-187098 in the post.
2 |
Component | UE - World Creation - Worldbuilding Tools - Level Instances |
---|---|
Affects Versions | 5.1, 5.2 |
Target Fix | 5.4 |
Fix Commit | 26094801 |
---|---|
Main Commit | 26095012 |
Created | May 26, 2023 |
---|---|
Resolved | Jun 19, 2023 |
Updated | Jun 22, 2023 |