Greetings.
In my saga of trying to get things done in UE 4, I have a need to be able to select a static mesh object via a slate widget as is given all over the Unreal Editor. I have found what are called widget properties to do this.
SObjectPropertyEntryBox and SAssetProperty.
SObjectPropertyEntryBox gives me the ability to select a static mesh as the code snippet below illustrates
SNew(SObjectPropertyEntryBox)
.OnObjectChanged(this, &MyProject::on_static_mesh_changed)
.AllowedClass(UStaticMesh::StaticClass())
.DisplayThumbnail(true)
However, I cannot find out anywhere any documentation or example on what the function on_static_mesh_changed function structure should be. The API for this function seems to return a type void and have an input variable of type const FAssetData &. as follows
void MyProject::on_static_mesh_changed(const FAssetData &static_mesh)
This passes the selected static mesh made from the widgets drop down list to this function, but does not update the selected mesh name in the displayed widget selection tab. So question one, how can I get this widget to update the selected mesh in the drop down widget instead of it remaining None? Also the expected thumbnail image is not displayed, is there something that I am missing in getting a thumbnail image displayed ?
Second question is to do with the SAssetProperty. According to the documentation given by,
there is a SAssetProperty that looks to be the same as the asset selector widgets used in the UE editor. But in all my attempts to get this to work, It seems I need to define a pointer to a created IDetailBuilder class. But I have found once again as in many cases in Unreal engine, I cannot create this pointer by a simple statement like
IDetailBuilder *MyDetailBuilder = new IDetailBuilder;
And I cannot find in all my searches on the net, here in the answer hub or in the source code how to correctly define a pointer to this IDetailBuilder class. So the question is, how does one do this because it is not explained anywhere how this is done ? This is shocking that this is not documented anywhere as it seems to be such a crucial step for building customised panels that are used extensively such as in the Landscape plugin source code I have looked at.
Thanks in advance and much appreciated for any information than can help.
Regards