Disconnect between Cura thumbnails and Arcwelder

If an ufp file is uploaded to OctoPrint the Cura thumbnails plugin replaces the file with the extracted gcode file. This new gcode file isn't automatically processed with Arcwelder.

My guess is that the method used by the Cura thumbnails plugin to save the gcode file sidesteps the point where the post-processing plugins are called, maybe because it is itself a post-processing plugin.

Is this a bug in one of the plugins or an unfortunate result of the plugin engine? Or are my expectations wrong :smiley: ?

I've been asked to look at the various thumbnail plugins to get them to work with ArcWelder, but have not done that since I'm still focusing on the initial release. I will take a look at some point and will try to get this working.

FYI, to my knowledge, all gcode analysis should run on the files generated by arcwelder, so I'm not sure what's going on right now.

My problem is the other way around. Arcwelder isn't run on the gcode generated by Cura thumbnails. So methinks the causation isn't in Arcwelder, but my knowledge of the plugin interface would fit with a large font in a tiny thumbnail. :wink:

Ahh, that is possible for sure. Sorry I didn't get it at first.

I'm using the standard add file command here from within OctoPrint when extracting the thumbnail from ufp format @FormerLurker so the standard callbacks should still be processed. Let me know if there's anything I need to adjust...

Will do. I will try it this weekend and will let you know. Thanks for your reply!!!

uploaded_file = self._file_manager.add_file("local", file_wrapper.filename, file_wrapper, allow_overwrite=True)

This is the call that should invoke the plugin callbacks including Arcwelder? I apologize for suspecting Cura thumbnails.

Before I started this topic I had tried to understand Cura thumbnails but gained nothing more than very superficial understanding :thinking:

That is correct. It's the same method used internally by octoprint when uploading files and it does trigger the fileadded event callbacks in all plugins that register them.

I've added compatibility for the cura thumbnail plugin and the prusaslicer plugin. However, there are some race conditions I cannot mitigate without some changes to both plugins, but I don't expect to hear many issues since pre-processing takes a bit of time for all but the smallest gcode files.

My plugin will now attempt to fetch either the cura or prusaslicer plugin impementation, grab the data directory, copy and rename the thumbnail, and add the appropriate metadata to the arcwelded file. It seems to work well for all my tests, even for gcodes with a single layer, which is why I don't expect too many race condition issues.