I’ve moved asset from one folder to another. The system creates redirectors. No problem.
For some redirectors, it is impossible to fixup. When you right click on the redirector I receive the popup message :
Fail to load assets
Show Message Log
When you click on the Show Message Log, nothing in the message log.
Therefore I’ve tried to see the references of the moved asset.
It shows the assets concerns and where linked to, I’ve openned the assets and check that all references to the asset is pointing on the right asset, which is the case. I’ve saved the asset referencing the asset with a redirector.
Relaunch the editor and always the same message.
If I delete the redirector from the directory using the file explorer, when I open the editor, the redirected asset is missing.
Any idea how to solve the problem without having to delete the redirector by hand and reassign all missing assets ?
UObject* StaticLoadObject(UClass* ObjectClass, UObject* InOuter, const TCHAR* InName, const TCHAR* Filename, uint32 LoadFlags, UPackageMap* Sandbox, bool bAllowObjectReconciliation )
{
......
// break up the name into packages, returning the innermost name and its outer
ResolveName(InOuter, StrName, true, true);
if (InOuter)
{
.....
if( (FPlatformProperties::RequiresCookedData() || FPlatformProperties::IsServerOnly()) && GUseSeekFreeLoading )
{
.....
}
else
{
.....
// If the object was not found, check for a redirector and follow it if the class matches
UObjectRedirector* Redirector = FindObjectFast<UObjectRedirector>(InOuter, *StrName);
if ( Redirector && Redirector->DestinationObject && Redirector->DestinationObject->IsA(ObjectClass) )
{
return Redirector->DestinationObject;
}
}
}
......
return nullptr;
}
The call to UObjectRedirector* Redirector = FindObjectFast(…)
is unable to load the Redirector even if the object exists.
Finally I’ve found the solution to fix up all the redirectors.
I have to see the references for each moved objects (yes it can be very long).
For each reference, open the asset. Use the browse asset icon. Then clear the asset using the yellow arrow and reassign the asset using the back arrow to use the select asset in content browser.
Validate and Save.
After that check again the references for the object. And if no more link to the redirectory object, Fix up the redirector.
I had the same issue and it was really annoying. What helped me was I renamed the folder I had the issue with, then it made the new folder but kept the old one as well but it was empty. I was able to fix the redirectors in both folders afterwards, and deleting the old folder.
Remember to always backup your project before tempering with files on a large scale.