Add rotation lock in arrange and multiply objects

Add rotation lock in
- context menu item arrange and
- checkbox in multiply objects dialog

CURA-7951
This commit is contained in:
c.lamboo 2023-05-11 16:14:38 +02:00
parent 6a5a9e70af
commit 4f9d041ae8
7 changed files with 97 additions and 45 deletions

View file

@ -14,11 +14,13 @@ i18n_catalog = i18nCatalog("cura")
class ArrangeObjectsJob(Job):
def __init__(self, nodes: List[SceneNode], fixed_nodes: List[SceneNode], min_offset = 8) -> None:
def __init__(self, nodes: List[SceneNode], fixed_nodes: List[SceneNode], min_offset=8,
lock_rotation: bool = False) -> None:
super().__init__()
self._nodes = nodes
self._fixed_nodes = fixed_nodes
self._min_offset = min_offset
self._lock_rotation = lock_rotation
def run(self):
found_solution_for_all = False
@ -30,7 +32,8 @@ class ArrangeObjectsJob(Job):
status_message.show()
try:
found_solution_for_all = arrange(self._nodes, Application.getInstance().getBuildVolume(), self._fixed_nodes)
found_solution_for_all = arrange(self._nodes, Application.getInstance().getBuildVolume(), self._fixed_nodes,
lock_rotation=self._lock_rotation)
except: # If the thread crashes, the message should still close
Logger.logException("e", "Unable to arrange the objects on the buildplate. The arrange algorithm has crashed.")