Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cura/BuildVolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ def __init__(self, application: "CuraApplication", parent: Optional[SceneNode] =
# Therefore this works.
self._machine_manager.activeQualityChanged.connect(self._onStackChanged)

# Explicitly queue the timer here so _onStackChangeTimerFinished always runs once
# after construction to populate the dimensions regardless of signal ordering.
self._onStackChanged()

# Enable and disable extruder
self._machine_manager.extruderChanged.connect(self.updateNodeBoundaryCheck)

Expand Down Expand Up @@ -699,6 +703,10 @@ def _onStackChangeTimerFinished(self) -> None:
def _onEngineCreated(self) -> None:
self._engine_ready = True
self.rebuild()
if self._volume_aabb is None:
# rebuild() returned early. Re-queue it so dimensions are fetched and rebuild() is retried after a short delay.
Logger.warning("BuildVolume: _volume_aabb is still None after engine created; re-triggering stack refresh.")
self._onStackChanged()

def _onSettingChangeTimerFinished(self) -> None:
if not self._global_container_stack:
Expand Down
8 changes: 7 additions & 1 deletion cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,13 @@ def _arrangeAll(self, *, grid_arrangement: bool) -> None:
if node.callDecoration("getBuildPlateNumber") == active_build_plate:
# Skip nodes that are too big
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:
volume_bounding_box = self._volume.getBoundingBox()
if volume_bounding_box is None:
Logger.warning("_arrangeAll: build volume bounding box is None — rebuild not yet triggered. Requesting rebuild and aborting arrange.")
# Trigger a rebuild now and bail out; the user can retry arrange once the volume is ready.
self._volume.rebuild()
return
if bounding_box is None or bounding_box.width < volume_bounding_box.width or bounding_box.depth < volume_bounding_box.depth:
# Arrange only the unlocked nodes and keep the locked ones in place
if node.getSetting(SceneNodeSettings.LockPosition):
locked_nodes.append(node)
Expand Down
Loading