Download

Culling the names of Blueprint Struct/Actor Variables

Hey!

I have a CPP function that takes any struct as a parameter and uses the names of the variables of the struct to fetch certain rows from an SQL query. To make it as user friendly as possible, pure blueprint structs are also necessary. However, when I iterate over the properties of a pure blueprint struct, the property name is appended by some auto-generated stuff. Below is the snippet of the variable.

  •    Property    0x0000017a0eb92fc0 (Name=0x000001790722e9f8 "steam_id_3_99B7EFEE4C1F96D36D995294B3A01F5A")    UProperty * {UE4Editor-CoreUObject.dll!UIntProperty}
    

The property name is steam_id, given it is the database row and the following stuff (_3_99B7…) is the generated bit. I was wondering if anyone knows a safe way to fetch the pure name.

I used Property->GetName() or GetNameCPP(), which both failed. As an extra, I debugged with VS Watch, could not find anything that contains steam_id on its own. I cant tell if culling it by count from right would do the trick and reverse engineering would take some time (Potentially Struct editor load/save section might shed some light).

TLDR: UProperty name gives name+random numbers for blueprint structs. I wanna get just the name.

After some digging, I found https://api.unrealengine.com/INT/API/Runtime/CoreUObject/UObject/UStruct/PropertyNameToDisplayName/index.html.

Since it is not stored in the property itself, it is quite limiting, given we should get the property names during iteration and pass them as an extra parameter. Although, this is the solution and the topic can be locked if needs be.