Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No thumbnail for BambuStudio - A1 Mini #17

Closed
spuder opened this issue Feb 8, 2025 · 10 comments
Closed

No thumbnail for BambuStudio - A1 Mini #17

spuder opened this issue Feb 8, 2025 · 10 comments

Comments

@spuder
Copy link

spuder commented Feb 8, 2025

This application is working almost perfectly on OSX.

I used bambu slicer to export several plates as individual 3mf files. Strangely some of the previews are working and some are not.
The common denominator between the ones that work and the ones that don't is that the non working all have multiple objects on a single plate and have a large number of triangles.

Image Image Image

I can provide the original files for troubleshooting if desired. (They are too large to upload to GitHub issues)

Test 1

I've created a single plate with multiple primitive objects, and they show a preview correctly.

Image

Any advice of how to further troubleshoot would be appreciated.

@DavidPhillipOster
Copy link
Owner

Thanks for the follow up. For the .3mf that are returning a white icon with the green '3MF' text (example: MTS03-Blacksto...ode.3mf): That tells me that Thumb3mf (the quicklook plugin) extracted a valid thumbnail image from the .3mf file and then stamped that image with the green '3MF' text. Please unzip a copy of Blacksto...ode.3mf as in #16 (comment) to see the files within the .3mf

Has the tool that you used to generate the .3MF file included a non-blank thumbnail?

If the included thumbnail is blank, then Thumb3mf is working correctly, but the generating app is buggy.

If the included thumbnail is not blank, then can you upload the file to, for example, Google Doc, and share it with me?

@spuder
Copy link
Author

spuder commented Feb 8, 2025

Ah that is helpful.

I figured out that the common denominator is that the files that worked were sliced for P1S printers, and the ones that don't were sliced for A1 Mini printers.

I see there is a comment in the readme that Prusa Mini's don't generate the thumbnail. It seems that Bambu Studio doesn't generate the thumbnail for the A1 Mini

Here is what the extracted 3mf looks like of a non working 3mf file

unzip MTS03-BlackstoneHouse_plate_3.gcode_a1mini.gcode.3mf
Archive:  MTS03-BlackstoneHouse_plate_3.gcode_a1mini.gcode.3mf
  inflating: [Content_Types].xml
 extracting: Metadata/plate_1.png
 extracting: Metadata/plate_1_small.png
 extracting: Metadata/plate_2.png
 extracting: Metadata/plate_2_small.png
 extracting: Metadata/plate_3.png
 extracting: Metadata/plate_3_small.png
 extracting: Metadata/plate_4.png
 extracting: Metadata/plate_4_small.png
 extracting: Metadata/plate_no_light_1.png
 extracting: Metadata/plate_no_light_2.png
 extracting: Metadata/plate_no_light_3.png
 extracting: Metadata/plate_no_light_4.png
 extracting: Metadata/top_1.png
 extracting: Metadata/pick_1.png
 extracting: Metadata/top_2.png
 extracting: Metadata/pick_2.png
 extracting: Metadata/top_3.png
 extracting: Metadata/pick_3.png
 extracting: Metadata/top_4.png
 extracting: Metadata/pick_4.png
  inflating: Metadata/plate_3.json
  inflating: 3D/3dmodel.model
  inflating: Metadata/project_settings.config
  inflating: Metadata/filament_settings_1.config
  inflating: Metadata/filament_settings_2.config
  inflating: Metadata/plate_3.gcode.md5
  inflating: Metadata/plate_3.gcode
  inflating: Metadata/_rels/model_settings.config.rels
  inflating: Metadata/model_settings.config
  inflating: Metadata/cut_information.xml
  inflating: Metadata/slice_info.config
  inflating: _rels/.rels

Has the tool that you used to generate the .3MF file included a non-blank thumbnail?

The parent 3mf file (with all plates combined). Does include a working preview

Image Image

@spuder spuder changed the title Preview fails to render if multiple objects on plate No thumbnail for BambuStudio - A1 Mini Feb 8, 2025
@spuder
Copy link
Author

spuder commented Feb 8, 2025

To further muddy the waters, it seems that Bambu Studio does not generate a Metadata/thumbnail.png for either the P1S or the A1Mini.

Here is an unzip of a P1S plate (which does preview correctly)

unzip MTS03-BlackstoneHouse_plate_1.gcode_p1p.gcode.3mf
Archive:  MTS03-BlackstoneHouse_plate_1.gcode_p1p.gcode.3mf
  inflating: [Content_Types].xml
 extracting: Metadata/plate_1.png
 extracting: Metadata/plate_1_small.png
 extracting: Metadata/plate_2.png
 extracting: Metadata/plate_2_small.png
 extracting: Metadata/plate_3.png
 extracting: Metadata/plate_3_small.png
 extracting: Metadata/plate_4.png
 extracting: Metadata/plate_4_small.png
 extracting: Metadata/plate_no_light_1.png
 extracting: Metadata/plate_no_light_2.png
 extracting: Metadata/plate_no_light_3.png
 extracting: Metadata/plate_no_light_4.png
 extracting: Metadata/top_1.png
 extracting: Metadata/pick_1.png
 extracting: Metadata/top_2.png
 extracting: Metadata/pick_2.png
 extracting: Metadata/top_3.png
 extracting: Metadata/pick_3.png
 extracting: Metadata/top_4.png
 extracting: Metadata/pick_4.png
  inflating: Metadata/plate_1.json
  inflating: Metadata/plate_3.json
  inflating: Metadata/plate_4.json
  inflating: 3D/3dmodel.model
  inflating: Metadata/project_settings.config
  inflating: Metadata/filament_settings_1.config
  inflating: Metadata/filament_settings_2.config
  inflating: Metadata/plate_1.gcode.md5
  inflating: Metadata/plate_1.gcode
  inflating: Metadata/_rels/model_settings.config.rels
  inflating: Metadata/model_settings.config
  inflating: Metadata/cut_information.xml
  inflating: Metadata/slice_info.config
  inflating: _rels/.rels

