Description

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);
	}
}

Steps to Reproduce
  1. Create a LevelInstance with some actors
  2. Places the levelinstance away from 0,0,0
  3. (optional) set WorldPartition Cell Size And Loading Range low value in WorldSetting Pane
  4. Select the levelinstance in the outliner and press edit button in detail panel
  5. Select an actor in the outliner and attach it to another actor
  6. Commit the level instance
  7. Start PIE and move away far until actor streams out

[Link Removed]is the repro project.

Result:

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)

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-187098 in the post.

2
Login to Vote

Fixed
Fix Commit26094801
Main Commit26095012
CreatedMay 26, 2023
ResolvedJun 19, 2023
UpdatedJun 22, 2023
View Jira Issue