mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
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:
parent
6a5a9e70af
commit
4f9d041ae8
7 changed files with 97 additions and 45 deletions
|
@ -20,11 +20,12 @@ i18n_catalog = i18nCatalog("cura")
|
|||
|
||||
|
||||
class MultiplyObjectsJob(Job):
|
||||
def __init__(self, objects, count, min_offset = 8):
|
||||
def __init__(self, objects, count: int, min_offset: int = 8, lock_rotation: bool = False):
|
||||
super().__init__()
|
||||
self._objects = objects
|
||||
self._count = count
|
||||
self._min_offset = min_offset
|
||||
self._count: int = count
|
||||
self._min_offset: int = min_offset
|
||||
self._lock_rotation: bool = lock_rotation
|
||||
|
||||
def run(self) -> None:
|
||||
status_message = Message(i18n_catalog.i18nc("@info:status", "Multiplying and placing objects"), lifetime = 0,
|
||||
|
@ -39,7 +40,7 @@ class MultiplyObjectsJob(Job):
|
|||
|
||||
root = scene.getRoot()
|
||||
|
||||
processed_nodes = [] # type: List[SceneNode]
|
||||
processed_nodes: List[SceneNode] = []
|
||||
nodes = []
|
||||
|
||||
fixed_nodes = []
|
||||
|
@ -79,8 +80,9 @@ class MultiplyObjectsJob(Job):
|
|||
group_operation, not_fit_count = createGroupOperationForArrange(nodes,
|
||||
Application.getInstance().getBuildVolume(),
|
||||
fixed_nodes,
|
||||
factor = 10000,
|
||||
add_new_nodes_in_scene = True)
|
||||
factor=10000,
|
||||
add_new_nodes_in_scene=True,
|
||||
lock_rotation=self._lock_rotation)
|
||||
found_solution_for_all = not_fit_count == 0
|
||||
|
||||
if nodes_to_add_without_arrange:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue