mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-29 17:45:45 +08:00
Merge branch '3.2' of github.com:Ultimaker/Cura into 3.2
This commit is contained in:
commit
73840f6bfc
@ -1041,10 +1041,12 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
nodes = []
|
nodes = []
|
||||||
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
||||||
if type(node) not in {SceneNode, CuraSceneNode}:
|
if not isinstance(node, SceneNode):
|
||||||
continue
|
continue
|
||||||
if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"):
|
if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"):
|
||||||
continue # Node that doesnt have a mesh and is not a group.
|
continue # Node that doesnt have a mesh and is not a group.
|
||||||
|
if not node.isSelectable():
|
||||||
|
continue # Only remove nodes that are selectable.
|
||||||
if node.getParent() and node.getParent().callDecoration("isGroup"):
|
if node.getParent() and node.getParent().callDecoration("isGroup"):
|
||||||
continue # Grouped nodes don't need resetting as their parent (the group) is resetted)
|
continue # Grouped nodes don't need resetting as their parent (the group) is resetted)
|
||||||
nodes.append(node)
|
nodes.append(node)
|
||||||
|
@ -609,7 +609,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
|
|
||||||
instance_container.setName(self._container_registry.uniqueName(instance_container.getName()))
|
instance_container.setName(self._container_registry.uniqueName(instance_container.getName()))
|
||||||
new_changes_container_id = self.getNewId(instance_container.getId())
|
new_changes_container_id = self.getNewId(instance_container.getId())
|
||||||
instance_container._id = new_changes_container_id
|
instance_container.setMetaDataEntry("id", new_changes_container_id)
|
||||||
|
|
||||||
# TODO: we don't know the following is correct or not, need to verify
|
# TODO: we don't know the following is correct or not, need to verify
|
||||||
# AND REFACTOR!!!
|
# AND REFACTOR!!!
|
||||||
|
@ -6,8 +6,9 @@ from UM.Math.Vector import Vector
|
|||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.Math.Matrix import Matrix
|
from UM.Math.Matrix import Matrix
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
import UM.Scene.SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
from cura.Scene.CuraSceneNode import CuraSceneNode
|
|
||||||
|
from cura.CuraApplication import CuraApplication
|
||||||
|
|
||||||
import Savitar
|
import Savitar
|
||||||
|
|
||||||
@ -62,11 +63,15 @@ class ThreeMFWriter(MeshWriter):
|
|||||||
self._store_archive = store_archive
|
self._store_archive = store_archive
|
||||||
|
|
||||||
## Convenience function that converts an Uranium SceneNode object to a SavitarSceneNode
|
## Convenience function that converts an Uranium SceneNode object to a SavitarSceneNode
|
||||||
# \returns Uranium Scenen node.
|
# \returns Uranium Scene node.
|
||||||
def _convertUMNodeToSavitarNode(self, um_node, transformation = Matrix()):
|
def _convertUMNodeToSavitarNode(self, um_node, transformation = Matrix()):
|
||||||
if type(um_node) not in [UM.Scene.SceneNode.SceneNode, CuraSceneNode]:
|
if not isinstance(um_node, SceneNode):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
active_build_plate_nr = CuraApplication.getInstance().getBuildPlateModel().activeBuildPlate
|
||||||
|
if um_node.callDecoration("getBuildPlateNumber") != active_build_plate_nr:
|
||||||
|
return
|
||||||
|
|
||||||
savitar_node = Savitar.SceneNode()
|
savitar_node = Savitar.SceneNode()
|
||||||
|
|
||||||
node_matrix = um_node.getLocalTransformation()
|
node_matrix = um_node.getLocalTransformation()
|
||||||
@ -97,6 +102,9 @@ class ThreeMFWriter(MeshWriter):
|
|||||||
savitar_node.setSetting(key, str(stack.getProperty(key, "value")))
|
savitar_node.setSetting(key, str(stack.getProperty(key, "value")))
|
||||||
|
|
||||||
for child_node in um_node.getChildren():
|
for child_node in um_node.getChildren():
|
||||||
|
# only save the nodes on the active build plate
|
||||||
|
if child_node.callDecoration("getBuildPlateNumber") != active_build_plate_nr:
|
||||||
|
continue
|
||||||
savitar_child_node = self._convertUMNodeToSavitarNode(child_node)
|
savitar_child_node = self._convertUMNodeToSavitarNode(child_node)
|
||||||
if savitar_child_node is not None:
|
if savitar_child_node is not None:
|
||||||
savitar_node.addChild(savitar_child_node)
|
savitar_node.addChild(savitar_child_node)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user