Quantcast
Channel: 3D printer improvements
Viewing all articles
Browse latest Browse all 95

How to write a Cura / Skeinforge plugin

$
0
0

First, do you really really want to write a Skeinforge plugin ?


Preliminary note: you probably want to check my review about wood filament and about temperature gradients first, unless you are a programmer who wants to write your own plugin.
Some sites such as wired link to this quite technical page, while using the pictures of the much more interesting pages ;-)

Contrary to what was being done so far, I did not want to manually insert the M104 temperatures changes in the file sent to the printer. So I designed a plugin for the Cura / Skeinforge software pair.
Since that was not trivial, I will document it here.



Printing cushwa's owl (youtube hosts the HD version)

Cura probably will soon support its own plugin system, which will be easier compared to the Skeinforge labyrinth. Dealing with the latter is both complex and not enjoyable even though it does the job, and Cura "old style" adss a convenient GUI on top of it (see first pic).

Writing a Skeinforge plugin in the first place also makes it usable by users of the standalone Skeinforge obviously! Reciprocally, a Cura-specific plugin would make it compatible with the different slicers what it will support soon or later. And I hope it will be sooner than later!

Also, everything there is written in Python. Which is good since it is a clear an easy language (this was my first real experience with it by the way), even though it is slower than many other languages.

Where to create the plugin

Obviously, start by downloading Cura sourcecode. This post was made for version 12.08.

You are looking for the "craft" directory here:

skeinforge_application/skeinforge_plugins/craft_plugins

The best way to proceed is to duplicate an existing python plugin. Select one which is close to the functionality you are to implement, it will help also locating the reference to your plugin elsewhere (well, this post is there to help further in fact).

What to modify in existing sources

Add a section for your plugin with labels and help in:

Cura/cura_sf/fabmetheus_utilities/settings.py

Make sure to keep consistent naming as the labels are used by the program to transfert data between Cura interface, Skeinforge and the plugin (this is completely ugly by the way).

Add your plugin name to the list of extrusion operations in getCraftSequence(), keeping it in a correct sequence here:

Cura/cura_sf/skeinforge_application/skeinforge_plugins/profile_plugins/extrusion.py

Add the interface to Cura, most probably in the expert panel, taking extreme care with the namings again:

Cura/gui/expertConfig.py

One more setting block (with default values) in

Cura/util/profile.py

Finally, add it here if it takes time to process, with the appropriate factor:

Cura/util/sliceRun.py

Final note

Once again make sure you are consistent with the labels and plugin parameter names, else you will run in trouble passing the values from Cura GUI to your plugin. Seriously, consider postponing your plugins until there is something better for Cura. Meanwhile, you may read and use Daid's related message.


Viewing all articles
Browse latest Browse all 95

Trending Articles