mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 16:57:51 -06:00
CURA-4525 Fix load and save projects. Not storing build plates or object names yet.
This commit is contained in:
parent
be6561b575
commit
864f417723
4 changed files with 14 additions and 8 deletions
|
@ -169,7 +169,6 @@ class PrintInformation(QObject):
|
|||
return self._print_time_message_values[self._active_build_plate]
|
||||
|
||||
def _onPrintDurationMessage(self, build_plate_number, print_time, material_amounts):
|
||||
Logger.log("d", " ### print duration message for build plate %s", build_plate_number)
|
||||
self._updateTotalPrintTimePerFeature(build_plate_number, print_time)
|
||||
self.currentPrintTimeChanged.emit()
|
||||
|
||||
|
@ -276,7 +275,6 @@ class PrintInformation(QObject):
|
|||
def _onActiveBuildPlateChanged(self):
|
||||
new_active_build_plate = Application.getInstance().getBuildPlateModel().activeBuildPlate
|
||||
if new_active_build_plate != self._active_build_plate:
|
||||
Logger.log("d", " ## active build plate changed: %s", self._active_build_plate)
|
||||
self._active_build_plate = new_active_build_plate
|
||||
|
||||
self._initVariablesWithBuildPlate(self._active_build_plate)
|
||||
|
|
|
@ -15,8 +15,8 @@ from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
|||
from UM.Application import Application
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from cura.QualityManager import QualityManager
|
||||
#from UM.Scene.SceneNode import SceneNode
|
||||
from cura.Scene.CuraSceneNode import CuraSceneNode as SceneNode
|
||||
from cura.Scene.CuraSceneNode import CuraSceneNode
|
||||
from cura.Scene.BuildPlateDecorator import BuildPlateDecorator
|
||||
from cura.SliceableObjectDecorator import SliceableObjectDecorator
|
||||
from cura.ZOffsetDecorator import ZOffsetDecorator
|
||||
|
||||
|
@ -44,6 +44,7 @@ class ThreeMFReader(MeshReader):
|
|||
}
|
||||
self._base_name = ""
|
||||
self._unit = None
|
||||
self._object_count = 0 # Used to name objects as there is no node name yet.
|
||||
|
||||
def _createMatrixFromTransformationString(self, transformation):
|
||||
if transformation == "":
|
||||
|
@ -78,7 +79,12 @@ class ThreeMFReader(MeshReader):
|
|||
## Convenience function that converts a SceneNode object (as obtained from libSavitar) to a Uranium scene node.
|
||||
# \returns Uranium scene node.
|
||||
def _convertSavitarNodeToUMNode(self, savitar_node):
|
||||
um_node = SceneNode()
|
||||
self._object_count += 1
|
||||
node_name = "Object %s" % self._object_count
|
||||
|
||||
um_node = CuraSceneNode()
|
||||
um_node.addDecorator(BuildPlateDecorator(0))
|
||||
um_node.setName(node_name)
|
||||
transformation = self._createMatrixFromTransformationString(savitar_node.getTransformation())
|
||||
um_node.setTransformation(transformation)
|
||||
mesh_builder = MeshBuilder()
|
||||
|
@ -155,6 +161,7 @@ class ThreeMFReader(MeshReader):
|
|||
|
||||
def read(self, file_name):
|
||||
result = []
|
||||
self._object_count = 0 # Used to name objects as there is no node name yet.
|
||||
# The base object of 3mf is a zipped archive.
|
||||
try:
|
||||
archive = zipfile.ZipFile(file_name, "r")
|
||||
|
|
|
@ -7,6 +7,7 @@ from UM.Logger import Logger
|
|||
from UM.Math.Matrix import Matrix
|
||||
from UM.Application import Application
|
||||
import UM.Scene.SceneNode
|
||||
from cura.Scene.CuraSceneNode import CuraSceneNode
|
||||
|
||||
import Savitar
|
||||
|
||||
|
@ -63,7 +64,7 @@ class ThreeMFWriter(MeshWriter):
|
|||
## Convenience function that converts an Uranium SceneNode object to a SavitarSceneNode
|
||||
# \returns Uranium Scenen node.
|
||||
def _convertUMNodeToSavitarNode(self, um_node, transformation = Matrix()):
|
||||
if type(um_node) is not UM.Scene.SceneNode.SceneNode:
|
||||
if type(um_node) not in [UM.Scene.SceneNode.SceneNode, CuraSceneNode]:
|
||||
return None
|
||||
|
||||
savitar_node = Savitar.SceneNode()
|
||||
|
|
|
@ -304,8 +304,8 @@ Item
|
|||
Action
|
||||
{
|
||||
id: arrangeAllBuildPlatesAction;
|
||||
text: "";
|
||||
iconName: "document-open";
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates");
|
||||
//iconName: "document-open";
|
||||
onTriggered: CuraApplication.arrangeObjectsToAllBuildPlates();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue