diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index d204bee185..b7fe549601 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -39,6 +39,7 @@ class PlatformPhysics: Application.getInstance().getPreferences().addPreference("physics/automatic_push_free", False) Application.getInstance().getPreferences().addPreference("physics/automatic_drop_down", False) + Application.getInstance().getPreferences().addPreference("physics/per_model_drop", False) def _onSceneChanged(self, source): if not source.callDecoration("isSliceable"): @@ -54,6 +55,9 @@ class PlatformPhysics: 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") + # silent preference setting to mimic preference automatic_drop_down only different when user changes it explicitely while opening model + app_per_model_drop = app_preferences.getValue("physics/per_model_drop") + root = self._controller.getScene().getRoot() build_volume = app_instance.getBuildVolume() @@ -81,7 +85,11 @@ class PlatformPhysics: # Move it downwards if bottom is above platform move_vector = Vector() - 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 + # if per model drop is different then app_automatic_drop + # in case of 3mf loading when user changes this setting for that model + if (app_per_model_drop != app_automatic_drop_down): + node.setSetting(SceneNodeSettings.AutoDropDown, app_per_model_drop) + if node.getSetting(SceneNodeSettings.AutoDropDown, app_per_model_drop) 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 move_vector = move_vector.set(y = -bbox.bottom + z_offset) @@ -169,6 +177,8 @@ class PlatformPhysics: op = PlatformPhysicsOperation.PlatformPhysicsOperation(node, move_vector) op.push() + # setting this silent preference same as app_automatic_drop_down + app_preferences.setValue("physics/per_model_drop", app_automatic_drop_down) # After moving, we have to evaluate the boundary checks for nodes build_volume.updateNodeBoundaryCheck() diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index 8b4b2341d9..eefa0f713a 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -308,9 +308,14 @@ UM.Dialog spacing: UM.Theme.getSize("default_margin").width UM.CheckBox { + id: checkDropModels text: catalog.i18nc("@text:window", "Drop models to buildplate") - checked: UM.Preferences.getValue("physics/automatic_drop_down") == True - onCheckedChanged: UM.Preferences.setValue("physics/automatic_drop_down", checked) + checked: UM.Preferences.getValue("physics/automatic_drop_down") + onCheckedChanged: UM.Preferences.setValue("physics/per_model_drop", checked) + } + function reloadValue() + { + checkDropModels.checked = UM.Preferences.getValue("physics/automatic_drop_down") } } @@ -436,6 +441,7 @@ UM.Dialog materialSection.reloadValues() profileSection.reloadValues() printerSection.reloadValues() + dropToBuildPlate.reloadValue() } } }