mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-23 19:01:05 -07:00
Merge branch '4.6'
Conflicts: resources/texts/change_log.txt: Both modified but had different wording for the pause-at-height bugfix with motor timeout. I used the wording in 4.6 since it was more extensive.
This commit is contained in:
commit
01ec607d40
5 changed files with 21 additions and 47 deletions
|
|
@ -52,6 +52,7 @@ class ThreeMFReader(MeshReader):
|
|||
self._root = None
|
||||
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: str) -> Matrix:
|
||||
if transformation == "":
|
||||
|
|
@ -86,20 +87,17 @@ class ThreeMFReader(MeshReader):
|
|||
## Convenience function that converts a SceneNode object (as obtained from libSavitar) to a scene node.
|
||||
# \returns Scene node.
|
||||
def _convertSavitarNodeToUMNode(self, savitar_node: Savitar.SceneNode, file_name: str = "") -> Optional[SceneNode]:
|
||||
self._object_count += 1
|
||||
|
||||
node_name = savitar_node.getName()
|
||||
node_id = savitar_node.getId()
|
||||
if node_name == "":
|
||||
if file_name != "":
|
||||
node_name = os.path.basename(file_name)
|
||||
else:
|
||||
node_name = "Object {}".format(node_id)
|
||||
node_name = "Object %s" % self._object_count
|
||||
|
||||
active_build_plate = CuraApplication.getInstance().getMultiBuildPlateModel().activeBuildPlate
|
||||
|
||||
um_node = CuraSceneNode() # This adds a SettingOverrideDecorator
|
||||
um_node.addDecorator(BuildPlateDecorator(active_build_plate))
|
||||
um_node.setName(node_name)
|
||||
um_node.setId(node_id)
|
||||
transformation = self._createMatrixFromTransformationString(savitar_node.getTransformation())
|
||||
um_node.setTransformation(transformation)
|
||||
mesh_builder = MeshBuilder()
|
||||
|
|
@ -171,6 +169,7 @@ class ThreeMFReader(MeshReader):
|
|||
|
||||
def _read(self, file_name: str) -> Union[SceneNode, List[SceneNode]]:
|
||||
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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue