__init__.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright (c) 2015 Ultimaker B.V.
  2. # Uranium is released under the terms of the AGPLv3 or higher.
  3. import sys
  4. from UM.Logger import Logger
  5. try:
  6. from . import ThreeMFWriter
  7. except ImportError:
  8. Logger.log("w", "Could not import ThreeMFWriter; libSavitar may be missing")
  9. from . import ThreeMFWorkspaceWriter
  10. from UM.i18n import i18nCatalog
  11. i18n_catalog = i18nCatalog("uranium")
  12. def getMetaData():
  13. metaData = {
  14. "plugin": {
  15. "name": i18n_catalog.i18nc("@label", "3MF Writer"),
  16. "author": "Ultimaker",
  17. "version": "1.0",
  18. "description": i18n_catalog.i18nc("@info:whatsthis", "Provides support for writing 3MF files."),
  19. "api": 3
  20. }
  21. }
  22. if "3MFWriter.ThreeMFWriter" in sys.modules:
  23. metaData["mesh_writer"] = {
  24. "output": [{
  25. "extension": "3mf",
  26. "description": i18n_catalog.i18nc("@item:inlistbox", "3MF file"),
  27. "mime_type": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml",
  28. "mode": ThreeMFWriter.ThreeMFWriter.OutputMode.BinaryMode
  29. }]
  30. }
  31. metaData["workspace_writer"] = {
  32. "output": [{
  33. "extension": "curaproject.3mf",
  34. "description": i18n_catalog.i18nc("@item:inlistbox", "Cura Project 3MF file"),
  35. "mime_type": "application/x-curaproject+xml",
  36. "mode": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter.OutputMode.BinaryMode
  37. }]
  38. }
  39. return metaData
  40. def register(app):
  41. if "3MFWriter.ThreeMFWriter" in sys.modules:
  42. return {"mesh_writer": ThreeMFWriter.ThreeMFWriter(),
  43. "workspace_writer": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter()}
  44. else:
  45. return {}