OGRECave / ogre-meshviewer

Viewer for .mesh and .scene files as consumed by OGRE as well as any format supported by assimp
MIT License
57 stars 13 forks source link

File Open Dialog #19

Closed sercero closed 7 months ago

sercero commented 7 months ago

Hello @paroj,

What do you think of implementing a file open dialog?

That way if someone executes ogre-meshviewer without passing any command line arguments it is possible to select something after the fact.

I might be able to do it but with some help 😅

paroj commented 7 months ago

that is a can of worms actually..

imgui

there exist multiple implementations using ImGui already: https://github.com/ocornut/imgui/wiki/Useful-Extensions#file-browsers--file-dialog

each with their own quircks of how to be integrated with the ImGui/ Ogre build.

native

Then there is something like this: https://github.com/btzy/nativefiledialog-extended

which delegates to platform code for this. But it needs to be integrated into the Ogre build to be wrapped for python too.

linux only

on linux, you can just call zenity --file-selection - but obviously that will only work on Gnome..

sercero commented 7 months ago

Ouch, so it seems to be more difficult than I thought.

I'll see what I can do.

paroj commented 7 months ago

ah.. if an ugly solution is ok, then this is also an option: https://stackoverflow.com/a/14119223

sercero commented 7 months ago

ah.. if an ugly solution is ok, then this is also an option: https://stackoverflow.com/a/14119223

That might be the best solution, if ugly because all the FileOpenDialog options for ImGui require C++