tcobbs / ldview

Real-time 3D viewer for displaying LDraw models
https://tcobbs.github.io/ldview/
GNU General Public License v2.0
88 stars 17 forks source link

ldraw-thubnailer generates thumbnails only for .ldr files #77

Open nathaneltitane opened 1 year ago

nathaneltitane commented 1 year ago

Describe the bug ldraw-thumnailer seems to generate thumbs only for ldr file extension, not mpd.

To Reproduce Steps to reproduce the behavior: install ldview restart computer check ldraw files for thumbnail

Expected behavior ldraw-thumnailer should generate thumbnails for all supported ldraw spec file types

Screenshots image

Platform (please complete the following information): image

Additional context image

tcobbs commented 1 year ago

While mpd as a file extension is officially deprecated by LDraw (in favor of always using ldr for all user-generated LDraw files), it is specific enough that it does seem like it should be supported. I've assigned this to @pbartfai to take a look.

nathaneltitane commented 1 year ago

if that's the case I'll just rename my mpd files to ldr and call it a day.

Thanks!

EDIT:

Although, this is still relevant:

https://www.ldraw.org/article/47.html

and this as well:

https://wiki.ldraw.org/wiki/LDR

tcobbs-bentley commented 1 year ago

I do feel that ldraw-thumbnailer should support the mpd file extension. Having said that, if you look at the first link (to the MPD spec) you will note that all of the sample files have an ldr file extension. IMO, the wiki pages for LDR files should be updated to explicitly state that they can contain MPDs, and the wiki for MPD should also explicitly state that ldr is the preferred extension for MPD files.

nathaneltitane commented 1 year ago

I do feel that ldraw-thumbnailer should support the mpd file extension. Having said that, if you look at the first link (to the MPD spec) you will note that all of the sample files have an ldr file extension. IMO, the wiki pages for LDR files should be updated to explicitly state that they can contain MPDs, and the wiki for MPD should also explicitly state that ldr is the preferred extension for MPD files.

Sounds good. Out of habit, I've always discerned between mpd and ldr (mpd explicitly being the format I use when building multi-part model asssemblies)

nathaneltitane commented 1 year ago

@pbartfai @tcobbs on a side note, was taking anothe rlook at the thumbnailer - was looking to modify it (just for the sake of it to have it render using leocad)

does the thumbnailer explicitly call LDView anywhere else other than in /usr/bin/ldraw-thumbnailer?

What woudl it take to have it render with any other render capable LDraw compatible software other than the image/render-specific arguments?

Explicitly setting the arguments in ldraw-thumbnailer gets it to render but not when replacing the file under /usr/bin/

please see attached:

ldraw-thumbnailer.txt

pbartfai commented 1 year ago

@nathaneltitane when you double click on .mpd file will it be opened with LDView? So is the file type properly detected? Which file manager do you use? Dolphin? Is the problem experienced with Gnome? (It worked on my Gnome/Nautilus)

nathaneltitane commented 1 year ago

@nathaneltitane when you double click on .mpd file will it be opened with LDView? So is the file type properly detected? Which file manager do you use? Dolphin? Is the problem experienced with Gnome? (It worked on my Gnome/Nautilus)

Hi @pbartfai:

I am currently running KDE (been 4 years actually) - Dolphin is my main file manager - I haven't tried with Gnome/Nautilus

As far as opening the file (mpd or ldr) with LDView, I first had to assign the file type to LDView for some odd reason as KDE did not automatically associate the file type (even though the mimetype seems to be expressed correctly - I have no issues with LeoCAD)

EDIT:

I had a look at LPub3d's mimetype strings and Trevor seems to add 'application/x-multi-part-ldraw' to the 'MimeType=' line of his .desktop files.

I've manually added it to the relevant .desktop entries in charge of thumbnailing for LDView, restarted my computer and both the ldr and mpd are now thumbnailed.

EDIT 2:

Confirmed:

I reinstalled LDView to undo changes, cleared the home cache directory, restarted and now only the ldr file has a thumbnail after initialization. The MimeType declaration is what's bugging it.

Please update all MimeType entries to

MimeType=application/x-ldraw;application/x-multipart-ldraw;application/x-multi-part-ldraw;
nathaneltitane commented 1 year ago

@pbartfai

To continue on the mimetype saga, I've had a look at the files under QT/desktop

Attached are the modified files to reflect the missing x-multi-part-ldraw entries in those files

Also, the plugin entry label has been renamed to 'LDraw Models' to better reflect the file type, rather than simply have 'LDView' in the checkbox menu selections

desktop.tar.gz kde5.tar.gz

nathaneltitane commented 1 year ago

More issues about the thumbnailer - I decided to move upstream and install Debian 12 Gnome

Neither my custom leocad thumbnailer nor the packaged LDView one are functioning either..

Bit of an annoyance...

pbartfai commented 1 year ago

Please note Gnome thumbnail runs in bubblewrap jail. Qt version of LDView is not compatible with that. OSMesa works fine. The script /usr/bin/ldraw-thumbnailer detect it and will fallback to OSMesa if it is available.

nathaneltitane commented 1 year ago

I understand now why the leocad rendering would not work then. thanks for the clarification