Coder Social home page Coder Social logo

octoprint-prusaslicerthumbnails's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

octoprint-prusaslicerthumbnails's Issues

Missing image button

image

I installed PrusaSlicer Thumbnails 0.0.7 with Octoprint 1.4.0 and Python 3.6.9, but unfortunately, there's no new image button. I double checked, this gcode does have the thumbnail comments at the first few lines. I did not spot any errors on octoprint.log as well.

PrusaSlicer 2.3 Alpha 2 Plugin dont works

Hi Thanks for your hard work,i love your Plugin,in the new PrusaSlicer 2.3 Alpha 2 your Plugin dont works,can you please make a new workaround for thumbnails = 16x16,220x124 because in PrusaSlicer 2.3 the Octoprinter Profil is a Pysical Printer Profil and there is no line with thumbnails ? Thanks

Adjust Configuration Instructions to be More Detailed

Select Show Configuration Folder from the help menu a directory should open that is on your machine. In that folder there is a sub-folder named printers. Each of the ini files in that folder are the equivalent of your Printer list you see in PrusaSlicer in the top right of the application. Open the printer setting you want to modify in a text editor like Notepad or Notepad++ (all depends on your operating system) and look for the text "thumbnails = " and add the resolutions after the equal sign. So for example make it so it looks like "thumbnails = 16x16,220,124" (without the quotes). Once you've made the change restart PrusaSlicer and slice up a file and upload to OctoPrint.

thumbnail= -> thumbnails =

The instructions for other printers (including my MK3s) indicate I should adjust an entry called thumbnail. This entry was not there in my configuration file, there is a entry thumbnails however.
Adjusting that as indicated worked just fine :)

Thumbnails not working for subdirs

Had an existing subdir in OctoPrint file structure hosting some old files and when I navigate into this directory none of the line items (separate gcode files) have the icon for the thumbnail. But works GREAT in main directory.

Greedy regex

For me current regex is too greedy.
When slicer generates small and big thumbnail in octoprint I see only the small one(first instead of last).
After a little of debugging I saw that len(matches) returns 1. Problem is that current regex match from start of first thumbnail to the end of second one.
Changing
regex = r"(?:^; thumbnail begin \d+x\d+ \d+)(?:\n|\r\n?)((?:.+(?:\n|\r\n?))+)(?:^; thumbnail end)"
to
regex = r"(?:^; thumbnail begin \d+x\d+ \d+)(?:\n|\r\n?)((?:.+(?:\n|\r\n?))+?)(?:^; thumbnail end)"
Fixes problem for me and shouldn't break anything.

Thumbnails Broken With File Moves

Strangley, whilst I can still upload via Prusa Slicer, the thumbnails are no longer showing in Octoprint UI...

2020-04-22 13:47:10,745 - tornado.access - WARNING - 404 GET /plugin/prusaslicerthumbnails/thumbnail/Overglasses_Frame_V3b2_(2no)_0.3mm_PETG_MK3S_1h44m.png?20200422134115 (::ffff:192.168.0.133) 12.28ms
2020-04-22 13:47:18,155 - tornado.access - WARNING - 404 GET /plugin/prusaslicerthumbnails/thumbnail/Overglasses_Frame_V3b2_(2no)_0.3mm_PETG_MK3S_1h44m.png?20200422134115 (::ffff:192.168.0.133) 3.78ms
2020-04-22 13:49:19,922 - octoprint.plugins.prusaslicerthumbnails - INFO - File Added: Overglasses_Frame_V5B_0.3mm_PETG_MK3S_58m.gcode
2020-04-22 13:49:26,914 - tornado.access - WARNING - 404 GET /plugin/prusaslicerthumbnails/thumbnail/Overglasses_Frame_V3b2_(2no)_0.3mm_PETG_MK3S_1h44m.png?20200422134115 (::ffff:192.168.0.133) 7.17ms

Capture

I move the files from root to a different directory. Thumbnail was fine at first, but then I restarted the server and now I don't see the thumbnail, just a placeholder.

Edit: I did restart Prusa Slicer, so that's not the issue. :)

Originally posted by @ruralaccent in #3 (comment)

