diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 8aeeb9c1e8..b28e17f792 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1432,7 +1432,9 @@ class CuraApplication(QtApplication): target_build_plate = self.getBuildPlateModel().activeBuildPlate if arrange_objects_on_load else -1 for original_node in nodes: - node = CuraSceneNode() # We want our own CuraSceneNode + + # Create a CuraSceneNode just if the original node is not that type + node = original_node if isinstance(original_node, CuraSceneNode) else CuraSceneNode() node.setMeshData(original_node.getMeshData()) node.setSelectable(True) diff --git a/plugins/GCodeReader/FlavorParser.py b/plugins/GCodeReader/FlavorParser.py index fa5d6da243..0cd49e2fca 100644 --- a/plugins/GCodeReader/FlavorParser.py +++ b/plugins/GCodeReader/FlavorParser.py @@ -8,14 +8,14 @@ from UM.Logger import Logger from UM.Math.AxisAlignedBox import AxisAlignedBox from UM.Math.Vector import Vector from UM.Message import Message -from UM.Scene.SceneNode import SceneNode +from cura.Scene.CuraSceneNode import CuraSceneNode from UM.i18n import i18nCatalog from UM.Preferences import Preferences catalog = i18nCatalog("cura") from cura import LayerDataBuilder -from cura import LayerDataDecorator +from cura.LayerDataDecorator import LayerDataDecorator from cura.LayerPolygon import LayerPolygon from cura.Scene.GCodeListDecorator import GCodeListDecorator from cura.Settings.ExtruderManager import ExtruderManager @@ -292,7 +292,7 @@ class FlavorParser: # We obtain the filament diameter from the selected printer to calculate line widths self._filament_diameter = Application.getInstance().getGlobalContainerStack().getProperty("material_diameter", "value") - scene_node = SceneNode() + scene_node = CuraSceneNode() # Override getBoundingBox function of the sceneNode, as this node should return a bounding box, but there is no # real data to calculate it from. scene_node.getBoundingBox = self._getNullBoundingBox @@ -422,7 +422,7 @@ class FlavorParser: material_color_map[0, :] = [0.0, 0.7, 0.9, 1.0] material_color_map[1, :] = [0.7, 0.9, 0.0, 1.0] layer_mesh = self._layer_data_builder.build(material_color_map) - decorator = LayerDataDecorator.LayerDataDecorator() + decorator = LayerDataDecorator() decorator.setLayerData(layer_mesh) scene_node.addDecorator(decorator) diff --git a/plugins/SimulationView/SimulationPass.py b/plugins/SimulationView/SimulationPass.py index b453020ffa..c9c1443bfe 100644 --- a/plugins/SimulationView/SimulationPass.py +++ b/plugins/SimulationView/SimulationPass.py @@ -106,7 +106,7 @@ class SimulationPass(RenderPass): nozzle_node = node nozzle_node.setVisible(False) - elif issubclass(type(node), SceneNode) and (node.getMeshData() or node.callDecoration("isBlockSlicing")) and node.isVisible() and node.callDecoration("getBuildPlateNumber") == active_build_plate: + elif issubclass(type(node), SceneNode) and (node.getMeshData() or node.callDecoration("isBlockSlicing")) and node.isVisible(): layer_data = node.callDecoration("getLayerData") if not layer_data: continue