mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Merge branch 'per-object-autodropdown' of github.com:Piezoid/Cura
This commit is contained in:
commit
3400210f9b
2 changed files with 9 additions and 4 deletions
|
@ -1447,7 +1447,7 @@ class CuraApplication(QtApplication):
|
||||||
bounding_box = node.getBoundingBox()
|
bounding_box = node.getBoundingBox()
|
||||||
if bounding_box is None or bounding_box.width < self._volume.getBoundingBox().width or bounding_box.depth < self._volume.getBoundingBox().depth:
|
if bounding_box is None or bounding_box.width < self._volume.getBoundingBox().width or bounding_box.depth < self._volume.getBoundingBox().depth:
|
||||||
# Arrange only the unlocked nodes and keep the locked ones in place
|
# Arrange only the unlocked nodes and keep the locked ones in place
|
||||||
if UM.Util.parseBool(node.getSetting(SceneNodeSettings.LockPosition)):
|
if node.getSetting(SceneNodeSettings.LockPosition):
|
||||||
locked_nodes.append(node)
|
locked_nodes.append(node)
|
||||||
else:
|
else:
|
||||||
nodes_to_arrange.append(node)
|
nodes_to_arrange.append(node)
|
||||||
|
|
|
@ -50,8 +50,13 @@ class PlatformPhysics:
|
||||||
if not self._enabled:
|
if not self._enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
app_instance = Application.getInstance()
|
||||||
|
app_preferences = app_instance.getPreferences()
|
||||||
|
app_automatic_drop_down = app_preferences.getValue("physics/automatic_drop_down")
|
||||||
|
app_automatic_push_free = app_preferences.getValue("physics/automatic_push_free")
|
||||||
|
|
||||||
root = self._controller.getScene().getRoot()
|
root = self._controller.getScene().getRoot()
|
||||||
build_volume = Application.getInstance().getBuildVolume()
|
build_volume = app_instance.getBuildVolume()
|
||||||
build_volume.updateNodeBoundaryCheck()
|
build_volume.updateNodeBoundaryCheck()
|
||||||
|
|
||||||
# Keep a list of nodes that are moving. We use this so that we don't move two intersecting objects in the
|
# Keep a list of nodes that are moving. We use this so that we don't move two intersecting objects in the
|
||||||
|
@ -75,7 +80,7 @@ class PlatformPhysics:
|
||||||
# Move it downwards if bottom is above platform
|
# Move it downwards if bottom is above platform
|
||||||
move_vector = Vector()
|
move_vector = Vector()
|
||||||
|
|
||||||
if Application.getInstance().getPreferences().getValue("physics/automatic_drop_down") and not (node.getParent() and node.getParent().callDecoration("isGroup") or node.getParent() != root) and node.isEnabled(): #If an object is grouped, don't move it down
|
if node.getSetting(SceneNodeSettings.AutoDropDown, app_automatic_drop_down) and not (node.getParent() and node.getParent().callDecoration("isGroup") or node.getParent() != root) and node.isEnabled(): #If an object is grouped, don't move it down
|
||||||
z_offset = node.callDecoration("getZOffset") if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator) else 0
|
z_offset = node.callDecoration("getZOffset") if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator) else 0
|
||||||
move_vector = move_vector.set(y = -bbox.bottom + z_offset)
|
move_vector = move_vector.set(y = -bbox.bottom + z_offset)
|
||||||
|
|
||||||
|
@ -84,7 +89,7 @@ class PlatformPhysics:
|
||||||
node.addDecorator(ConvexHullDecorator())
|
node.addDecorator(ConvexHullDecorator())
|
||||||
|
|
||||||
# only push away objects if this node is a printing mesh
|
# only push away objects if this node is a printing mesh
|
||||||
if not node.callDecoration("isNonPrintingMesh") and Application.getInstance().getPreferences().getValue("physics/automatic_push_free"):
|
if not node.callDecoration("isNonPrintingMesh") and app_automatic_push_free:
|
||||||
# Do not move locked nodes
|
# Do not move locked nodes
|
||||||
if node.getSetting(SceneNodeSettings.LockPosition):
|
if node.getSetting(SceneNodeSettings.LockPosition):
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue