Adding PNG thumbnail for custom asset

I’m having trouble changing the default image of my custom asset. Essentially, there are 3 classes involved: **UDataAsset** (which is the asset I want to change the image for), **UDataAssetFactory** (which defines the drag and drop behavior in the editor and manages the allowed file types), and **IAssetTypeActions** (which is responsible for modifying these properties, including the thumbnail). This is the function that creates the brush during startup.

And this is the part that should change the thumbnail in the IAssetTypeAction:

It does change the file, but there were two cases where a checkerboard pattern appeared along with the error:
LogSlateStyle: Warning: Missing Resource from ‘BridgeStyle’ Style: ‘Unable to find Brush ‘MidiEssenceStyle.MidiAsset.Icon’.’

Screenshot_1

I’m using the default Icon128 image for testing. Thanks in advance!

I finally made it… In case anyone goes through the same thing, I swapped IAssetTypeAction with UAssetDefinitionDefault because, from what I saw, IAsset is for versions prior to 5.1. I don’t think that was the reason, but anyway, I created a file to manage the style, and then you just go to the module and call the Initialize() function of that class in the StartupModule.
MidiStyle.cpp (1.1 KB)
MidiStyle.h (515 Bytes)

Probably I was managing the path incorrectly as well… In the UAssetDefinition, I overrode the GetThumbnailBrush() function.

virtual const FSlateBrush* GetThumbnailBrush(const FAssetData& InAssetData, const FName InClassName) const override
{
return FSlateStyleRegistry::FindSlateStyle(“MidiStyle”)->GetBrush(“MidiEssence.MidiAsset”);
}

1 Like