I’m trying to add an asset picker (the same kind used all over the editor) to an editor utility widget, and I thought this would be simple but I guess there’s no support for it yet?
My research has led me down a Slate rabbit hole, with little to show for it. Apparently
**SObjectPropertyEntryBox** is a slate widget type I could use? I made a UWidget subclass with
**SNew(SObjectPropertyEntryBox)** etc in
**RebuildWidget()** and that does result in an asset picker, but I can’t seem to get
**OnObjectChanged** hooked up properly. It expects a reference to a callback function with
**const FAssetData& Data** as a parameter, which seems pretty straightforward, but deep down in the slate codegen somewhere it calls
**CreateSP(StaticCastSharedRef<UserClass>(InUserObject->AsShared()), InFunc, Vars...)** where
**UserClass** is the widget type that gets passed to
**OnObjectChanged** (my widget type), and
**InUserObject is a
**UserClass*. And the handler function in question is expected to be a member of that class, I think? e.g.
.**OnObjectChanged(thi****s, &UMyAssetPickerWidget::OnAssetChanged)**. The problem is, my UWidget subclass isn’t
**TSharedFromThis** so it doesn’t have
**->AsShared()** and the compiler chokes there.
If there’s an easier way to do this, please let me know. Otherwise, how can I get a
**SObjectPropertyEntryBox** or something similar into a widget I can use in UMG?