bigtreetech / BIGTREETECH-TouchScreenFirmware

support TFT35 V1.0/V1.1/V1.2/V2.0/V3.0, TFT28, TFT24 V1.1, TFT43, TFT50, TFT70
GNU General Public License v3.0
1.28k stars 1.63k forks source link

Thumbnail visibility for Prusaslicer #1238

Closed neew1 closed 3 years ago

neew1 commented 3 years ago

Hi Guys,

first of all, many thanks for your effort.

The Cura plugin for the thumbnails is great, but I actually use the Prusaslicer. Is there such a plugin or something for this one?

According to the Internet, you can (like the Mini) add the item Thumbnail to the corresponding printer profile via Prusaresearch.ini. But I can't get the thumbnail to be displayed. can someone help me? Hardware: SKR 1.4 Turbo and Btt TFT35 V3.0

friendly greetings

oldman4U commented 3 years ago

Hi.

I added your feature request to the pinned FR list #1170 . This list has been made so that users which would like to contribute have a single point where they can look for FR and BUGs. This also allows to make sure, that only a single developer works on a certain feature and not several developers - like we had in the past.

It would be great if you could close this ticket. This would allow us to keep this system maintainable.

Thank you and happy printing

traffic-light commented 3 years ago

Hi, Good idea. But it's not possible to create a plugin for prusaslicer. Then there should be a edited version of prusaslicer which they've to maintain. And that's the hard part...

neew1 commented 3 years ago

It's a shame, I like to work with the slicer because I always had problems with Cura. So many little things that were simply not available with the Prusaslicer. But today with these screens it should soon be standard. Hopefully

oldman4U commented 3 years ago

I do not know who finally made the functionality, BTT or a user or someone got paid for it, I do not know. But I could imagine, that they finally followed simply the majority of users and this seems to be 80% plus for Cura.

This is open source, the way is clear, one already walked down the road and now someone else has to go the same way. What the community delivers is what we all can use. There is no manufacturer we can blame or ask to do it.

You can use Prusaslicer and there is nothing wrong with it, but you get the functions which are available for it and those using Cura get the other functions. It is great that there is a choice, isn't it!?

neew1 commented 3 years ago

Sure, of course, It's a shame anyway;) of course a plus for Cura. But it's also a shame that I don't know my way around here and can't do anything like programming either.

I wanted to ask if there is something like that and / or someone of you could do something like that, but I also can't estimate the effort.

Since I just manage to configure Marlin to print.

And the most important thing is that with each success, the fun of the thing increases.

And excuse my "English" that is translated from g ....;)

Happy printing

oldman4U commented 3 years ago

I mean this is a nice to have feature finally and not a must have. Even not all Cura users use this function and use the list view instead.

Maybe one day there will be a similar function for Prusa also, or you give Cura a second try and you decide again afterwards.

traffic-light commented 3 years ago

image

neew1 commented 3 years ago

Oh really? would that mean that there is a way to possibly set this for the Prusaslicer.

how could i do that

excuse the question.

Kind regards

bigtreetech commented 3 years ago

Does anyone know the encoding format of prusaslicer thumbnail? Or related document links? another point to consider is whether the resolution of prusaslicer thumbnail can be set. Otherwise, we can't confirm that all TFTs are compatible

traffic-light commented 3 years ago

I don't know. But I can test or send the file to you @bigtreetech

traffic-light commented 3 years ago

@bigtreetech I received an answer:

As answer to Bigtreetech

The thumbnail-data from PusaSlicer is a base64 encodet 256 color png.

And you can see in my phyton script it writes all four tumbnail sizes to the gcode file

def overseek(gfile):

    outdatar = ""

    outdatar = outdatar + overread(QSize(70,70),gfile)

    outdatar = outdatar + overread(QSize(95,80),gfile)

    outdatar = outdatar + overread(QSize(95,95),gfile)

    outdatar = outdatar + overread(QSize(160,140),gfile)

    return outdatar

Marc

neew1 commented 3 years ago

So what does that mean exactly?

Can this be inserted anywhere?

excuses these questions,

traffic-light commented 3 years ago

biqu_convert_new.zip

This is the file for thumbnail in prusaslicer.

I don't know how it works. I don't care enough about it at this moment to research it ;-)

effgarces commented 3 years ago

This works rather nicely, thanks for the script. I already made a small change to it, as it sits now, it saves whatever gcode file it receives with [Bigtree].gcode appended to the end of it. I modified it so it simply adds _btt (a little bit smaller) and it preserves the original file extension, instead of enforcing .gcode: biqu_convert_mod.zip

How to use: Download and install python 3 (3.9.1 at this moment in time), afterwards, install PyQt5, by going to the command line and issuing pip install PyQt5

Next open prusa slicer and add the thumbail generation: Captura de ecrã 2021-01-01 124431

Finaly go to your Print Settings and in Post processing scripts, add the following [python absolute path] [space] [script absolute path] and if any of the paths contain spaces enclose them in "": Captura de ecrã 2021-01-01 131206

Then when saving the gcode, it will be processed by the script that will replace it with a version with the correct thumbnails for our TFT

sarvenn commented 3 years ago

@effgarces I tried you instruction but could not go further then installing pyton. I'm quite far from using pyton, coding etc. Is it possible to provide a plug and play file? Run and go. I tried the cura plugin which works great. Now I use prusaslicer and I would be happy to get thumbnail from prusaslicer as well.

effgarces commented 3 years ago

@sarvenn I've created a repo with the modded version that I shared above and also "compiled" a windows standalone version, using auto-py-to-exe, if you are on windows give it a try, seems to be working for me. Grab it here: https://github.com/effgarces/Biqu-Thumbnail-Generator/releases/tag/0.01 With this standalone version you shouldn't have to install python or pyqt, simply copy the exe to the prusalicer.exe or superslicer.exe folder and add the following to the post processing scripts section: Captura de ecrã 2021-01-10 155118

sarvenn commented 3 years ago

Great! Thank you. I'll try it tomorrow and inform you.

sarvenn commented 3 years ago

@sarvenn I've created a repo with the modded version that I shared above and also "compiled" a windows standalone version, using auto-py-to-exe, if you are on windows give it a try, seems to be working for me. Grab it here: https://github.com/effgarces/Biqu-Thumbnail-Generator/releases/tag/0.01 With this standalone version you shouldn't have to install python or pyqt, simply copy the exe to the prusalicer.exe or superslicer.exe folder and add the following to the post processing scripts section: Captura de ecrã 2021-01-10 155118

@effgarces I tried your solution above recently. It works perfectly. Thank you very much. I think your solution should drive PrusaSlicer developers to integrate this into slicer software. How can we take their attention?

3dfixer commented 3 years ago

works for me. when printing from tft it also replaces babystepping icon with the picture!

effgarces commented 3 years ago

@sarvenn I've created a repo with the modded version that I shared above and also "compiled" a windows standalone version, using auto-py-to-exe, if you are on windows give it a try, seems to be working for me. Grab it here: https://github.com/effgarces/Biqu-Thumbnail-Generator/releases/tag/0.01 With this standalone version you shouldn't have to install python or pyqt, simply copy the exe to the prusalicer.exe or superslicer.exe folder and add the following to the post processing scripts section: Captura de ecrã 2021-01-10 155118

@effgarces I tried your solution above recently. It works perfectly. Thank you very much. I think your solution should drive PrusaSlicer developers to integrate this into slicer software. How can we take their attention?

I really doubt that the prusaslicer developers would integrate this solution as it sits right now. The best approach would probably be rewrite it in c++ and do a pull request on the prusaslicer github but even then I'm not sure if they would be willing to integrate it. Maybe the superslicer developers would be more open to that integration.

effgarces commented 3 years ago

works for me. when printing from tft it also replaces babystepping icon with the picture!

Yeah, I've also noticed that. The weird is that if start a print from wifi, using esp3d, the picture is missing. Probably a bug in the touchscreen firmware.

sarvenn commented 3 years ago

@effgarces as you guessed superslicer developers are interested but prusaslicer developer suggested to change BTT's thumbnail view format. Actually it is an another solution may be but this time there Cura will also need to change it's relevant plugin. Anyway, you solved the problem. Thanks again mate. I wish I knew coding as well to help the community.

gordo3di commented 3 years ago

Works great! Thank you. I believe it's supposed to replace the babystepping icon intentionally otherwise there's nowhere else to display it.

neew1 commented 3 years ago

Thank you a lot, this works so nice. great work.

thanks

marcotagliabo commented 3 years ago

Hi to All... Someone have done this python "trick" with MacOS? i've tried but PrusaSlicer get error compiling g-code

Post-processing script /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 "/Library/Frameworks/Python.framework/Versions/3.9/bin/biqu_convert_new.py" on file /var/folders/jj/bk768xgs5lsg_r6rrjgj6fgw0000gn/T/.PrusaSlicer.upload.265f-b320-6b5d-a7a7 failed. Error code: 1 Output: Python path configuration: PYTHONHOME = '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current' PYTHONPATH = '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/site-packages' program name = '/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9' isolated = 0 environment = 1 user site = 1 import site = 1 sys._base_executable = '/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9' sys.base_prefix = '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current' sys.base_exec_prefix = '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current' sys.platlibdir = 'lib' sys.executable = '/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9' sys.prefix = '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current' sys.exec_prefix = '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current' sys.path = [ '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/site-packages', '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python39.zip', '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.9', '/Users/marcotagliabo/Library/Application Support/Autodesk/webdeploy/production/aea9db95b176b4e876666d6d1c364de9e4dfc5b8/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.9/lib-dynload', ] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' Current thread 0x0000000115a0edc0 (most recent call first):

bttguy commented 3 years ago

@bigtreetech Any possible implementation of native PS thumbnail images without a post processing script?

bigtreetech commented 3 years ago

@bigtreetech Any possible implementation of native PS thumbnail images without a post processing script?

Not available yet.

oldman4U commented 3 years ago

Cura offers what you want.

oldman4U commented 3 years ago

