diff --git a/plugins/MakerbotWriter/MakerbotWriter.py b/plugins/MakerbotWriter/MakerbotWriter.py index 71620d8457..6d91043e3e 100644 --- a/plugins/MakerbotWriter/MakerbotWriter.py +++ b/plugins/MakerbotWriter/MakerbotWriter.py @@ -110,13 +110,12 @@ class MakerbotWriter(MeshWriter): gcode_text_io = StringIO() success = gcode_writer.write(gcode_text_io, None) - # TODO convert gcode_text_io to json - # Writing the g-code failed. Then I can also not write the gzipped g-code. if not success: self.setInformation(gcode_writer.getInformation()) return False + json_toolpaths = du.gcode_2_miracle_jtp(gcode_text_io.getvalue()) metadata = self._getMeta(nodes) png_files = [] @@ -134,6 +133,7 @@ class MakerbotWriter(MeshWriter): try: with ZipFile(stream, "w", compression=ZIP_DEFLATED) as zip_stream: zip_stream.writestr("meta.json", json.dumps(metadata, indent=4)) + zip_stream.writestr("print.jsontoolpath", json_toolpaths) for png_file in png_files: file, data = png_file["file"], png_file["data"] zip_stream.writestr(file, data)