Thumbnail gone on octoprint instances with a shared upload folder

I have 5 printers running off one server with 5 octoprint instances. They share an upload folder but the g-code is only sent to one instance's API key.

when I upload, the printer with the API key loads the thumbnail no issues but all other instances show a small place holder photo.
image
image

exception parsing thumbnails

I stopped seeing thumbnails at some point, and I see this in OctoPrint's log on a freshly-uploaded file:

2020-05-22 16:21:31,130 - octoprint.filemanager.analysis - INFO - Starting analysis of local:2020-05-22_NinjaFlex_3D_Benchy_0.2mm_FLEX_MK3S_2h27m.gcode
2020-05-22 16:21:31,131 - octoprint.filemanager.analysis - INFO - Invoking analysis command: /opt/octoprint-venv/bin/python -m octoprint analysis gcode --speed-x=6000 --speed-y=6000 --max-t=10 --throttle=0.0 --throttle-lines=100 /run/octoprint/uploads/2020-05-22_NinjaFlex_3D_Benchy_0.2mm_FLEX_MK3S_2h27m.gcode
2020-05-22 16:21:31,175 - octoprint.plugin - ERROR - Error while calling plugin prusaslicerthumbnails
Traceback (most recent call last):
  File "/opt/octoprint-venv/lib/python3.8/site-packages/OctoPrint-1.4.0-py3.8.egg/octoprint/plugin/__init__.py", line 224, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/opt/octoprint-venv/lib/python3.8/site-packages/octoprint_prusaslicerthumbnails/__init__.py", line 92, in on_event
    self._extract_thumbnail(gcode_filename, thumbnail_filename)
  File "/opt/octoprint-venv/lib/python3.8/site-packages/octoprint_prusaslicerthumbnails/__init__.py", line 62, in _extract_thumbnail
    gcode = octoprint.util.comm.gcode_command_for_cmd(line)
  File "/opt/octoprint-venv/lib/python3.8/site-packages/OctoPrint-1.4.0-py3.8.egg/octoprint/util/comm.py", line 4739, in gcode_command_for_cmd
    gcode, _ = gcode_and_subcode_for_cmd(cmd)
  File "/opt/octoprint-venv/lib/python3.8/site-packages/OctoPrint-1.4.0-py3.8.egg/octoprint/util/comm.py", line 4747, in gcode_and_subcode_for_cmd
    match = regex_command.search(cmd)
TypeError: cannot use a string pattern on a bytes-like object

2020-05-22_NinjaFlex_3D_Benchy_0.2mm_FLEX_MK3S_2h27m.gcode.gz

This may be related to #40 and #34?

[Feature Request] Add Print button and details to window when clicking on thumbnail in File panel

First thanks for the plugin, it is a huge help keeping track of items in the queue.

I have inline thumbnails enabled and when I mouse over the image, the entire file "cell" including details and action buttons highlights implying some sort of global action, but a click only brings up an enlarged version of the image itself. It would be extremely convenient if this window included action buttons (posibly a large print button) and all of the extended file details as part of a purpose made screen. A small extension would be arrow buttons (and or Up/down keyboard shortcuts) to scroll through all files while in this popout window with the larger image size to clearly see differences in files.

With inline thumbnails displayed, only one file fits in the Files pane at a time and then only with careful alignment and the extended details hidden, breaking everything out to a larger window makes reading this easier. An option (probably a separate feature request) to extend the height of the Files panel would also be a useful adaptaiton to better show off the thumbnails.

No image button to toggle thumbnail preview

Hello,
First of all thanks for very usefull plugin. Great work. I really appretiate it.

I cannot see the image icon to preview the thumbnail. Thumbnails are being shown all the time.

Running: OctoPrint 1.3.12 running on OctoPi 0.16.0, PrusaSlicerThumbnails 0.0.4
ย 
image

Thumbnail feature not working

Hi. I'm having an issue with the Thumbnail feature not working correctly in Octoprint. This may well be a mistake on my part.

Steps taken:
1.) Go to Help > Show Configuration Folder
2.) Go to vendor folder and open PrusaResearch.ini
3.) Add in a thumbnails line..exact code including last line of thumbnails is:

