mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Add None check in bottomFaceSelection()
CURA-6745
This commit is contained in:
parent
44db4216bc
commit
efbcdcc8ac
1 changed files with 4 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
from PyQt5.QtCore import QObject, QUrl
|
from PyQt5.QtCore import QObject, QUrl
|
||||||
from PyQt5.QtGui import QDesktopServices
|
from PyQt5.QtGui import QDesktopServices
|
||||||
from typing import List, cast
|
from typing import List, Optional, cast
|
||||||
|
|
||||||
from UM.Event import CallFunctionEvent
|
from UM.Event import CallFunctionEvent
|
||||||
from UM.FlameProfiler import pyqtSlot
|
from UM.FlameProfiler import pyqtSlot
|
||||||
|
@ -94,12 +94,15 @@ class CuraActions(QObject):
|
||||||
rotation_quaternion = Quaternion.rotationTo(face_normal_vector.normalized(), Vector(0.0, -1.0, 0.0))
|
rotation_quaternion = Quaternion.rotationTo(face_normal_vector.normalized(), Vector(0.0, -1.0, 0.0))
|
||||||
|
|
||||||
operation = GroupedOperation()
|
operation = GroupedOperation()
|
||||||
|
current_node = None # type: Optional[SceneNode]
|
||||||
for node in Selection.getAllSelectedObjects():
|
for node in Selection.getAllSelectedObjects():
|
||||||
current_node = node
|
current_node = node
|
||||||
parent_node = current_node.getParent()
|
parent_node = current_node.getParent()
|
||||||
while parent_node and parent_node.callDecoration("isGroup"):
|
while parent_node and parent_node.callDecoration("isGroup"):
|
||||||
current_node = parent_node
|
current_node = parent_node
|
||||||
parent_node = current_node.getParent()
|
parent_node = current_node.getParent()
|
||||||
|
if current_node is None:
|
||||||
|
return
|
||||||
|
|
||||||
rotate_operation = RotateOperation(current_node, rotation_quaternion, rotation_point_vector)
|
rotate_operation = RotateOperation(current_node, rotation_quaternion, rotation_point_vector)
|
||||||
operation.addOperation(rotate_operation)
|
operation.addOperation(rotate_operation)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue