Commit Graph
1098 Commits
Author SHA1 Message Date
Ian Bassi 803dddb0f5 Fix adaptive and TPMS infill paths that start mid-line and end on themselves (#17334)
(cherry picked from commit 4cfdccfe45)
2026-11-07 02:55:16 +08:00
Ian Chua 62e60b2896 feat: Add plugin permission management to the Plugins dialog (#17285)
* feat: permissions tab in plugin dialog ui draft

* feat: allow full access, make threading a boolean

* fix: clang-tidy

* feat: save changes button

* fix: clang-tidy

* fix: only allow permission editing when plugin not loaded

* fix: plugin permission drafts, target validation, and sidecar synchronization

* fix: minor html/css changes

* fix: Make plugin permission edits immediate and thread-safe

* refactor: rehaul UI

* fix: add don't show again to request permission dialog

* fix: permission request dialog ui

* fix: clean up plugin permission dialog and mutation APIs

* fix: retry Windows plugin permission file replacement

* test: extract and cover plugin permission validators

* fix: show clear denial for worker plugin file operations

* fix: clang-tidy

* docs: clarify plugin filesystem permissions and clean up declaration

* fix: handle the 3 states of install state read

* fix: match equivalent paths for exact filesystem grants

* fix: preserve unreadable plugin state and allow socket grant editing

* Recover plugins whose install-state file cannot be parsed

---------

Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
(cherry picked from commit 932b492252)
2026-11-07 02:14:51 +08:00
Kris Austin 1f32f5a99f Fill every filament slot when a project has fewer filaments than tools (#17330)
Opening a project with fewer filaments than the printer has tools tops
up filament_presets and the flush matrix, but leaves filament_colour
and the other per-filament arrays at the project's count. Slicing then
fails the flush matrix check, and an overwriting filament sync reads
past the end of those arrays.

load_current_presets() used to fill the arrays on every load. Since
#15385 it compares against filament_presets, which the top-up has
already raised, so it no longer runs. Grow the arrays where the project
is loaded.

(cherry picked from commit b5c4ccd9c5)
2026-11-07 02:14:51 +08:00
Lam Wei Lun fe9a99bb32 fix: stop the Speed Dial dismissing itself on the first open (#17245)
* fix: stop the Speed Dial dismissing itself on the first open

Opening the dial with Space and not touching anything closed it again a
moment later, on GNOME and KDE, X11 and Wayland, and only on the first open.

The dial hides on wxEVT_ACTIVATE(false), but wxGTK does not deliver that
event to the window that lost the focus: gtk_frame_focus_out_callback sends
it to g_activeFrame, the toplevel that was activated last (wx
src/gtk/toplevel.cpp:192-205). A deactivation that belongs to another
window, or the same one arriving while the dial is still taking the focus,
therefore read as "the user dismissed the dial". The first open is the only
one that maps the window, moves it, resizes it to its content and grabs
focus into a web view that has never held it, so it is the only open
exposed to that ordering.

Validate the dismissal instead of trusting the event: arm a 150 ms one-shot,
cancelled by any activation, and hide only if the dial is still shown and
its window is no longer active. On GTK ask the window with
gtk_window_is_active(), because wxTopLevelWindow::IsActive() resolves
through wx focus tracking, which does not follow the focus that WebKit's
native widget takes. Also skip the pre-map focus grab on the first open: at
that point wxGTK has not mapped the window yet, so the grab cannot land.

speed_dial_should_hide() is a free function, so the rule is covered by
tests/slic3rutils/test_speed_dial_dismiss.cpp without a GUI.

* docs(wxwidgets-skill): document the validated Speed Dial deactivation

Section 10 described the dial's old handler, which hid on every
wxEVT_ACTIVATE(false). The skill is the review ground truth, so it has to
match the code: the deactivation is now validated after a settle interval
against the window's real active state, because wxGTK sends that event to
the last activated toplevel whatever window lost the focus.

* Ignore Page Changes of Inner Books in the Main Tab Handler

The main frame's tab-panel handler receives the page-changed event of
any book inside a page, because wxBookCtrlEvent propagates and the
Calibration page's Tabbook has no handler of its own. It then treated
the inner page switch as a main tab change: it reset the selected tab,
toggled the undo/redo buttons and called SetFocus() on the current page.

On wxGTK, SetFocus() on a child of a visible but inactive top-level
window presents that window. While the Calibration page is built in the
background after start-up, this re-activated the main window and the
Speed Dial, which hides when it loses the focus, closed by itself a
moment after its first open on Linux.

Only act on events whose object is the main tab panel.

* Include wx/timer.h Where the Speed Dial Binds Its Timer

* Describe the Real Cause of the Speed Dial's First-Open Close

The deferred, re-checked hide absorbs a focus bounce shorter than its
delay. It did not stop the first-open close, which was the main frame
activating itself from its tab handler; say so in the comments, the
test and the skill reference instead of describing a misdelivered
deactivation.

---------

Co-authored-by: Hanif Koh <hanifkoh@outlook.com>
(cherry picked from commit bd3e9aeb96)
2026-11-07 02:14:51 +08:00
Sergei 34c8e78e31 Fix/wipetower klipper m400 stalls (#17246)
* WipeTower2: on Klipper, sync motion only before temperature commands

Follow-up to #15133. On Klipper, flush_planner_queue() emitted M400 at
every toolchange boundary, stalling the toolhead over the tower. Keep the
sync only before M104/M109/M591, and drop the sync line left behind when
GCode.cpp strips the interface-temperature M109.

End the deretraction placeholder with a newline: without the M400 that
used to follow it, the next tower move was glued to the placeholder line,
skipped post_process_wipe_tower_moves and kept tower-local Y.

Creator 5 Pro, 247 toolchanges: 1235 M400 -> 247 (~30 min saved).

* Update src/libslic3r/GCode.cpp

Good point, done. The strip now uses flush_planner_queue_command() and follows whatever the tower writes.

Co-authored-by: Kris Austin <kris.austin@gmail.com>

* tests: move the wipe tower slice and shared checks into one helper

* WipeTower2: keep the sync at the end of the unload on Klipper

[change_filament_gcode] and Tn are macros on Klipper; their non-motion
parts run when parsed, so without the sync a filament-change macro could
run while the unload and ramming moves are still queued.

Creator 5 Pro, 247 toolchanges: 494 M400 instead of 1235 (247 in this PR
before). The other boundary flushes, which stalled the toolhead over the
tower, stay removed.

* tests: check the unload sync before each change_filament_gcode

* WipeTower2: don't sync the cooldown after the interface wipe

The reset to the base temperature after the interface wipe isn't
timing-critical, but its M400 stopped the head over the tower before the
tower perimeter. Test print, Creator 5 Pro, 247 toolchanges: 3:22 with
the sync, 3:17 without it.

* tests: check only the interface cooldown for a missing sync

* WipeTower2: skip the cooldown sync on Klipper only

---------

Co-authored-by: Kris Austin <kris.austin@gmail.com>
Co-authored-by: GhZserG <ghzserg@zmod.link>
(cherry picked from commit cb80a0db84)
2026-11-07 02:14:51 +08:00
GNUGiminot 84a2400a90 Plugin audit: keep non-Latin path names intact in the keyword check (#16925)
* Keep non-Latin path names intact in the plugin audit keyword check

is_denied_path_keyword() lowercased every path component with
std::tolower(), which follows the C locale. With a single-byte locale,
which the UI language sets on Windows (Russian_Russia.1251), that
rewrites bytes of UTF-8 sequences: "Новая папка" is no longer valid
UTF-8, and has_denied_config_extension() then throws "boost::filesystem
::path codecvt to wstring: partial" while turning it back into a path.
The exception left the CPython audit hook, so the plugin call never
returned, and the app crashed later in PyFrame_GetCode.

The keyword check now uses the file's ascii_lower(), which lowercases
A-Z only; the keywords are ASCII, so matching stays case-insensitive.
ascii_lower() itself no longer goes through a locale-aware
boost::algorithm::to_lower(), so the network permission keys get the
same guarantee. The audit hook also no longer lets any C++ exception
reach the interpreter: a check that fails denies the event, like an
unanswered prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Address review: narrower try in audit_hook, shorter comments, a test for the catch

- Wrap only audit_plugin_event() in the try, so release_frames() is called
  once after the event is decided.
- Shorten the ascii_lower() comment and drop the one that repeated it.
- Use only the .1251 locale in the non-Latin path test.
- Test that a permission prompt that throws denies the event, which
  reaches the new catch on every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: GNUGiminot <215263196+GNUGiminot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
(cherry picked from commit 2ec1a0732f)
2026-11-07 02:14:51 +08:00
Lam Wei Lun 69f66d781e By layer: keep As object list copies in their list order (#17232)
By layer: order As object list copies by their list position

sort_object_instances_by_model_order() keyed every instance on its object's
index when it initialized the order, so all copies of an object tied.
print.objects() does not list the copies in list order either: copies with a
different rotation live in separate PrintObjects, ordered by transformation,
so the ties were broken by that grouping and the copies printed as 2, 4, 6,
1, 3, 5. std::sort reordering the ties made it worse from 17 instances up.

Number the instances by their position in the model's object and instance
lists instead. No order key repeats, so a plain sort is enough; the renumber
after it compacts this print's instances to 1..n. The other intra-layer orders
and the by-object path are unaffected.

The new test rotates every second copy, which fails on every platform before
this change, MSVC included.

(cherry picked from commit a620d804ef)
2026-11-07 02:14:51 +08:00
HanifKoh 2c7d5a4b88 Start the Orca Cloud Sync Cursor at Zero (#17263)
Fixes #17256

On a machine with no saved `sync_state`, the first `sync/pull` sent whatever was in memory as `?cursor=`. The server answered 400, nothing was downloaded, and the account's presets never arrived because only a 410 clears the cursor.

`SyncState::last_sync_timestamp` now starts at zero, so a session with no saved state pulls everything. `SyncPullResponse::next_cursor` had the same problem on a 304, where a stray value would have been saved to `sync_state` and sent on every later pull, so it and the other scalars in `ProfileUpsert` and `SyncPushResult` start at zero too.

(cherry picked from commit dd0079ec64)
2026-11-07 02:14:51 +08:00
Kris Austin b39046ad04 Fix the freeze before the Creality send dialog opens on a printer without a CFS (#17177)
Fixes #17128

Clicking Print on a Creality printer asked it for its CFS slots on the UI thread, with the 10 s command timeout. A K1C without a CFS never answers that query, so OrcaSlicer froze for 10 s on every click.

The send dialog now opens right away and reads the printer on a background thread. Upload works at once, and Upload and Print turns on when the read ends. The slot query waits 5 s, or the full 10 s once the printer reports `"cfsConnect": 1`, and stops as soon as it reports `"cfsConnect": 0`. When there is no filament mapping, the dialog says whether the printer reports no CFS, lists no slots, or can't be reached.

(cherry picked from commit 0b1d825142)
2026-11-07 02:14:51 +08:00
Ian Bassi 3886779138 Fill internal solid Spiral Inset with Arachne walls
Internal solid infill fell back to fixed width loops so that Arachne's open
walls would not be printed after an outward spiral, which ends at the edge
and travelled back to the centre for them. Fixed width loops leave strips
up to two lines wide in the middle of an island and wedges where it
branches: on calicat.3mf they need 218 mm of gap fill against 53 mm with
Arachne, and with gap fill off for internal solid those gaps stay empty.

Keep Arachne for every solid surface and print each open wall at the centre
end of the nearest spiral instead: before an outward spiral, which starts
there, and after an inward one, which ends there.

(cherry picked from commit 9afa96e92f)
2026-11-07 02:14:51 +08:00
Ian Bassi 9ccc83fc64 Print gap fill after the lines next to it in fills that keep their order
insert_gap_fill() put each piece of gap fill wherever it added the least
travel, which could be before the extrusions bordering it: the centre gap
of a Spiral Inset printed before the spiral that starts there, and gaps
where spirals meet printed before the later spiral. Each piece now only
goes after the last extrusion of its fill that passes within half its
widest width and a line spacing of it.

(cherry picked from commit 88c4c1e915)
2026-11-07 02:14:51 +08:00
Lam Wei Lun 05a9af75f9 Keep the Speed Dial anchored to the main window (#17242)
fix: keep the Speed Dial anchored to the main window

The dial is a long-lived hidden window. Its origin was computed once, at
construction (DPIAware's CenterOnParent and create_webview's), and never
again, so moving or resizing the main frame - or dragging it to another
display - left the dial at the centre of the frame's original rect. Wayland
only looked correct because the compositor places the window there.

Re-derive the origin from the parent's current screen rect on every open,
again once the window is mapped (GTK drops a position requested before the
map), and on a DPI change. The origin comes from the fixed 540x282 box
rather than the current client height, so the content-driven resize does
not move the window while the user types. On GTK, clear the dialog's
default CENTER_ON_PARENT hint so the window manager stops overriding the
computed coordinates.

The geometry is a free function, so the centring and the work-area clamp
are testable without a GUI.

(cherry picked from commit 78134d24c6)
2026-11-07 02:14:51 +08:00
Valerii Bokhan 9ed545fae6 Fix Wipe Inward retraction splitting and sandwich wall offsets (#17160)
(cherry picked from commit 0b041740b1)
2026-11-07 02:14:51 +08:00
SoftFever d11925ea1c Split .py plugin dependencies only at the commas between items (#17196)
(cherry picked from commit 55e760a483)
2026-11-07 02:14:51 +08:00
Joseph Robertson 6bb2578951 Belt printer: lay the brim as high above the belt as the part's outer wall (#16757)
On a belt the brim and the part's outer wall didn't land at the same
height above the belt, so no single endstop or Y offset setting worked
for both (#16705). Brim lines sat at a fixed 0.75 layer height above
the belt. The outer wall where it rests on the belt sits half a layer
up, because the layer is sliced at mid-height, plus half its width
times tan(tilt), because it is inset half a width from the slice edge.
At 45 degrees with 0.32 mm layers and a 0.4 mm wall that is 0.24
against 0.36 mm. Brim lines now sit at the clearance of the outer wall
that rests on the belt in their own band's layer, with XY contour
compensation included. Each line's bead is built from its spacing and
clearance, so it fills its cell however small the clearance gets.
Flow::with_cross_section(), used before, delivers only a quarter of the
area once it falls back to a round bead.

The first-layer test measured from the nozzle, so a wall resting on
the belt never counted as first layer and printed at full speed with
the fan on, and the raised brim would have dropped out too. It now
measures from the belt under the edge of the bead. Travels use the
width of the path they lead to. Brim lines are as wide as the bands
are far apart, not as a bead, so they always count as resting on the
belt.

Speed, flow ratio and acceleration are chosen once per path, and a
wall loop runs from the belt up the part, so the whole loop took
whatever its seam point got. Belt paths are now cut where they cross
the edge of the first-layer band or a step of the slow_down_layers
ramp. Each piece is judged by the heights of all its points. Small-area
flow compensation keeps using the original line lengths.

Non-belt printers are unaffected.

Claude-Session: https://claude.ai/code/session_01Ux9BwdWCA7N8UG7ftaNkWg

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3ac1b0078d)
2026-11-07 02:14:51 +08:00
fa1k3 c66adc3534 Apply the Z shrinkage compensation once to the belt height (#16490)
On a belt printer the slicing height comes from the box of the mesh under
trafo_centered(), which already carries the shrinkage compensation, and
SlicingParameters::create_from_config() scaled it by the Z compensation again.
With a Z shrinkage above 100 % the top of the part was not sliced.

The belt build height check now also compares the compensated height when the
object is too tall, so an object that only fits after the compensation is no
longer refused.

Co-authored-by: SoftFever <softfeverever@gmail.com>
(cherry picked from commit a837652833)
2026-11-07 02:14:51 +08:00
HanifKoh f3e0e244e6 Read a Retyped Option From the Preset Cache as a JSON Profile Would (#17047)
A vendor's installed preset cache survives an app upgrade, and the
dictionary records the type every option was written as. When a build
reads a cache written by a build that typed an option differently, the
reader dropped the option and the preset fell back to the collection
default, which is not what the vendor's JSON says. enable_arc_fitting
became an enum in 2.5.0-beta, so every vendor whose bundle was not bumped
between the alpha and the beta now loads with arc fitting off from the
alpha's cache, and the alpha reads the beta's cache the same way.

Read such a value by the writer's type and hand its text to
set_deserialize through a scratch config, so handle_legacy and the
bool/enum substitution run on it exactly as for a JSON profile and a
failed parse leaves nothing behind. A text this build cannot place is
still dropped, reported once per key per file.

(cherry picked from commit 5fb129f1f3)
2026-11-07 02:14:51 +08:00
HanifKoh f2ad1c8536 Keep the Scarf Ramp at Its Exact Length Past a Vertex on a Straight Line (#17030)
A scarf ramp that would end less than half a step before the next loop
vertex was extended to that vertex, so that no flat stub follows the ramp.
Arachne places the wall's vertices a little differently on every layer, and
arc fitting moves them further, so the ramp grew by a different amount on
neighbouring layers: the scarf end, which the preview draws as the seam,
stepped sideways by up to half a step from one layer to the next.

Where the vertex lies within an eighth of a common line width of the
straight line from the exact ramp end to the vertex after it, measured in
3D so a Z contour is kept, the flat path now skips that vertex instead. The
ramp keeps its exact length and ends at the same place on every layer, and
the first flat segment is still at least as long as the one that followed
the vertex. At a corner, or when the vertex ends the path, the ramp is
extended as before.

(cherry picked from commit 6c96e41162)
2026-11-07 02:14:51 +08:00
Ian Chua dacdb5a72d fix: revert native device tab flag (#17162)
(cherry picked from commit fcab66ca9e)
2026-11-07 02:14:51 +08:00
Rodrigo Faselli 44f792dbc3 Print bridges at bridge speed when slowing down for curled perimeters (#17144)
With slowdown_for_curled_perimeters on, the fully unsupported entry of the overhang speed table was overhang_4_4_speed for every role. Since #14735 samples the inside of a line, the unsupported middle of an anchored bridge strand got that speed. Bridge infill now uses bridge_speed there, like the branch without curled slowdown. Other roles keep their old speeds.

(cherry picked from commit 533d4c3e9e)
2026-11-07 02:14:51 +08:00
Noisyfox bf21673469 Fix Mesh Boolean crash on meshes with unreferenced vertices (#17080)
Mesh boolean crashed in the CGAL volume check when a mesh had vertices that no triangle used. The conversion to CGAL now removes those vertices and renumbers the rest. The conversion used by UV unwrapping still keeps the original vertex numbering.

(cherry picked from commit b3f8d0af15)
2026-11-07 02:14:51 +08:00
SoftFever af2ffb8cdd Keep the time-format tests passing when daylight saving ends (#17116)
(cherry picked from commit d1d8204dc1)
2026-11-01 17:55:38 +08:00
SoftFever 645610f015 Let Slice and Print retry after a post-processing script or plugin fails (#17095)
(cherry picked from commit 1093ff0714)
2026-11-01 09:53:53 +08:00
TheLegendTubaGuy 8386727e1d Keep Short Objects on the Plate When Arranging By Object (#17011)
* Keep Short Objects on the Plate When Arranging By Object

Arranging objects shorter than the nozzle height for printing by object
placed them off the plate, and the plate then reported them too close to
each other (#16991).

- The arrange bed grew by half the extruder clearance radius, while short
  objects are only inflated by half the gap between them, so the extra bed
  was free to use. The bed now grows by the objects' actual inflation,
  after the bed margin is given back to the largest object.
- Arrange kept short objects 2 mm apart, but the sequential clearance
  check needs a nozzle diameter between them.
- Giving back the bed margin measures objects without that inflation,
  which only keeps objects apart, plus EPSILON so rounding still lets an
  object that fills the bed be placed.
- Exclusion regions are moved only when the bed grows, so short objects
  keep their gap to calibration regions on every side.

* Avoid objects at the bed edge and fit turned objects when arranging by object

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
(cherry picked from commit 041df4031e)
2026-11-01 09:53:53 +08:00
SoftFever 3263e6a84b Remember the last printer and keep AMS-synced filaments across restarts (#17086)
(cherry picked from commit 913c622574)
2026-11-01 09:53:53 +08:00
SoftFever b51a538032 Read nozzle diameters correctly when the UI language uses a decimal comma (#17079)
(cherry picked from commit 27cafaa06c)
2026-11-01 09:53:53 +08:00
SoftFever a2acec57c4 Match the printer's loaded filaments when grouping filaments on dual-nozzle printers (#17074)
* Group a filament onto the nozzle that has it loaded in Filament-Saving mode

* Match closer colours and the same filament sub-type in Convenience mode

(cherry picked from commit 7b6c12cf74)
2026-11-01 09:53:53 +08:00
Kris Austin 4b3e4194ff Fix lightning infill hang when an overhang sample lands past the infill (#17066)
The lightning distance field samples each layer's overhang on a grid
anchored at the bounding box of the infill outlines. The opening it
applies to the overhang first can push a sample a little past that box.
Such a sample falls into its neighbor's grid cell or one update() never
visits, so it is never erased, and generateNewTrees() adds the same
point to the tree forever until memory runs out.

Grow the box to cover every sample. It only changes when a sample lies
outside it, and models that slice today give the same result.

Fixes #17051

(cherry picked from commit 7ac46c9a61)
2026-11-01 09:53:53 +08:00
SwineFlew931 df5f9d078d Keep Each Extruder's Values on User Printers With More Extruders Than Their Parent (#16536)
A user printer preset with more extruders than its system parent lost the extra extruders' values on load. The parent copy is now grown to the child's extruder count before the child's values are merged, in all three load paths.

Fixes #16535

(cherry picked from commit 9b4f84a923)
2026-11-01 09:53:53 +08:00
Arthur Porto ee6c30d5c1 Give each object the layer height limits of its own extruder, and compare layers rather than limits for the prime tower (#17000)
* Test the layer height limits taken for an object, and that they don't keep objects from sharing a prime tower

* Take the layer height limits from an object's own extruder, and don't let them refuse a prime tower

* Test the prime tower check through Print::validate(), and shorten the equal_layering comment

The test runs Print::validate() on two cubes, on filaments 1 and 3 of a printer whose first extruder allows thicker layers than the others. Without this PR, and with only the index fix, it fails with the refusal from #16938. It uses filament 3 because filament 2 read extruder 1's limits before the index fix.

---------

Co-authored-by: raistlin7447 <kris.austin@gmail.com>
(cherry picked from commit fcd96ad91c)
2026-11-01 09:53:53 +08:00
Ian Bassi f4bfb4660f Fix infill and surface filaments overriding each other in Filament for features (#17058)
(cherry picked from commit 304924a69a)
2026-11-01 09:53:53 +08:00
Gazi Faysal Jubayer 61ad14148f Use the printing filament's retraction lift settings (#16965)
On a single-extruder printer with several filaments, every filament used filament 1's "Only lift Z above", "Only lift Z below", "On surfaces" and "Travel distance threshold" values, so a filament's own overrides of these settings were ignored. All four are now read for the filament that is printing.

Fixes #16185

(cherry picked from commit 98b539c3e6)
2026-11-01 09:53:53 +08:00
SoftFever 2dc6f7b18f fix: Preserve inherited filament presets during AMS sync (#16986)
# Description

<!--
> Please provide a summary of the changes made in this PR. Include
details such as:
  > * What issue does this PR address or fix?
  > * What new features or enhancements does this PR introduce?
> * Are there any breaking changes or dependencies that need to be
considered?
-->

When an AMS reports a system filament preset, syncing will replace a
custom preset based on it, losing the user’s overrides. Keep the
existing preset when it inherits from the reported preset, while still
syncing the tray’s filament data.

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->

## Tests

<!--
> Please describe the tests that you have conducted to verify the
changes made in this PR.
-->

<!--
> A guide for users on how to download the artifacts from this PR.
-->

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)

(cherry picked from commit db35f3d098)
2026-11-01 09:53:53 +08:00
Roman Romantsov 39408fa1f2 fix: fix no sparse layers during a toolchange (#15441)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
(cherry picked from commit 29e1899571)
2026-11-01 09:53:53 +08:00
Clifford 98b67a0227 Widen the post-slice extruder masks to 64 bits (#17002)
The post-slice check stored the extruders that can't print each filament as bits in an int. From the 32nd extruder on, the shift overflowed, and on x86 extruder 33's bit landed on extruder 1. limit_filament_maps and the printable area mask are now 64-bit, which covers MAXIMUM_EXTRUDER_NUMBER. Printers with up to 31 extruders get the same values as before.

The tests check the area, height and filament type limits on nozzles 2, 32, 33 and 64, and slice a cube on nozzle 64 of a 64-nozzle printer.

(cherry picked from commit 5ea64864ef)
2026-11-01 09:53:53 +08:00
Gazi Faysal Jubayer 45d0c77caa Give enum list options in the print config defaults their keys map (#16966)
Enum list options in the static print config defaults had no keys map. A config copied from them, such as `DynamicPrintConfig::full_print_config()`, wrote these options as an empty string and crashed when a name was read into one. `StaticCache::finalize()` now sets `coEnums` defaults from `create_default_option()`, which adds the keys map. Option values are unchanged.

Fixes #16964

(cherry picked from commit d28c71c485)
2026-11-01 09:53:53 +08:00
Kris Austin a45cd836d9 fix: slicing crash on an object too thin for any layer with a raft (#17013)
With a raft, an object too thin for any layer gets an empty layer
list. Two functions read it as if it had an entry.

- groupingVolumesForBrim() reads the first layer, and slice() calls it
  before its own check for an empty list.
- With Precise Z height on, adjust_layer_series_to_align_object_height()
  read the last entry. This also runs in Print::validate(), so it
  crashed before slicing started.

Both functions now return early on an empty list, so slicing reaches
the existing "No layers were detected" error.

Fixes #17009

(cherry picked from commit 59f0cc3806)
2026-11-01 09:53:53 +08:00
Kris Austin 61eb4622ea fix: Print plate and Send to Moonraker printers upload a 3MF zip as G-code (#16968)
With "Use printer agents" on, Print plate and Send on Moonraker-based printer agents uploaded the plate's .gcode.3mf bundle under a .gcode name, so Klipper read a zip as G-code and cancelled the print.

Both paths now upload the plate's G-code from the bundle, named after the job. Printers whose profile sets use_3mf keep getting the bundle, named <job>.gcode.3mf, and the Qidi agent's print start names the plate with plateindex. The print start quotes the file name, so job names keep spaces, apostrophes and non-ASCII letters.

Picks up #16453 by DIEHARDave, who wrote the plate G-code extraction for Print plate.

Fixes #16954

Co-authored-by: DIEHARDave <diehard.dave@gmail.com>
(cherry picked from commit 187baae4ee)
2026-11-01 09:53:53 +08:00
Kris Austin 5ca36251a2 Fix crash when transferring a post-processing script to another preset (#16963)
Transferring an unsaved post-processing script onto a preset with no scripts crashed Orca. apply_only called set_at() on the empty target list, and set_at() reads the list's first value. apply_only now gives an empty target list a first value, and an empty source list replaces the target list.

deep_diff now reports serialized lists (post-processing scripts and the flow compensation model) as one setting, through is_edited_as_whole_list(). Tab::options_list_storage_key uses the same check. The unsaved changes and Compare Presets dialogs show these lists the way the settings tab does.

(cherry picked from commit 98619b64a2)
2026-11-01 09:53:53 +08:00
Lam Wei Lun 858a32c6dd Fix Full Publish variant layout and project round trip (#17014)
* fix: keep a Full Publish copy's variant vectors and list in step

A published Full entry clones the receiver's filament preset and overlays
the author's values, but the copy's variant list was rewritten to the
author's columns even when a variant-bearing key could not be filled from
the file. That key kept the receiver's width while every reader sizes the
layout from the list, so one variant silently read another variant's
value.

Copy a variant key only when the file carries all of the author's
columns, then drop any remaining variant key whose length disagrees with
the author's column count, and set the list last. filament_extruder_variant
is itself a member of filament_options_with_variant and is skipped by that
cleanup. The layout joins the entry's dedup key, so two entries naming one
preset but carrying different variants cannot share a copy.

A Full copy is detached and parentless, which also meant it never reached
the receiver's saved project: get_preset_differed_for_save stored no diff
without a parent, and load_project_embedded_presets dropped a preset whose
inherits did not resolve. Embed a parentless preset with its whole config
and resolve it over the default preset on load, mirroring the custom-root
branch of the user-preset loader. A preset naming a missing parent is
still dropped.

Tests: a Full copy drops a variant key the file cannot fill; a parentless
project-embedded preset keeps its own variants on reload.

* fix: stop relabelling and truncating published filament variants

Review of the previous commit found three paths that still let a Full
Publish copy or a loaded preset describe variants its vectors do not
hold.

set_num_filaments resizes every key in m_filament_option_keys to the
filament count, and two of those keys (filament_retract_length_nc and
volumetric_speed_coefficients) are variant-bearing. Loading a
multi-variant preset, including a saved Full copy, truncated them to the
first variant, which readers then hid by clamping. Skip variant-bearing
keys there, as Preset::normalize's own pass already does.

A variant key the file did not carry was kept whenever its width matched
the author's column count, then relabelled with the author's variant
names. When the receiver lists the variants in another order, that puts
one variant's value under another's name. Keep the key only when the
receiver's list is the same layout, or it holds a single value; otherwise
drop it and report it in skipped_keys.

An imported material key that names a file column but is per-slot in this
build was read positionally, returning another slot's column. Skip and
report it instead.

Also narrow the parentless project-embedded preset path to a filament
preset that carries a variant layout, and keep a failed apply from
aborting the whole project load.

* test: store filament_retract_length_nc as the nullable option it is

The filament count test set the key through the non-nullable accessor.
The option's default is ConfigOptionFloatsNullable although the
definition says coFloats, so the value was written through the wrong
dynamic type and the later lookup returned null. Use the nullable
accessor and assert the lookups succeed instead of dereferencing blindly.

(cherry picked from commit 45a29d391b)
2026-11-01 09:53:53 +08:00
Lam Wei Lun 181e64fd78 Fix Publish 3MF export and import of filament variants (#16984)
* Fix Publish 3MF export and import of filament variants

Variant-bearing filament keys (filament_options_with_variant) hold one
value per (slot, variant) in the uncompacted config, but the published
path addressed them by slot: export kept the wrong column once an
earlier filament had more than one variant, import wrote every material
key to receiver variant 0, and Full Publish copied a single variant.

Add a column model in PublishSettings: file columns from
filament_self_index, exact variant matching, and the column a slot
actually prints with (filament_map / filament_volume_map / nozzle
types, hybrid mapped through the slot's own volume type). Export
rewrites partial material entries to base#col, masks those keys by
column instead of slot, and drops a key whose column is foreign, out of
range, or whose vector does not match the file layout. Import maps
base#col back to the receiver preset's variant with the same name and
skips (reports) a miss instead of writing variant 0; plain keys from
older publishes keep the positional import. Full Publish copies every
variant of the author's slot and sets the copy's
filament_extruder_variant.

No new file keys: variant-bearing material keys gain a #col suffix.
No UI change in this commit.

* Fix missing includes

* Fix unit tests

* Fix unit tests

(cherry picked from commit c0efd44e56)
2026-11-01 09:53:53 +08:00
HanifKoh a02f6ed9be Validate Only the Edited Variant's Adaptive PA Model and Accept Spaces in It (#16978)
* Validate Only the Edited Variant's Adaptive PA Model and Accept Spaces in It

Since pressure advance became a per-variant filament setting, the Filament
tab validated every variant column of the adaptive pressure advance model
whenever one was edited. The columns the user never touched still hold the
default placeholder, which the validator rejects, so every edit of a
multi-variant filament ended in a "Line 1: flow value must be greater than PA
value" dialog about a column the user could not see. The check now covers the
variant being edited only, as the nozzle temperature checks on the same tab do.

The validator also rejected whitespace between the values, which the model
parser accepts, so a model typed as "0.027, 8.1416, 2000.0" sliced correctly
but warned on every slice. Whitespace is now ignored before the values are
checked.

Enabling adaptive pressure advance before entering a model warned that the
model "may contain invalid values", which only meant that the placeholder is
all zeros. That case now gets its own warning saying that no measurements
have been entered.

* Keep the Empty Adaptive PA Model a Single Filament Column in Its Test

Deserializing an empty string into the model option leaves it with no
entries, and get_at on an empty vector aborts on a libstdc++ built with
assertions, as the Flatpak unit-test lanes are. Presets always hold one
column per filament, so set the value directly.

(cherry picked from commit 2cb2f0d2e7)
2026-11-01 09:53:53 +08:00
Gazi Faysal Jubayer bbffe8f4df Use the assigned filament's settings in the PA Line calibration test (#16882)
The PA Line test took its speed limit, line width and extrusion from filament 0, whatever filament the test was assigned to. On any other AMS slot or filament, the test printed with the wrong speeds and the wrong extrusion (#16530).

The test now uses the filament the G-code generator has selected for it:
- the fast lines are capped by that filament's max volumetric speed;
- the line width uses the nozzle diameter of that filament's extruder;
- the lines and the number box use Extruder::e_per_mm() times print_flow_ratio, like a regular print.

With one filament whose flow ratio is not 1, the PA lines now use that flow ratio too. PA Pattern output is unchanged.

Adds a regression test that checks the PA line feedrate and extrusion for a test assigned to the second of two different filaments.

(cherry picked from commit 4b68224ff4)
2026-11-01 09:53:53 +08:00
Rui Valim db53e2ca57 Fix Creality Hi CFS filament sync over Moonraker (#15857)
The Creality Hi runs Moonraker but reports its CFS in the `box` printer object, which the Moonraker agent didn't read, so filament sync found no slots. The agent now queries `box` when it finds no lane data or Happy Hare, and the parser lives in `Utils/CrealityCfs.cpp`. Creality material IDs map to filament types, with the K2 family's `same_material` list as a fallback for branded spools.

`update_filament_multi_color()` no longer stops at the first slot without a multi-colour list. It uses the slot's own colour instead, so the list stays aligned with the filament list and selecting a later filament no longer writes past its end.

The CrealityPrintAgent fallback no longer syncs a preset of a different material when no base preset of the reported type exists.

The K2 Plus `same_material` fallback is from mattjanus.

Co-authored-by: mattjanus <18539984+mattjanus@users.noreply.github.com>
(cherry picked from commit d67e0d8dc4)
2026-11-01 09:53:53 +08:00
SoftFever 4c9ea56314 Fix Windows startup failure on an OrcaSlicer.conf without a trailing newline (#16983)
# Description

On Windows, OrcaSlicer refused to start with "Orca Slicer GUI
initialization failed: invalid string position" when `OrcaSlicer.conf`
ended right at its closing brace, as it does after a person or a tool
edits and saves it. Such a file now loads, and the missing checksum is
only logged, as it already was for a checksum that doesn't match. A
backup `OrcaSlicer.conf.bak` without its checksum line no longer crashes
the recovery path either; as before, it is not used to restore a
corrupted configuration.

No change for configuration files the app saved itself: their checksum
is still verified.

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->

## Tests

New `[AppConfig]` tests load a configuration without the checksum line
(ending at the brace, and at a newline), restore a corrupted
configuration from a backup whose checksum matches, and leave a backup
without its checksum line unused. The two regression tests fail without
the fix with "invalid string position" and pass with it; the full test
suite passes on Windows.

By hand on Windows: a build without the fix shows the initialization
error on a configuration ending at its brace, this branch opens the main
window on it, and restarting on the configuration the app then saved
logs no checksum warning.

<!--
> A guide for users on how to download the artifacts from this PR.
-->

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)

(cherry picked from commit 4720370149)
2026-11-01 09:53:53 +08:00
Kris Austin cb770802c4 Fix AltGr typing in settings boxes switching tabs, and add go-to shortcuts for the other tabs (#16918)
Remove the old Ctrl+1 to Ctrl+4 key handler on settings fields. wxWidgets reports AltGr as Ctrl+Alt, so on AZERTY and similar layouts, typing `{`, `~` or `#` in a multi-line settings box switched the main tab. The handler was also outside the shortcut registry and clashed with the Ctrl+1 to Ctrl+4 camera shortcuts.

Add unbound "Go to the ... tab" shortcuts for Home, Design, Multi-device and Calibration, next to the Prepare, Preview, Device and Project ones from #16301.

Fixes #9649

(cherry picked from commit 42608687e5)
2026-11-01 09:53:53 +08:00
Eldenroot 0b2cb5ac48 ENH: Configurable shortcuts to switch between the main tabs including tab switching (#16301)
Adds unbound shortcuts to jump to Prepare, Preview, Device and Project, and Ctrl+Tab / Ctrl+Shift+Tab to cycle through the tabs. Cycling wraps around, skips tabs that refuse the switch, and moves focus to the tab bar on web pages so the next key press still works.

(cherry picked from commit af16875afb)
2026-11-01 09:53:53 +08:00
TheLegendTubaGuy 89fa736737 Fix center of mass details, belt preview and section view bugs (#16958)
* Fix center of mass details, belt preview and section view bugs

Fixes the center of mass bugs from #16781 (center of mass a-d and
rendering b).

- The details box follows its marker, so zooming toward the cursor
  could slide it under the mouse, where ImGui took the wheel and
  zooming stopped. The wheel now zooms over the box.
- Esc closes the details box. A click on a marker now focuses the 3D
  view first, so Esc reaches it after typing in a sidebar field.
- On belt printers the Preview markers stayed in the raw G-code frame
  while the upright view draws the toolpaths back-transformed. The
  masses now get the toolpaths' transform. It shears, so the second
  moments are kept as a full 3x3 matrix to keep the moments of
  inertia right, and the bounding box rows are left out for a map
  that mixes the axes, where the box of the mapped corners would be
  far too large.
- At the top layer of the slider the solid marker of what is printed
  so far covered the faded finished-print one, which could not be
  clicked. At the top layer only the finished print's markers show,
  drawn solid.
- The section view cuts a marker away when its center is on the cut
  side, as it does the toolpaths' option markers.

* Keep the belt bounding box and store six second moments

- Belt prints keep the bounding box rows in the details. The G-code
  back-transform moves from GCodeViewer into
  BeltTransformPipeline::build_gcode_back_transform(), and on a belt
  print the processor keeps a second box per mass, of each segment's
  ends and bead height mapped by its linear part. ObjectMass::transform()
  moves that box by the translation, instead of dropping the box that
  the shear would blow up.
- A mass stores its second moments as the diagonal and the three cross
  terms instead of a full matrix, which is built only to transform it.

(cherry picked from commit e66569a966)
2026-11-01 09:53:53 +08:00
Lam Wei Lun f13335ee0c Publish per-extruder process settings in the Publish 3MF dialog (#16971)
* Publish per-extruder process settings in the Publish 3MF dialog

Process settings that differ per extruder (speeds, accelerations, jerk,
top surface flow ratio) were published as one row showing extruder 1 and
exported as the whole vector, so the dialog could not select an extruder's
value and checking the row shipped every extruder's value.

- Dialog: one tab per extruder, as in the Printer section. On a
  multi-extruder printer the tabs sit behind a MultiSwitchButton below the
  page tabs; each row is keyed "key#N" and reads the uncompacted config.
  Pre-check follows each row's own key. Single-extruder printers get one
  "Extruder" page tab.
- Export: "key#N" process keys are masked to the checked slot, as printer
  keys already are.
- Import: the file carries the author's print extruder layout. Process keys
  map by extruder number and nozzle type on multi-extruder receivers.
  Single-extruder receivers keep the positional import. Files without the
  layout keep the positional import.
- Reopening a file without the layout: its "key#N" process entries select
  that setting on every extruder, so re-publishing keeps the values it had.
- MultiSwitchButton gains Unselect(), which clears the selection without
  an event.

* Fixes clang-tidy

* Fix per-extruder masking test to use the nullable outer_wall_speed type

outer_wall_speed is ConfigOptionFloatsNullable, so the ConfigOptionFloats
casts in the test returned null and the test segfaulted.

(cherry picked from commit aa3291b380)
2026-11-01 09:53:53 +08:00
Lam Wei Lun 16b9b18f26 Fix Publish 3MF showing Undefined for extra printer extruders (#16940)
* Fix Publish 3MF printer extruder values showing Undefined

The Publish dialog indexed printer per-extruder rows by variant column
but read them from full_config(), which compacts those vectors to one
slot per extruder. Read the Printer rows from full_config(false) instead.

Inherited printer per-variant vectors also kept the root's length, so a
printer with more variants than its root had no value for the extra
variants. Pad them to the printer's variant count after inheritance.

* Map published printer keys to the receiver's extruder with the same number

A published printer key used to land on the receiver's slot with the
same index, so the author's layout decided the target. Files now carry
the author's printer_extruder_id and printer_extruder_variant. On import,
each key goes to the receiver's extruder with the author's number, when
that extruder currently runs the author's nozzle type. Anything else is
left unapplied and reported. Files without the layout keep the positional
import.

* Fix clang-tidy

(cherry picked from commit 97e6c71793)
2026-11-01 09:53:53 +08:00