From 2f8fc2cabef19b23f2d024105b21ad7ccd5b09a4 Mon Sep 17 00:00:00 2001 From: Saumya Jain Date: Wed, 8 May 2024 11:40:30 +0200 Subject: [PATCH] Updated bounds and meta values in MakerbotWriter The MakerbotWriter.py file has been adjusted to handle "application/x-makerbot-sketch" files without providing bounding box values. Instead of using the node name for model_counts, it now uses the count of nodes under the name "instance0". --- plugins/MakerbotWriter/MakerbotWriter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/MakerbotWriter/MakerbotWriter.py b/plugins/MakerbotWriter/MakerbotWriter.py index 163dab6de7..4e4930075d 100644 --- a/plugins/MakerbotWriter/MakerbotWriter.py +++ b/plugins/MakerbotWriter/MakerbotWriter.py @@ -1,6 +1,5 @@ # Copyright (c) 2023 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. - from io import StringIO, BufferedIOBase import json from typing import cast, List, Optional, Dict, Tuple @@ -173,7 +172,8 @@ class MakerbotWriter(MeshWriter): bounds = node_bounds else: bounds = bounds + node_bounds - + if file_format == "application/x-makerbot-sketch": + bounds = None if bounds is not None: meta["bounding_box"] = { "x_min": bounds.left, @@ -214,7 +214,7 @@ class MakerbotWriter(MeshWriter): meta["extruder_temperature"] = materials_temps[0] meta["extruder_temperatures"] = materials_temps - meta["model_counts"] = [{"count": 1, "name": node.getName()} for node in nodes] + meta["model_counts"] = [{"count": len(nodes), "name": "instance0"}] tool_types = [extruder.variant.getMetaDataEntry("reference_extruder_id") for extruder in extruders] meta["tool_type"] = tool_types[0]