mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
Make automatic drop to buildplate optional.
This commit is contained in:
parent
30a679ddf9
commit
7a1f7b3654
2 changed files with 16 additions and 1 deletions
|
@ -31,6 +31,7 @@ class PlatformPhysics:
|
||||||
self._change_timer.timeout.connect(self._onChangeTimerFinished)
|
self._change_timer.timeout.connect(self._onChangeTimerFinished)
|
||||||
|
|
||||||
Preferences.getInstance().addPreference("physics/automatic_push_free", True)
|
Preferences.getInstance().addPreference("physics/automatic_push_free", True)
|
||||||
|
Preferences.getInstance().addPreference("physics/automatic_drop_down", True)
|
||||||
|
|
||||||
def _onSceneChanged(self, source):
|
def _onSceneChanged(self, source):
|
||||||
self._change_timer.start()
|
self._change_timer.start()
|
||||||
|
@ -68,7 +69,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 not (node.getParent() and node.getParent().callDecoration("isGroup")): #If an object is grouped, don't move it down
|
if Preferences.getInstance().getValue("physics/automatic_drop_down") and not (node.getParent() and node.getParent().callDecoration("isGroup")): #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)
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@ UM.PreferencesPage
|
||||||
|
|
||||||
UM.Preferences.resetPreference("physics/automatic_push_free")
|
UM.Preferences.resetPreference("physics/automatic_push_free")
|
||||||
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
|
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
|
||||||
|
UM.Preferences.resetPreference("physics/automatic_drop_down")
|
||||||
|
dropDownCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_drop_down"))
|
||||||
UM.Preferences.resetPreference("mesh/scale_to_fit")
|
UM.Preferences.resetPreference("mesh/scale_to_fit")
|
||||||
scaleToFitCheckbox.checked = boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
|
scaleToFitCheckbox.checked = boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
|
||||||
UM.Preferences.resetPreference("mesh/scale_tiny_meshes")
|
UM.Preferences.resetPreference("mesh/scale_tiny_meshes")
|
||||||
|
@ -195,7 +197,19 @@ UM.PreferencesPage
|
||||||
onCheckedChanged: UM.Preferences.setValue("physics/automatic_push_free", checked)
|
onCheckedChanged: UM.Preferences.setValue("physics/automatic_push_free", checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
UM.TooltipArea {
|
||||||
|
width: childrenRect.width
|
||||||
|
height: childrenRect.height
|
||||||
|
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?")
|
||||||
|
|
||||||
|
CheckBox
|
||||||
|
{
|
||||||
|
id: dropDownCheckbox
|
||||||
|
text: catalog.i18nc("@option:check", "Automatically drop models to the build plate")
|
||||||
|
checked: boolCheck(UM.Preferences.getValue("physics/automatic_drop_down"))
|
||||||
|
onCheckedChanged: UM.Preferences.setValue("physics/automatic_drop_down", checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UM.TooltipArea {
|
UM.TooltipArea {
|
||||||
width: childrenRect.width;
|
width: childrenRect.width;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue