Jump to content
Ultimaker Community of 3D Printing Experts

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


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
     Share

    • Our picks

      • New here? Get ahead with a free onboarding course
        Hi,
         
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
        • 11 replies
    ×
    ×
    • Create New...