When importing a CSV into a data table using AssetToolsModule with a file containing an FText, the resulting FText value is invalid. As a note, there are no issues when importing an FGuid, a FString or a FVector.
Here is an example of the CSV to import as a DataTable:
,NameCheckpoint1,"NSLOCTEXT(""[2D45083E4A0E4844F79D62AE42EA7A0C]"",""DF8074A54B023F413FD1B4A9C658C347"",""First place"")"
Code to run to import the data:
FAssetToolsModule& AssetToolsModule = FModuleManager::GetModuleChecked<FAssetToolsModule>("AssetTools"); UCSVImportFactory* Factory = NewObject<UCSVImportFactory>(this); Factory->AutomatedImportSettings.ImportRowStruct = FCheckpointDataTable::StaticStruct(); Factory->AutomatedImportSettings.ImportType = ECSVImportType::ECSV_DataTable; UAutomatedAssetImportData* ImportData = NewObject<UAutomatedAssetImportData>(this); ImportData->bReplaceExisting = true; ImportData->Filenames = UsableFiles; ImportData->DestinationPath = DataPath; ImportData->Factory = Factory; ImportedAssets = AssetToolsModule.Get().ImportAssetsAutomated(ImportData);
The FCheckpointDataTable:
USTRUCT(BlueprintType) struct FCheckpointDataTable : public FTableRowBase { GENERATED_BODY() public: FCheckpointDataTable() = default; UPROPERTY(EditAnywhere, BlueprintReadWrite) FText Name; };
After running via ImportAssetsAutomated, observe an incorrect result (may vary):
(Name=NSLOCTEXT("[F9775C984D14798165E61DB816DBB97C]", "4AC41E3945B7FB01A1BAA280AC91453B", "First place"))
Versus when reimported manually in the editor, the expected result:
(Name=NSLOCTEXT("[2D45083E4A0E4844F79D62AE42EA7A0C]", "DF8074A54B023F413FD1B4A9C658C347", "First place"))
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-186362 in the post.
0 |
Component | UE - Editor - Content Pipeline |
---|---|
Affects Versions | 5.1 |
Created | May 18, 2023 |
---|---|
Resolved | Jun 28, 2023 |
Updated | Jun 28, 2023 |