[printer_model:MK3S]
name = Original Prusa i3 MK3S
variants = 0.4; 0.25; 0.6
technology = FFF
family = MK3
bed_model = mk3_bed.stl
bed_texture = mk3.svg
default_materials = Generic PLA; Generic ABS; Generic PETG; Prusament PLA; Prusament PETG; Prusament ASA; Prusament PC Blend
thumbnails = 16x16,220x124

4.) In PrusaSlicer..import a model...Slice model...press 'send to printer'

5.) Model appears in Octoprint..but no thumbnail icon appears.

Thanks for any clues on what I'm doing wrong...(unless this is a bug..but seems unlikely given others have no issuess)

Thumbnail Alignment Options

Would it be possible for alignment options to be a dropdown menu or radio buttons etc.? At the moment you have to type in what you want.

Fixed options will negate issues with folk who don't understand html/css commands...and anyone who doesn't use US English spelling for 'centre'!

No immediate hurry, but just a suggestion to avoid confusion/error.

Many thanks.

Plugin with Themeifiy

Hello,
Sorry I don't understand what I must to do in Themeify with this line:
div.row-fluid.inline_prusa_thumbnail > img
Can you explain me?

PrusaSlicer Crashing when loading edited profile

Unfortunately, when I create a copy of the profile (for the MK3S) and add the thumbnail line to it, Prusaslicer crashes when I try to load the new printer profile. I'm using PS 2.1.1 64bit and edited the ini file with notepad++. I've uploaded the resulting ini file in case anyone wants to take a look and provide any suggestions.

Original Prusa i3 MK3S - Smith.zip

No button available - maybe due to Canvas Plugin

I'm running OctoPrint 1.4.0 (@ OctoPi 0.16.0).

Installing PrusaSlicer Thumbnails 0.1.0 doesn't show up the button for displaying the thumbnail:

image

As additional info: I'm running the Canvas Plugin 2.3.3 since I have the Palette2. This plugin also modified the UI, by adding additional information to the file list.

Best regards,
Bastian

Image not update if file is re-uploaded

Messing around with changing the order of the thumbnails in the gcode and notice that it appears once you have a thumbnail for an object, a new one isn't created when the same filename is re-uploaded.

Other than that seems to be working as expected.

I can't put my hands on the Mini at the moment as it's remote, but my recollection is that the 16x16 thumbnail is used in the object list on the display, and the larger thumbnail is used when viewing or printing the object. I'm not sure if they parse that out, or if they just take the first thumbnail and use it for the object list. Changing the order in the ini does of course change the order in the gcode, but might not work on the Mini, I'll have to test that when I can physically get to the Mini.

As I'm updating my plugins in OctoPrint I'm noticing your name on a majority of the plugins I use, is there some place I can drop you a tip? Same username on Thingiverse, I could use that?

Access Thumbnail via API?

First, I'm not even sure if, as part of the OctoPrint plugin system, you can even expose something via the REST API to begin with... that being said.

It would be awesome if there were a REST endpoint where I could fetch the thumbnail image of the current print.

Or maybe offer it up as an endpoint with a secure token on the end, like:

http://192.168.0.2/api/plugins/thumbnails/currentjob.jpg?token=abcd1234abcd1234....

I was hoping that it would be available in the GET /api/job call but no dice there.

Is this possible, and if so, could this be added in a future update?

WARNING: UPGRADE TO 0.0.5 PREVIOUS WORKING IMAGES ARE BROKEN

There's a chance that previously uploaded gcode with successfully extracted images will not display the button or inline thumbnail after upgrading to 0.0.5. This is a result of the compatibility feature with UltimakerFormatPackage and was required to allow both plugins to work together. Simply re-uploading your gcode files should resolve the problem.

"Gcode editor plugin" wont display

am using the gcode editor plugin which inserts an icon next to the "open" and "print" icons below the gcode file in the file manager. The thumbnail will not display because of this. Once disabled the thumbnail displays fine. Inline, and with button.

Running Octoprint in dual setup...

