Fixed multiplyObject group. CURA-3239

This commit is contained in:
Jack Ha 2017-04-03 11:12:20 +02:00
parent bd874a62ac
commit e866c03b50
2 changed files with 8 additions and 8 deletions

View file

@ -143,7 +143,7 @@ class Arrange:
Logger.log("d", "Current buildplate: \n%s" % str(arranger._occupied[::10, ::10]))
return arranger
## Find placement for a node and place it
## Find placement for a node (using offset shape) and place it (using hull shape)
#
def findNodePlacements(self, node, offset_shape_arr, hull_shape_arr, count = 1, step = 1):
# offset_shape_arr, hull_shape_arr, arranger -> nodes, arranger

View file

@ -856,17 +856,17 @@ class CuraApplication(QtApplication):
if not node and object_id != 0: # Workaround for tool handles overlapping the selected object
node = Selection.getSelectedObject(0)
root = self.getController().getScene().getRoot()
arranger = Arrange.create(scene_root = root)
offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(node, min_offset = min_offset)
nodes = arranger.findNodePlacements(node, offset_shape_arr, hull_shape_arr, count = count)
if nodes:
current_node = node
# Find the topmost group
while current_node.getParent() and current_node.getParent().callDecoration("isGroup"):
current_node = current_node.getParent()
root = self.getController().getScene().getRoot()
arranger = Arrange.create(scene_root = root)
offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(current_node, min_offset = min_offset)
nodes = arranger.findNodePlacements(current_node, offset_shape_arr, hull_shape_arr, count = count)
if nodes:
op = GroupedOperation()
for new_node in nodes:
op.addOperation(AddSceneNodeOperation(new_node, current_node.getParent()))