diff options
author | Remco Burema <r.burema@ultimaker.com> | 2019-09-03 17:04:38 +0300 |
---|---|---|
committer | Remco Burema <r.burema@ultimaker.com> | 2019-09-03 17:04:38 +0300 |
commit | d9b10e718066132f011e6e87d7fe4ed2b7ca9177 (patch) | |
tree | 79a117cd9c757798687c5194a1660f9a007d9184 /cura/CuraActions.py | |
parent | 70332978fde2883751765569a971a7f6ab68f684 (diff) | |
parent | efbcdcc8ac41d91ef9ea0fc93f718725f82fb2b1 (diff) |
Merge branch 'feature_bottom_face' of https://github.com/Ultimaker/Cura into feature_bottom_face
Diffstat (limited to 'cura/CuraActions.py')
-rw-r--r-- | cura/CuraActions.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cura/CuraActions.py b/cura/CuraActions.py index ad359973c1..3a1b35d987 100644 --- a/cura/CuraActions.py +++ b/cura/CuraActions.py @@ -3,7 +3,7 @@ from PyQt5.QtCore import QObject, QUrl from PyQt5.QtGui import QDesktopServices -from typing import List, cast +from typing import List, Optional, cast from UM.Event import CallFunctionEvent from UM.FlameProfiler import pyqtSlot @@ -85,7 +85,7 @@ class CuraActions(QObject): original_node, face_id = selected_face meshdata = original_node.getMeshDataTransformed() - if not meshdata or face_id < 0 or face_id > Selection.maxFaceSelectionId(): + if not meshdata or face_id < 0 or face_id > Selection.getMaxFaceSelectionId(): return rotation_point, face_normal = meshdata.getFacePlane(face_id) @@ -94,12 +94,15 @@ class CuraActions(QObject): rotation_quaternion = Quaternion.rotationTo(face_normal_vector.normalized(), Vector(0.0, -1.0, 0.0)) operation = GroupedOperation() + current_node = None # type: Optional[SceneNode] for node in Selection.getAllSelectedObjects(): current_node = node parent_node = current_node.getParent() while parent_node and parent_node.callDecoration("isGroup"): current_node = parent_node parent_node = current_node.getParent() + if current_node is None: + return rotate_operation = RotateOperation(current_node, rotation_quaternion, rotation_point_vector) operation.addOperation(rotate_operation) |