Jump to content

Post Process Plugin for Cura 15.06 guidance


gearsawe

Recommended Posts

Posted · Post Process Plugin for Cura 15.06 guidance

I am still very new to Cura. In 15.04 I made a simple post process plugin which modifies the g-code to work with a specific printer. The plugin has some parameters which could be adjusted and it would modify the gcode at save. This was pretty simple in 15.04. Now in 15.06 I am starting to understand how to add parameters to a printer configuration in the "fixes" catagory but how to pass these values to let sat a new GCodeWriter plugin is where I am completely lost. I tried to make my own "GCodeWrinerM3DMicro" but since it uses the same extension ".gcode" only the original gcode writer seem to be used. I did not want to modify the the Orignal GCodeWrite process and hard code settings into it. But make it optional for those who would like to use the software for more than one type of printer on the same system.

I am not a programmer by trade so I learn as I go. Forgive my lack of terminology understanding when it comes to pointers, imports, object, mutli-dimensional arrays and so forth.

So in my custom printer config if have a small snippet of code which show a value in to adjust in the fixes category. Maybe I am going about this all wrong. But how to pass these values into a custom gcode writer is where I am clueless. Any guidance would be appreciated.

 

"micro": {           "label": "Micro",           "visible": true,           "icon": "category_fixes",           "settings": {               "micro_prefs": {                   "label": "Use Micro Prefs",                   "description": "Use Micro preferences",                   "type": "boolean",                   "default": false,                   "visible": false               },               "chop_len": {                   "label": "Max Line Dist",                   "description": "Longest a line can be before is it chopped.",                   "unit": "mm",                   "type": "float",                   "default": 2.5,                   "visible": false,                   "active_if": {                       "setting": "micro_prefs",                       "value": true                   }               }           }       }

 

  • Link to post
    Share on other sites

    Posted · Post Process Plugin for Cura 15.06 guidance

    @daid - can you answer this? He has written plugins for the older cura but having trouble with the latest.

    @gearsawe - it might be simply that you need to wait another month or two before you can write fancy plugins like this. You should know that there are ".json" files that you can mess with to partly customize to another printer design but that might not be enough - you might indeed have to write a plugin:

    C:\Program Files (x86)\Cura_15.05.95\resources\settings

  • Link to post
    Share on other sites

    Posted · Post Process Plugin for Cura 15.06 guidance

    ... it might be simply that you need to wait another month or two before you can write  fancy plugins like this.  You should know that there are ".json" files that you can mess with...

    C:\Program Files (x86)\Cura_15.05.95\resources\settings

     

    The above is actually from the .json file. Along with a bunch of other custom settings for the printer. I actually have a model of the printer with the print volume in the correct position. Displaying correctly. Just took a while to find where everything is stored

    Till then I might just have to modify the original GCodeWriter and hardcode the code to modify the gcode there. I made my own "GCodeWriterMicro" it actually shows up in the save as options but when saving it still only use the original writer. I think I am doing it right but the new system just is now supporting what I need it to do like you said.

    It would be great if the settings in the json file could be used by the script when saving. Would make things a whole lot better.  I really don't want to see the g-code paths in the viewer since the pathing looks like a mess because of the backlash movement and offset put in place.

    One thing that did not make sense is in the Plugins my custom GcodeWriterMicro was showing up but I could not turn it off. The check box would always stay on no matter how much I clicked. And then it acts like it is not being used when saving. So there might be a bug there. Not sure. Don't know enough about the new system.

  • Link to post
    Share on other sites

    Posted (edited) · Post Process Plugin for Cura 15.06 guidance

    @gearsawe: I think you are not writing a plugin for the new Cura but changing its code (nothing wrong with that but I think it's not the way intended by UM).

    @nallath has put a very quick description of the new plugin system onto Github somewhere under Ultimaker/Uranium.

    Btw: json-files should be nested for variations of the same printer. In order to find out how it is done you best open the UMO or UM2 json file and see how it is connected with the more fundamental fdmprinter.json.

    Edited by Guest
  • Link to post
    Share on other sites

    Posted · Post Process Plugin for Cura 15.06 guidance
    . The check box would always stay on no matter how much I clicked.

    I played with a beta version of this latest Cura and there were a few bugs related to checkboxes so I suspect this is just another one.

    I think you should report all this on the issue tracker because programmers love to help other programmers. If Daid sees these bugs he'll probably fix them quickly.

  • Link to post
    Share on other sites

    Posted (edited) · Post Process Plugin for Cura 15.06 guidance

    so to get the value of a setting for a printer config...

    in the printer config you have a category "MyCategory" and a value "MyValue" in that category

     

    from UM.Application import ApplicationMyValue = Application.getInstance().getActiveMachine().getSettingsCategory("MyCategory").getSettingByKey("MyValue").getValue()

     

    THe code above is not formatting correctly It keeps putting url tags automatically in the posting. There should be be no urls inside code brackets. GRR

    But still having that one problem making my own custom GCodeWriter. I have gone a head and reported the bug but still not sure if I am not setting something up right.

    Edited by Guest
  • Link to post
    Share on other sites

    Posted · Post Process Plugin for Cura 15.06 guidance

    @daid - can you answer this?  He has written plugins for the older cura but having trouble with the latest.

     

    Daid has had very little to do with the new Cura, so he wont be able to answer in depth answers about it.

    Plugins in itself have little to do with the .json files. The json files are for printer settings. The plugins are much, much more. If you have settings for your plugin, they don't really have a place in the printer json files (because if someone uses a custom printer, the plugin wouldnt work).

    The disabling of plugins is indeed a bit broken. Its on our list.

    You should not use values / methods that start with an underscore! Python does not have private / protected members, so we indicate those by starting with an underscore. You should -not- acces _value directly but use .getValue() or setValue() respectively. If you directly change the value no events are passed to other parts of the code (hence it being private).

  • Link to post
    Share on other sites

    Posted · Post Process Plugin for Cura 15.06 guidance

    Thanks missed the getValue() will use that. (corrected posting above)

    As for the settings I am retrieving is a printer settings such as backlash which is specific to this type of printer. I don't necessarily want to see the actual tooling path with backlash in the viewer since it will look like a mess. This will be something that is done at save. But now I am able to pull the set values into the gcode writer which makes me very happy. And will hopefully be useful for those who also own a M3D Micro.

  • Link to post
    Share on other sites

    Posted · Post Process Plugin for Cura 15.06 guidance

    gearsawe, have you posted your plugin for the earlier version of Cura somewhere? I have a Micro now and would love to use Cura instead of the software it comes with. Can you send the files directly to the printer through Cura?

  • 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.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 18 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...