Jump to content

Daniel26

Dormant
  • Posts

    34
  • Joined

  • Last visited

Posts posted by Daniel26

  1. Hello,

     

    I've wrote a plugin for Cura 4.x. This worked well.

    Now, with Cure 5.0 I have to update my plugin. The only thing I have to change is the sdk version in the plugins.json.

    So I set "supported_sdk_versions": ["7.0.0", "8.0.0"]" there, set the "Version" one up and uploaded the zip.

    But then, I only get as eror message "null(null)" and the package is still in the draft status?


    Can anybody tell me, where the error is? What did I wrong?

     

    Regards


    Daniel

     

     

  2. Quote
    1 hour ago, ahoeben said:

    A better place to store the plugin is inside the ````"plugins" folder in the Configuration Folder (See Help->Show configuration folder). Then you won't have this issue.

     

    A propos, that is why I asked (twice!) where you place the plugin files.

     

     

    Quote

    The file are in a seprate folder in the plugins dir.

     

    I answered that. I didn't realise that there is another plugin folder.

    But I think its a bug in Cura. All the Plugins before the Console Logger are also not Logged. Perhaps the logging starts with the ConsoleLoggerPlugin? The Renaming this Plugin so it is loaded at first would make sense.

     

    But I found another bug that crashes Cura completely.

     

    Thanks for your patience.

     

    Regards

     

    Daniel

     

  3. Ok, found the source of my problems...

    Cura registers the plugins in alphabetical order. The log starts at "C", the amf-reader was not listed in the log, but it was loaded. So I renamed my plugin-folder to something starting with "Z". And then I saw errors in the logile.

    I had some missing imports. Thats all. After I corrected that the plugin was loaded fine.

     

    My plugin simply was loaded before the logging starts.....

  4. Ok, tried it now with the logger, but still no message in the logs:

     

    #Copyright (c) 2018 Ultimaker B.V.
    #Cura is released under the terms of the LGPLv3 or higher.
    
    import sys
    
    from UM.Logger import Logger
    try:
        from . import ChituCodeWriter
    except ImportError:
        Logger.log("w", "Could not import ChituCodeWriter")
    
    from UM.i18n import i18nCatalog #To translate the file format description.
    from UM.Mesh.MeshWriter import MeshWriter #For the binary mode flag.
    
    i18n_catalog = i18nCatalog("cura")
    
    def getMetaData():
        Logger.log("w", "--- get metadata of ChituCodeWriter ---")
        if "ChituCodeWriter.ChituCodeWriter" not in sys.modules:
            return {}
    
        return {
            "mesh_writer": {
                "output": [
                    {
                        "mime_type": "text/chitu-g-code",
                        "mode": MeshWriter.OutputMode.TextMode,
                        "extension": "gcode",
                        "description": i18n_catalog.i18nc("@item:inlistbox", "Chitu gcode")
                    }
                ]
            }
        }
    
    def register(app):
        Logger.log("w", "--- register  ChituCodeWriter ---")
        if "ChituCodeWriter.ChituCodeWriter" not in sys.modules:
            return {}
        else:
            return { "mesh_writer": ChituCodeWriter.ChituCodeWriter() }

    Nothing in the logs.

    I also have no such mime type in the save-as-dialog.

     

    Frustrating...

     

    Regards


    Daniel

  5. Here the __init__.py:

    #Copyright (c) 2018 Ultimaker B.V.
    #Cura is released under the terms of the LGPLv3 or higher.
    
    import sys
    
    from UM.Logger import Logger
    try:
        from . import ChituCodeWriter
    except ImportError:
        Logger.log("w", "Could not import ChituCodeWriter")
    
    from UM.i18n import i18nCatalog #To translate the file format description.
    from UM.Mesh.MeshWriter import MeshWriter #For the binary mode flag.
    
    i18n_catalog = i18nCatalog("cura")
    
    def getMetaData():
        print("Loading chitu_mods metadata")
        if "ChituCodeWriter.ChituCodeWriter" not in sys.modules:
            return {}
    
        return {
            "mesh_writer": {
                "output": [
                    {
                        "mime_type": "text/chitu-g-code",
                        "mode": MeshWriter.OutputMode.TextMode,
                        "extension": "gcode",
                        "description": i18n_catalog.i18nc("@item:inlistbox", "Chitu gcode")
                    }
                ]
            }
        }
    
    def register(app):
        if "ChituCodeWriter.ChituCodeWriter" not in sys.modules:
            return {}
        else:
            print("fregistering chitu_mods")
            return { "mesh_writer": ChituCodeWriter.ChituCodeWriter() }

     

    Cura.log is attached.

     

    Thanks for your time

    cura.log

  6. Quote

    "file_formats": "application/x-ufp;text/x-gcode"

     

    Note how application/x-ufp is in front of text/x-gcode

     

    So, If I understand correctly: The file generated from ufp is "piped thru" the Script that creates the gcode? So with the order of the fileformats I can control the order the plugins are used?

     

    Quote

    Do you want to write multiple files at once (ie: a thumbnail and a gcode file in two separate files)? That is not something the MeshWriter supports easily. You would have to build that yourself.

    Nope. There are only additional M-Commands included in the gcode-file. So I only wan't one file.

     

  7. 31 minutes ago, ahoeben said:

    > if printer is a tronxy, the g-code should be created, that g-code hat to be modified by my plugin.

     

    What sort of modifications are you talking about? Does the modified gcode file have to be named *.chitu? If not, it is easier/less confusing for the user to not use a meshwriter, but use something that simply post-processes the gcode when it is written.

     

    It adds e.g. a Screenshot to the gcode so the part is shown on the touchscreen of the printer. The timestamps also have a special format.

    I tried to submit a post process script, but they won't include it in the cura release. They advised me to write a mesh writer plugin and to submit it to the plugin database.

     

  8. Hello,

     

    I try to implement my own extruder definition.

    But the test at github claims about a machine_id, which cannot be found.

    {
        "version": 2,
        "name": "Extruder 1",
        "inherits": "fdmextruder",
        "metadata": {
            "machine": "tronxy_base_extruder",
            "position": "0"
        },
    
        "overrides": {
            "extruder_nr": { "default_value": 0 },
            "machine_nozzle_size": { "default_value": 0.4 },
            "material_diameter": { "default_value": 2.75 }
        }
    }


     

    Quote

     

    E AssertionError: The machine ID tronxy_base_extruder is not found.

    E assert False

     

     

     

    Can anybody explain me this?


    Regards

     

    Daniel

     

  9. Ok. Thats for testing.

    What I wan't: if printer is a tronxy, the g-code should be created, that g-code hat to be modified by my plugin.

    How can I do that? Is that done by "file_formats": "text/x-gcode;text/chitu-g-code" in the printers definition?

     

    Sorry for that stupid questions, but I can't find any info about "Mesh_writer" Plugins.

     

    Regards

     

    Daniel

  10. Sorry, here is the complete __init__.py

     

    import sys
    
    from UM.Logger import Logger
    try:
        from . import ChituCodeWriter
    except ImportError:
        Logger.log("w", "Could not import ChituCodeWriter")
    
    from UM.i18n import i18nCatalog #To translate the file format description.
    from UM.Mesh.MeshWriter import MeshWriter #For the binary mode flag.
    
    i18n_catalog = i18nCatalog("cura")
    
    def getMetaData():
        if "ChituCodeWriter.ChituCodeWriter" not in sys.modules:
            return {}
    
        return {
            "mesh_writer": {
                "output": [
                    {
                        "mime_type": "text/chitu-g-code",
                        "mode": MeshWriter.OutputMode.TextMode,
                        "extension": "chitu",
                        "description": i18n_catalog.i18nc("@item:inlistbox", "Chitu Code")
                    }
                ]
            }
        }
    
    def register(app):
        if "ChituCodeWriter.ChituCodeWriter" not in sys.modules:
            return {}
    
        return { "mesh_writer": ChituCodeWriter.ChituCodeWriter() }

     

     

    How can I be sure that the new mimetype is known by cura?

    I don't see any signs that my plugin is used.

     

    Regards

     

    Daniel

     

  11. Hello,

     

    I wrote a plugin which I wan't to start by a new mimetype. But how do I register that mimetype?

    My __init__.py in the plugins directory:

    def getMetaData():
        if "ChituCodeWriter.ChituCodeWriter" not in sys.modules:
            return {}
    
        return {
            "mesh_writer": {
                "output": [
                    {
                        "mime_type": "text/chitu-g-code",
                        "mode": MeshWriter.OutputMode.TextMode,
                        "extension": "chitu",
                        "description": i18n_catalog.i18nc("@item:inlistbox", "chitu addons")
                    }
                ]
            }
        }

    Is that really enough so I can call that plugin via the printers definition with 

    "file_formats": "text/x-gcode;text/chitu-g-code",

    Regards

     

    Daniel

  12. Hello,

     

    I try to create a printerdefinition, but somethin seems to be not correct.

    The log says:

    2020-03-22 20:07:18,375 - INFO - [MainThread] cura.Settings.MachineManager.addMachine [342]: Trying to add a machine with the definition id [tronxy_xy2_pro]
    2020-03-22 20:07:18,419 - ERROR - [MainThread] UM.Logger.logException [98]: Exception: Error when loading container tronxy_xy2_pro: Definition uses version 2 but expected version 2
    2020-03-22 20:07:18,424 - ERROR - [MainThread] UM.Logger.logException [102]: Traceback (most recent call last):
    2020-03-22 20:07:18,428 - ERROR - [MainThread] UM.Logger.logException [102]:   File "X:\4.5-exe\build\inst\lib\python3.5\site-packages\UM\Settings\ContainerRegistry.py", line 183, in findContainers
    2020-03-22 20:07:18,433 - ERROR - [MainThread] UM.Logger.logException [102]:   File "C:\Program Files\Ultimaker Cura 4.5\plugins\LocalContainerProvider\LocalContainerProvider.py", line 68, in loadContainer
    2020-03-22 20:07:18,438 - ERROR - [MainThread] UM.Logger.logException [102]:     container.deserialize(f.read(), file_path)
    2020-03-22 20:07:18,442 - ERROR - [MainThread] UM.Logger.logException [102]:   File "X:\4.5-exe\build\inst\lib\python3.5\site-packages\UM\Settings\DefinitionContainer.py", line 292, in deserialize
    2020-03-22 20:07:18,446 - ERROR - [MainThread] UM.Logger.logException [102]:   File "X:\4.5-exe\build\inst\lib\python3.5\site-packages\UM\Settings\DefinitionContainer.py", line 243, in readAndValidateSerialized
    2020-03-22 20:07:18,450 - ERROR - [MainThread] UM.Logger.logException [102]:   File "X:\4.5-exe\build\inst\lib\python3.5\site-packages\UM\Settings\DefinitionContainer.py", line 397, in _resolveInheritance
    2020-03-22 20:07:18,456 - ERROR - [MainThread] UM.Logger.logException [102]:   File "X:\4.5-exe\build\inst\lib\python3.5\site-packages\UM\Settings\DefinitionContainer.py", line 409, in _verifyJson
    2020-03-22 20:07:18,460 - ERROR - [MainThread] UM.Logger.logException [102]: UM.Settings.DefinitionContainer.IncorrectDefinitionVersionError: Definition uses version 2 but expected version 2
    2020-03-22 20:07:18,467 - WARNING - [MainThread] cura.Settings.CuraStackBuilder.createMachine [36]: Definition tronxy_xy2_pro was not found!
    2020-03-22 20:07:18,473 - WARNING - [MainThread] cura.Settings.MachineManager.addMachine [355]: Failed creating a new machine!

     

     

    Any Ideas whats wrong here?

    The definitions can't be attached :(

     

    Regards

     

    Daniel

     

×
×
  • Create New...