Hi! I'm running multiple instances of Octoprint on the same system to be able to control two printers from the same RPi. I followed this guide and all works well. However, for some reason I only see the thumbnail pictures on one of the instances (the one I uploaded the gcode to), So if I upload to my "MK2.5", I only see the thumb there, and a "broken" thumb in the "MK3" instance. I'm using the "same" upload directory on both instances (located on another server). Even though I do a "Scan files", the thumbnail does not show in the "other" instance... Here is a picture example...
image

I don't know if this is fixable. Maybe if the "thumbnail-storage-directory" could be set manually in a configuration option?
The first instance uses : ~/.octoprint/data/prusaslicerthumbnails/
and the second uses: ~/.octoprint2/data/prusaslicerthumbnails/
And that's ok, but the thumbs only get's "created" on upload... ?

State Thumbnail Not Updated

The thumbnail displayed in the State panel does not update if a gcode file of the same name is uploaded. The new gcode will be printed if the State panel's print button is pressed, but the State panel thumbnail will remain out of date.

Steps to reproduce:

  1. Upload a gcode file
  2. Start a print
  3. Cancel the print
  4. Upload a different gcode file under the same name
  5. Notice the difference between the thumbnails in the State panel and the Files panel.

An example is shown here, where a model was cut, the new STL sliced, and the resulting gcode uploaded under the same name:
Thumnail update

Can't upload gcode with thumbnails.

Hi,

thanks for this great plugin.
I am using
PrusaSlicer Version 2.2.0+w64 and
Octoprint Version 1.4.0

I created a new Printer Profile in PrusaSlicer, that the thumbnails = section appears.
Then I sliced a stl file and uploaded it to Octoprint. It is working fine through PrusaSlicer and drag&drop on the webUI.

Then i added thumbnails = 16x16,220x124 and from that moment on, the upload to Octoprint fails with the following error:

Konnte die Datei nicht hochladen. Bitte stelle sicher, dass es sich um eine lesbare valide Datei mit einer dieser Erweiterungen ist: .g, .gco, .gcode

If I change the thumbnails = 16x16,220x124 back to thumbnails = the upload is working again.
So, I don't think this is an issue of your plugin, but maybe Octoprint or my configuation.
Any help is appreciated.

Thanks,
Andi

No thumbnail rendered, memory error in octoprint.log

I uploaded big (128MB) .gcode file, and no picture is shown in Octoprint.
In octoprint.log i found:
_2020-05-09 05:28:09,509 - octoprint.filemanager.analysis - INFO - Invoking analysis command: /home/pi/oprint/bin/python2 -m octoprint analysis gcode --speed-x=6000 --speed-y=6000 --max-t=10 --throttle=0.0 --throttle-lines=100 /home/pi/.octoprint/uploads/skull_0.6n_0.15mm_PETG.gcode
2020-05-09 05:28:12,068 - octoprint.plugin - ERROR - Error while calling plugin prusaslicerthumbnails
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/init.py", line 224, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_prusaslicerthumbnails/init.py", line 80, in on_event
self._extract_thumbnail(gcode_filename, thumbnail_filename)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_prusaslicerthumbnails/init.py", line 59, in extract_thumbnail
test_str = test_str.replace(octoprint.util.to_native_str('\r\n'),octoprint.util.to_native_str('\n'))
MemoryError

Current free:

# free
total used free shared buff/cache available
Mem: 997372 225356 576128 8392 195888 703684
Swap: 102396 67072 35324

Zipped whole gcode is too big to be attached (34MB).
I made only thumbnail fragment
thumbnail-only-skull_0.6n_0.15mm_PETG.gcode.zip

Change color of Thumbnail

Hi,

is there a way to change the Thumbnail color (Brown) to another color ? Or is this question related to Prusa Slicer ?

Zwischenablage02

Multiple instances don't show thumbnail

Im having the same issue. After updating to 0.1.1 - newly sliced gcodes dont show a thumbnail.
The gcode file still contains "; thumbnail begin 16x16 832".

Now to the strange part:
Im running multiple instances of OP on one Pi. On the first printer (Prusa) it doesnt show the thumbnail, but on the second printer (Anycubic) it does. I sliced them with different printer profiles (both have thumbs enabled).

If i upload the "Anycubic gcode" to the Prusa - the thumb is showing.
Maybe this helps finding the issue.

