I have tried to figure out how the preview pictures are implemented into the gcode like when you send the gcode directly via the Snapmaker Luban software.
Because this is a VERY cool feature I want to know more about it.
I want to use another slicer than Snapmaker Luban because I need some more options (and already purchased licences for Simplify3D).
I’ve tried to copy some parts of the Luban code to the S3D code and it seems to be only working if you replace the whole header.
Since I don’t know how important the header data are for the touch screen app and if it affects the print I wanted to ask the professionals here.
There has to be another way to implement pictures than slice it twice with diferent software and edit the gcode…
Maybe there would be a posibility to make a reference to an extra file (for example same file name as the gcode but with extension .png or .jpg)
Since nobody wanted to help me (or is not interested in the feature) I found a workaround (since I don’t know a detail of the SM Luban code) by myself:
Slice the file with Snapmaker Luban and export the gcode as a file (since I only want the picture there is no need to worry about the settings).
Then slice the model with your desired software.
Open both files with a text editor.
Now copy the marked parts from the Luban-created file to the other and save the file:
Now you can send the gcode to the machine and you will see a preview after the parsing (when you copy the complete header the picture is displayed earlier but the displayed values are incorrect).
PS: Since the header only contains the graphic all other values are calculated by the software on the SM2.0 - and the size is including skirt and end script.
PPS: Maybe somebody from the programmers (or anybody interested in this) can discuss with me about my “solution”.
But since the picture is saved as part of the generated gcode it is possible to manipulate codes from other slicers. I have a workaround in my previous post.
At the moment I want to know the specifications of the thumbnail (dimension, resolution,…) and the way how to convert the picture.
PS: The picture of the preview on the TS is showing a gcode created by Simplify3D (with imported thumbnail from Snapmaker Luban).
Will try this, thank you.
But a solution directly in Prusa-slicer would be very nice.
If I could, I would do it by myself, but my coding-knowledge is too bad.
I had a look, but prusa-slicer is not extendible through plugins. This would mean we had to fork the prusa-slicer and create our own version. It is possible, but with every new version from prusa somebody had to merge the functionality into the new version every time. Other possibility would be to implement it and do a pull-request and hope that the developers of prusa-slicer adapt this functionality. In either case, it is too much work for me.
@Razor1990: you sir, are the best.
I was already thinking about implementing this myself, but as I have no python experience that would have cost me ages. Your plugin seems to work perfect! Thanks!
I’ve not yet looked into the other gcode differences, but maybe you can expand your plugin to add the other header data that Luban adds as well? And maybe “check if the start/end gcode was set, if not add it”… that would make it the perfect bridge from Cura to the machine, for those who do not like Luban’s limited capabilities.
I now use cura also, and use your plugin, great work!
only “problem” I have is, when I save the gcode directly to a USB-Drive, Cura uses the normal gcode-format, not the snapmaker-gcode from your plugin.
Is there a way to change the fileformat which is used when saving directly to usb-drive?
Exactly as you say it. The moment you click “save gcode file” you will have to click the file type drop-down and change it from standard gcode format to the snapmaker gcode format. As the plugin runs “on save”.
I also made a tutorial about this plugin and cura setup, which I also posted on the official support facebook group:
@Razor1990: it got around 80 likes and a lot of positive comments, so your plugin should have had some more downloads lately (since 21/11)
I am working on a solution to directly send the Gcode over WiFi to the Snapmaker. So stay tuned.
But as I try to learn something about test-driven development with this project, it might take a bit more.