|
@@ -38,14 +38,12 @@ class PlatformPhysics:
|
|
|
self._minimum_gap = 2 # It is a minimum distance (in mm) between two models, applicable for small models
|
|
|
|
|
|
Application.getInstance().getPreferences().addPreference("physics/automatic_push_free", False)
|
|
|
- Application.getInstance().getPreferences().addPreference("physics/automatic_drop_down", False)
|
|
|
- self._app_per_model_drop = Application.getInstance().getPreferences().getValue("physics/automatic_drop_down")
|
|
|
+ Application.getInstance().getPreferences().addPreference("physics/automatic_drop_down", True)
|
|
|
+ self._app_all_model_drop = False
|
|
|
|
|
|
- def getAppPerModelDropDown(self):
|
|
|
- return self._app_per_model_drop
|
|
|
-
|
|
|
- def setAppPerModelDropDown(self, drop_to_buildplate):
|
|
|
- self._app_per_model_drop = drop_to_buildplate
|
|
|
+ def setAppAllModelDropDown(self):
|
|
|
+ self._app_all_model_drop = True
|
|
|
+ self._onChangeTimerFinished()
|
|
|
|
|
|
def _onSceneChanged(self, source):
|
|
|
if not source.callDecoration("isSliceable"):
|
|
@@ -78,7 +76,6 @@ class PlatformPhysics:
|
|
|
# We try to shuffle all the nodes to prevent "locked" situations, where iteration B inverts iteration A.
|
|
|
# By shuffling the order of the nodes, this might happen a few times, but at some point it will resolve.
|
|
|
random.shuffle(nodes)
|
|
|
-
|
|
|
for node in nodes:
|
|
|
if node is root or not isinstance(node, SceneNode) or node.getBoundingBox() is None:
|
|
|
continue
|
|
@@ -88,12 +85,9 @@ class PlatformPhysics:
|
|
|
# Move it downwards if bottom is above platform
|
|
|
move_vector = Vector()
|
|
|
|
|
|
- # if per model drop is different then app_automatic_drop, in case of 3mf loading when user changes this setting for that model
|
|
|
- if (self._app_per_model_drop != app_automatic_drop_down):
|
|
|
- node.setSetting(SceneNodeSettings.AutoDropDown, self._app_per_model_drop)
|
|
|
- if node.getSetting(SceneNodeSettings.AutoDropDown, self._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
|
|
|
+ if (node.getSetting(SceneNodeSettings.AutoDropDown, app_automatic_drop_down) or self._app_all_model_drop) and not (node.getParent() and node.getParent().callDecoration("isGroup") or node.getParent() != root) and node.isEnabled():
|
|
|
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)
|
|
|
|
|
|
# If there is no convex hull for the node, start calculating it and continue.
|
|
|
if not node.getDecorator(ConvexHullDecorator) and not node.callDecoration("isNonPrintingMesh") and node.callDecoration("getLayerData") is None:
|
|
@@ -180,7 +174,7 @@ class PlatformPhysics:
|
|
|
op.push()
|
|
|
|
|
|
# setting this drop to model same as app_automatic_drop_down
|
|
|
- self._app_per_model_drop = app_automatic_drop_down
|
|
|
+ self._app_all_model_drop = False
|
|
|
# After moving, we have to evaluate the boundary checks for nodes
|
|
|
build_volume.updateNodeBoundaryCheck()
|
|
|
|