__init__.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright (c) 2022 UltiMaker
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. import sys
  4. from UM.Logger import Logger
  5. try:
  6. from . import UFPWriter
  7. except ImportError:
  8. Logger.log("w", "Could not import UFPWriter; libCharon may be missing")
  9. from UM.i18n import i18nCatalog # To translate the file format description.
  10. from UM.Mesh.MeshWriter import MeshWriter # For the binary mode flag.
  11. i18n_catalog = i18nCatalog("cura")
  12. def getMetaData():
  13. if "UFPWriter.UFPWriter" not in sys.modules:
  14. return {}
  15. return {
  16. "mesh_writer": {
  17. "output": [
  18. {
  19. "mime_type": "application/x-ufp",
  20. "mode": MeshWriter.OutputMode.BinaryMode,
  21. "extension": "ufp",
  22. "description": i18n_catalog.i18nc("@item:inlistbox", "UltiMaker Format Package")
  23. }
  24. ]
  25. }
  26. }
  27. def register(app):
  28. if "UFPWriter.UFPWriter" not in sys.modules:
  29. return {}
  30. return { "mesh_writer": UFPWriter.UFPWriter() }