mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-20 12:49:38 +08:00
Add the skeleton of the plugin
Contributes to CURA-5155.
This commit is contained in:
parent
8c41bc86d2
commit
412bcc9b90
@ -12,9 +12,6 @@ catalog = i18nCatalog("cura")
|
||||
from . import MarlinFlavorParser, RepRapFlavorParser
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Class for loading and parsing G-code files
|
||||
class GCodeReader(MeshReader):
|
||||
_flavor_default = "Marlin"
|
||||
|
24
plugins/UFPReader/UFPReader.py
Normal file
24
plugins/UFPReader/UFPReader.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from UM.Mesh.MeshReader import MeshReader
|
||||
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
|
||||
from cura.Scene.CuraSceneNode import CuraSceneNode
|
||||
|
||||
|
||||
class UFPReader(MeshReader):
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
MimeTypeDatabase.addMimeType(
|
||||
MimeType(
|
||||
name = "application/x-ufp",
|
||||
comment = "Cura UFP File",
|
||||
suffixes = ["ufp"]
|
||||
)
|
||||
)
|
||||
self._supported_extensions = [".ufp"]
|
||||
|
||||
def _read(self, file_name: str) -> CuraSceneNode:
|
||||
print("Reading", file_name)
|
26
plugins/UFPReader/__init__.py
Normal file
26
plugins/UFPReader/__init__.py
Normal file
@ -0,0 +1,26 @@
|
||||
#Copyright (c) 2019 Ultimaker B.V.
|
||||
#Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
|
||||
from . import UFPReader
|
||||
|
||||
i18n_catalog = i18nCatalog("cura")
|
||||
|
||||
|
||||
def getMetaData():
|
||||
return {
|
||||
"mesh_reader": [
|
||||
{
|
||||
"mime_type": "application/x-ufp",
|
||||
"extension": "ufp",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Ultimaker Format Package")
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
def register(app):
|
||||
app.addNonSliceableExtension(".ufp")
|
||||
return {"mesh_reader": UFPReader.UFPReader()}
|
||||
|
8
plugins/UFPReader/plugin.json
Normal file
8
plugins/UFPReader/plugin.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "UFP Reader",
|
||||
"author": "Ultimaker B.V.",
|
||||
"version": "1.0.0",
|
||||
"description": "Provides support for reading Ultimaker Format Packages.",
|
||||
"supported_sdk_versions": ["6.0.0"],
|
||||
"i18n-catalog": "cura"
|
||||
}
|
@ -492,6 +492,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"UFPReader": {
|
||||
"package_info": {
|
||||
"package_id": "UFPReader",
|
||||
"package_type": "plugin",
|
||||
"display_name": "UFP Reader",
|
||||
"description": "Provides support for reading Ultimaker Format Packages.",
|
||||
"package_version": "1.0.0",
|
||||
"sdk_version": "6.0",
|
||||
"website": "https://ultimaker.com",
|
||||
"author": {
|
||||
"author_id": "UltimakerPackages",
|
||||
"display_name": "Ultimaker B.V.",
|
||||
"email": "plugins@ultimaker.com",
|
||||
"website": "https://ultimaker.com"
|
||||
}
|
||||
}
|
||||
},
|
||||
"UFPWriter": {
|
||||
"package_info": {
|
||||
"package_id": "UFPWriter",
|
||||
|
Loading…
x
Reference in New Issue
Block a user