From ee513b0b83b4dcbaae776144381c5e526ed0a23c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 8 Sep 2015 11:34:05 +0200 Subject: [PATCH] Fixed resetting transformation / position of groups. Contributes to #CURA-112 --- cura/CuraApplication.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 62c0691547..5834da5f64 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -313,8 +313,13 @@ class CuraApplication(QtApplication): def resetAllTranslation(self): nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if type(node) is not SceneNode or not node.getMeshData(): + if type(node) is not SceneNode: continue + if not node.getMeshData() and not node.callDecoration("isGroup"): + continue #Node that doesnt have a mesh and is not a group. + if node.getParent() and node.getParent().callDecoration("isGroup"): + continue #Grouped nodes don't need resetting as their parent (the group) is resetted) + nodes.append(node) if nodes: @@ -330,8 +335,12 @@ class CuraApplication(QtApplication): def resetAll(self): nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if type(node) is not SceneNode or not node.getMeshData(): + if type(node) is not SceneNode: continue + if not node.getMeshData() and not node.callDecoration("isGroup"): + continue #Node that doesnt have a mesh and is not a group. + if node.getParent() and node.getParent().callDecoration("isGroup"): + continue #Grouped nodes don't need resetting as their parent (the group) is resetted) nodes.append(node) if nodes: