You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Fix FSoftObjectPathFixupArchive not recursing into outered objects
#rb jeanfrancois.dube #preflight 618d4d54e96ba2832153b68e #ROBOMERGE-AUTHOR: patrick.enfedaque #ROBOMERGE-SOURCE: CL 18154376 in //UE5/Release-5.0/... #ROBOMERGE-BOT: STARSHIP (Release-5.0 -> Release-Engine-Staging) (v889-18060218) [CL 18154398 by patrick enfedaque in ue5-release-engine-staging branch]
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "HAL/ThreadSingleton.h"
|
||||
#include "UObject/Class.h"
|
||||
#include "UObject/ObjectPtr.h"
|
||||
#include "UObject/UObjectHash.h"
|
||||
|
||||
/**
|
||||
* A struct that contains a string reference to an object, either a top level asset or a subobject.
|
||||
@@ -469,11 +470,17 @@ struct FSoftObjectPathFixupArchive : public FArchiveUObject
|
||||
{
|
||||
}
|
||||
|
||||
FArchive& operator<<(FSoftObjectPath& Value)
|
||||
FArchive& operator<<(FSoftObjectPath& Value) override
|
||||
{
|
||||
FixupFunction(Value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Fixup(UObject* Root)
|
||||
{
|
||||
Root->Serialize(*this);
|
||||
ForEachObjectWithOuter(Root, [this](UObject* InObject) { InObject->Serialize(*this); });
|
||||
}
|
||||
|
||||
TFunction<void(FSoftObjectPath&)> FixupFunction;
|
||||
};
|
||||
|
||||
@@ -300,7 +300,7 @@ AActor* FWorldPartitionActorDesc::Load() const
|
||||
{
|
||||
if (SoftObjectPathFixupArchive)
|
||||
{
|
||||
Actor->Serialize(*SoftObjectPathFixupArchive);
|
||||
SoftObjectPathFixupArchive->Fixup(Actor);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -113,34 +113,14 @@ void FWorldPartitionLevelHelper::RemapLevelSoftObjectPaths(ULevel* InLevel, UWor
|
||||
check(InLevel);
|
||||
check(InWorldPartition);
|
||||
|
||||
struct FSoftPathFixupSerializer : public FArchiveUObject
|
||||
FSoftObjectPathFixupArchive FixupSerializer([InWorldPartition](FSoftObjectPath& Value)
|
||||
{
|
||||
FSoftPathFixupSerializer(UWorldPartition* InWorldPartition)
|
||||
: WorldPartition(InWorldPartition)
|
||||
if(!Value.IsNull())
|
||||
{
|
||||
this->SetIsSaving(true);
|
||||
this->ArShouldSkipBulkData = true;
|
||||
InWorldPartition->RemapSoftObjectPath(Value);
|
||||
}
|
||||
|
||||
FArchive& operator<<(FSoftObjectPath& Value)
|
||||
{
|
||||
if (!Value.IsNull())
|
||||
{
|
||||
WorldPartition->RemapSoftObjectPath(Value);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
UWorldPartition* WorldPartition;
|
||||
};
|
||||
|
||||
FSoftPathFixupSerializer FixupSerializer(InWorldPartition);
|
||||
TArray<UObject*> SubObjects;
|
||||
GetObjectsWithOuter(InLevel, SubObjects);
|
||||
for (UObject* Object : SubObjects)
|
||||
{
|
||||
Object->Serialize(FixupSerializer);
|
||||
}
|
||||
});
|
||||
FixupSerializer.Fixup(InLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user