Jump to content

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


Hanabi-san

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

      • Introducing Universal Cura Projects in the UltiMaker Cura 5.7 beta
        Strap in for the first Cura release of 2024! This 5.7 beta release brings new material profiles as well as cloud printing for Method series printers, and introduces a powerful new way of sharing print settings using printer-agnostic project files! Also, if you want to download the cute dinosaur card holder featured below, it was specially designed for this release and can be found on Thingiverse! 
          • Like
        • 10 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...