Fixed an issue where the contextual menu interpreted the relative file path of a source file an the display label instead of using the actual display label store with the source file.

#rb Alexis.Matte

[CL 26739466 by julien stjean in ue5-main branch]
This commit is contained in:
julien stjean
2023-08-01 11:01:43 -04:00
parent 030a1ef5db
commit c19fe82eb4
3 changed files with 6 additions and 8 deletions

View File

@@ -1310,16 +1310,10 @@ void FAssetFileContextMenu::GetSelectedAssetSourceFilePaths(TArray<FString>& Out
{
GetSourceFilesArgs.Assets = TConstArrayView<FAssetData>(&AssetData, 1);
EAssetCommandResult Result = AssetDefinition->GetSourceFiles(GetSourceFilesArgs, [&OutFilePaths](const FAssetSourceFilesResult& AssetImportInfo)
EAssetCommandResult Result = AssetDefinition->GetSourceFiles(GetSourceFilesArgs, [&OutFilePaths, &OutUniqueSourceFileLabels](const FAssetSourceFilesResult& AssetImportInfo)
{
OutFilePaths.Add(AssetImportInfo.FilePath);
return true;
});
GetSourceFilesArgs.FilePathFormat = EPathUse::Display;
AssetDefinition->GetSourceFiles(GetSourceFilesArgs, [&OutUniqueSourceFileLabels](const FAssetSourceFilesResult& AssetImportInfo)
{
OutUniqueSourceFileLabels.Add(AssetImportInfo.FilePath);
OutUniqueSourceFileLabels.AddUnique(AssetImportInfo.DisplayLabel);
return true;
});

View File

@@ -95,6 +95,7 @@ EAssetCommandResult UAssetDefinition::GetSourceFiles(const FAssetSourceFilesArgs
for (FAssetImportInfo::FSourceFile& SourceFiles : ImportInfo.SourceFiles)
{
Result.FilePath = MoveTemp(SourceFiles.RelativeFilename);
Result.DisplayLabel = MoveTemp(SourceFiles.DisplayLabelName);
Result.Timestamp = MoveTemp(SourceFiles.Timestamp);
Result.FileHash = MoveTemp(SourceFiles.FileHash);

View File

@@ -141,6 +141,9 @@ struct FAssetSourceFilesResult
/** The file path in the format requested. */
FString FilePath;
/** The Label was used to display this source file in the property editor. */
FString DisplayLabel;
/** The timestamp of the file when it was imported (as UTC). 0 when unknown. */
FDateTime Timestamp;