Instantane de reference de la reprise de migration (2026-09-29). Contient GI.uasset tel que trouve (copie UE4 identique a 4.27, MD5 F4550DA5DC05FC005400CDCA2FC123C9). Ajouts de ce commit : .gitattributes (aucune conversion de fin de ligne), regles .gitignore CHG-001, Tools/ (Snapshot, Restore, AssetHeaders), empreintes L0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
#include "StreetMapReimportFactory.h"
|
|
#include "StreetMap.h"
|
|
#include "EditorFramework/AssetImportData.h"
|
|
|
|
UStreetMapReimportFactory::UStreetMapReimportFactory(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
}
|
|
|
|
|
|
bool UStreetMapReimportFactory::CanReimport( UObject* Obj, TArray<FString>& OutFilenames )
|
|
{
|
|
UStreetMap* StreetMap = Cast<UStreetMap>( Obj );
|
|
if( StreetMap != nullptr )
|
|
{
|
|
OutFilenames.Add( StreetMap->AssetImportData->GetFirstFilename() );
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
void UStreetMapReimportFactory::SetReimportPaths( UObject* Obj, const TArray<FString>& NewReimportPaths )
|
|
{
|
|
UStreetMap* StreetMap = CastChecked<UStreetMap>( Obj );
|
|
StreetMap->Modify();
|
|
StreetMap->AssetImportData->Update( NewReimportPaths[0] );
|
|
}
|
|
|
|
|
|
EReimportResult::Type UStreetMapReimportFactory::Reimport( UObject* Obj )
|
|
{
|
|
UStreetMap* StreetMap = CastChecked<UStreetMap>( Obj );
|
|
|
|
const FString Filename = StreetMap->AssetImportData->GetFirstFilename();
|
|
const FString FileExtension = FPaths::GetExtension(Filename);
|
|
|
|
// If there is no file path provided, can't reimport from source
|
|
if ( !Filename.Len() )
|
|
{
|
|
return EReimportResult::Failed;
|
|
}
|
|
|
|
if( UFactory::StaticImportObject( StreetMap->GetClass(), StreetMap->GetOuter(), *StreetMap->GetName(), RF_Public|RF_Standalone, *Filename, nullptr, this ) )
|
|
{
|
|
// Mark the package dirty after the successful import
|
|
StreetMap->MarkPackageDirty();
|
|
return EReimportResult::Succeeded;
|
|
}
|
|
|
|
return EReimportResult::Failed;
|
|
}
|
|
|
|
|
|
int32 UStreetMapReimportFactory::GetPriority() const
|
|
{
|
|
return 0;
|
|
}
|