mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 12:35:57 +08:00
Arrange newly placed models
CURA-7440
This commit is contained in:
parent
2d084c9e2b
commit
a34f1a6504
@ -53,6 +53,7 @@ from cura.Arranging.Arrange import Arrange
|
|||||||
from cura.Arranging.ArrangeObjectsAllBuildPlatesJob import ArrangeObjectsAllBuildPlatesJob
|
from cura.Arranging.ArrangeObjectsAllBuildPlatesJob import ArrangeObjectsAllBuildPlatesJob
|
||||||
from cura.Arranging.ArrangeObjectsJob import ArrangeObjectsJob
|
from cura.Arranging.ArrangeObjectsJob import ArrangeObjectsJob
|
||||||
from cura.Arranging.ShapeArray import ShapeArray
|
from cura.Arranging.ShapeArray import ShapeArray
|
||||||
|
from cura.Arranging.Nest2DArrange import findNodePlacement, arrange
|
||||||
from cura.Machines.MachineErrorChecker import MachineErrorChecker
|
from cura.Machines.MachineErrorChecker import MachineErrorChecker
|
||||||
from cura.Machines.Models.BuildPlateModel import BuildPlateModel
|
from cura.Machines.Models.BuildPlateModel import BuildPlateModel
|
||||||
from cura.Machines.Models.CustomQualityProfilesDropDownMenuModel import CustomQualityProfilesDropDownMenuModel
|
from cura.Machines.Models.CustomQualityProfilesDropDownMenuModel import CustomQualityProfilesDropDownMenuModel
|
||||||
@ -1821,6 +1822,8 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
select_models_on_load = self.getPreferences().getValue("cura/select_models_on_load")
|
select_models_on_load = self.getPreferences().getValue("cura/select_models_on_load")
|
||||||
|
|
||||||
|
nodes_to_arrange = [] # type: List[CuraSceneNode]
|
||||||
|
|
||||||
for original_node in nodes:
|
for original_node in nodes:
|
||||||
# Create a CuraSceneNode just if the original node is not that type
|
# Create a CuraSceneNode just if the original node is not that type
|
||||||
if isinstance(original_node, CuraSceneNode):
|
if isinstance(original_node, CuraSceneNode):
|
||||||
@ -1869,6 +1872,8 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
node.translate(Vector(0, center_y, 0))
|
node.translate(Vector(0, center_y, 0))
|
||||||
|
|
||||||
|
nodes_to_arrange.append(node)
|
||||||
|
|
||||||
# This node is deep copied from some other node which already has a BuildPlateDecorator, but the deepcopy
|
# This node is deep copied from some other node which already has a BuildPlateDecorator, but the deepcopy
|
||||||
# of BuildPlateDecorator produces one that's associated with build plate -1. So, here we need to check if
|
# of BuildPlateDecorator produces one that's associated with build plate -1. So, here we need to check if
|
||||||
# the BuildPlateDecorator exists or not and always set the correct build plate number.
|
# the BuildPlateDecorator exists or not and always set the correct build plate number.
|
||||||
@ -1887,6 +1892,8 @@ class CuraApplication(QtApplication):
|
|||||||
if select_models_on_load:
|
if select_models_on_load:
|
||||||
Selection.add(node)
|
Selection.add(node)
|
||||||
|
|
||||||
|
arrange(nodes_to_arrange, self.getBuildVolume())
|
||||||
|
|
||||||
self.fileCompleted.emit(file_name)
|
self.fileCompleted.emit(file_name)
|
||||||
|
|
||||||
def addNonSliceableExtension(self, extension):
|
def addNonSliceableExtension(self, extension):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user