Jump to content

Recommended Posts

Posted · Add a custom plugin to Ultimaker Cura which includes a library not yet included by Cura

Hallo 

 

I have created a custom plugin which uses a library, which is not included in Cura yet. When I run Cura from source, I can add the plugin to Cura, since I imported the library in my locally installed python. But when I add the plugin to the Cura Application, it does not work (it's an extension plugin and won't show up in the extensions menu).

 

I would like to be able to add the plugin directly to the Cura Application instead of having to run Cura from source, since I plan to use it on multiple devices and setting up Cura from source is a lot of work. How can I do this? Do I have to build the new library somehow and add it to the Cura Application?

 

Thanks and Cheers 

  • Link to post
    Share on other sites

    Posted · Add a custom plugin to Ultimaker Cura which includes a library not yet included by Cura

    You can - in most cases - include the module with your plugin and import it from there. It depends a bit on what module it is how much work it is to include it with your plugin.

     

    The OctoPrint plugin contains two pure-Python modules, and here is how they are imported:

    https://github.com/fieldOfView/Cura-OctoPrintPlugin/blob/3.5/OctoPrintOutputDevicePlugin.py#L27

     

     

  • Link to post
    Share on other sites

    Posted · Add a custom plugin to Ultimaker Cura which includes a library not yet included by Cura

    Thank you for your fast reply! I'm trying to import the PyNacl library (https://github.com/pyca/pynacl). When I use your suggested method, I get an error message saying, that PyNacl cannot find its own imports anymore. For instance, in the public.py file of the module, it calls "import nacl.bindings". But after I imported the modul in my project, I get an error message stating "No module named 'nacl'". Does that mean the PyNacl library is not compatible?

     

    Thanks and Cheers

  • Link to post
    Share on other sites

    Posted · Add a custom plugin to Ultimaker Cura which includes a library not yet included by Cura

    You may be interested in this thread:

    To make your life easier, see if you can use ```the cryptography module instead of pynacl.

    • Like 2
    Link to post
    Share on other sites

    Posted (edited) · Add a custom plugin to Ultimaker Cura which includes a library not yet included by Cura

    I Just realized that I asked a really similar question about 2 years ago. Back then, I could not solve the problem. However, now I was able to include the PyNacl library by unzipping the PyNacl wheel file of my operating system and including this folder in my project plugin folder. Then, by using your suggested method, I import the library and then Cura is able to load the library correctly.

     

    Thank you for your help!

     

    Cheers

    Edited by Hanabi-san
    • Like 1
    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...