__init__.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright (c) 2015 Ultimaker B.V.
  2. # Uranium is released under the terms of the LGPLv3 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. from UM.Platform import Platform
  12. i18n_catalog = i18nCatalog("cura")
  13. def getMetaData():
  14. workspace_extension = "3mf"
  15. metaData = {}
  16. if "3MFWriter.ThreeMFWriter" in sys.modules:
  17. metaData["mesh_writer"] = {
  18. "output": [{
  19. "extension": "3mf",
  20. "description": i18n_catalog.i18nc("@item:inlistbox", "3MF file"),
  21. "mime_type": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml",
  22. "mode": ThreeMFWriter.ThreeMFWriter.OutputMode.BinaryMode
  23. }]
  24. }
  25. metaData["workspace_writer"] = {
  26. "output": [{
  27. "extension": workspace_extension,
  28. "description": i18n_catalog.i18nc("@item:inlistbox", "Cura Project 3MF file"),
  29. "mime_type": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml",
  30. "mode": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter.OutputMode.BinaryMode
  31. }]
  32. }
  33. return metaData
  34. def register(app):
  35. if "3MFWriter.ThreeMFWriter" in sys.modules:
  36. return {"mesh_writer": ThreeMFWriter.ThreeMFWriter(),
  37. "workspace_writer": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter()}
  38. else:
  39. return {}