mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Fixed multiplyObject group. CURA-3239
This commit is contained in:
parent
bd874a62ac
commit
e866c03b50
2 changed files with 8 additions and 8 deletions
|
@ -143,7 +143,7 @@ class Arrange:
|
||||||
Logger.log("d", "Current buildplate: \n%s" % str(arranger._occupied[::10, ::10]))
|
Logger.log("d", "Current buildplate: \n%s" % str(arranger._occupied[::10, ::10]))
|
||||||
return arranger
|
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):
|
def findNodePlacements(self, node, offset_shape_arr, hull_shape_arr, count = 1, step = 1):
|
||||||
# offset_shape_arr, hull_shape_arr, arranger -> nodes, arranger
|
# offset_shape_arr, hull_shape_arr, arranger -> nodes, arranger
|
||||||
|
|
|
@ -856,17 +856,17 @@ class CuraApplication(QtApplication):
|
||||||
if not node and object_id != 0: # Workaround for tool handles overlapping the selected object
|
if not node and object_id != 0: # Workaround for tool handles overlapping the selected object
|
||||||
node = Selection.getSelectedObject(0)
|
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
|
current_node = node
|
||||||
# Find the topmost group
|
# Find the topmost group
|
||||||
while current_node.getParent() and current_node.getParent().callDecoration("isGroup"):
|
while current_node.getParent() and current_node.getParent().callDecoration("isGroup"):
|
||||||
current_node = current_node.getParent()
|
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()
|
op = GroupedOperation()
|
||||||
for new_node in nodes:
|
for new_node in nodes:
|
||||||
op.addOperation(AddSceneNodeOperation(new_node, current_node.getParent()))
|
op.addOperation(AddSceneNodeOperation(new_node, current_node.getParent()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue