I’ve been making use of TObjectPtrs with the instanced property specifier, and with a goal of reducing UObject counts, I’m trying to migrate some of them to Instanced Structs which were recently moved into the main engine from their plugin.
However, one slight stumbling block I’ve found is that where I used to be able to make a PropertyTypeCustomization for the UObject class which would even work for the instanced property (allowing me to customize the header etc), I can’t seem to do the same thing with TInstancedStruct<MyBaseStruct>. It seems that the PropertyTypeCustomization for the struct only gets called for raw properties of it and not the instanced variety.
Are there plans to allow for this customisation like the instanced uobjects? Is there a workaround to replicate this behaviour?
I’ve had a look into this and I can confirm that it is possible to apply an IPropertyTypeCustomization to a TInstancedStruct<>. Since you have this working for Instanced objects It’s hard to tell where the issue might be without some sort of repro project or code snippets. Would you be able to provide a minimal setup based on what you have for the instanced structs?
Considering your existing set up you might already be accounting for this but I have a couple of issues that commonly catch people out when registering/un-registering the property type layout:
Make sure that you use the base name of your struct without the prefix e.g “MyBaseStruct” vs “FMyBaseStruct”.
Any child structs that you want to use the custom layout for must also be registered separately.
“Any child structs that you want to use the custom layout for must also be registered separately.”
It appears that this is the source of my problems, as you do not need to do this with UObjects, they automagically get the customisation from their parent class.