diff options
author | fieldOfView <aldo@fieldofview.com> | 2018-03-16 15:22:43 +0300 |
---|---|---|
committer | fieldOfView <aldo@fieldofview.com> | 2018-03-16 15:22:43 +0300 |
commit | 83168886d6cfafffc88ec9d7c55770f8631c3afe (patch) | |
tree | 50372fae2a21bb283c675336017685b0099ee30c /plugins/SupportEraser/SupportEraser.py | |
parent | 8e26d27e805ad030a2623f89dcfd6f75451d5211 (diff) |
Parent added meshes to the parent node instead of creating a group
This requires a small change in PlatformPhysics, or otherwise the added mesh would still drop down.
Diffstat (limited to 'plugins/SupportEraser/SupportEraser.py')
-rw-r--r-- | plugins/SupportEraser/SupportEraser.py | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/plugins/SupportEraser/SupportEraser.py b/plugins/SupportEraser/SupportEraser.py index 58624ea058..22dd9b6d9c 100644 --- a/plugins/SupportEraser/SupportEraser.py +++ b/plugins/SupportEraser/SupportEraser.py @@ -120,49 +120,16 @@ class SupportEraser(Tool): op = GroupedOperation() # First add the node to the scene, so it gets the expected transform op.addOperation(AddSceneNodeOperation(node, root)) - - # Determine the parent group the node should be put in - if parent.getParent().callDecoration("isGroup"): - group = parent.getParent() - else: - # Create a group-node - group = CuraSceneNode() - group.addDecorator(GroupDecorator()) - group.addDecorator(BuildPlateDecorator(active_build_plate)) - group.setParent(root) - center = parent.getPosition() - group.setPosition(center) - group.setCenterPosition(center) - op.addOperation(SetParentOperation(parent, group)) - - op.addOperation(SetParentOperation(node, group)) + op.addOperation(SetParentOperation(node, parent)) op.push() - Application.getInstance().getController().getScene().sceneChanged.emit(node) - # Select the picked node so the group does not get drawn as a wireframe (yet) - if not Selection.isSelected(parent): - Selection.add(parent) - if Selection.isSelected(group): - Selection.remove(group) + Application.getInstance().getController().getScene().sceneChanged.emit(node) def _removeEraserMesh(self, node: CuraSceneNode): - group = node.getParent() - if group.callDecoration("isGroup"): - parent = group.getChildren()[0] - - op = GroupedOperation() - op.addOperation(RemoveSceneNodeOperation(node)) - if len(group.getChildren()) == 2: - op.addOperation(SetParentOperation(parent, group.getParent())) - + op = RemoveSceneNodeOperation(node) op.push() - Application.getInstance().getController().getScene().sceneChanged.emit(node) - # Select the picked node so the group does not get drawn as a wireframe (yet) - if parent and not Selection.isSelected(parent): - Selection.add(parent) - if Selection.isSelected(group): - Selection.remove(group) + Application.getInstance().getController().getScene().sceneChanged.emit(node) def _updateEnabled(self): plugin_enabled = False |