When moving actors from a level into a Level Instance, Unreal uses FAssetRenameManager to update soft references from the actors’ old object paths to their new
paths.
During this process, unrelated packages may be incorrectly classified as referencing the moved actors. As a result, the source-control checkout dialog can contain
hundreds or thousands of unrelated assets, including Level Sequences that only reference other actors in the same map.
The issue is in this overload:
bool FAssetRenameManager::CheckPackageForSoftObjectReferences(
UPackage* Package,
const TMap<FSoftObjectPath, FSoftObjectPath>& AssetRedirectorMap,
TArray<UObject*>& OutReferencingObjects) const
The function appends objects found in the current package to OutReferencingObjects, but returns whether the accumulated output array is non-empty:
return OutReferencingObjects.Num() != 0;
OutReferencingObjects is shared across multiple package checks in LoadReferencingPackages():
TArray<UObject*> SoftReferencingObjects;
for (each candidate package)
{
const bool bFoundSoftReference =
CheckPackageForSoftObjectReferences(
Package,
ModifiedPaths,
SoftReferencingObjects);
}
Once any package contains a matching soft reference, SoftReferencingObjects remains non-empty. Every package checked afterward therefore returns true, even when
the current package contains no matching soft reference.
Those unrelated packages are then added to PackagesToSaveForThisAsset and eventually included in the source-control checkout prompt.
## Affected Code
File:
Engine/Source/Developer/AssetTools/Private/AssetRenameManager.cpp
Current implementation:
bool FAssetRenameManager::CheckPackageForSoftObjectReferences(
UPackage* Package,
const TMap<FSoftObjectPath, FSoftObjectPath>& AssetRedirectorMap,
TArray<UObject*>& OutReferencingObjects) const
{
TMap<FSoftObjectPath, TArray<UObject*>> ReferencingObjectsMap;
CheckPackageForSoftObjectReferences(
Package,
AssetRedirectorMap,
ReferencingObjectsMap);
for (const auto& It : ReferencingObjectsMap)
{
for (UObject\* Obj : It.Value)
{
OutReferencingObjects.AddUnique(Obj);
}
}
return OutReferencingObjects.Num() != 0;
}
The return value reflects all previously checked packages instead of only the current Package.
## Suggested Fix
return !ReferencingObjectsMap.IsEmpty();
[Attachment Removed]