Daily Unreal Column #53 - Filter Data Table
Data table is a generic type that takes a struct that defines its row layout. Here is how to filter them by row type in the editor.
When you make a blueprint exposed UPROPERTY
like this:
UPROPERTY(EditAnywhere)
TObjectPtr<UDataTable> MyDataTable;
Once you open the editor and try to assign a value to this property, you will immediately notice that all existing data tables are shown. Which in most cases is NOT what you want, because you expect a data table with a specific row type definiton.
To make Unreal editor filter the displayed data table to only show the ones with a specific row type, you need to update the declaration of the property to match the following:
UPROPERTY(EditAnywhere, meta = (RequiredAssetDataTags = "RowStructure=/Script/GameName.YourRowType"))
TObjectPtr<UDataTable> MyDataTable;
where YourRowType
is the name of the struct that defines the row type of your data table.
Subscribe to Robert Lewicki
Launched 10 months ago
Daily Unreal Column is a project about sending one and only one bite-sized news per day at 12pm CET, from Monday to Friday, to expose you to a features of Unreal Engine that are not very well known.