gcode.zip

Originally posted by @Lanovar in #34 (comment)

Image preview not available...

So I installed the plugin manually (not available through the plugin manager), everything went fine, I have the configuration options in the settings.

I also modified my printer configuration file as described in the settings and export a GCODE with prusaslicer. But no image icon is showing up in the list... I tried enabling the preview option but that does not change a thing either.

Not getting a Thumbnail button in the file list

The plugin seems to be loaded in my OctoPrint 1.4.0 instance The plugin configuration page does show up in the OctoPrint settings.

However, I don't get the new button showing up in the file list as expected.

I have a GCode file with the thumbnail embedded in the file list, but I would think the button would show up regardless of what was in the file.

Any idea what I might be missing?
Capture

Thumbnail State not showing, only thumbnail inline in files

I'm using two octoprint instances, one for a Prusa Mini and one for an MK3S, the Mini works fine and displays the thumbnail in the State and in the Files inline, the MK3S only shows the thumbnail inline in the Files and not the State.

I've made the modification to the printer ini in Slic3r PE, have the newest version of Slicer, newest version of Octoprint with Python3, newest version of the Thumbnail Plugin and have rebooted the OctoPi and flagged and reflagged the setting, the gcode has the thumbnail in it and it is showing up in the file but I can not get it to show in the Printer State.

Any ideas?

no button no change 0.4 to 1.0

I've been trying since vesion 0.4 to 1.0 never had any change in the interface or button.

I've reinstalled and erased all data, including my print files.
screenshot 350
screenshot 351
screenshot 352

Touch UI Interface Icons

After trying to manipulate the different view options i am unable to get the files to print from my touch UI instance. Only the website works. which is very inconvenient, and breaks my workflow.

This is a very important feature and it renders the use of touch ui semi useless as a standalone controller.

Images below reflect inline and stateless views. Paul de Vries (BillyBlaze) Might have to alter Touch UI to work with this plugin.
IMG_20200428_101320

IMG_20200428_090033

Bed Visualizer Not Reading Reported Data

Hello! I have an ender 3 pro with a bltouch sensor installed, the firmware im using is the one provided by creality from the youtube channel, I am trying to use the bed visualizer but am getting some weird results,
I have simple settings

G28
@BEDLEVELVISUALIZER
G29 T

and I get back this in the terminal

Recv: Bilinear Leveling Grid:
Recv:       0      1      2
Recv:  0 -1.775 -0.943 -0.120
Recv:  1 +0.253 +0.968 +1.210
Recv:  2 +2.195 +2.872 +3.142

for some reason the four corners arent getting saved to the bed visualizer the current mesh data is

-100     NaN     -0.943     NaN
0     0.253     0.968     1.210
100     NaN     2.872     NaN
    -100     0     100

I will attach the log, from doing a quick look the issue seems to be here.

2020-11-09 22:18:28,097 - octoprint.util.comm - ERROR - Error while processing hook bedlevelvisualizer:
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 2952, in _readline
    ret = hook(self, ret)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_bedlevelvisualizer/__init__.py", line 327, in process_gcode
    self.mesh[~circle_mask] = None
ValueError: operands could not be broadcast together with shapes (3,2) (2,3) 
2020-11-09 22:18:28,113 - octoprint.util.comm - INFO - Telling the printer to set the busy interval to our "communicationBusy" timeout - 1s = 2s
2020-11-09 22:18:28,130 - octoprint.util.comm - ERROR - Error while processing hook bedlevelvisualizer:
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 2952, in _readline
    ret = hook(self, ret)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_bedlevelvisualizer/__init__.py", line 327, in process_gcode
    self.mesh[~circle_mask] = None
ValueError: operands could not be broadcast together with shapes (3,2) (2,3) 

octoprint.log

State thumbnail visibility

If the user choose to have the thumbnail in "State" panel while printing and the gcode is located in a folder, the thumbnail disappears when user navigate out of that folder or to another folder
in this example I'm printing a file from "Speaker_Box" folder and when I'm viewing the root folder there is no thumbnail:
root folder


but if I navigate to the mentioned folder it appears:
speaker box

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.