Developer Notes

Not a bug; these users have misunderstood the documentation, in particular the fact that a TAssetPtr will only yield an asset if it has already been loaded (it's a lazy weak object pointer). If the asset has not been loaded and you wish to access the asset through the TAssetPtr, it's necessary to force it to be loaded first.

Description

Importing a .csv file that contains references to assets in the project requires the user to copy the references for each asset again before they will work correctly. The references do not need to be pasted anywhere, simply copying them again seems to be sufficient.

Steps to Reproduce
  1. Create a new code project using the First Person template, with starter content.
  2. Build the project in Visual Studio.
  3. Open the project in the Editor if it did not open automatically when the project was created.
  4. Add a new code class to the project derived from UserDefinedStruct. Name the class FNeedLookupTable.
  5. Close the Editor.
  6. In Visual Studio, replace the existing code in FNeedLookupTable.h with the following code:
    // Fill out your copyright notice in the Description page of Project Settings.
    
    #pragma once
    
    #include "Engine/DataTable.h"
    #include "FNeedLookupTable.generated.h"
    
    /**
     * 
     */
    USTRUCT(BlueprintType)
    struct FNeedLookupTable : public FTableRowBase
    {
    	GENERATED_USTRUCT_BODY()
    
    public:
    	FNeedLookupTable()
    		: NeedName(FText::FromString(TEXT("")))
    		, Comment(FText::FromString(TEXT("")))
    		, Thumbnail()
    	{}
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Need)
    		FText NeedName;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Need)
    		FText Comment;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Need)
    		TAssetPtr<UTexture2D> Thumbnail;
    };
    
  7. Build the project in Visual Studio.
  8. Open the project in the Editor.
  9. Import the attached DataTable.csv file into the project.
    • This file uses UTF-8 encoding. If it is opened in Excel, do not save it.
  10. Select NeedLookupTable as the Data Table Row Type.
  11. Open the resulting Data Table asset.

RESULT:
The entries in the Thumbnail column are all formatted similar to Texture2D'/Game/StarterContent/Textures/T_Brick_Clay_Beveled_D.T_Brick_Clay_Beveled_D', and will not display correctly when used in the project.

EXPECTED:
The entries in the Thumbnail column are formatted similar to /Game/StarterContent/Textures/T_Brick_Clay_Beveled_D.T_Brick_Clay_Beveled_D.

WORKAROUND:
This workaround only works while the Editor is open. If the Editor is closed and re-opened, the workaround must be done again.

  1. With the Data Table closed in the Editor, select the first twelve Textures in the StarterContent/Textures folder.
  2. Right-click on one of the selected textures and select the Copy Reference option.
  3. Open the Data Table asset.
  4. Note the entries in the Thumbnail column are now formatted as expected.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

By Design
ComponentTools
Affects Versions4.74.8
CreatedFeb 26, 2015
ResolvedApr 2, 2015
UpdatedJul 14, 2021