Hello.
I am trying to set a default value for UTexture
.h
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SelectionToolComponent\|Style\|Outline Textures")
UTexture* CornerTexture1;
.cpp In the constructor
String ContentDir = IPluginManager::Get().FindPlugin(“SelectionTool”)->GetContentDir();
FString Texture1 = “/Textures/Points1.Points1”;
ContentDir = ContentDir + Texture1;static ConstructorHelpers::FObjectFinder PathCornerTexture1(*(ContentDir));
if (PathCornerTexture1.Succeeded())
{
CornerTexture1 = PathCornerTexture1.Object;
}
When launching the UE, I get the error
But this is the correct path to the texture.
Any ideas how to set UTexture in constructor from Content Plugin Folder ?
UPD:
As always, I create a theme and after 5 minutes I solve the problem.
And so the decision to use ‘Copy Reference’ and not write the absolute path
static ConstructorHelpers::FObjectFinder<UTexture> PathCornerTexture1(TEXT("Texture2D'/SelectionTool/Textures/Points1.Points1'"));