It does have plate_1.png preview files

Image

@DavidPhillipOster
Copy link
Owner

Note that in #17 (comment) that file does contain a Metadata/plate_1.png and that .png is blank.

Currently, Thumb3MF looks for these files in order, and grabs the first match: Metadata/thumbnail.png, Metadata/thumbnail.jpg, Metadata/plate_1.png, Metadata/plate_1.jpg.

I wonder if Thumb3MF, if it doesn't find a file inside the zip labeled 'thumbnail.png' or thumbnail.jpg should look for an 𝑥𝑥𝑥.json file, and if it finds it, use the corresponding 𝑥𝑥𝑥.png file.

@DavidPhillipOster
Copy link
Owner

I've downloaded those two files from Google Drive, so you can remove them from there now.

@DavidPhillipOster
Copy link
Owner

I see from inspecting MTS03-BlackstoneHouse_plate_3.gcode_a1mini.gcode.3mf that there is nothing useful inside the .json file inside the Metadata directory, so just the presence of the file is an indication of which .png to use.

But MTS03-BlackstoneHouse_plate_2.gcode_p1p.gcode.3mf contains multiple .json files, each with a corresponding 𝑥𝑥𝑥.png file so you may be better off overriding the thumbnail that Thumb3MF hands Finder:

Override by opening the file in an app, using ^⇧⌘4 (Control + Shift + Command + 4) to sweep out a rectangle in the app and put the resulting image on the clipboard, then ⌘i on the selected file in Finder, and click on the icon in the upper left of that Get Info window, and ⌘v to paste the image on the clipboard as the icon of the file.

The downside of this method is: if you copy the file to non-macOS drive, like the SD card for the printer, it will loose your custom icon on that drive.

I wonder how Microsoft Windows handles files like these.

@spuder
Copy link
Author

spuder commented Feb 8, 2025

I have an updated theory to what is happening.

The parent file of these 3mf files contained 4 plates

Image

When slicing for the A1 Mini, some of the objects were too large to fit on the smaller plate, so Bambu Studio moved them off of plates

Image

I then exported the plate sliced file

Image

Even though it exported a single plate, bambustudio still exported 4 Metadata/plate_x.png files. The plate_1 and plate_2 are empty because there were no objects on it.

Steps to reproduce

Attached is a 3mf file that contains 2 objects. One of the objects is too large for the A1 Mini build plate. When slicing for A1 Mini it removes the large file from the plate which causes plate_1.png to be blank.

Cube.3mf.zip

Conclusion

This is a very specific edge case / bug in Bambu Studio where exporting a single plate exports the preview images for all plates. It isn't ThumbHost3mf responsibility to account for the quirky export from Bambu Studio when a user inadvertently leaves plate 1 empty when exporting.

Possible Workarounds

if there are multiple plates, and the plate_1 is empty (1096 bytes), skip it and use the first non empty plate file.

67847853 -rw-r--r--@  1 foo  wheel      1096 Feb  7 14:51 plate_1.png
67847854 -rw-r--r--@  1 foo  wheel       143 Feb  7 14:51 plate_1_small.png
67847855 -rw-r--r--@  1 foo  wheel      1096 Feb  7 14:51 plate_2.png
67847856 -rw-r--r--@  1 foo  wheel       143 Feb  7 14:51 plate_2_small.png
67847880 -rw-r--r--@  1 foo  wheel  52972836 Feb  7 14:51 plate_3.gcode
67847879 -rw-r--r--@  1 foo  wheel        32 Feb  7 14:51 plate_3.gcode.md5
67847873 -rw-r--r--@  1 foo  wheel       539 Feb  7 14:51 plate_3.json
67847857 -rw-r--r--@  1 foo  wheel     52934 Feb  7 14:51 plate_3.png
67847858 -rw-r--r--@  1 foo  wheel      5830 Feb  7 14:51 plate_3_small.png
67847859 -rw-r--r--@  1 foo  wheel     73010 Feb  7 14:51 plate_4.png
67847860 -rw-r--r--@  1 foo  wheel      6713 Feb  7 14:51 plate_4_small.png

@spuder
Copy link
Author

spuder commented Feb 9, 2025

Opened Issue with Bambu Studio bambulab/BambuStudio#5927

@spuder spuder closed this as completed Feb 9, 2025
@DavidPhillipOster
Copy link
Owner

Thank you. Please file a new issue with me if BambuStudio starts using thumbnail names other than thumbnail or plate_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants