You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
[UE-18384] Fix for actors in hidden levels losing their transform data and becoming visible
[CL 2631365 by Dan Oconnor in Main branch]
This commit is contained in:
committed by
Dan.OConnor@epicgames.com
parent
ec07d2c153
commit
74b4fd457f
@@ -761,6 +761,19 @@ void FActorReplacementHelper::Finalize(const TMap<UObject*, UObject*>& OldToNewI
|
||||
NewActor->ExecuteConstruction(TargetWorldTransform, &DummyComponentData);
|
||||
}
|
||||
|
||||
// make sure that the actor is properly hidden if it's in a hidden sublevel:
|
||||
bool bIsInHiddenLevel = false;
|
||||
if (ULevel* Level = NewActor->GetLevel())
|
||||
{
|
||||
bIsInHiddenLevel = !Level->bIsVisible;
|
||||
}
|
||||
|
||||
if (bIsInHiddenLevel)
|
||||
{
|
||||
NewActor->bHiddenEdLevel = true;
|
||||
NewActor->MarkComponentsRenderStateDirty();
|
||||
}
|
||||
|
||||
if (TargetAttachParent)
|
||||
{
|
||||
UObject* const* NewTargetAttachParent = OldToNewInstanceMap.Find(TargetAttachParent);
|
||||
@@ -981,6 +994,16 @@ void FBlueprintCompileReinstancer::ReplaceInstancesOfClass(UClass* OldClass, UCl
|
||||
FRotator Rotation = FRotator::ZeroRotator;
|
||||
if (USceneComponent* OldRootComponent = OldActor->GetRootComponent())
|
||||
{
|
||||
// We need to make sure that the ComponentToWorld transform is up to date, but we don't want to run any initialization logic
|
||||
// so we silence the update, cache it off, revert the change (so no events are raised), and then directly update the transform
|
||||
// with the value calculated in ConditionalUpdateComponentToWorld:
|
||||
FScopedMovementUpdate SilenceMovement(OldRootComponent);
|
||||
|
||||
OldRootComponent->ConditionalUpdateComponentToWorld();
|
||||
FTransform OldComponentToWorld = OldRootComponent->ComponentToWorld;
|
||||
SilenceMovement.RevertMove();
|
||||
|
||||
OldRootComponent->ComponentToWorld = OldComponentToWorld;
|
||||
Location = OldActor->GetActorLocation();
|
||||
Rotation = OldActor->GetActorRotation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user