Good morning.

I hope you all have seen PR#1973 from user @Cyberdeck which includes the requested feature.

gordo3di commented 3 years ago

Good morning.

I hope you all have seen PR#1973 from user @CyberDeck which includes the requested feature.

Awesome thanks @oldman4U and @cyberDeck !

oldman4U commented 3 years ago

Cyberdeck did everything I only let you know.

But feedback would be very welcome I believe.

So happy testing

👍🏻

sarvenn commented 2 years ago

@effgarces hi, I switched to PrusaSlicer 2.4 beta 1 (final release version does not work on my PC). I used your standalone scripts. It doesn't work. It still works on PS 2.3.3. I think an update needed for the script to work with version 2.4, right?

This is the error pop up from PS 2.4.0 beta1 image

effgarces commented 2 years ago

I just took a look at this and from my understanding the expected behavior for post-processing scripts changed with prusaslicer 2.4, now the scripts are expected change the g-code in place and not delete/rename the final file. I will see if I can find the documentation on how to properly comply with this and see If I can fix it.

sarvenn commented 2 years ago

I just took a look at this and from my understanding the expected behavior for post-processing scripts changed with prusaslicer 2.4, now the scripts are expected change the g-code in place and not delete/rename the final file. I will see if I can find the documentation on how to properly comply with this and see If I can fix it.

Thanks @effgarces. Your solution was the best working solution for me.

effgarces commented 2 years ago

I've updated the script to comply with PrusaSlicer 2.4, the modified version can be found over at https://github.com/effgarces/Biqu-Thumbnail-Generator/ , there's also a "compiled" standalone version, like previously.

carlosjln commented 2 years ago

@effgarces thanks for updating it 🙏

cronos45 commented 2 years ago

I've updated the script to comply with PrusaSlicer 2.4, the modified version can be found over at https://github.com/effgarces/Biqu-Thumbnail-Generator/ , there's also a "compiled" standalone version, like previously.

Any idea how I could implement this on Mac OS?

lauchablanca commented 2 years ago

Actualicé el script para cumplir con PrusaSlicer 2.4, la versión modificada se puede encontrar en https://github.com/effgarces/Biqu-Thumbnail-Generator/ , también hay una versión independiente "compilada", como antes.

¿Alguna idea de cómo podría implementar esto en Mac OS?

Hola, no puedo encontrar la versión compilada. Sólo el archivo PY. Podrías revisarlo?

effgarces commented 2 years ago

I've updated the script to comply with PrusaSlicer 2.4, the modified version can be found over at https://github.com/effgarces/Biqu-Thumbnail-Generator/ , there's also a "compiled" standalone version, like previously.

Any idea how I could implement this on Mac OS?

For the Mac you will probably need something like py2app (https://py2app.readthedocs.io/en/latest/) in order to "compile" a standalone version

effgarces commented 2 years ago

Actualicé el script para cumplir con PrusaSlicer 2.4, la versión modificada se puede encontrar en https://github.com/effgarces/Biqu-Thumbnail-Generator/ , también hay una versión independiente "compilada", como antes.

¿Alguna idea de cómo podría implementar esto en Mac OS?

Hola, no puedo encontrar la versión compilada. Sólo el archivo PY. Podrías revisarlo?

Check the releases area

supermerill commented 2 years ago

Hi, can someone tell me what's wrong with this 95x95 thumbnail in this file: Shape-Box_bqu.gcode.txt

I'm trying to implement the thumbnail format natively.

sarvenn commented 2 years ago

Hi, can someone tell me what's wrong with this 95x95 thumbnail in this file: Shape-Box_bqu.gcode.txt

I'm trying to implement the thumbnail format natively.

@effgarces , @CyberDeck , @bigtreetech , @Msq001 , @traffic-light hi guys, could you help @supermerill on his study please? I did my best but could not help him further. ( https://github.com/supermerill/SuperSlicer/issues/887)

sarvenn commented 2 years ago

Kind reminder guys. @effgarces , @CyberDeck , @traffic-light

effgarces commented 2 years ago

I'm sorry, but right now is a really bad time for me, I really don't have much time at the moment, maybe in two to three days but not guarantees.

alejandrojrey commented 2 years ago

Hi, is there any way to preserve colors in the preview as the cura plugin does?

Nudekz commented 4 months ago

image Hi, im getting this error, any sugestions?

supermerill commented 4 months ago

btw, I updated the Biqu thumbnail update for Superslicer (2.5.59.8), based on the orca one. Can someone tellme if it works?

emguepo commented 2 months ago

well, i found the solution... only download this other file... Captura de pantalla 2024-04-28 143739 Captura de pantalla 2024-04-28 143855

emguepo commented 2 months ago

image Hi, im getting this error, any sugestions?

see my post...

sarvenn commented 2 months ago

well, i found the solution... only download this other file... Captura de pantalla 2024-04-28 143739 Captura de pantalla 2024-04-28 143855

You can move that .py file to your PrusaSlicer folder (where prusaslicer.exe exists) and just put biqu_convert_p24.py wording into post prosessing script section in your slicer.