metalman3797 / Cura-Dremel-Printer-Plugin

Dremel Idea Builder plugin for Cura version 3.x and onward. This plugin enables the user to use the Dremel Ideabuilder 3D20, 3D40, and 3D45 printers and use Cura to export the proprietary .g3drem files.
GNU Lesser General Public License v3.0
57 stars 11 forks source link

Fix installing mesh and profiles #30

Closed Ghostkeeper closed 6 years ago

Ghostkeeper commented 6 years ago

I've taken some time to fix the installation of profiles for you on the current Cura master. The profiles were not being loaded because the material diameter must be set in an extruder definition now, or the extruder definition of fdmextruder.def.json would overwrite it to 2.85.

I've also made a fix for installing the mesh. It now just creates a folder 'meshes' in the data resources path and puts the file there.

Another fix included here is to not do all of these things if your plug-in is disabled by the user. That is just a bit neater, I'd say.

This was tested on the current Master branch of Cura, set for beta release in a month and a half. I didn't test on 3.4 but I would expect that it works the same. I've also not tested the release making script tool because that only runs on Windows.

timmehtimmeh commented 6 years ago

@Ghostkeeper - Thank you so much for your help looking into this - I really appreciate it!

I've tested your changes and have run into a few minor issues that I've cleaned up (i.e. the release-making script needs to copy the extruder file into the zip dir, and the extruder file isn't being copied into the correct location). My changes are here if you have any questions: https://github.com/timmehtimmeh/Cura-Dremel-3D20-Plugin/tree/Ghostkeeper-fix_installing_profiles

I'm not sure if I'm missing something, but when I clear out Cura 3.4's caches, and install the plugin with these fixes the quality profiles still seem to be the default ones (I'd expect there to only be 3 selections for the 3 profiles instead of the six I'm seeing), and the dremel_pla file doesn't seem to be loading. I'll keep banging on it, but if you have a moment here's a curapackage version of the code contained in the Ghostkeeper-fix_installing_profiles:

~link redacted to avoid confusion~

If you're too busy I completely understand and no worries - thanks so much for the help so far =)

In my branch I reverted the call to _onInitialized as that leads to the following sequence:

  1. The user installs the curapackage,
  2. The user must restart Cura
  3. Cura calls the plugins init function
  4. Cura searches for installed printers
  5. Cura emits initializationFinished, which calls the _onInitialized function and the plugin installs the printer definition files etc...
  6. The user has to restart Cura a second time before being able to actually select the printer

Alternately, If the files are installed in the init function then it seems that Cura initializes the plugin before searching for printer definitions, and the user doesn't have to restart Cura a second time. I kept the call to check whether the plugin is active very high up in the init function and return early if the plugin is deselected by the user - thanks for showing me how to get that information! I'm completely open to alternative methods if you know of any, or arguments why this is a bad idea (i know only enough python to be dangerous =)

Cheers! Tim

timmehtimmeh commented 6 years ago

@Ghostkeeper - I figured out the issues I was experiencing. Thanks again for your help!

Ghostkeeper commented 6 years ago

I think I had been restarting Cura so often during development that I might not have notices that you'd need to restart Cura twice. Also, sorry about introducing a bug in your install script :disappointed: As I said, I couldn't test it.

Glad you figured it out on your own! I'm not usually very fast to react...

timmehtimmeh commented 6 years ago

Hey - no worries - I'll work on making the script cross-platform. I checked the script in mostly so that I could revert in case I messed something up myself, and didn't expect anyone to use it. I truly appreciate your help!

I've released version 0.4.6 that I'm testing right now on mac and linux, and if all goes well I'll submit it to you guys for inclusion in your plugin repo!

Thanks again for your time & efforts - I've credited you & the some of the other Ultimaker guys on the "Contributors" page. =)

Cheers!