mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 04:07:57 -06:00
Fix imports to Charon classes
Contributes to issue CURA-4872.
This commit is contained in:
parent
600e2abce1
commit
8a3a3d32da
1 changed files with 4 additions and 3 deletions
|
@ -1,15 +1,16 @@
|
||||||
#Copyright (c) 2018 Ultimaker B.V.
|
#Copyright (c) 2018 Ultimaker B.V.
|
||||||
#Cura is released under the terms of the LGPLv3 or higher.
|
#Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import charon
|
from charon.VirtualFile import VirtualFile #To open UFP files.
|
||||||
|
from charon.OpenMode import OpenMode #To indicate that we want to write to UFP files.
|
||||||
|
|
||||||
from UM.Mesh.MeshWriter import MeshWriter #The writer we need to implement.
|
from UM.Mesh.MeshWriter import MeshWriter #The writer we need to implement.
|
||||||
from UM.PluginRegistry import PluginRegistry #To get the g-code writer.
|
from UM.PluginRegistry import PluginRegistry #To get the g-code writer.
|
||||||
|
|
||||||
class UFPWriter(MeshWriter):
|
class UFPWriter(MeshWriter):
|
||||||
def write(self, stream, nodes, mode = MeshWriter.OutputMode.BinaryMode):
|
def write(self, stream, nodes, mode = MeshWriter.OutputMode.BinaryMode):
|
||||||
archive = charon.VirtualFile()
|
archive = VirtualFile()
|
||||||
archive.open(stream, charon.OpenMode.WriteOnly)
|
archive.open(stream, OpenMode.WriteOnly)
|
||||||
|
|
||||||
#Store the g-code from the scene.
|
#Store the g-code from the scene.
|
||||||
archive.addContentType(extension = "gcode", mime_type = "text/x-gcode")
|
archive.addContentType(extension = "gcode", mime_type = "text/x-gcode")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue