I’m trying to make an importer plugin to help port my project from another engine, and I’m already stumped at the first step: Trying to make a dialog to let the user pick a file to import. I’m trying to use FDesktopPlatformModule::Get()->OpenFileDialog(...); in PluginButtonClicked, but I die at getting the window handle:
I’m guessing one of the pointers in that long chain is null.
You don’t actually need to give a parent window handle to OpenFileDialog, however Windows might do some weird stuff with focus if you don’t. If your plugin has its own window, then ideally this would be the window of your plugin rather than some random viewport in the editor; if not, then I guess you could use the MainFrame window handle.
You can also get the window handle from any widget, for example, this is how SFilePathPicker gets its window handle when opening a file picker: