Nokse22 / Exhibit

3D model viewer for the GNOME desktop powered by f3d
https://flathub.org/apps/io.github.nokse22.Exhibit
GNU General Public License v3.0
87 stars 10 forks source link

App won't start without HDRIs #24

Closed RedAuburn closed 4 months ago

RedAuburn commented 4 months ago

thank you so much for adding https://github.com/Nokse22/Exhibit/issues/21!

When testing it, i couldn't load any models. running via terminal shows:

harry@fedora:~$ flatpak run io.github.nokse22.Exhibit 
Traceback (most recent call last):
  File "/app/share/exhibit/exhibit/main.py", line 158, in do_activate
    win = Viewer3dWindow(application=self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/share/exhibit/exhibit/window.py", line 291, in __init__
    for filepath in os.listdir(hdri_path):
                    ^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/harry/.var/app/io.github.nokse22.Exhibit/data/HDRIs'

IMO it'd make sense to still launch without any HDRIs added/bundled.

Additionally, the previews aren't shown. Presumably this is because it needs some sort of thumbnail that would be included with a proper release?

image

Nokse22 commented 4 months ago

Thank you for testing. It is a bug that the app doesn't open without HDRIs, I'm fixing it.

The previews are made with GTK that can't open .hdr or .exr files, so my solution for now is to bundle HDRI in another format like jpg, this way are also smaller. But I still need to find a solution if there are other HDRI formats in the folder.

RedAuburn commented 4 months ago

I'd imagine you're already aware, but just in case, storing HDRIs as JPG doesn't work well due to the dynamic range loss (https://en.wikipedia.org/wiki/RGBE_image_format#Description)

I guess the current loader is pixbuf; from my beginner understanding, it'd be best to switch to Glycin, but it doesn't have python bindings (or HDR support yet)... maybe it's possible to generate a small JPG preview instead with imagemagick etc, then use the actual HDRI for F3D?

Nokse22 commented 4 months ago

I know, I have used jpg for now for the semplicity. But I want the user to be able to add HDRIs to the folder, so it would be best to generate a thumbnail for sure.

Nokse22 commented 4 months ago

It now generates thumbnails for any HDRI file added in the HDRIs folder using ImageMagick. You can open the folder from the menu. When it's released I will then bundle some low res HDRI.