Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2017-04-07 17:40:39 +0300
committerJaime van Kessel <nallath@gmail.com>2017-04-07 17:40:39 +0300
commite26ade0e6f6a76eb3ae476ad380693a95e7490c2 (patch)
tree16be2f35410d4c27701427f4fc3a954b14e7512c /cura/MultiplyObjectsJob.py
parentf9fbd8c02e5804463d15a60d8b96af92a1de2162 (diff)
Multiplying now also gives a message if it could not find a suitable spot for some objects
Diffstat (limited to 'cura/MultiplyObjectsJob.py')
-rw-r--r--cura/MultiplyObjectsJob.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/cura/MultiplyObjectsJob.py b/cura/MultiplyObjectsJob.py
index f7bb3cf0fb..870f165487 100644
--- a/cura/MultiplyObjectsJob.py
+++ b/cura/MultiplyObjectsJob.py
@@ -49,10 +49,17 @@ class MultiplyObjectsJob(Job):
arranger = Arrange.create(scene_root=root)
offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(current_node, min_offset=self._min_offset)
nodes = []
-
+ found_solution_for_all = True
for i in range(self._count):
# We do place the nodes one by one, as we want to yield in between.
- nodes.append(arranger.findNodePlacement(current_node, offset_shape_arr, hull_shape_arr))
+ node, solution_found = arranger.findNodePlacement(current_node, offset_shape_arr, hull_shape_arr)
+ if not solution_found:
+ found_solution_for_all = False
+ new_location = node.getPosition()
+ new_location = new_location.set(z = 100 - i * 20)
+ node.setPosition(new_location)
+
+ nodes.append(node)
Job.yieldThread()
status_message.setProgress((i + 1) / self._count * 100)
@@ -61,4 +68,8 @@ class MultiplyObjectsJob(Job):
for new_node in nodes:
op.addOperation(AddSceneNodeOperation(new_node, current_node.getParent()))
op.push()
- status_message.hide() \ No newline at end of file
+ status_message.hide()
+
+ if not found_solution_for_all:
+ no_full_solution_message = Message(i18n_catalog.i18nc("@info:status", "Unable to find a location within the build volume for all objects"))
+ no_full_solution_message.show() \ No newline at end of file