Compare commits

..

427 Commits

Author SHA1 Message Date
dependabot[bot] 0f947c8a99 Bump actions/setup-python from 6 to 7
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-01 16:24:20 +00:00
Alexandre Folle de Menezes 95a2732145 UTF-8, SVG and STEP should always be in UPPERCASE (#17092)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-11-01 10:40:12 -03:00
SoftFever b5517b693e Write an ordered download table into draft release notes (#17117) 2026-11-01 18:10:32 +08:00
SoftFever d1d8204dc1 Keep the time-format tests passing when daylight saving ends (#17116) 2026-11-01 17:54:09 +08:00
SoftFever bb4c092ae4 Show 3D-Fuel Pro PCTG ESD with its brand in the filament list (#17115) 2026-11-01 16:01:37 +08:00
Ian Bassi 3aedd50bcb Draw the Section View Cut Face in Its Part's Color (#17105)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-10-31 19:04:53 -03:00
Ian Bassi 4a41281761 Fix "it's" typo in Snapmaker U1 start G-code comment (#17099) 2026-10-31 17:27:54 -03:00
SoftFever 1093ff0714 Let Slice and Print retry after a post-processing script or plugin fails (#17095) 2026-11-01 03:14:58 +08:00
HanifKoh c77020e654 Keep a Loaded Creality CFS Spool the Printer Cannot Name (#17034)
A K2 SE lists a loaded spool whose RFID tag the firmware does not know
with only its colour: vendor, type and name blank, state 2. The printer
shows the spool, but parse_cfs_response skipped every material with a
blank vendor and type regardless of state, so the sync dialog never
offered that slot. No firmware has been seen marking an empty slot that
way; empty slots carry state 0 and no colour.

Skip a non-zero state entry only when its colour is blank too. The slot
then shows in the sync dialog as an unread tray, like a Bambu tray with
an unknown spool: mapping it yields Generic PLA in the default colour.
The preset matcher returns no preset for an empty type instead of
scanning every preset for nothing.

The sync code for Moonraker printers assumes every tray either carries
a filament id or is a placeholder for an empty slot; an existing tray
with neither shifts the entries of the trays after it in an overwrite
sync. So a tray that resolved to no preset is published as a placeholder
as well: the overwrite sync keeps the project filament in that position,
as it does for an empty slot, and the tray stays visible in its colour.

Read the box and material fields through the null-safe JSON helpers the
K1 parser already uses, so a null or mistyped field reads as blank
instead of throwing out of the sync.

Tests: parse the reporter's boxsInfo payload and check that the unnamed
spool is listed, a truly blank entry is still skipped, a null field
reads as blank, and an empty type matches no preset; an overwrite sync
with such a placeholder between loaded slots keeps every slot's colour.
2026-11-01 03:14:28 +08:00
TheLegendTubaGuy 041df4031e 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>
2026-11-01 02:35:55 +08:00
Felix14_v2 4045a87b70 Review Russian localization AI updates (#16849)
* Update OrcaSlicer_ru.po

* Restore `G-code` translation removal

* Restore `G-code` translation removal 2

* Update OrcaSlicer_ru.po

* IMEX, color mixing, etc.

* More IMEX improvements

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Restore `G-code` translation removal

* Restore `G-code` translation removal 2

* Update OrcaSlicer_ru.po

* IMEX, color mixing, etc.

* More IMEX improvements

* Fix validation

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Remove old detailed pattern descriptions

(hopefully localized descriptions will be moved to wiki)

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Restore `G-code` translation removal

* Restore `G-code` translation removal 2

* Update OrcaSlicer_ru.po

* IMEX, color mixing, etc.

* More IMEX improvements

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Restore `G-code` translation removal 2

* Update OrcaSlicer_ru.po

* IMEX, color mixing, etc.

* More IMEX improvements

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Remove old detailed pattern descriptions

(hopefully localized descriptions will be moved to wiki)

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po
2026-11-01 01:01:37 +08:00
Alexandre Folle de Menezes 4ab172fd33 Verify and improve AI pt_BR translations (#16871)
* Verify and improve AI pt_BR translations

* Fix typos and agreement left by the pt_BR term changes

Cabeçote is masculine and ponte feminine, so the switch from cabeça da ferramenta and pórtico left mismatched articles and pronouns. Also restore capitals on sentence-initial "Clique" and fix "rteservada".

---------

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-11-01 01:00:36 +08:00
Thalis Antunes 4274ea6bb3 Remove settings OrcaSlicer ignores from the Sovol process profiles (#17085)
wall_loop_direction and initial_solid_infill_acceleration in the three
SV08 MAX processes, and minimum_sparse_infill_threshold in eight SV06 ACE
and SV06 Plus ACE processes, are not options OrcaSlicer defines. The
loader drops them, so removing them does not change the sliced output.
The SV06 ACE files already set minimum_sparse_infill_area.

Bump the Sovol bundle version to 02.04.00.09.
2026-11-01 00:59:05 +08:00
Alec Johnson 3ca96a0891 3D-Fuel Filament Profiles (#17032)
* Added 3D-Fuel filament profiles to
OrcaFilamentLibrary

* added esd filament to files

---------

Co-authored-by: Alec Johnson <ajohnson@3dfuel.com>
2026-11-01 00:58:29 +08:00
Sezgin AÇIKGÖZ efd65b7334 Update OpenEYE Peacock V2 printer and process profiles (#17028)
Signed-off-by: Sezgin AÇIKGÖZ <sezginacikgoz@mail.com>
2026-11-01 00:56:41 +08:00
Aditya-Sharma-12n ffdb5da100 Add BenFab 450 printer profiles (#16976)
Adds system profiles for the BenFab 450, a Klipper (Moonraker) FFF printer with a 426 x 426 x 480 mm build volume: 0.4/0.6/0.8/1.0 mm nozzle variants, Fine/Optimal/Standard/Draft processes per nozzle, OrcaFilamentLibrary generic filaments, cover image, bed model and texture.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-01 00:53:02 +08:00
Hugo Costa eac3ba4416 Inline Machine start gcode for RF50 0.6 nozzle (#16932)
* Inline Machine start gcode for RF50 0.6 nozzle

The previous fix seperated the `machine_start_gcode` into
multiline strings sperated by commas which were then translated
to real commas on the RF50 0.6 nozzle profile. Now it's inline
and the gcode commands are only seperated by a newline. This way
there are no errors when printing with this profile and the correct
pressure advance is set when the print start.

* Bump up Blocks profile version
2026-11-01 00:52:10 +08:00
SoftFever 5cc5fb7f9c Fix a crash when closing OrcaSlicer with a Bambu LAN printer connected (#17087) 2026-11-01 00:27:03 +08:00
SoftFever 913c622574 Remember the last printer and keep AMS-synced filaments across restarts (#17086) 2026-11-01 00:26:17 +08:00
SoftFever 7af3995544 Link the bundled libjpeg instead of the system one on Arch Linux (#17082) 2026-11-01 00:25:21 +08:00
SoftFever 27cafaa06c Read nozzle diameters correctly when the UI language uses a decimal comma (#17079) 2026-10-31 20:35:45 +08:00
SoftFever 7b6c12cf74 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
2026-10-31 16:27:52 +08:00
SoftFever 8e37d7d4b2 Match closer colours and the same filament sub-type in Convenience mode 2026-10-31 14:25:00 +08:00
SoftFever aa66e41e64 Group a filament onto the nozzle that has it loaded in Filament-Saving mode 2026-10-31 14:25:00 +08:00
Kris Austin 7ac46c9a61 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
2026-10-30 22:00:00 -05:00
SwineFlew931 9b4f84a923 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
2026-10-30 21:58:08 -05:00
Arthur Porto fcd96ad91c 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>
2026-10-30 21:56:12 -05:00
Kris Austin 19a78830d7 CI: save a crash dump when a Windows unit test crashes (#17053)
A test process on Windows arm64 sometimes crashes during exit, after
all of its assertions passed, so the test log shows nothing useful.
Have Windows Error Reporting write a full dump on hosted Windows
runners and upload it when the job fails.
2026-10-30 21:52:33 -05:00
Ian Bassi 304924a69a Fix infill and surface filaments overriding each other in Filament for features (#17058) 2026-10-30 18:38:40 -03:00
Kiss Lorand a4a5100879 Fix build-plate-only tree supports inside XY clearance (#17060) 2026-10-30 18:15:56 -03:00
Gazi Faysal Jubayer 98b539c3e6 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
2026-10-30 14:16:22 -05:00
Ian Chua 52c50e626e fix: flatpak bundle uv (#17045)
* fix: flatpak builds weren't bundling UV

* fix: prominently fail if no UV
2026-10-31 02:22:48 +08:00
Kris Austin eda4062d68 Fix crash opening a project with missing or empty settings (#17040)
fix: crash opening a project with missing or empty settings

load_files reads filament_colour from the project config before the
defaults are merged in, and uses it without a null check. A 3MF whose
project_settings.config has no filament_colour crashes on open. The
2.3.1-alpha migration reads sparse_infill_rotate_template and
sparse_infill_pattern the same way.

Check those reads for null. A missing filament_colour keeps the count
at 1, and a missing infill pattern falls back to the default the merge
would apply. The two identical 2.3.1-alpha migrations become one lambda.

The 2.3.1-alpha and newer-version branches also skipped the empty-config
check, so an empty project config reached the same reads. Send every
project config the load skips through one fallback that loads the
geometry only and logs it. It keeps each branch's notice, and a
config-only import now says the 3MF has no project settings OrcaSlicer
can import instead of claiming to load geometry. A same-version file no
longer calls itself old.

Geometry-only imports decided by these checks never added filaments for
objects assigned past the first, because that step ran before them. Run
it after the checks. Count project filaments per file, and drop the two
branches at the end of the chain that no file type reaches.

Fixes #17008
2026-10-31 01:45:47 +08:00
Ian Bassi 3bc827066d Fix tooltip line breaks and ambiguous msgids in all languages (#17055) 2026-10-30 12:52:34 -03:00
Kiss Lorand b1953ab423 Fix transform gizmos not updating after pressing Tab (#16921)
Fix transform gizmo refresh after tabbing
2026-10-30 23:20:19 +08:00
mgoiogana f894d08881 Enable Basque language in preferences (#17052)
* Enable Basque language in preferences

Add Basque to the supported languages list and display it as Euskara in the language menu.

* only formating

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-10-30 12:19:24 -03:00
SoftFever db35f3d098 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)
2026-10-30 19:48:29 +08:00
SoftFever abe28edbe7 Merge branch 'main' into fix/ams-sync-preset-override 2026-10-30 18:50:23 +08:00
SoftFever 23fe913936 Keep a slot's user preset when AMS sync reports the same filament 2026-10-30 18:48:37 +08:00
Chris Martinkovic 6372a37d71 Accessibility Improvements for Buttons and checkboxes (MacOS and Windows) (#16788)
Accessibility improvements for custom UI buttons and checkboxes
2026-10-30 15:51:44 +08:00
HanifKoh 9992b585b0 Name the Filament and the Line in the Adaptive Pressure Advance Model Warning (#17033)
The slice-time warning for an invalid Adaptive Pressure Advance model
only said that the model "for one or more extruders may contain invalid
values". It now names the filament and carries the validator's message,
which identifies the line, on a second line. The check no longer stops
at the first invalid model, so every filament with one gets its own
notification.
2026-10-30 13:31:51 +08:00
HanifKoh 9e5110d593 Keep the Canvas Printable State When the Scene Reloads a Volume (#17003)
Deleting the last modifier of an unprintable object painted it in its
normal colour again: ModelObject::delete_volume gives the remaining
volume a new id, reload_scene then builds a fresh GLVolume for it, and
nothing copied the instance's printable flag into the new volume. The
object list and the slice were right; only the 3D view went stale.

reload_scene now copies ModelInstance::printable into every GLVolume it
creates or reuses, so the canvas follows the model on every reload
instead of relying on each call site to refresh it afterwards.

Checked on Linux with a cube plus a block modifier saved as unprintable:
deleting the modifier turned the cube from grey to its normal colour
before, and leaves it grey now; toggling Printable from the object's
context menu still switches it both ways.
2026-10-30 12:50:03 +08:00
HanifKoh efe735853a Drop a Scheduled Print Host Upload When the Slice Ends Before It Is Queued (#17016)
A print host job scheduled by Print is moved into the print host job queue at
the end of prepare_upload(). When the run ended before that point, because a
post-processing script or a slicing-pipeline plugin failed in upload mode, or
because the slice was cancelled, the job stayed in m_upload_job. Every later
plain slice, even in a new project, then ran prepare_upload() again with the
first job's output name and uploaded (and printed) the file although only Slice
was pressed, until an upload succeeded or OrcaSlicer was restarted.

reset_export() runs after every completed, failed or cancelled slice and on a
new project, and already clears the export path for the same reason. Clear the
scheduled upload there as well.
2026-10-30 12:49:51 +08:00
Roman Romantsov 29e1899571 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>
2026-10-29 18:06:26 -03:00
Kris Austin 2117d28713 Bring back the stale bot for issues and waiting PRs (#17035)
Adds .github/workflows/stale.yml, which replaces orca_bot.yml (removed in b78381e4f5).

Issues go stale after 90 days with no activity and close 14 days later. Enhancement, assigned and milestoned issues are skipped.

PRs are only checked when they have the wait for response label. They go stale after 90 days with no activity and close 14 days later. Drafts are skipped, and branches are not deleted.

Each run is limited to 300 operations, so the backlog gets labeled over about a week.
2026-10-29 16:02:18 -05:00
foXaCe f273fe8ac1 Add printing_filament_types placeholder for the output filename (#14706)
Adds the printing_filament_types placeholder. It lists the filament types that are actually printed on the plate, with duplicates removed, in filament order, joined with "_" (for example ABS_PLA). It works in the file name template and in custom G-code. Before slicing, the file name shows the placeholder unfilled, the same way print_time does.

Nothing changes for templates that don't use it.
2026-10-29 15:53:19 -05:00
Clifford 5ea64864ef 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.
2026-10-29 15:50:57 -05:00
Clifford 7dcceeb9ee Compare the plate's IMEX cache key field by field (#17001)
On IMEX printers, each plate built a string cache key from a dozen
config lookups twice a frame, and resolved the active mode through
find_imex_mode(), which copies the whole mode, G-code included.

The key is now ImexLayoutKey in IMEXZones, compared field by field
against the live config and copied only when something changed. The
active mode's roster and Primary head are resolved only when the key
changes. The G-code preview's carriage marker key is built on the same
struct.

Clearances and the carriage margin are now compared exactly, so a
change under 0.1 mm rebuilds the zones.
2026-10-29 15:48:04 -05:00
HanifKoh 3911c9a56e Restore Read Access to the Extracted AppImage Before Repacking It (#17036)
The Linux build unpacks the AppImage to add the preset caches and packs
it again with appimagetool. The runtime extracts every directory as
0700, and appimagetool's continuous build 333 (2026-10-29) refuses to
pack a tree that other users could not read, so every Linux build has
failed at that step since. Give the whole extracted tree, caches
included, world read and execute access right before repacking.
2026-10-30 04:18:00 +08:00
HMITCHR 3610d8bb35 Do not prebuild pages while a modal dialog is open (#16994)
On macOS the app could hang at 100% CPU when a project with customized
presets was opened into a running app and the message box was closed
while the idle prebuild was building the Project page's web view. The
web view waits for WebKit in a wxYield() loop, and closing the dialog
aborts the modal session, so the reply never arrives.

The idle scheduler now runs a slice only in the main event loop, so no
pages are built while a modal dialog is open. Building resumes when the
dialog closes.
2026-10-29 14:43:38 -05:00
HanifKoh 6112429980 Tell a Printer Without a Filament System Apart From an Unreachable One When Syncing (#17021)
Synchronize filament list showed "OrcaSlicer can't connect to <printer>"
whenever the filament list came back empty. For pull-mode agents that is
also the normal outcome on a reachable printer that has no AMS, CFS or
other multi-material unit, so every such Moonraker printer was reported as
powered off or off the network.

When the printer is online and has already reported its status, explain
that it lists no filament system instead.
2026-10-30 02:59:21 +08:00
Maarten 88806ac63e Add K1 Max to Creality CFS-capable models and K1 family, use the CrealityPrint host for all K1 profiles (#15858)
* Add K1 Max printer model to Creality multicolor capable prints

Not sure why, but for some reason the K1 Max is not under CFS-capable models while all others are.

This corrects that mistake

It also enables using the lidar (enableSelfTest) which the k1 max came with from the factory

* fix(CrealityPrint): treat K1 Max as a K1-family model

K1 Max firmware stores gcodes under /usr/data and uses the stricter
WebSocket protocol, so it needs the same handling as the other K1
models. Add it to is_k1_family().

* profiles: switch K1 Max to the CrealityPrint host

Mirror the rest of the K1 family (#14089): set host_type and
printer_agent to crealityprint so the K1 Max uses the CrealityPrint
LAN host instead of the generic Octo/Klipper host, and bump the
Creality profile version.

* fix(CrealityPrint): cover the K1 *_CFS-C model names

The CFS bundle variants report their own literal /info model names, so
list K1 Max_CFS-C, K1 SE_CFS-C and K1C_CFS-C in both the K1-family set
and the CFS-capable table, next to the existing K1_CFS-C entry.

Also refresh the discovery comments, which still described the K2
platform only.

* profiles: switch the remaining K1 CFS-C variants to the CrealityPrint host

K1 Max_CFS-C, K1 SE_CFS-C and K1C_CFS-C were the last K1 machine
profiles still on the generic Octo/Klipper host after #14089. Set
host_type/printer_agent to crealityprint like their non-CFS siblings.

* Recognise the Creality K2 SE (F016) as a CFS-Capable Printer

The Creality Print host gates CFS filament sync, the colour mapping in the
send dialog and the multi-colour start command on a model table that had no
entry for the K2 SE. Its firmware reports the model code F016, so a K2 SE
Combo was treated as a plain printer: the CFS was never queried, the
Moonraker fallback found nothing and the sidebar reported a connection
failure.

Add F016 to the table under the name Creality Print uses for it.

* Use the CrealityPrint Host for the K2 SE Profile

The K2, K2 Plus and K2 Pro presets talk to the printer through the
CrealityPrint host, which is where CFS sync, the colour mapping and the
multi-colour start command live. The K2 SE preset was still on the generic
Octo/Klipper host with no printer agent, so a stock K2 SE never reached that
code even once its model code is recognised.

Switch it to the same host and agent as the rest of the K2 family. The
bundle version was already raised in this change.

---------

Co-authored-by: Maarten <9350591+mjkl-gh@users.noreply.github.com>
Co-authored-by: Hanif Koh <hanifkoh@outlook.com>
2026-10-29 23:00:35 +08:00
Gazi Faysal Jubayer d28c71c485 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
2026-10-29 08:35:13 -05:00
Kris Austin 59f0cc3806 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
2026-10-29 07:05:05 -05:00
Kris Austin 187baae4ee 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>
2026-10-29 07:03:15 -05:00
Kris Austin 98619b64a2 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.
2026-10-29 07:01:55 -05:00
HanifKoh 0e33e3239a Resolve a Renamed System Preset by Its Old Name in the CLI (#16735)
A project saved before a system preset was renamed names it by its old
name. The GUI finds the renamed preset through renamed_from and refreshes
the project's unlisted values from it; the CLI looked the name up exactly,
logged "No vendor lists the preset" and sliced with the stored values.

find_preset_vendor now matches renamed_from once no vendor lists the name
itself, from each preset's file or from the vendor's preset cache, and
the vendor bundle the CLI loads builds its rename map so find_preset()
returns the renamed preset.
2026-10-29 17:33:48 +08:00
HanifKoh 40d7f25ff9 Bump wxWidgets to the Fork Commit With the Wayland Seat Release Fix (#17015)
* Update WxWidget Git Tag

* Bump the Flatpak wxWidgets Pin to the Same Commit as the Deps Build
2026-10-29 14:45:40 +08:00
Ian Chua 6f20243514 Merge branch 'main' into fix/ams-sync-preset-override 2026-10-29 14:04:45 +08:00
SoftFever 0db324476f Fix crash on New Project after opening the Design tab (#16997)
# Description

Starting a new project or opening one could crash OrcaSlicer if the
Design tab had been opened earlier in the session and OrcaSlicer wasn't
the active window at that moment. It no longer crashes, and the Design
tab is still cleared for the new project as before.

Only reachable with the CAD feature turned on. No change to slicing or
to project files.

# Screenshots/Recordings/Graphs

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

## Tests

Reproduced on a Windows Release build of a feature branch that has the
same code, by driving New Project with OrcaSlicer visible but not the
active window and a debugger attached. Before the change it crashed with
the same stack as the original crash log. After it, the same steps
finish without a crash. This branch (main plus the change) wasn't built
on its own. There's no automated test, because the crash needs a real
change of window focus.

<!--
> 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)
2026-10-29 14:03:19 +08:00
Lam Wei Lun 45a29d391b 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.
2026-10-29 13:37:23 +08:00
HanifKoh 2cb2f0d2e7 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.
2026-10-29 12:08:50 +08:00
Lam Wei Lun c0efd44e56 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
2026-10-29 10:55:35 +08:00
TheLegendTubaGuy d81a212f53 Fix printer agent firmware check and send dialog name list (#16970)
MachineObject::upgrade_display_state lost its initializer when it became an enum, and only Bambu status messages assign it. Printer agent printers (Moonraker, Qidi) kept whatever value was in memory, so the Print and Send dialogs could block an idle printer as "updating firmware". It now starts at UpgradingUnavaliable, the value it had before.

The Send to Printer dialog now labels printers with get_shown_printer_name(), so printer agent printers show "Name (IP)" and Bambu labels are unchanged. Printers that share a name each get their own entry, where before every entry pointed to the first printer with that name.
2026-10-28 15:43:24 -05:00
TheLegendTubaGuy 2e562e8b9e Fix camera orbit speed multiplier ignoring decimals in non-English languages (#16967)
The orbit multiplier preference is stored with a decimal point, but was
parsed with std::stod, which follows the C locale set by the interface
language. With a comma-decimal language, 0.99 parsed as 0 (frozen camera)
and 1.99 as 1. Parse it with string_to_double_decimal_point instead.

Fixes #11534
2026-10-28 15:40:22 -05:00
SoftFever ba756706be Fix crash on New Project after opening the Design tab 2026-10-29 03:02:17 +08:00
Erkan Ozgur Yilmaz d709eb251c Keep Paint on Sharp Edges After Subdivision Mesh (#16484)
Subdivision mesh now keeps paint on sharp edges and corners when "Keep painted feature after mesh change" is on. The paint is remapped onto the subdivided mesh before its vertices are smoothed. That mesh still lies on the old surface, and the smoothed mesh has the same triangles, so the paint data stays valid for it. With the preference off, nothing changes. The menu item no longer says "(Lost color)".
2026-10-28 10:06:29 -05:00
Gazi Faysal Jubayer 4b68224ff4 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.
2026-10-28 09:57:43 -05:00
sirjassam f0827063bd Add PrintaLot PLA profiles for Bambu Lab printers (#16951)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-10-28 11:27:56 -03:00
Nathan 7349ea795b Fix STL export creating duplicate file extensions (#15296)
Strip known model extensions from object names in per-object STL export, so `bracket.stl` exports as `bracket.stl` instead of `bracket.stl.stl`. Leading and trailing dots and spaces are trimmed too, so names like `.stl` no longer become hidden files.

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-10-28 09:14:35 -05:00
HanifKoh 8c2c16f318 Match BBLModelTask to the 02.08.04 Plug-in's Layout (#16973)
The 02.08.04 Bambu network plug-in series appended four strings to
BBLModelTask (design_title, title, instance_title, create_client).
get_subtask() hands the plug-in an OrcaSlicer-allocated BBLModelTask to
fill in place, so the plug-in wrote 128 bytes past the end of the object
and corrupted the heap as soon as the Device tab fetched the subtask of a
connected printer. Routing get_subtask through the Bambu agent (#15908)
exposed it; before that the call hit the Orca Cloud stub.

Add the members so the object is as large as the plug-in's. Older
plug-ins fill only the leading members and leave these empty.
2026-10-28 22:11:49 +08:00
HanifKoh 541ff1da58 Prune the Cached Preset JSONs Once for All Windows Targets (#16926)
* Prune the Cached Preset JSONs Once for All Windows Targets

build_preset_cache.bat pruned each target on its own, reading every
vendor's preset list from the checkout's <vendor>.json. CI names the
checkout as the first target, and pruning it deletes those files, so the
install tree that the portable zip and the MSIX are packed from only
lost the 71 vendor JSONs and kept all 14,600 preset JSONs next to the
caches. The prune also started one PowerShell per vendor and deleted
file by file, which took 28 minutes on the Windows arm64 runner against
under a minute on x64, and set the wall clock of every PR.

The pruning moves to prune_cached_presets.ps1, run once for all targets:
it reads every vendor profile before touching any target and deletes in
a single process, printing how long each target took. The batch script
only validates the targets, installs the caches and queues them.

A test suite exercises the script on a made-up profiles tree, including
the source-then-install-tree order CI uses, and runs in the Windows build
script tests job.

* Resolve the Prune Script Next to the Repo Root, Not %0

The prune label runs after the argument loop has shifted %0 along with
the rest, so %~dp0 named the last target's directory and PowerShell
could not find the script. REPO_ROOT was captured before any shift.

* Read the Preset List From the Target's Own Profile in the Shell Script

The shell script read each vendor's preset list from the source profiles,
which is gone once an earlier --prune-source target has been pruned. No
caller passes the source as a target today, so this is the same latent
dependency the batch file had, removed before it bites.

Ported from https://github.com/OrcaSlicer/OrcaSlicer/pull/16975.

---------

Co-authored-by: Lam Wei Lun <weilun.lam@gmail.com>
2026-10-28 22:11:34 +08:00
Rui Valim d67e0d8dc4 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>
2026-10-28 08:50:51 -05:00
SoftFever 4720370149 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)
2026-10-28 21:39:08 +08:00
Kris Austin 42608687e5 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
2026-10-28 07:17:52 -05:00
Ian Chua 2ca7bdf23c fix: ams sync overriding custom preset 2026-10-28 20:15:14 +08:00
TheLegendTubaGuy e66569a966 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.
2026-10-28 08:04:52 -03:00
SoftFever c7fc22288e Fix Windows startup failure on an OrcaSlicer.conf without a trailing newline 2026-10-28 18:00:29 +08:00
Lam Wei Lun aa3291b380 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.
2026-10-28 15:55:22 +08:00
Ian Chua 3a0517831f fix: warn on preset save when plugin not found (#16929)
* fix: warn on preset save when plugin not found

* refactor: build the unsaved-changes save config in one place

* Fixes clang-tidy

---------

Co-authored-by: Lam Wei Lun <weilun.lam@gmail.com>
2026-10-28 13:02:05 +08:00
Gazi Faysal Jubayer 3322f6101c Set the Snapmaker U1's printer structure to CoreXY (#16914)
The U1 profiles never set printer_structure, so every U1 preset showed Undefined. Set it to corexy on fdm_U1, the base all five U1 nozzle presets inherit, and bump the Snapmaker bundle version to 02.04.00.20.

Slicing output is unchanged: the code only branches on i3, so CoreXY and Undefined take the same paths.

Fixes #16413
2026-10-27 21:15:47 -05:00
yw4z e410cf3656 Fix crash at exit from the preset sync thread (#16948)
The preset sync thread pushed bundle notifications to the notification manager directly from the thread. At exit the Plater is destroyed before OnExit() joins the thread, so a pass still running could crash in push_notification_data().

The notifications are now pushed on the GUI thread with CallAfter() and dropped once the app is closing or the sync is stopped. The bundle loop also returns as soon as the sync is stopped, so the thread exits quickly and does not delete the subscribed bundles it did not reach.
2026-10-27 21:01:03 -05:00
Fernando Marino` 5897d95d4d Fix filament slot editor desync across multi-material presets (#15896)
On printers where a filament slot's edit button opens the editor directly (IDEX, toolchanger, multi-extruder), cancelling the unsaved-changes dialog wrote the preset still open in the editor into the clicked slot.

- `switch_to_tab()` now compares the slot's assigned preset with the one open in the editor to decide whether to reload.
- The edit button sets `editing_filament` only after `switch_to_tab()` succeeds, as `Sidebar::edit_filament()` does.
- `UnsavedChangesDialog::build()` checks the `find_preset()` result for null.

Fixes #15767
2026-10-27 21:00:02 -05:00
Lam Wei Lun 97e6c71793 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
2026-10-28 08:42:10 +08:00
TheLegendTubaGuy 9c3b0a86e1 Fix realistic view shadows for by-object prints and the section view (#16942)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-10-27 20:54:58 -03:00
Ian Bassi e105d3c587 Fix support painting overhang highlight missing faces at the threshold angle (#16957) 2026-10-27 20:52:32 -03:00
Clifford 59aa101ea6 Check mixed filaments against their component filaments' extruders (#16947)
A mixed filament prints with its component filaments, each on its own extruder, but the placement checks resolved it as a filament of its own. On non-Bambu multi-tool printers this could block an object because an extruder that prints none of the components can't reach it, or allow it when a component's extruder can't.

Mixed filaments are now expanded to their components before extruder resolution in the printable area check (GUI and CLI), arrange and the exclusion volume preview, Print::validate(), and brim and support exclusion clipping.

Fixes #16945
2026-10-27 18:33:28 -05:00
Eminy 3936995b6e Update Turkish translations (#16943)
* Update Turkish translations

* Match option names to the existing Turkish labels

* Drop the AI Translated comments from the reviewed Turkish entries

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-10-28 01:34:52 +03:00
Grzegorz Libiszewski 6d2869c430 Allow network upload of manual multi-material prints to Flashforge printers without IFS (#15547)
Uploading a multi-filament plate to a Flashforge printer failed with "Enable IFS" even when the printer has no IFS and the profile uses Manual Filament Change. The upload dialog now skips the IFS requirement when Manual Filament Change is on, and starts with IFS unchecked in that case on printers that have one.

Fixes #15307
2026-10-27 15:28:44 -05:00
foXaCe 9f39b8347f Fix Qidi exported filename showing slot-1 material instead of the printed one (#16922)
fdm_process_qidi_x3_common used {filament_type[0]} in filename_format, so files were named after the material in filament slot 1. Use {filament_type[initial_tool]} like the other Qidi process presets, and bump the Qidi profile version to 02.04.00.20.
2026-10-27 14:20:07 -05:00
Clifford b7ecf1b295 Fix false "G-code path exceeds the printable range" when an extruder area is inset on several sides (#16931)
The post-slice check compared each path with the bounding box of the region its nozzle can't reach. When the nozzle's printable area is inset on two or more sides, that region is L-, U- or frame-shaped and its box covers the whole bed, so every slice failed. The check now tests the path's box against the region itself, and the same result sets limit_filament_maps.

Fixes #15746
2026-10-27 14:16:48 -05:00
Downtime 731a08d1c6 fix(gui): improve code -1 connection failure guidance (#16273)
When the Bambu network plugin reports a failed LAN connection with code -1, the dialog now lists three things to check under the existing error line. They cover the network and IP address, the network plug-in version in Preferences, and a missing or damaged certificate in printer.cer.

The error line keeps its existing msgid, and each hint is its own translatable sentence.
2026-10-27 13:58:44 -05:00
Kuzuri a30ca5e54a By object: print tall objects later when the list order would collide (#14987)
When the object list order fails the height-to-rod check, look for an order that passes. Each object taller than the rod height prints after every object it overlaps in Y, keeping the list order where possible. A list order that already passes is kept as it is.

When an object has to print later than its place in the object list, a warning names it and links to it. If no order works, the "too tall" error is still reported.

Adds tests in test_print.cpp for both cases.
2026-10-27 13:53:40 -05:00
SoftFever e4e00e9746 Fix macOS notarization stapling failing on GitHub-hosted runners (#16939)
Since mid-October, `xcrun stapler staple` on GitHub-hosted macOS runners loses its connection to Apple's ticket service (-1005, Error 68) after notarization is accepted, and all three retries fail. The stapler fetches the ticket over HTTP/3 on UDP 443, which the hosted runners drop (actions/runner-images#14924). A new step blocks outbound UDP 443 before signing, so the stapler uses TCP. It is skipped on self-hosted runners, where the firewall rule would outlive the job.
2026-10-27 13:36:20 -05:00
Eric Lin 7125a546b8 Fix Slice sometimes needing a second click (#15180)
The GUI re-applies the unchanged config after every slice. filament_map, filament_volume_map and filament_nozzle_map are adopted from the new config but were left in full_config_diff, because the erase was commented out. That invalidated psGCodeExport on every reapply, so the slice that had just finished was thrown away. Erase them from full_config_diff too, including filament_nozzle_map in manual map mode.
2026-10-27 10:53:44 -05:00
TheLegendTubaGuy b6ca378b23 Apply the print dialog's Box mapping on Qidi printers (#16723)
With printer agents on, the Qidi agent now uses the Box slot picked for each filament in the print dialog. After the upload it writes `SAVE_VARIABLE VARIABLE=value_t<n> VALUE="'slot<m>'"` for each mapped filament, which the firmware's T<n> macros read. Then it starts the print through `/printer/print/start`, because the Max 4, Q2, Q2C and Plus 5 only open prints from the copy that Moonraker's print start makes.

- `MoonrakerPrinterAgent::start_local_print` now ends with a virtual `print_uploaded_file()`. The default still sends `SDCARD_PRINT_FILE`, so other Moonraker agents are unchanged.
- Box units show as "Qidi Box 1", "Qidi Box 2". Agents can set an optional `display_name` on an AMS unit.
- New agent flag `native_device_tab`. Qidi sets it to false, so its native Device and Calibration tabs are hidden and the web page becomes the Device tab.
- The Moonraker agent retries its first connection with the status stream's backoff. A disconnect, a newer connection or closing the app stops the retries.
- The print dialog fetches filament data itself for agents that only send it when asked, so the slot picker shows the Box units without a sidebar sync.
- Agent printers show their address in the print dialog's printer list instead of "(LAN)". Bambu printers keep "(LAN)".
- A single nozzle whose size the printer hasn't reported shows no size instead of "Unknown".
2026-10-27 10:47:06 -05:00
Eldenroot af16875afb 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.
2026-10-27 10:10:20 -05:00
SoftFever 65aab6bcf7 Stop preset cloud deletes from retrying forever (#16928)
# Description

Deleting a custom printer preset queued every compatible system filament
for a cloud delete. These ids can never name a cloud profile, so
OrcaSlicer resent each one about once a minute for as long as it ran.
Deletes for profiles the signed-in account doesn't have were also resent
forever, even across restarts. After an account switch, a pending delete
could go out with the other account's token.

With this change:
- Only the user's own presets are queued.
- A delete is finished once the server confirms the profile is gone or
there was nothing to delete.
- Network failures are no longer mistaken for "not found".
- Other failures wait longer between attempts, up to an hour.
- A delete is only ever sent with its own account's token.
- A delete still pending when OrcaSlicer quits is sent at the next
start. That includes a custom printer's, which were missed before.

Deleting a custom printer also deleted every user filament and process
preset that worked with it, including presets with no printer
restriction that other printers use. It now deletes only the presets
made for that printer alone, and the confirmation dialog counts exactly
those.
- **Inherited presets stay.** A preset made for the printer is kept if a
kept preset inherits from it, so the kept preset still loads.
- **Copies of bundle presets count as the printer's own.** Presets
copied from a bundle's when the printer was created are treated like the
printer's other presets.

Saving another preset's settings over an existing synced preset deleted
that preset's cloud profile right after uploading the replacement. Other
devices then dropped the preset until the saving device restarted. The
replacement now takes over the profile and updates it. When the update
gives a preset with no parent a parent, or takes it away, other devices
move the preset's file instead of keeping a second copy.

Subscription polls downloaded the whole subscription list every minute,
although the gateway can answer 304 Not Modified when it hasn't changed.
Each poll now asks whether the list the signed-in account received last
is still current, and reuses it when it is. One account's list is never
reused for another, or kept after signing out.

There is no change to slicing.

# Screenshots/Recordings/Graphs

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

## Tests

**Built:** macOS arm64 Release, with the app and the test suite.

**New unit tests**, in `tests/slic3rutils/test_cloud_delete_queue.cpp`
and new cases in `test_orca_cloud_agent.cpp`:
- **What they cover:**
- ownership of each delete, and account switches, including one in the
middle of a request;
  - the retry waits;
- the scan for deletes left over from an earlier run, custom printers'
among them, and cleanup of their `.info` files.
- **How the agent cases run:** against a local HTTP server, with real
requests. They also cover a token refresh that switches the session to
another account during a retry.
- **Results:**
- All 19 queue test cases and all 29 cloud agent test cases pass, in
random order.
- Most of the new tests use code this PR adds, so they can't build
without it.

**New subscription tests**, in `test_orca_cloud_agent.cpp`, cover:
- a 304 answer reusing the list received last;
- a changed list replacing it;
- a list never being revalidated for another account, or after signing
out.

**New preset tests**, in
`tests/libslic3r/test_preset_bundle_loading.cpp`, check:
- which presets go with a deleted printer;
- that a preset a kept preset inherits from stays;
- that a preset copied from a bundle's for a new printer is the user's
own;
- that saving another preset over a synced preset keeps its cloud
profile, and leaves no `.info` that would turn into a delete;
- that a cloud update giving a root preset a parent leaves no copy of it
in `base`.

They and all `[Preset]` test cases pass in random order: 202 on macOS
and the 198 that build on Windows.

**Full `slic3rutils` suite, without the Python tests:** passes, except
`JPEG texture decoding coexists with thumbnails and video frames`. It
fails the same way on its own and doesn't touch this code.

**Full `libslic3r` suite:** passes, except two `[TextureImport]` cases
that decode JPEGs. They fail the same way on `main`.

**Run by hand on two machines**, macOS arm64 and Windows 11 arm64,
signed in to the same Orca Cloud account against api.orcaslicer.com.
Both machines ran `c34532ae`. Results:
- **Deleting a custom printer:**
- The printer had a filament and a process made for it alone. It also
had a filament made for it alone that an unrestricted filament inherits
from.
  - The dialog said "1 filament preset and 1 process preset".
  - Only the printer and those two presets were deleted.
- The filament inherited from was kept, and the filament inheriting from
it still loaded after a restart.
- A filament shared with another printer, an unrestricted filament and
the account's other user presets were kept.
- **Deleting the same printer on the second machine:** its profiles were
already gone from the cloud. Each delete got one 404 and finished
without a retry.
- **Deleting a custom printer while offline:**
- The deletes were retried after 1 and then 2 minutes, and the `.info`
files stayed.
- The app was then quit while offline, the network reconnected, and the
app started again.
- The deletes of the printer and its filament were sent at startup, and
their `.info` files were removed.
  - The printer was not brought back by the startup pull.
- On an earlier run, a filament deleted offline was retried after 1, 2
and 4 minutes, and the attempt after reconnecting succeeded.
- **`.info` files left by older builds, at startup:**
  - A system preset id sent no request.
- Profiles the cloud doesn't have, one of them a custom printer's, each
got one 404 and finished.
  - An entry owned by another account was never sent.
- **Deleting a filament from the Edit Filament dialog:** its delete was
sent and succeeded.
- **Saving another preset over a synced preset**, on `1e1f9dc2` and then
`dc2400b2`:
- Each save was on the Mac. It uploaded an update under the same id and
sent no delete.
  - Windows got the new settings at its next start.
- Two of the saves replaced a preset with no parent, and on the Mac its
file moved out of `base` with nothing left behind.
- On `1e1f9dc2`, Windows kept the old copy in `base` as well. On
`dc2400b2` it moved its copy the same way the Mac did.
- **Subscription polls:** every poll after the first got a 304 and
logged `(unchanged)`, including the first poll after the network came
back.

**Not run by hand: copying a bundle's presets for a new printer.** The
account has no subscribed bundles, so this is covered only by the unit
test.

**Not run: switching accounts.** This should be checked by hand with two
accounts before merging:
1. As account A, go offline and delete a synced user preset.
   - Expected: the delete fails and its `.info` file stays.
2. Sign in as B and go back online.
   - Expected: nothing of A's is sent.
3. Sign back in as A.
- Expected: the delete is sent with A's token and the `.info` is
removed.

<!--
> 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)
2026-10-27 22:29:55 +08:00
Ioannis Giannakas 176b1dc63d Fix Arachne wall order at pinched holes and next to one wall on top (#16894)
* Arachne wall order pinch and top band

* Cover Inner/Outer and Outer/Inner in the one wall on top order test
2026-10-27 14:08:09 +00:00
SoftFever dc2400b235 Remove a preset's old copy when a cloud update moves its file 2026-10-27 22:05:41 +08:00
SoftFever 1e1f9dc27a Keep a preset's cloud profile when saving another preset over it 2026-10-27 21:52:44 +08:00
TheLegendTubaGuy 4c7928d8aa Fix the prime tower being decided from the previous model's filaments (#16326)
The late normalize_fdm_2 pass in Print::apply counted filaments before the regions were rebuilt, and it could only turn options off. After a filament change, the first slice had no prime tower, and export sliced again with one.

The late pass now runs after the region rebuild, on a copy of the config from before normalization. It can turn the tower on as well as off, and it re-slices the objects when it changes the tower. PartPlate::load_gcode_from_file no longer applies twice.

Fixes #15991
2026-10-27 08:34:40 -05:00
Clifford c7bc1b27a5 Fix extruder printable area placement checks for non-BBL multi-nozzle printers (#14140)
Non-Bambu printers do not regroup filaments, but the placement check
before slicing treated them as if they did. In auto map mode it only
flagged a filament that fits on no extruder, so an object outside its
own extruder's printable area got no warning until slicing failed.

On these printers the check now uses the filament map from
get_effective_exclusion_filament_maps(), the same map the
exclusion-volume check and arrange use. A conflict on a third or later
extruder now shows a generic message. Before, it blocked slicing with
no message. The "Click here to regroup" link is hidden on non-Bambu
printers.

Fixes #14070
2026-10-27 08:17:33 -05:00
HanifKoh be4eff43f4 Fail the Profile Checks When a Changed Bundle Keeps Its Version (#16923)
The app installs a bundled profile set only when its version is newer than
the installed one, and the OTA profile update is named after the version, so
a vendor bundle merged without a bump in its <Vendor>.json never reaches a
user. Nothing checked that: two recent OrcaFilamentLibrary additions and a
Qidi printer model merged with their version unchanged.

Add a version-check command to orca_profile_tool.py that diffs two revisions
(or the working tree against the commit it left main at), groups the changed
files by vendor bundle, and fails unless every changed bundle's version is
newer than before and written as four numbers. The fourth component folds
into the third as the app reads it, so 02.04.00.100 is not newer than
02.04.01.00. A bundle the base does not have, blacklist.json and the user
preset directory are not judged.

Run it as the version_bump check in the Check profiles workflow against the
branch a PR merges into, and in check_profile.sh and check_profile.ps1,
which take --base / -Base to compare with another ref and skip the check for
a --profiles tree outside a git checkout.
2026-10-27 21:10:54 +08:00
HanifKoh a50b0a167b Bump the Version of Nine Vendor Bundles Changed Since Their Last Bump (#16924)
The app installs a bundled profile set only when its version is newer than
the installed one. These bundles changed on main after their version was
last raised, so users who already had them never received the change:

  Qidi           02.04.00.18 -> 02.04.00.19  X-Smart 5 added
  Elegoo         02.04.00.11 -> 02.04.00.13  reverted below the 02.04.00.12
  OrcaArena      02.04.00.07 -> 02.04.00.09  and 02.04.00.08 nightlies shipped
  M3D            02.04.00.05 -> 02.04.00.06  cover images and bed textures
  Meltingplot    02.04.00.01 -> 02.04.00.02
  Pragostroj     01.00.01.00 -> 01.00.01.01
  RH3D           02.04.00.05 -> 02.04.00.06
  WonderMaker    02.04.00.04 -> 02.04.00.05
  Wanhao France  02.04.00.06 -> 02.04.00.07  fdm_machine_common.json fix

Elegoo and OrcaArena skip a number because the version the revert went back
to is below what nightlies from 2026-09-29 to 2026-10-08 installed.
2026-10-27 21:10:36 +08:00
SoftFever c34532aefa Recover pending custom-printer deletes and keep parents of kept presets
Presets cloned from a bundle's for a new printer are the user's own, and every
cloud delete now passes the same check that the preset is the user's synced one.
2026-10-27 20:46:21 +08:00
SoftFever 474980a51b Revalidate the subscription list instead of downloading it on every poll 2026-10-27 18:53:55 +08:00
SoftFever c313f3328b Keep shared user presets when deleting a custom printer 2026-10-27 18:35:10 +08:00
SoftFever f5b6d95cae Include the headers clang-tidy asks for in CloudDeleteQueue 2026-10-27 18:34:58 +08:00
SoftFever bec67ab2c7 Stop preset cloud deletes from retrying forever 2026-10-27 17:52:57 +08:00
HanifKoh e28af4e5f2 Bump the Orca Filament Library Version to 02.04.00.20 (#16919)
The School House Spools filaments from #16780 were added without a version bump, so datadirs that already hold 02.04.00.16 (the 2.5.0 alpha) never reinstall the library. Nightlies from the OTA test (#16017, #16151) shipped 02.04.00.17 to .19, so the bump skips past those too.
2026-10-27 13:48:41 +08:00
TheLegendTubaGuy 70b0530c22 Keep the mouse pointer visible after closing a webview from the keyboard on Windows (#16880)
Keep the mouse pointer visible after closing a webview from the keyboard

WebView2 runtime 152+ hides the pointer while typing and only shows it
again on a mouse event inside the webview. Closing the Speed Dial with
Enter after typing left the pointer hidden over all of OrcaSlicer until
the dial was reopened (WebView2Feedback#5687, still open on 155).

Disable the runtime's HideCursorWhileTyping feature at startup on
Windows, before any webview is created, unless the user already set
WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS.

Fixes #16868

Co-authored-by: Lam Wei Lun <weilun.lam@gmail.com>
2026-10-27 13:42:16 +08:00
HanifKoh f92dc78be0 Check Moonraker Free Space Before Reporting Storage (#16903)
* Report storage on every Moonraker status push

MachineObject sets the storage state on every push, first from "sdcard"
and then from home_flag bits 8-9. The Moonraker agent sent neither, so
each push reset the state to NO_SDCARD and the send dialog blocked with
"Storage needs to be inserted before printing". Moonraker printers always
have storage (virtual_sdcard), so report it in both places.

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

* Check Moonraker Free Space Before Reporting Storage

Report storage only when the gcodes root has free space, read from
disk_usage in /server/files/directory?path=gcodes, instead of always
reporting it. The status stream checks before the subscription and again
from the read loop every 30 s. A check that fails counts as no storage.

Move the Http::get boilerplate of the device info, status, object list
and storage queries into one get_json helper.

* Ask to Insert Storage or Free Up Space Before Printing

A printer agent now also reports no storage when its disk is full, so
the messages for that state say to free up space as well. The two
"before send(ing) to printer" variants share one string.

---------

Co-authored-by: dr-apple <15102858+dr-apple@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 13:27:04 +08:00
HanifKoh f7d23705ea Name the Tool When a Temperature Tower Steps the Nozzle Temperature (#16898)
The temperature tower re-targets the hotend at every layer with a bare
M104. Every other temperature command on a multi-tool printer names its
tool, and the firmware applies a tool-less M104 to whichever tool it
considers active, so a tower assigned to any tool but the first heated
the wrong nozzle. Pass the tool printing the tower, as the first-layer
M109 right before it already does.
2026-10-27 12:22:50 +08:00
packerlschupfer adea4e48a6 CLI: report configuration values that were substituted with defaults (#16305)
When a preset or a 3mf has an enum or bool value this build cannot parse, the config loader replaces it and records a substitution. The CLI only logged these at info level, which the default log level filters out. A preset with an invalid ironing_type therefore sliced with ironing off, printed nothing and exited 0.

Each substitution is now printed to stderr and added to result.json's warnings array with the class config_value_substituted. Exit codes are unchanged, and --strict does not escalate these warnings. test_cli_strict.sh has a new case for it.
2026-10-26 21:35:55 -05:00
packerlschupfer 35235d9a43 CLI: write result.json and --pipe progress even when a name is not valid UTF-8 (#16303)
nlohmann's dump() throws type_error.316 on a string that is not valid UTF-8. Object names come from file names, which on Linux can be any bytes. In record_exit_reson() the catch-all swallowed the throw, so no result.json was written. In cli_callback_mgr_t::notify() nothing caught it, so a --pipe run aborted.

Both calls now dump with error_handler_t::replace, which writes U+FFFD in place of the invalid bytes. Output for valid UTF-8 is unchanged.
2026-10-26 21:32:54 -05:00
Kiss Lorand ee6d195b0e Fix slicing validation for multipart objects outside the plate (#16564) 2026-10-26 18:57:25 -03:00
Eldenroot 63048e3858 ENH: Add a Select All button to the timelapse and model file lists of the printer storage (#16716)
* Add a Select All button to the printer's timelapse and model file lists

While files are being selected for batch download or deletion, one click now
selects every file of the list that is shown.

Ported from BambuStudio 2.5.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYra1zfuVBUu8unsTTXHVN

* Keep Select All visible and let it start the selection like BambuStudio

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYra1zfuVBUu8unsTTXHVN

* Let the Select All button clear the selection once every file is selected

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYra1zfuVBUu8unsTTXHVN

* Revert the Select All toggle: Cancel already clears the selection

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYra1zfuVBUu8unsTTXHVN

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-26 23:34:37 +03:00
Error404JoyNotFound e52c735d1a Fix unindexed vector placeholders reading the wrong filament or extruder (#16211)
Unindexed vector placeholders like `{z_hop}` read `filament_map` as a 0-based index, so they used the wrong slot. Per-extruder options now use `filament_map - 1`, and options that filament overrides expand per filament (`filament_extruder_override_keys`) use the current filament.

Fixes #12804
2026-10-26 13:45:55 -05:00
yw4z 2801c679b1 Fix: Prevent saving profiles with non valid names (#15579)
Disable OK in the Save preset dialog while the name is invalid. Before, an invalid name such as an empty one could still be saved.

The Save preset and Physical Printer dialogs now share one name check, check_preset_name(). It adds three new checks: control characters, Windows reserved device names (CON, PRN, AUX, NUL, COM0-9, LPT0-9), and a length limit of 230 bytes and 150 UTF-16 units, so the save file fits within the Linux file name and Windows path limits.
2026-10-26 13:38:47 -05:00
Andrew Gribben 21d2856429 Size painted segmentation from the filament count, not the color palette (#15998)
multi_material_segmentation_by_painting sized its per-filament output from filament_colour, but apply_mm_segmentation reads one entry per filament_diameter. When the palette was shorter than the filament list, slicing an object painted with a filament that had no color read past the end and crashed. Size it from filament_diameter instead.

Adds a regression test that paints one side of a cube with filament 2 while filament_colour has one entry.
2026-10-26 13:36:37 -05:00
yw4z ab24043937 Make plate renames undoable and refresh G-code that uses {plate_name} (#16900)
Renaming a plate now creates an undo snapshot, so a rename is its own undo step and marks the project as modified. All four rename paths use the new `Plater::rename_plate()`.

When a G-code template uses `{plate_name}`, renaming a sliced plate invalidates only the G-code export step, so the next slice only re-exports the G-code. `filename_format` is excluded because the file name is built from the current plate name at export time.

The "Rename Plate" undo snapshot is from #16141.

Co-authored-by: cook0001 <79376116+cook0001@users.noreply.github.com>
2026-10-26 13:25:16 -05:00
RrrrobertB1992 e00f4b7008 Moonraker printer agents: report a color list for every slot (#16630)
Moonraker agents now send cols and ctype for every tray, the same fields the Bambu AMS sends. A single-color tray sends its one color with ctype 1. A multi-color spool sends all its colors once an agent fills the new AmsTrayData::tray_colors. Sending cols for every tray keeps update_filament_multi_color() from stopping at the first tray that has none.
2026-10-26 13:16:15 -05:00
Ian Bassi 0ef9015904 Ask for the size of a primitive when adding it (#16848) 2026-10-26 15:01:47 -03:00
Lam Wei Lun 0b4e7e9e2a Handle Unreadable Bundled uv Path in Python Plugin Init (#16888)
boost::filesystem::exists() threw on Windows error 1005 for the build-time uv path, which skipped the packaged uv fallback. Use the error_code overloads so an unreadable path counts as absent, and look up uv before scoped_interpreter is created so a failure there cannot leave the interpreter running.
2026-10-27 00:28:53 +08:00
SoftFever 22220136d4 Translate the new strings into French (#16908)
# Description

Translates the 221 new strings in the French catalog, so it has no empty
entry left. Most are the messages that explain why a setting is hidden
or disabled, and each one quotes the setting's existing French label or
dropdown value in « », so users can find what to change. Where the
English says "Marlin firmware G-code flavor", the translation names the
dropdown value it refers to, Marlin 2. The rest are the plate menu's
Order By, the discrete-GPU and high-precision G-code options, the color
picker and the two plugin network-access prompts.

Four entries carry a `# Needs human review` note. Three are SLA strings
about the pad, whose French terms (Socle, Élévation de l'objet) come
from PrusaSlicer because this catalog has none. One has English that
says "wrapping detection" while the setting it gates is "Enable clumping
detection".

The French glossary cells these strings rely on are filled in
OrcaSlicer/OrcaSlicer_WIKI#422.

# Screenshots/Recordings/Graphs

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

## Tests

`scripts/run_gettext.sh --full` exits 0 and leaves the catalog
unchanged, and `msgfmt --check-format --check-header` and the skill's
`check` report no errors for fr. The strings were not checked in the
running app.

<!--
> 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)
2026-10-26 23:40:32 +08:00
SoftFever 6e8a14f3aa Translate the new strings into French 2026-10-26 23:34:21 +08:00
SoftFever 01e6f17b13 Translate the new strings into German (#16907)
# Description

Translates the 221 new strings in the German catalog, so it has no empty
entry left. Most are the messages that explain why a setting is hidden
or disabled, and each one quotes the setting's existing German label or
dropdown value, so users can find what to change. Where the English says
"Marlin firmware G-code flavor", the translation names the dropdown
value it refers to, Marlin 2. The rest are the plate menu's Order By,
the discrete-GPU and high-precision G-code options, the color picker and
the two plugin network-access prompts.

Five entries carry a `# Needs human review` note. Three are SLA strings
about the pad, whose German terms come from PrusaSlicer because this
catalog has none. One has English that says "wrapping detection" while
the setting it gates is "Enable clumping detection". One uses the
label's wording Druckkammer-Temperatursteuerung instead of the
glossary's chamber-temperature cell.

The German glossary cells these strings rely on are filled in
OrcaSlicer/OrcaSlicer_WIKI#421.

# Screenshots/Recordings/Graphs

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

## Tests

`scripts/run_gettext.sh --full` exits 0 and leaves the catalog
unchanged, and `msgfmt --check-format --check-header` and the skill's
`check` report no errors for de. The strings were not checked in the
running app.

<!--
> 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)
2026-10-26 23:15:17 +08:00
SoftFever 69756de353 Translate the new strings into German 2026-10-26 23:12:50 +08:00
SoftFever 3ce5122b22 Translate the new strings into Japanese (#16905)
# Description

Translates the 217 new strings in the Japanese catalog, so it has no
empty entry left. Most are the messages that explain why a setting is
hidden or disabled, and each one quotes the setting's existing Japanese
label or dropdown value, so users can find what to change. Where the
English says "Marlin firmware G-code flavor", the translation names the
dropdown value it refers to, Marlin 2. The rest are the plate menu's
Order By, the discrete-GPU and high-precision G-code options, and the
color picker.

21 entries carry a `# Needs human review` note. Most mention the prime
or wipe tower, a term the glossary still marks as unsettled for
Japanese. The others are three SLA strings about the pad, three that
quote the existing label エアフィルトレーションを有効化 where the glossary has 空気ろ過,
and one whose English says "wrapping detection" while the setting it
gates is "Enable clumping detection".

The Japanese glossary cells for Single Extruder Multi Material and Air
filtration are filled in OrcaSlicer/OrcaSlicer_WIKI#420.

# Screenshots/Recordings/Graphs

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

## Tests

`scripts/run_gettext.sh --full` exits 0 and leaves the catalog
unchanged, and the skill's `check` (which includes `msgfmt
--check-format`) reports no errors for ja. The strings were not checked
in the running app.

<!--
> 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)
2026-10-26 22:53:19 +08:00
SoftFever caa777f256 Translate the new strings into Simplified and Traditional Chinese (#16904)
# Description

Translates the 217 new strings in both Chinese catalogs, so neither has
an empty entry left. Most are the messages that explain why a setting is
hidden or disabled, and each one quotes the setting's existing label in
that catalog, so users can find what to change. Where the English says
"Marlin firmware G-code flavor", the translations name the dropdown
value it refers to, Marlin 2. The rest are the plate menu's Order By,
the discrete-GPU and high-precision G-code options, and the color
picker. Three SLA-only strings about the pad carry a `# Needs human
review` note.

The glossary terms these strings use are added in
OrcaSlicer/OrcaSlicer_WIKI#419.

# Screenshots/Recordings/Graphs

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

## Tests

`scripts/run_gettext.sh --full` exits 0 and changes nothing in either
catalog, and the skill's `check` (which includes `msgfmt
--check-format`) reports no errors for zh_CN and zh_TW. The strings were
not checked in the running app.

<!--
> 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)
2026-10-26 22:52:39 +08:00
HanifKoh a0e51b4044 Keep Cut Connector Holes at Full Depth While They Break Through the Cut Face (#16893)
Every connector hole was moved 0.05 mm toward the cut face so it would open
the face instead of leaving a coplanar skin. Moving the whole volume also
moved its far end, so a plug hole was 0.05 mm shallower than depth plus
tolerance, and each dowel hole 0.05 mm shallower than depth plus half the
tolerance.

Grow the plug and snap hole by the overlap at the face instead of moving it,
and cut each dowel half just past the plane so the holes keep their depth
and still overlap the face.

The connector tests now measure each hole from the cut face, which is what
shows the missing 0.05 mm, and also run on a tilted, shifted cut plane.
2026-10-26 22:45:30 +08:00
SoftFever f3ffd6b1a6 Translate the new strings into Japanese 2026-10-26 22:42:17 +08:00
SoftFever a4fb4e951c Translate the new strings into Simplified and Traditional Chinese 2026-10-26 22:11:05 +08:00
SoftFever 2dc3c92d0a update locale 2026-10-26 21:47:55 +08:00
Ian Bassi b4772dca38 Add Order By to the plate menu (name, filament, height, size) (#16850) 2026-10-26 10:43:41 -03:00
Dipl.-Ing. Raoul Rubien, BSc 1f8111526c Fix GCC dangling-pointer, maybe-uninitialized and use-after-free warnings (#10750)
Give two Eigen `auto` locals in SLAPrint.cpp and Selection.cpp concrete types so they no longer refer to destroyed temporaries. Zero-initialize two vectors in GLGizmoBrimEars.cpp, and build each wxDataViewItem before its delete in ObjectDataViewModel::Delete.
2026-10-26 08:22:04 -05:00
Error404JoyNotFound 4a0d0bb553 Split the cut tool's dowel depth tolerance evenly between both holes (#16020)
Dowels are centered on the cut plane, so the extra depth from the tolerance already splits evenly between the two holes. Only plugs and snaps are now shifted along the cut normal.

The test fix that finds the cut parts by their position in the object is from HanifKoh.

Co-authored-by: HanifKoh <76276251+HanifKoh@users.noreply.github.com>
2026-10-26 08:13:16 -05:00
thereprocase bff0487b76 Fix CLI crash and dropped layers when loading filaments without colours (#16867)
Filament presets have no `filament_colour`, so loading two or more filaments in the CLI without `--filament-colour` left a one-entry palette. Code that sizes per-filament tables from it then read out of bounds, which crashed the slicer or dropped the layers for filament 2. The CLI now pads `filament_colour` to the filament count and rebuilds the flush matrix. Adds a CLI test that slices a per-layer change to filament 2.
2026-10-26 07:51:50 -05:00
TheLegendTubaGuy aa069d90fb Fix plates keeping stale objects after a cut (#16881)
The cut and "Delete all connectors" removed objects without telling the plates, so the plates kept counting objects by their old index. Prime tower previews showed another plate's filaments, and Select All picked up objects from other plates.

Removing a whole object now also removes every instance of it from the plates, not just the first one.
2026-10-26 07:46:30 -05:00
Noisyfox 13a40b47a2 Fix MSVC-only lazy preset dialog build failure (#16899)
* Fix MSVC-only build failures after MainFrame forward declarations

* Defer lazy preset dialog instantiation with unique_ptr

* Include memory directly for std::make_unique
2026-10-26 20:34:34 +08:00
QIDI-Official 1433316b55 New Model X-Smart 5 (#16734)
Merged by /bot merge on behalf of @QIDI-Official (id 345232244).
Grants: resources/profiles/Qidi, resources/profiles/Qidi.json
Head: 0a65583c3c
2026-10-26 11:32:29 +00:00
Lam Wei Lun e021ccb316 Fix missing-plugin notices not appearing on preset switch (#16897)
The notices were rebuilt only during plate validation, so selecting a
preset that needs a missing plugin on an empty plate showed nothing.
new_project() cleared the notices but kept their shown state, so they
never came back.

Refresh the notices on every preset change or edit, when a plugin loads,
unloads or has a capability disabled, after a plugin is deleted or
unsubscribed, and at the end of new_project(). A notice that is no
longer on screen is pushed again even when its set of plugins is
unchanged.
2026-10-26 18:10:23 +08:00
SoftFever 3e8cd1a505 Match filament presets by filament_id/setting_id from Moonraker lane_data (#14423)
## Description

When OrcaSlicer reads `lane_data` from Moonraker, it previously matched
filament presets only by material type. This PR adds matching by
`filament_id` and `setting_id` fields from `lane_data` — fields
populated by tools like spoolman-lane-sync and ACE Pro — before falling
back to material-type matching.

This allows OrcaSlicer to automatically select the correct filament
preset when lane data carries a known preset identifier.

## Changes

- Add `PresetCollection::filament_id_by_id_or_name()` in
`Preset.cpp`/`.hpp` which resolves a preset by trying (in order):
  1. Exact `filament_id` match
  2. Exact `setting_id` match
  3. Exact preset name match
  4. Case-insensitive match against full name or base name (before ` @`)
- Use it in `MoonrakerPrinterAgent::fetch_moonraker_filament_data()` to
match on both `filament_id` and `setting_id` from lane_data before
falling back to type-based matching
- Add name-based fallback in `PresetBundle::sync_ams_list()` and
`get_ams_cobox_infos()` for user presets that have no `filament_id`

## Backwards Compatibility

No existing behaviour changes when `filament_id` and `setting_id` are
absent from lane_data — the existing material-type fallback is
unchanged.

## Tests

Built and tested on Linux and Windows. Verified that filament presets
are correctly matched from Moonraker lane_data populated by
spoolman-lane-sync. Falls back correctly to type-based matching when no
preset match is found.

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-10-26 17:50:59 +08:00
SoftFever 10c38a54e1 Merge branch 'main' into feat/lane-data-filament-id-matching 2026-10-26 17:40:53 +08:00
SoftFever 20388f846d Resolve Moonraker lane filament_id through the shared AMS matcher 2026-10-26 17:30:42 +08:00
SoftFever 555321215e Add alpha and gradient support to custom AMS colors (#16538)
# Description

AMS custom colors now support alpha and ordered gradients through the
shared color picker. Printers advertising manual multicolor support can
edit up to four gradient colors; other printers retain single-color
editing with alpha. The picker accepts a per-caller gradient limit while
project editing and shared favorites retain their existing seven-color
limit. Canceling or confirming an unchanged seed preserves selections
that the editor cannot represent.

Filament previews composite translucent colors over a checkerboard,
including AMS custom swatches, circles and cards, the filament rack,
Change Filament menus, object-list selectors and feature-filament
selectors. Single-color AMS, external-spool and AMS Lite cards use the
same checkerboard renderer and alpha compositing as gradient cards, with
no separate SVG checkerboard cache. Rounded AMS card fills retain their
geometry and remaining-material bounds. Generated preview bitmaps use
opaque RGB storage after compositing so Windows menu conversion does not
corrupt the numbered labels; stored RGBA colors remain intact.

The rendering uses the existing graphics-context path without alternate
rendering fallbacks. Existing project/profile formats and device
permission checks are preserved.

# Screenshots/Recordings/Graphs

AMS now can have custom gradient with alpha up to 4 colors:
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/c28c0ee6-aad2-41c8-ae03-b8bd25ce1da8"
/>


Checkerboard background for colors with alpha:
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/de2af9e5-141f-4ab2-bcfe-561168c2435b"
/>


Bambu Handy should work too:
<img width="500" alt="98456ee77c51d79981ac50cd8f562e86"
src="https://github.com/user-attachments/assets/86951dbf-b898-4caa-9dc6-9407204f61fc"
/>
<img width="500" alt="b911c1c638ce71306ad1ac92587aea96"
src="https://github.com/user-attachments/assets/2f65c748-25fc-4bde-bbcf-305d0dfd3293"
/>


## Tests

- Windows, using the existing `build-dbginfo` / `RelWithDebInfo`:
`ALL_BUILD` and `slic3rutils_tests` build successfully.
- Focused native tests pass: 63 test cases, 5118 assertions, randomized
order. Includes AMS settings, device command payloads, color picker
validation and bitmap pixels, including 48 solid-versus-gradient
transparency comparisons.
- `node --test
resources/web/dialog/ColorPickerDialog/colorpicker.test.js`: 10 tests
pass.
- Manual GUI/device writeback and macOS/Linux runtime verification were
not performed.

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-10-26 17:26:19 +08:00
HanifKoh b1488b5c0c Fix Adaptive PA Speed When the Extrusion Inherits the Travel Feedrate (#16857)
The cooling buffer drops a G1 F that repeats the feedrate the preceding
travel, wipe or retraction already set, so an extrusion printed at the
travel speed reaches the adaptive pressure advance processor without a
feedrate line of its own. The processor only read standalone G1 F lines
and fell back to the last one it had seen, often the first layer's, so
the predicted pressure advance stayed at the first-layer value for the
rest of the print.

Track the feedrate every move with an F word sets, as the firmware does,
and use it for an extrusion that no G1 F precedes.
2026-10-26 16:36:56 +08:00
HanifKoh fbc50d3d3a Start a Creality Print Job From the Spool Holder When No CFS Slot Is Mapped (#16794)
CrealityPrint::start_print() chose between the plain opGcodeFile start and the
colorMatch + multiColorPrint pair by the model id alone, and inside the
multi-colour branch it fell back to the plain start only when a filament was
mapped onto box 0. A K1-family printer reports the same model id with and
without a CFS, and without one it never answers the boxsInfo query, so the send
dialog had no slots to map and the printer received a colorMatch with an empty
list followed by multiColorPrint. The job printed, but the firmware flagged
"no material" (materialStatus 1) for its whole duration. The same happened on
any CFS-capable model whenever the boxsInfo query failed.

Treat an empty mapping like a mapping onto the spool holder and send the plain
start with enableSelfTest, which is what Creality Print does when the printer
lists no colours. The command building moves into start_print_commands(), a
pure function, so the decision is unit-tested. Every plain start now reads the
printer's answer best-effort before closing, as the non-CFS start already did,
so the close frame never follows the command in the same burst.

Fixes #16695.
2026-10-26 15:27:20 +08:00
Noisyfox 0d7c956558 Merge upstream/main into dev/ams-custom-color-alpha-gradient 2026-10-26 15:18:06 +08:00
SoftFever c1119ee013 Merge branch 'main' into feat/lane-data-filament-id-matching 2026-10-26 14:55:37 +08:00
yw4z 2dfcba390a Add color sampler to color picker dialog (#16587)
* init

* update icons

* Fix macOS color sampler compilation with Xcode

* add linux support

* add more guards for portal

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
2026-10-26 14:54:40 +08:00
Lam Wei Lun ab4ed386d0 Added missing headers. Does not build without precompiled headers 2026-10-26 14:43:26 +08:00
HanifKoh 12ce9d6fe6 Make the Discrete GPU a Linux Preference Instead of a Desktop-Entry Hint (#16875)
* Make the Discrete GPU a Linux Preference Instead of a Desktop-Entry Hint

The desktop entries asked the launcher for the discrete GPU with
PrefersNonDefaultGPU and X-KDE-RunOnDiscreteGpu. KDE and GNOME honour
that by adding the PRIME variables to every menu launch, so on a hybrid
laptop under Wayland the 3D view was rendered by zink on the GPU that
does not drive the display and its frames never reached the compositor:
an empty Prepare and Preview canvas from the menu, a working one from a
terminal.

Drop the two keys from the installed desktop file, the AppImage's
embedded entry and the entries the Desktop Integration dialog writes.
Add a "Render on the discrete GPU" preference (Linux, default off,
requires restart) that exports DRI_PRIME and, with the NVIDIA kernel
module loaded, the NVIDIA render-offload variables before GTK opens the
display. The GDK_BACKEND=x11 opt-in path exported them unconditionally;
it now leaves GPU selection to the preference as well.

The preference acts before GUI_App loads the configuration, so
AppConfig::peek_bool reads one app boolean straight from the saved file
and xdg_config_dir resolves the default Linux data dir the way the wx
code did; GUI_App's two copies of that lookup use the same helper, and AppConfig::config_path gained a
static form so the file name lives in one place.

* Share the Linux Data-Dir Lookup and Let DRI_PRIME Override the GPU Preference

default_data_dir() in libslic3r resolves the Linux data dir a start without
--datadir uses: a portable data_dir folder next to the executable, else the
XDG config dir. GUI_App::init_app_config and the discrete-GPU start-up code
both call it, so they cannot drift apart.

A DRI_PRIME already in the environment now skips the export entirely, so one
start with DRI_PRIME=0 gets back to Preferences when the discrete GPU cannot
open the window. The tooltip says so.

* Attach the DRI_PRIME Translator Note to the Tooltip It Describes
2026-10-26 14:02:54 +08:00
SoftFever acb4cce4ae Explain why settings are hidden or disabled (#16657)
* Record option availability reasons per settings tab

* Explain option restrictions in field and label tooltips

* Show option restriction reasons in settings search

* Explain support and raft option restrictions

* Explain print option dependency restrictions

* Explain printer and filament option restrictions

* Declare settings owner lookup in the Tab header

* Reuse repeated option availability reasons

* Fix availability tooltips for synthetic options

* Deduplicate availability reasons in row tooltips

* Keep motion limit availability consistent with disabled controls

* Show availability reasons in object table settings

* Explain filament override retraction dependencies

* Explain disabled preset compatibility conditions

* Stop search and Speed Dial from refusing settings that are visible

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-10-26 13:59:47 +08:00
SoftFever 1d9bd2704d Stop search and Speed Dial from refusing settings that are visible 2026-10-26 13:43:32 +08:00
HanifKoh 5817a76da6 Trim pybind11 Includes From the Plugin Headers (#16839)
* Move Plugin JSON-Python Helpers Out of PluginFsUtils to Trim pybind11 Includes

* Forward Declare pybind11 module_ in PagesPluginCapability Header
2026-10-26 12:40:52 +08:00
HanifKoh d0966a0502 Forward Declare PartPlate and Other GUI Types in Plater.hpp (#16840) 2026-10-26 12:40:40 +08:00
HanifKoh 2a6e7a199b Forward Declare GUI Panels in MainFrame.hpp (#16842)
* Forward Declare GUI Panels in MainFrame.hpp

* Include wx/statline.h Directly Where wxStaticLine Is Used

The Windows builds failed in AboutDialog.cpp because MainFrame.hpp no longer brings in wx/statline.h.

* Include BBLTopbar.hpp Directly in GUI_App.cpp

The Windows builds failed in GUI_App.cpp with member access into incomplete type BBLTopbar.
2026-10-26 12:40:27 +08:00
HanifKoh cbbe590230 Trim Heavy Includes From GUI_App.hpp (#16841)
* Trim Heavy Includes from GUI_App.hpp

* Include winternl.h in the Windows Troubleshoot Dialog Code

The Windows builds failed in TroubleshootDialog.cpp with unknown type name NTSTATUS.
2026-10-26 12:39:32 +08:00
yw4z 0fb11ef556 Fetch cloud plugin metadata off the UI thread at startup (#16642)
When an Orca Cloud account is logged in, on_init_inner() ran fetch_plugins_from_cloud() synchronously, about 2 s of UI-thread time before presets loaded. The fetch now runs on a worker thread while presets load and the main window is created.

The "no longer available" and "unauthorized" plugin notifications are posted with CallAfter. If they arrive before post_init(), they are kept and shown from post_init(). Before this change they were never shown at startup, because plater() was still null.

The thread is joined on logout, so the fetch can't re-add the old account's metadata, and in OnExit(), CleanUp() and the macOS wxEVT_END_SESSION handler.
2026-10-25 22:00:10 -05:00
Kris Austin 1008a47870 Update OpenCV to 4.14.0 (#16851)
Update OpenCV from 4.6.0 to 4.14.0.

- Drop 0001-vs.patch. 4.14.0 already detects the VS 2022 and VS 2026 runtimes, so OpenCV now builds with no patches.
- Turn off three options that 4.14.0 enables by default: AVIF (it would link a system libavif), the new GIF decoder, and KleidiCV (downloaded at configure time on aarch64).
- Build OpenCV with -fno-delayed-template-parsing under clang-cl, so softfloat.cpp compiles for Windows ARM64.
- Point the Flatpak manifest at the 4.14.0 tarball.

Behavior change: the PNG reader rejects a few malformed files that 4.6 loaded.
2026-10-25 21:57:10 -05:00
Eric Lin 4804b54cd1 Fix: WSS streaming over TLS (#16878)
The Moonraker printer agent's status stream returned at once for an https print host, so Orca got the printer's first status over HTTP and no live updates after it. The stream now connects over TLS for an https print host. Like the agent's HTTP requests, it does not verify the certificate, so a printer's self-signed one is accepted. It sends the host name for SNI, and the `Host` header leaves out the default port 443.
2026-10-25 21:56:21 -05:00
Gazi Faysal Jubayer 6c36861a6b Fix MSVC build of PluginHostUi.cpp (#16870)
`run_on_ui_blocking()`, added in #16763, declared its call states in an enum inside the function template. MSVC does not find those enumerators from the default member initializer of the local `struct Call`, so `libslic3r_gui` failed to compile with cl (C2065, C2280). The states are now at namespace scope as `UiCallPending`, `UiCallClaimed` and `UiCallAbandoned`. Behavior is unchanged.
2026-10-25 21:44:10 -05:00
Josh Jones 710452d0b8 Fix plate name filename placeholder (#16715)
Undo/redo restores a plate's name but reattaches its Print without copying the name, so `{plate_name}` in the output filename and G-code could be empty or out of date. For example, delete a named plate and then undo. `PartPlate::set_print()` now copies the plate name to the Print.
2026-10-25 21:41:40 -05:00
Broncosis 9a49a14674 docs: add a lane_data field reference table
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-25 19:33:07 -07:00
Broncosis 39127c5813 docs: describe Moonraker lane_data filament matching in filament_id.md
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-25 18:58:45 -07:00
Broncosis 0d1c53d36e Match filament presets by filament_id/setting_id from Moonraker lane_data
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-25 18:58:38 -07:00
Eric Lin baff031626 Fix: Connect to Moonraker over https (#16872)
`MachineObject::connect` read `use_ssl` from `dev_ip`, which holds host:port with the scheme removed. So the Moonraker printer agent always used plain HTTP and could not reach a printer whose print host is https. It now reads the scheme from the matching `print_host`.
2026-10-25 14:55:59 -05:00
HanifKoh 75252a70f7 Bound Plugin Disconnect and Python Shutdown When OrcaSlicer Exits (#16765)
* Bound Plugin Disconnect and Python Shutdown When OrcaSlicer Exits

A Python printer agent whose disconnect_printer() never returned froze
the closing app, and a plugin thread that never ended kept the process
alive after its window closed, because Py_Finalize joins every
non-daemon thread.

At shutdown a Python agent's disconnect_printer() now runs once per
agent on a helper thread with a 3 second deadline, holding a reference
that keeps the plugin object alive if the call outlives a forced
unload. PythonInterpreter::shutdown() waits up to 3 seconds for running
plugin calls and for non-daemon threads; if either is still going, the
interpreter is left unfinalized for the process exit to end.

* Run the Threading Atexit Hooks Before Waiting for Plugin Threads

An idle concurrent.futures worker only ends when the hooks registered with
threading._register_atexit() tell it to, and Py_Finalize runs those after
the shutdown wait, so a plugin that left an executor open made every exit
wait the full deadline and skip finalization. The hooks now run first, on a
daemon thread joined within the same deadline, since they join their
workers without a timeout.
2026-10-26 03:52:09 +08:00
Kenneth Raplee 88890b9bb1 Build against recent system Boost (>= 1.87) (#15835)
Boost 1.87 removed io_service and io_context::reset(), and 1.88 moved the classic Boost.Process API under boost/process/v1/ and dropped deadline_timer from boost/asio.hpp. Use io_context, restart() and steady_timer, and include Boost.Process only through the new slic3r/Utils/BoostProcessCompat.hpp, which picks the v1 headers on 1.88+. The bundled Boost 1.84 build is unchanged.
2026-10-25 14:33:17 -05:00
Valerii Bokhan 887a8f1806 Feature: Add experimental high precision G-code export (#16568) 2026-10-25 16:29:13 -03:00
Sergei 51dfa8fe7a Fix first-layer bbox in plate_N.json being shifted by the plate origin (#16860)
get_first_layer_bbox() already returns plate-local coordinates, and generate_first_layer_bbox() subtracted the plate origin from them a second time. On every plate after the first, bbox_all and bbox_objects in plate_N.json ended up outside the bed. The CLI export path already wrote plate-local values, and the wipe tower handling is unchanged.
2026-10-25 14:25:22 -05:00
Kris Austin 1b8bc0b19d Remove the FreeType dependency (#16852)
FreeType was only bundled for OCCT's font code in TKService. The only Orca code that used that font code was Shape/TextShape.cpp, and nothing calls it. Its one call in ImGuiWrapper.cpp is commented out. The Emboss tool and the Design tab's text use stb_truetype.

Build OCCT with USE_FREETYPE=OFF, and remove the FREETYPE dep, its Flatpak source entry, the freetype.dll copy on Windows, TextShape, and the freetype and fontconfig links in libslic3r. OCCT only links fontconfig when FreeType is on, and libslic3r_gui links fontconfig on its own.
2026-10-25 13:51:34 -05:00
HanifKoh 9cb9f9694f Keep nlohmann/json.hpp Out of Widely Included Headers (#16843) 2026-10-26 02:33:27 +08:00
HanifKoh a438fb9aaa Move std::regex Out of Utils.hpp and the Precompiled Headers (#16844) 2026-10-26 02:31:45 +08:00
SoftFever 8efa90c763 Merge branch 'main' into dev/option-unavailability-reasons 2026-10-26 02:19:01 +08:00
SoftFever b5e9cb3c5e Revise the Japanese translations (#16874) 2026-10-26 02:10:57 +08:00
HanifKoh 8af4c382a1 Add Precompiled Headers to the Larger Test Suites (#16838) 2026-10-26 01:06:25 +08:00
Kris Austin 09aa0114b4 Fix the Lay on Face delay when Smooth normals is on (#16846) 2026-10-25 10:31:50 -03:00
SoftFever e2590f7559 Stop re-adding a deleted filament on dual-nozzle printers (#16856) 2026-10-25 20:56:34 +08:00
SoftFever d26c94b5ee Revise the Simplified Chinese translations (#16865) 2026-10-25 20:46:47 +08:00
SoftFever fbbba46169 Update the translation template and remove obsolete catalog entries (#16864) 2026-10-25 20:46:25 +08:00
SoftFever cea0844cf4 Add a catalog review workflow, source context and obsolete-entry purge to the translation skill (#16863) 2026-10-25 20:45:48 +08:00
SoftFever 2a37794d55 Run Check profiles, Check locale and clang-tidy on first-time contributors' PRs automatically (#16853)
* Run Check profiles, Check locale and clang-tidy on first-time contributors' PRs automatically

* Sweep for pending first-time contributor runs every 10 minutes
2026-10-25 14:30:41 +08:00
yw4z 51fd8604f8 Texture Displacement Gizmo: use Resolution and Bugdet controls on a expandable section and move "Add Layer" button to header (#16524)
• Makes gizmo more compact
• Moved budget and resolution on collapsible "Quality" section. it shows
"Auto" status on title
• Moved "Add layer" moved layers header. Fixes position of button and
thats important while adding layers repeatedly

**Before - After**
<img width="757" height="566" alt="Screenshot-20261015200616"
src="https://github.com/user-attachments/assets/d7e356fd-6685-4608-92a6-56e1d2518f69"
/>
2026-10-25 14:00:08 +08:00
Kris Austin 2054242884 Fix Creality print host hanging on a printer that stops answering (#16772)
ws_connect(), query_boxes_info() and start_print() set expires_after()
deadlines, then made synchronous Beast calls. Beast only applies those
deadlines to async operations, so none of them fired. A printer that
accepted the websocket and then stopped answering blocked the caller
forever. That froze the GUI thread when the Creality send dialog opened
or the sidebar synced filaments, and left uploads stuck after the file
arrived.

Run every websocket call as an async operation on the local io_context,
so the deadlines apply. run_until_done() and the per-address connect
loop move from MoonrakerPrinterAgent.cpp into AsioUtils.hpp, and both
files share them. Each resolved address gets its own connect deadline,
and start_print() gets a reply deadline for its commands. A start-print
timeout shows the translated timeout message that HTTP timeouts already
use, now shared through PrintHost::timed_out_message(), and other
websocket errors drop Boost's source location.

The websocket port and deadlines move into a protected ws_settings
member, so the tests can use a local port and short deadlines. The new
tests run CrealityPrint against a fake printer that goes silent before
or after the handshake.
2026-10-24 22:01:15 -05:00
mosfet80 710341338c Update libpng to 1.6.59 (#16819)
libpng 1.6.35 was from 2018, and 1.6.59 includes the security fixes released since then. The local patches and the NEON workarounds are removed, because 1.6.59 already handles the macOS target architecture, the clang 19 build on macOS, and NEON on Windows ARM64. Apple arm64 builds now use NEON, which is the libpng default.
2026-10-24 21:16:49 -05:00
yw4z 7bbb18cbf4 Make gizmo +/- buttons repeat while held (#16525)
Holding a +/- step button on a gizmo input changed the value only once. ImGui repeats a held button only on new frames, and the canvas draws only when an event arrives, so a mouse held still produced no repeats.

- Add ImGuiWrapper::request_frames_while_held() and call it after the Emboss Height and Depth, SVG Depth, and Cut groove Count inputs.
- Set io.DeltaTime from a real clock in ImGuiWrapper::new_frame(), capped at 1/60 s, so the repeat rate does not depend on the frame rate.
- Handle wxEVT_MOUSE_CAPTURE_LOST on the canvas, so a lost button-up does not leave an ImGui widget active.
- Cut groove Count no longer rebuilds when the value is already at its limit.
2026-10-24 20:44:49 -05:00
yw4z 2ec2a60b81 Homepage Fixes / Improvements (#15785)
* init

* update

* keep dimming for disabled login item

* fix navigation buttons

* Add translation support

* fix button style not applies for cloud

* add translations and fix actions bar height

* translate page after updating recent list
2026-10-25 02:01:57 +03:00
Kenneth Raplee 115df364e2 Avoid SetLabel() on plain wxTextCtrl controls (#15881)
* Avoid SetLabel() on plain wxTextCtrl controls in Field.cpp

wxWidgets 3.3 turned wxTextCtrlBase::SetLabel() into an explicit
failure (wxFAIL_MSG, "Use SetValue() or ChangeValue() instead"). It
sets nothing, and with assertions enabled every call pops up an
assertion dialog.

TextCtrl::BUILD() only sets the side-text label in the single-line
case now (the TextInput composite). For multiline fields the control
is a plain wxTextCtrl, and the option group draws the side text
itself when there is any (combine_side_text() is false).

SpinCtrl::BUILD() replaces SetLabel() on the inner text control with
ChangeValue(). Nothing has been stored there since 3.3, and the one
reader of that label (propagate_value(), null-value case) already
sees an empty string. ChangeValue sets the initial text without
events, and the following SetValue(default_value) determines what is
displayed.

* Avoid label APIs on TextInput's inner wxTextCtrl

SetLabelText() routes to the virtual SetLabel(), which wx 3.3's
wxTextCtrlBase overrides, so both label APIs assert or silently no-op on
a plain wxTextCtrl. All become ChangeValue(), which sets the text
without events.

* Apply review suggestions to SliderCtrl, SpinCtrl, and machine dialog

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-10-25 01:50:49 +03:00
Dipl.-Ing. Raoul Rubien, BSc 9f5b414589 Fix GCC -Warray-bounds warnings in ConfigOptionVector::set_at (#15079)
Use dynamic_cast in the vector branch of ConfigOptionVector::set_at. GCC at -O3 inlines set_at into the wipe tower position code, where the argument is a scalar ConfigOptionFloat, and the static_cast made it warn about an out-of-bounds read in the branch that never runs.

The scalar branch still uses static_cast. ConfigOptionFloatOrPercent is not a ConfigOptionSingle<FloatOrPercent>, so a dynamic_cast there would throw when a coFloatsOrPercents option is edited in the GUI.
2026-10-24 16:55:13 -05:00
Eric Lin a07bc8ff5b Fix out-of-bounds config reads in the Type1 prime tower (#15183)
Several per-filament and per-extruder options default to a single value. When a config lists fewer values than there are filaments or nozzles, the Type1 prime tower and the pre-heat injector read past the end of the vector, and the same scene could slice to different G-code from one run to the next.

- Read `filament_change_length`, `filament_change_length_nc` and `hotend_cooling_rate` with the same fallback to the first value that `get_at()` uses.
- `is_nil(idx)` falls back to the first value like `get_at()` instead of reading past the end.
- Skip the pre-cooling and last-layer reads when `get_extruder_id()` returns -1, and when no wall filament matches the selected category.
- Bounds-check the pre-heat injector's per-filament and per-extruder reads, and use the extruder index when `physical_extruder_map` is too short.

Configs that list a value for every filament and nozzle produce the same G-code as before.

Adds a test that nozzle-change ramming extrudes the same length in both directions when `filament_change_length` has one value for two filaments.
2026-10-24 16:21:32 -05:00
Kris Austin f2037c1d48 Build OpenCV against Orca's libpng (#16828)
OpenCV compiled its bundled libpng 1.6.37 into opencv_world, so glTF
textures decoded with cv::imdecode and images loaded with cv::imread went
through that copy instead of the libpng the rest of Orca uses. Turn
BUILD_PNG off and depend on dep_PNG, the same way libjpeg is shared.

0002-clang19-macos.patch only patched the bundled copy's pngpriv.h,
which is no longer compiled, so drop it.
2026-10-24 16:11:01 -05:00
Erkan Ozgur Yilmaz 00444ae4d7 Add 3Dconnexion Settings to the View Menu (#16345)
* Add 3Dconnexion Settings to the View Menu

The 3Dconnexion settings overlay could only be opened with its keyboard
shortcut. On macOS that is Cmd+Shift+M, because plain Cmd+M is the
system Minimize shortcut, so users who pressed Cmd+M minimized the
window and never found the dialog (#5484).

Add a "3Dconnexion settings" check item to the View menu. It toggles the
overlay and shows the shortcut bound to it, and its label follows the
key if the user rebinds it. It is enabled only on Prepare and Preview
when a device is connected (on Windows, also only with the legacy
3Dconnexion option enabled).

Move that availability test into
Mouse3DController::can_show_settings_dialog() so the menu item and the
canvas shortcut share it.

* Rename and move the 3Dconnexion Settings menu item

Label it "Show 3Dconnexion Settings" to match the other View menu items,
and move it below "Reset Window Layout" in its own separated group since
it opens a settings window.

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-10-24 22:53:05 +03:00
HanifKoh 9f85357ade Fail Plugin UI Calls From Worker Threads Once the App Is Closing (#16763)
A host UI call from a plugin thread queued work on the UI thread and
waited with no limit. If the UI thread was itself waiting for that
thread while closing (a printer agent joining its worker in
disconnect_printer), the app hung forever. Once closing has started, a
call the UI thread has not picked up yet now raises RuntimeError
instead; the shared call state keeps an abandoned queued task from
touching the caller's stack.
2026-10-25 03:40:36 +08:00
HanifKoh ca51cba597 Refuse a Filament Flow Ratio of 0 Instead of Writing NaN Extrusion (#16719)
A used filament with a flow ratio of 0 sliced in the GUI and wrote
E-92233720368547.758 on every extrusion move: GCode::_extrude multiplied
the flow by the ratio and divided by it again, giving 0 * 0 / 0 = NaN.
The CLI already rejected the value through the config check, but
Print::validate never looked at it.

Print::validate now stops the slice with an error naming the filament
when a used filament's flow ratio is 0 or nil, and _extrude converts the
flow to extrusion length with the bare filament cross-section, so the
ratio is applied once without a divide.
2026-10-25 03:39:51 +08:00
Ian Bassi 258ddc15e8 Fix a crash from the Russian extruder range warning, and check plural placeholders in CI (#16815) 2026-10-24 15:44:49 -03:00
SoftFever 694b3ad705 update locale 2026-10-25 02:29:49 +08:00
SoftFever e0fcab61d2 Fix Kobra 2 layer-change G-code comments (#16381)
# Description

Comment both Kobra 2 layer markers so text such as `0 @ 0.2mm` is
emitted as `;0 @ 0.2mm`. Bump the Anycubic profile version to
`02.04.00.10` and add a regression test.

Fixes #16219.

## Tests

<details>
<summary>Local validation (Release)</summary>

- The regression exports a 1 mm cube with each shipped template: 10
failed assertions before the fix, passes afterward.
- Regression and existing G-code test: 2/2 passed via CTest.
- Clang-tidy, JSON validation and `git diff --check`: passed.
- Generated G-code verified locally; no physical printer test.

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

</details>
2026-10-25 02:21:14 +08:00
SoftFever 3d3771f420 Merge branch 'main' into RJAudas/fix-kobra2-layer-markers 2026-10-25 02:00:54 +08:00
SoftFever 46b308c832 Add School House Spools Matte PLA, Silk PLA, Marble PLA, TPU 95A, Matte PETG and Transparent PETG filament profiles (#16780)
Follow-up to #15429. Adds six more School House Spools filament profiles
to the global Orca Filament Library.

# Description

New profiles, each with an @base and @System file under
`OrcaFilamentLibrary/filament/SchoolHouseSpools/`:

* School House Spools Matte PLA
* School House Spools Silk PLA
* School House Spools Marble PLA
* School House Spools TPU 95A
* School House Spools Matte PETG
* School House Spools Transparent PETG

These match the products School House Spools sells. Values start from
the equivalent standard material profiles. Printer-specific items (start
G-code for Bambu printers, plate-specific settings) are left out so the
profiles stay generic across printers. Vendor name, filament cost and
descriptions are School House Spools' own.

Silk PLA and TPU 95A have short usage notes in the description field:
fresh sealed spools can be printed as they are, and Silk PLA looks best
with an outer wall speed of 40 to 60 mm/s.

As with #15429, this only touches the global OrcaFilamentLibrary. There
are no printer-specific override files, because nothing has been
separately tuned per printer.

# Screenshots/Recordings/Graphs

N/A, profile data only.

## Tests

* `scripts\check_profile.bat -Vendor OrcaFilamentLibrary`:
`profile_tool` passes with 0 errors and 0 warnings.
* filament_ids minted with `orca_profile_tool.py generate-id`,
setting_ids assigned by the tool, and `update-index` run so the index is
canonical.
2026-10-25 01:59:31 +08:00
SoftFever 312c490014 re:3D Profile: Change seam_gap to '10%' (#16739)
# Description
* Updated seam_gap value to include percentage.


[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-10-25 01:57:47 +08:00
SoftFever 89cd37e990 bump version 2026-10-25 01:56:51 +08:00
SoftFever 356f1dcd42 Update ankermake m5/m5c file_start_gcode with additional parameters (#16571)
# Description

filament used and weight are shown on the m5 touchscreen. This now
enables display of that.

# Screenshots/Recordings/Graphs
N/A

## Tests

Built w/ latest changes of main locally. Tested on a fresh install
(cleaned appdata). Added M5 printer, new vars are in the file header
gcode of the printer config. sliced file and checked gcode. Matches what
printer expects.

<!--
> 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)
2026-10-25 01:55:25 +08:00
SoftFever a12d6f1ee3 fix: update api to allow requesting network permissions (#16690)
# 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?
-->

Add host-based network permissions for plugins (#16592).

## Summary
- Extend orca.request_permissions() to accept network URLs and request
permission during plugin registration.
- Store approved HTTP(S) permissions as canonical scheme://host grants,
shared across HTTP and socket events.
- Match requests by scheme and host, so changing URL paths or query
strings does not trigger repeat prompts. Existing full-URL grants remain
scoped to that URL.
- Allow targetless network events when the plugin already has a network
grant.
- Add a manual probe plugin for verifying permission persistence,
targetless socket events, and URL matching.

# 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)
2026-10-25 01:49:43 +08:00
TheLegendTubaGuy a57a0d10a0 Hide the sidebar nozzle card when a multi-tool printer has nothing to choose (#16803) 2026-10-24 14:02:40 -03:00
SoftFever f1011098ca Clarify how permission requests match network targets 2026-10-25 00:03:23 +08:00
SoftFever 54afdaf887 Merge branch 'main' into fix/plugin-network-permissions 2026-10-24 23:58:51 +08:00
SoftFever 11cde46b04 feat: add wildcard permissions for fs (#16793)
# 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?
-->

Adds wildcard permissions for filepaths. 

Previously, permissions were only granted to exact hostname URLs, e.g.
```
/path/to/folder/file1
/path/to/folder/file2
/path/to/folder/file3
```

This PR grants permissions via wildcards:
`/path/to/folder/*`

This way, the user of the plugin isn't bombarded with multiple
permission dialogs.

# 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)
2026-10-24 23:51:41 +08:00
SoftFever b4a2eb8803 Merge branch 'main' into feat/plugin-wildcard-permissions 2026-10-24 23:14:26 +08:00
SoftFever 2ffc301c9b Show G-code toolpaths in Preview on Parallels Desktop (#16829)
# Description

On Windows running in a Parallels Desktop VM on Apple Silicon, the
Preview tab shows the legend and the seams but no toolpaths. The segment
shader reads its vertex ID from a buffer of single bytes. Metal only
accepts vertex strides that are a multiple of 4 bytes, and the Parallels
OpenGL driver, which runs on Metal, draws nothing from that buffer and
reports no GL error. The vertex IDs are now 32-bit, so the toolpaths
render there. The Preview has been broken in Parallels since libvgcode
was ported from PrusaSlicer.

The only cost is the shared template buffer, which grows from 8 to 32
bytes. Rendering on other drivers should not change.

# Screenshots/Recordings/Graphs

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

## Tests

Tested on Windows 11 ARM64 in Parallels Desktop on an Macbook Pro
(OpenGL 4.3, "Parallels using Metal") with a sliced 20 mm cube. Without
the change, the Preview shows no toolpaths. With it, the walls, infill
and top surfaces render normally. I did not test on native Windows,
macOS or Linux GPUs, or the OpenGL ES build.

<!--
> 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)
2026-10-24 22:29:48 +08:00
SoftFever 41c3aab5e1 Merge branch 'main' into fix/parallels-preview-toolpaths 2026-10-24 22:25:10 +08:00
SoftFever 6c619c795a Fix Chinese, Japanese and Korean text in the Text tool (#16824)
# Description

On macOS, text fields drawn in the 3D view, such as the Text tool's,
ignored the input method, so with Pinyin or another Chinese, Japanese or
Korean input source only English letters came through. Input methods now
work there, and Esc, Backspace and Enter pressed while composing act on
the composition only, not on the text. This follows BambuStudio's fix
for the same problem.

With the UI in Chinese, Japanese or Korean, the Text tool also showed
its default text as "????" with an error whenever the system's default
font lacks those characters, for example on an English Linux system. New
text now starts with one of OrcaSlicer's bundled fonts that can write
the translated default text (HarmonyOS Sans SC, or NanumGothic for
Korean). When no available font can, the default text is in English.
Saved text styles are kept as they are. Users whose system font already
covers their language see no change.

On Linux outside the Flatpak, choosing a bundled font such as HarmonyOS
Sans SC in the Text tool also embossed the text in a system font. It now
uses the bundled font.

#14658 also deals with "?" in embossed text, by drawing missing
characters with system CJK fonts. This PR doesn't mix fonts in one text:
it picks a bundled font for the default text, so it also works where the
system CJK fonts can't be used, such as the variable Noto CJK fonts in
Fedora 43.

# Screenshots/Recordings/Graphs

<img width="457" height="189" alt="image"
src="https://github.com/user-attachments/assets/b760601c-e82c-40f3-bb19-b27858789b35"
/>


## Tests

Fedora 43 VM with KDE Plasma and an English system, AppImage built from
this branch:

- Chinese UI, no saved text styles: the Text tool starts with the
"Default font" style (HarmonyOS Sans SC) and embosses 浮雕文字. Chinese
typed with Pinyin works, and the text reopens for editing in the same
font.
- Chinese UI with saved text styles: the default text is "Embossed
text", with no error.
- Picking HarmonyOS Sans SC in the font list now previews and embosses
Chinese characters.
- English UI: unchanged, and no extra style is saved.
- Korean UI: the default text is "Embossed text". The AppImage doesn't
list NanumGothic among its fonts on this system, which is an existing
issue.

macOS on Apple silicon, Release build of this branch:

- Chinese UI, no saved text styles: the Text tool starts with HarmonyOS
Sans SC and the default text 浮雕文字.
- Pinyin in the Text tool types Chinese, and Esc, Backspace and Enter
pressed while composing change only the composition.

A Flatpak build of an earlier revision of this branch was tested the
same way: Chinese and Korean (NanumGothic, 텍스트 양각) worked, and English
and German were unchanged. The Flatpak was not rebuilt after the Linux
font lookup fix. Windows was not tested, nor were Japanese and Thai UIs,
nor Japanese and Korean input methods on macOS.

<!--
> 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)
2026-10-24 22:24:12 +08:00
Damir Galeev 09761a3136 Fix seam alignment, contour continuity and painted boundaries (#16447)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-10-24 11:10:48 -03:00
SoftFever 812ce9f055 Show G-code toolpaths in Preview on Parallels Desktop 2026-10-24 21:17:30 +08:00
yw4z 0a00730dbb Reconstruct context menu (#14787)
* init

* update

* update

* update

* update

* update

* fix conflict

* fix tidy

* move drop to main menu

* call utilities menu as "More"

* use transform sub menu for multi selection

* plates menu

* fix visiblity of export options on object menu

* fix modifier volume menus and separator usages

* move special type volume options to first place

* minor fixes & cleanup

* revert changes for precise seam
2026-10-24 17:39:35 +08:00
SoftFever c44779966b Support Chinese and other input methods in canvas text fields on macOS 2026-10-24 14:20:45 +08:00
SoftFever 8c1c9fee97 Merge branch 'main' into feature/text_tool_default_font 2026-10-24 12:04:40 +08:00
SoftFever bc23e79fa5 Emboss with the bundled fonts themselves on Linux outside Flatpak 2026-10-24 12:03:02 +08:00
SoftFever 094456871c Stop the Text tool's default text from showing as question marks 2026-10-24 12:03:02 +08:00
Ian Bassi a26501c0ed Port Snapmaker's paint penetration layers to its profiles (#16821) 2026-10-23 20:22:51 -03:00
DIEHARDave 37115565ff Select the printer bound in the Device tab when a preset loads (#16455)
With printer agents on, a printer bound from the Device tab is saved as a device of the agent, not in the preset's `print_host`. `GUI_App::select_machine()` returned early when `print_host` was empty, so after a restart no printer was selected and the sidebar filament sync button did nothing until the print dialog picked one.

When `print_host` is empty, select the agent's bound printer if it is the only one, the same rule `MainFrame::load_printer_url()` uses.
2026-10-23 17:49:31 -05:00
Ian Bassi b1846e3408 Add top and bottom paint penetration layers (#16818) 2026-10-23 19:49:08 -03:00
Adam Robinson c34ae1f34a build: check for ninja in macOS script (#14494)
With -x, build_release_macos.sh now stops before the CMake configure step if ninja is not on PATH, and tells the user to run `brew install ninja`. The -x help text now says Ninja is required.
2026-10-23 17:47:59 -05:00
TheLegendTubaGuy d7224f700a fix: CLI keeps a project's values when it lists no changed settings (#16703)
* fix: CLI keeps a project's values when it lists no changed settings

A project whose different_settings_to_system is missing or empty in
every entry does not say which of its values were changed: the GUI
saves it that way both when its presets match their parents and when
it cannot find those parents. The CLI still refreshed every unlisted
printer, process and filament key from the system presets, so such a
project sliced with system values instead of its own, e.g. with
supports turned off, and exited 0.

A plain run now keeps the stored values of such a project and only
fills the keys it lacks from its system printer and process presets.
Projects that list changes follow the existing rule, and --uptodate
still refreshes.

Fixes #16698

* fix: CLI fills missing filament keys of an unlisted project from its presets

Without any entry in different_settings_to_system, a plain run skipped
the filament refresh, so filament keys the project lacks, e.g. options
added after it was saved, fell back to the option defaults while
missing printer and process keys came from the system presets.

The filament presets are resolved again for such a project, and each
refreshed filament keeps every key the project has, mapped onto the
system preset's extruder variants; only the keys it lacks come from
the preset. The filament_dev_* values the project has are kept too,
unless a filament is loaded from a file. The test removes two filament
keys and a filament_dev key from the unlisted project.

---------

Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
2026-10-24 04:38:27 +08:00
Ian Bassi 7319a2c54c Draw translucent filaments translucent in Preview (#16776) 2026-10-23 17:14:09 -03:00
Ian Bassi 5869d227b4 Fix features printing with the wrong filament and idle tool changes in filament for features (#16805) 2026-10-23 17:13:35 -03:00
Damir Galeev 54e89cab74 Fix seam placement on overhanging outer walls (#16334)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-10-23 16:59:06 -03:00
Kris Austin 292deeca06 Ask contributors not to open many PRs at once (#16816) 2026-10-23 14:22:12 -05:00
yw4z e97a59d4ce Windows: Detect a 3D mouse via Raw Input instead of hid_enumerate (#16670)
On Windows, the startup 3D mouse check called hid_enumerate(), which opens every HID device. That took about 100 to 200 ms on the UI thread. Windows keeps the vendor id, product id and usage of each HID collection for Raw Input, so the check now reads that list and opens nothing. It takes under 1 ms.
2026-10-23 14:18:35 -05:00
Kris Austin f423c49f41 Add CONTRIBUTING.md (#16785)
* Add CONTRIBUTING.md

Add a short contributor guide. It covers what every PR description
should answer, what reviewers need for each kind of PR and which label
it gets, rules that are easy to miss, using AI tools, what to do after
opening a PR, and when a PR may be closed. The details for each kind of
PR are on the wiki's How to Contribute page.

AGENTS.md now tells agents to read CONTRIBUTING.md before they open a
PR or post on GitHub. Agents load AGENTS.md automatically but not
CONTRIBUTING.md.

* Link the wiki's How to Contribute page for new contributors

The label bot's comment greets first-time contributors and links the
How to Contribute page. Other authors get the same comment as before,
now with the missing period after the label commands.

CONTRIBUTING.md links the wiki's Opening an Issue section, since
GitHub shows CONTRIBUTING.md on the new issue page too.
2026-10-23 14:04:25 -05:00
SoftFever b665e0f4e0 Keep dropdown lists open on Wayland when an item's tooltip appears (#16813)
# Description

On Linux under Wayland, resting the pointer on a filament, printer or
process preset whose name is cut off closed the whole dropdown list just
as the tooltip with the full name was about to appear, and the terminal
logged `Tried to unmap the parent of a popup`. The list now stays open
and the tooltip shows the full name, as it does for preset descriptions.
The orca-wxwidgets skill gains the matching rule for popups on Wayland.

Fixes #16800

Only Linux under Wayland is affected; X11, Windows and macOS behave as
before. One edge case remains on Wayland: if another app takes the focus
while an item's tooltip is showing, the list stays open until you return
to OrcaSlicer, where the first click closes it.

# Screenshots/Recordings/Graphs

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

## Tests

Checked by hand on KDE Plasma (Wayland, GTK 3.24.52) against a build
without the fix. Resting on a truncated preset or on one with a
description used to close the list when its tooltip appeared; the list
now stays open with the tooltip and no GDK warning. Opening a vendor
sub-list after a tooltip, moving quickly between rows, scrolling,
clicking outside, and another app taking the focus with no tooltip
showing all behave as before, and X11 is unchanged.

<!--
> 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)
2026-10-24 02:54:35 +08:00
SoftFever 61f0490cd9 Start the Flatpak When Regional Formats Use a Missing Locale (#16801)
# Description

Fixes #16617 and #12961.

The Flatpak no longer fails to open when the desktop's regional formats,
such as KDE's or GNOME's currency, date or measurement settings, use a
language whose locale Flatpak has not installed for its runtime. Those
settings fall back to the main language instead, and starting from a
terminal prints which ones were ignored and how to install the missing
language with `flatpak config`. An environment whose locales are all
installed is passed through exactly as before, so users with a different
interface language or comma-decimal formats see no change.

No change for Flatpak users whose locales are installed, and none for
the AppImage or native builds. Flathub picks it up with its next commit
pin bump.

### Compared with #16797

Both PRs fix the same failure in the Flatpak entrypoint, in opposite
directions: #16797 compiles the missing locale so the user's setting
works, while this PR drops the setting that names a missing locale so
that category follows the main language. #16797 also adds a C++ start-up
check; this PR changes only the entrypoint.

| | This PR | #16797 |
|---|---|---|
| Size | `scripts/flatpak/entrypoint` only, +34 lines | entrypoint +40,
C++ in `CLI::run` and `LocalesUtils`, 4 Catch2 tests; about 250 lines in
5 files |
| What the reporter gets | The missing currency/address/measurement
formats follow `LANG` (`en_GB`); nothing visible changes in OrcaSlicer |
The exact `de_DE` formats, compiled with `localedef` from the runtime's
locale sources |
| Missing `LANG` | Falls back to `C.UTF-8`; OrcaSlicer's language
detection on a fresh config sees English | Compiled, so the session
language's locale exists |
| Cost per start | One `locale` check (about 1 ms), nothing written |
First start compiles about 3 MB per locale into the app data dir; one
check per set variable; `LOCPATH` exported to the app and every process
it starts, from then on |
| If the repair fails | Cannot really fail; it only removes variables |
A `localedef` failure falls through to the C++ check, which prints the
fix and exits, so the app still does not start |
| Native builds | Unchanged (Boost's error) | A clear message naming the
variable and how to install it, then exits |
| Automated tests | None in the repo; verified in a VM and with a
30-setup matrix (see Tests) | Unit tests for the detection |

From reading #16797's code (not tested): its entrypoint treats any
`locale` stderr output as a missing locale, so loader output such as
`LD_DEBUG` would make it compile locales the runtime already has; and
its C++ check uses `newlocale(LC_ALL_MASK, "")`, which, like glibc's
`setlocale`, rejects a composite `LC_ALL` (`LC_CTYPE=…;LC_NUMERIC=…`)
that libstdc++ accepts today, so in that rare setup it would exit where
the app currently starts. This PR matches glibc's specific error message
and leaves a composite `LC_ALL` alone.

The two entrypoint changes need not both land: with #16797's compile
step in place, this one would find nothing missing. This PR keeps
working setups exactly as they are, with the least machinery and no
source change; #16797 is the better fit if keeping a broken setup's
exact regional formats, or a clearer error for native builds, matters
more. Its C++ diagnostic could also be taken on its own for native
builds without conflicting with this PR.

# Screenshots/Recordings/Graphs

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

## Tests

Reproduced both reports in a Fedora VM with the reporter's regional
formats on GNOME and on KDE Plasma 6.7.5: Flathub 2.4.2 aborts and the
nightly exits, whether started from the app grid, the Plasma launcher or
a terminal. A Flatpak built with `scripts/build_flatpak_with_docker.sh`
starts in the same setups from the app grid, the Plasma launcher and a
terminal, opens a model passed on the command line, and also starts when
`LANG` itself names an uninstalled locale. After adding the language
through `flatpak config` (both `languages` and `extra-languages`), the
formats are passed through unchanged. A properly set-up German machine
with comma-decimal formats gets the same environment and an identical
German interface as the current nightly, and across 30 locale setups run
against the real binary inside the runtime, every setup that starts
today is left byte-identical while every one that fails today now
starts.

<!--
> 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)
2026-10-24 02:54:08 +08:00
SoftFever 9d96950a0b Keep dropdown lists open on Wayland when an item's tooltip appears 2026-10-24 02:52:40 +08:00
Alexandre Folle de Menezes 2c3c0e012e Verify and improve AI pt_BR translations (#16749) 2026-10-23 15:37:21 -03:00
mgoiogana 4ebb7ea924 Update Basque translation for OrcaSlicer 2.5.0 (#16666) 2026-10-23 15:36:29 -03:00
SoftFever 1fb0be0a95 Fix the web Device page crashing or staying blank after startup (#16806)
# Description

Fixes a macOS crash shortly after startup, which happened when the web
Device page of a printer with an API key finished loading while a
context menu was open. It also makes that page show the printer's web UI
on the first visit; until now it could stay blank until another printer
was selected and then this one again.

Only the web Device page is affected.

Related: #14675, the same startup crash, which #14747 fixed when no menu
is open; and #16752, whose fix left the page blank after startup.

# 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)
2026-10-24 02:35:30 +08:00
SoftFever f576b5e69e Fix the web Device page crashing or staying blank after startup 2026-10-24 02:03:57 +08:00
peachismomo de6861bb38 fix: tests 2026-10-24 01:40:28 +08:00
SoftFever df8d5802b4 Open dropdowns on the first click on Wayland when a tooltip is showing (#16799)
# Description

On Linux under Wayland, clicking the filament, printer or process
dropdown while its tooltip was showing did nothing, so it often took
several clicks to open the list, and the terminal logged `Tried to map a
popup with a non-top most parent`. Dropdowns and Orca's other popups now
open on the first click even when a tooltip is up. The orca-wxwidgets
skill gains the matching rule for popups on Wayland.

Fixes #16595

Only Linux under Wayland is affected; X11, Windows and macOS behave as
before.

# Screenshots/Recordings/Graphs

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

## Tests

Checked by hand on KDE Plasma (Wayland, GTK 3.24.52) against a build
without the fix. With the combo's tooltip showing, a click used to open
nothing; it now opens the filament, process and printer lists on the
first click with no GDK warning. Vendor sub-lists, picking an item,
clicking outside and clicking the combo again still work, and tooltips
come back after the list closes.

<!--
> 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)
2026-10-24 00:50:02 +08:00
Ian Chua bc39752fa2 Merge branch 'main' into feat/plugin-wildcard-permissions 2026-10-23 23:27:17 +08:00
Ian Chua 7073bbb09c Merge branch 'main' into fix/plugin-network-permissions 2026-10-23 23:25:47 +08:00
Ian Chua 501139e527 fix: use correct prepare state when adding handy objects (#16796) 2026-10-23 23:24:19 +08:00
SoftFever 2813c0ac5a Start the Flatpak When Regional Formats Use a Missing Locale 2026-10-23 23:15:51 +08:00
Lam Wei Lun bead387c4e Update GIT_TAG to use commit hash 2026-10-23 22:27:58 +08:00
Lam Wei Lun 831be085a1 Keep GIT_TAG v3.3.2 as reverted
The pin is set by hand later.
2026-10-23 22:27:58 +08:00
Lam Wei Lun fd844e6845 Keep the wx build options and header copy in OrcaSlicer
wxWidgets.cmake passes its options again and copies the private headers
after install. The patches stay in the fork, so the patch command is gone.
2026-10-23 22:27:58 +08:00
Lam Wei Lun bca3588ab0 Revert back to GIT_TAG v3.3.2 2026-10-23 22:27:58 +08:00
Lam Wei Lun 71a20aeb1c Build wxWidgets from the Orca-deps-wxWidgets fork
The wx options, the two patches and the private-header copy now live in the
fork, so wxWidgets.cmake keeps only the platform and Flatpak policy.
2026-10-23 22:27:58 +08:00
Noisyfox bfd3002875 Merge upstream/main and retain motion limit availability reasons
Follow the removal of silent_mode by updating only motion limit index zero, preserving disabled tooltips and visible controls.
2026-10-23 22:21:29 +08:00
SoftFever 2c91bfe0d3 Open dropdowns on the first click on Wayland when a tooltip is showing 2026-10-23 22:11:05 +08:00
HanifKoh 14da40e3a7 End the Process if Closing OrcaSlicer Takes More Than 30 Seconds (#16766)
Last resort for code that never returns while the app closes, such as
plugin code, vendor libraries or a lost network call. Once closing can
no longer be vetoed, a watchdog thread waits 30 seconds, logs that the
app did not finish closing and ends the process with std::_Exit. The app
config is saved on idle and again in MainFrame::shutdown, so little is
lost.
2026-10-23 19:21:22 +08:00
SoftFever 30ceeee18d Fix the Newer 3MF Warning for Alpha and Beta Projects in Nightlies (#16791)
# 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?
-->

Fixes #16771. Opening a project saved by 2.5.0-alpha in a nightly shows
"The 3MF file version 2.5.0-alpha is newer than OrcaSlicer's version
2.5.0-dev, found the following unrecognized keys:", followed by an empty
list.

Three things cause this:

- `semver.c` ranks `dev` below every other prerelease. Nightlies stay on
`x.y.z-dev` after the alpha and beta are tagged on the release branch,
so every alpha or beta project looked newer than the nightly opening it.
- `silent_mode` was retired: `handle_legacy` drops it on load, and
nothing can set it. It was still defined, though, so it was written into
every project. Every project then reported it as an unrecognized key on
load, and every project from a newer version took the "unrecognized
keys" branch of the warning. For the project in the issue it is the only
key reported.
- The warning never printed the keys it found, so the list was blank.

## Changes

- Rank `dev` above the other prereleases of the same version and below
the release: alpha < beta < rc < dev < release. This also changes two
other places that compare against the app's version:
- A project saved by a `x.y.z-dev` nightly now counts as newer when
opened in that version's alpha or beta.
- The update check, with prereleases enabled, no longer offers that
version's alpha or beta to nightly users. It still offers the release.
- Remove the `silent_mode` option, so projects no longer save it, along
with the code that only read it: the Normal/Silent columns on the
printer's Motion ability page, the Normal/Silent label in the
unsaved-changes dialog, and the switch that enabled the stealth time
estimator. Since the value was always false, none of these ran. The key
stays in the obsolete set, so older projects that contain it still load.
- List the unrecognized keys in the newer-version warning. The UI
strings are unchanged, so existing translations stay valid.

Projects saved before this change still carry `silent_mode`, so the
warning lists it when one of them is newer than the running version.

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->
Before:
<img width="860" height="200" alt="before"
src="https://github.com/user-attachments/assets/5d067ae1-5cfb-40b4-8973-3ac10cf2aeb9"
/>

After:
<img width="860" height="200" alt="after"
src="https://github.com/user-attachments/assets/2ef2401e-e869-4ae8-84f6-8730494c13c0"
/>

## Tests

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

- New `[Semver]` cases: dev ranks above alpha, beta and rc and below the
release of its version; two dev builds compare equal. They fail without
the `semver.c` change.
- New `[Config]` case: a full config has no `silent_mode`, and loading
one that has it drops it and reports it as unrecognized.
- On Linux, loaded the project from the issue in a `2.5.0-dev` build.
Before: the warning with an empty list. After: no warning. The same
project relabelled as 2.5.0 and given an unknown key shows the warning
listing that key and `silent_mode`.
- Re-saved the project from the CLI: `silent_mode` is no longer in
`project_settings.config`.
- Sliced the project before and after: identical moves and time
estimates; only the settings comments differ.
- `tests/libslic3r` and `tests/fff_print` pass on Linux. The STEP case
"A cone with a slightly tilted seam imports as a closed mesh" fails
locally on main too. The profile tool tests pass.

<!--
> 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)
2026-10-23 18:47:11 +08:00
SoftFever e0af998078 Tidy the Unrecognized Key List and Drop an Unused Stealth Setter 2026-10-23 18:45:59 +08:00
Ian Chua 35e1f8fa04 Merge branch 'main' into fix/plugin-network-permissions 2026-10-23 18:28:51 +08:00
Ian Chua fc2ca1fe08 Merge branch 'main' into feat/plugin-wildcard-permissions 2026-10-23 18:28:28 +08:00
Ian Chua f3f872281e fix: clang-tidy 2026-10-23 18:27:48 +08:00
SoftFever 022769c813 fix: keep vendor data files when shipping preset caches (#16706)
# Description

Filament preset compilation was deleting other JSON files that the
application reads at runtime. This causes the filament color selector to
not show vendor specific colors and always show an arbitrary color
picker instead of presets.

Also look up filament color codes by Bambu id inside
FilamentColorCodeQuery, so the Bambu color picker works when a non-Bambu
printer agent (or none) is live.

Fixes #16700

# Screenshots/Recordings/Graphs

Before:

<img width="427" height="510" alt="image"
src="https://github.com/user-attachments/assets/635fff2d-56fe-4c3e-bcb9-d7a22b1abbc6"
/>


After:

<img width="759" height="452" alt="image"
src="https://github.com/user-attachments/assets/f6a7bb02-d5ab-4d5d-a9c9-c55f61f6a167"
/>


## Tests

Tested on a local build with the fixes from this PR.

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-10-23 18:06:27 +08:00
Lam Wei Lun d645c702da Update wxWidgets Git repository URL 2026-10-23 17:17:44 +08:00
Lam Wei Lun 9d9bdeb9a6 Keep WebView2 content at monitor DPI, not Windows text size
WebView2 sets its rasterization scale to monitor DPI multiplied by the
user's Windows text size, and tracks that value itself. wx keeps the
webview bounds in raw pixels, so the page is drawn at the larger scale
inside an unchanged box. Dialogs hosting web content (Color Picker,
Plugins, Speed Dial, WebPanel pages) look zoomed in at 200% text size,
while the native wx chrome does not.

Turn off monitor-change detection on the controller and set the
rasterization scale to the webview's DPI scale on every bounds update,
so the page follows the monitor like the rest of the UI. The patch is
applied only on MSVC, the only build that uses the Edge backend.
2026-10-23 17:17:44 +08:00
Ian Chua 9739d3a9c4 fix: reject symlink and resolve relative paths to absolute 2026-10-23 16:48:34 +08:00
Ian Chua a9544713e3 Merge branch 'main' into feat/plugin-wildcard-permissions 2026-10-23 16:47:32 +08:00
Hanif Koh c15d401a5d Include the Catch2 Message Header in the Semver Test 2026-10-23 16:28:34 +08:00
SoftFever 5de3ec264f Restore exhaust fan settings on Bambu Lab printers that have one (#16792)
# Description

Brings back the filament Exhaust fan settings on the Bambu Lab X1, X1
Carbon, P1S, P2S, H2D, H2D Pro, H2S and X2D, so the exhaust fan again
runs during and after a print as configured. This fixes a regression
from 2.4.2 that first appeared in 2.5.0-alpha. Bambu ABS on the P2S with
a 0.6 nozzle keeps the exhaust fan off, as it did in 2.4.2.

Closes #14013

Profile data only. Slicing output changes only on these printers, with
filaments that turn on air filtration: those prints get back the exhaust
fan commands 2.4.2 emitted.

# Screenshots/Recordings/Graphs

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

## Tests

Each of the eight printers was sliced before and after the change. The
only G-code differences are the exhaust fan commands, and they match
what BambuStudio emits for the same printer and filament once air
filtration is turned on. `check_profile.sh` passes, and the GUI shows
the Exhaust fan group for the X2D and H2D, including in projects saved
with 2.5.0-alpha.

<!--
> 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)
2026-10-23 16:22:56 +08:00
Hanif Koh a8d73e6456 Rank Dev Builds Above Alpha and Beta
Nightlies stay on x.y.z-dev after the alpha and beta are tagged, so
ranking dev below every prerelease made each alpha or beta project look
newer than the nightly that should open it. Dev now ranks above the other
prereleases of its version and below the release.
2026-10-23 16:20:45 +08:00
Ian Chua 3bb40bc007 Merge branch 'main' into feat/plugin-wildcard-permissions 2026-10-23 16:15:30 +08:00
Ian Chua a131aa1124 Merge branch 'main' into fix/plugin-network-permissions 2026-10-23 16:13:12 +08:00
Ian Chua 6a0223f055 fix: Tighten plugin network grants and clarify consent scope 2026-10-23 16:12:57 +08:00
SoftFever b4e9047de5 Restore exhaust fan settings on Bambu Lab printers that have one 2026-10-23 16:10:55 +08:00
Hanif Koh 23ed61843e List the Unrecognized Keys in the Newer 3MF Version Warning
The warning said it found unrecognized keys but never printed them.
2026-10-23 16:08:48 +08:00
Hanif Koh 19eb55d3e5 Stop Saving silent_mode
silent_mode has been dropped on load since it was retired, and nothing
can set it, yet it was still defined and written into every project.
Remove the option and the code that only read it. The key stays in the
obsolete set so older projects still load.
2026-10-23 16:08:47 +08:00
Lam Wei Lun a860e533eb Revert the ci changes 2026-10-23 15:50:14 +08:00
Lam Wei Lun 71ee9c7379 Make the locale test check the wipe tower's BBL tags
GCodeProcessor::s_IsBBLPrinter is reset by export before the test asks for the tag names, so reserved_tag() returned the main G-code's ;HEIGHT: / ;WIDTH: spellings and the scan never saw the tower's lines. Use the literals the writer emits, and generate de_DE in the Linux test job so the case stops skipping there.
2026-10-23 15:50:14 +08:00
Lam Wei Lun e1d613096d Keep a Decimal Point in the Wipe Tower's Flow Tags
The ;HEIGHT: and ;WIDTH: tags that WipeTowerWriter writes for GCodeProcessor
were formatted with std::to_string, which follows the C numeric locale. On a
thread that keeps the user's locale, a comma-decimal locale wrote tags such as
";HEIGHT:0,300000". GCodeProcessor parses these values with the C locale, so it
logs an error and ignores the tag, and the width and height it assumes for the
tower fall back to its own.

Format them with float_to_string_decimal_point like the move coordinates beside
them, keeping six decimals so the output in the C locale is unchanged. The same
tags in WipeTower2 go through a stream, which formats in the global C++ locale
and was never affected.

Adds a test that slices with a comma numeric locale and checks every ;HEIGHT:
and ;WIDTH: line, including the two the writer's constructor emits before the
tower's start tag.

Related to #16777.
2026-10-23 15:50:14 +08:00
HanifKoh 04a9aecf01 Let OrcaSlicer Exit After a Device Warning Dialog Was Shown (#16764)
wx leaves the main loop only when no other top-level window exists,
hidden ones included. The unsupported-control and chamber temperature
warnings were parentless frames that are hidden, never destroyed, and
the printer parts dialog was heap-allocated without being destroyed, so
after any of them had been shown the process stayed alive once the main
window closed. Parent the warnings to the main frame and put the parts
dialog on the stack.
2026-10-23 15:48:59 +08:00
HanifKoh 5b39df5723 Stop the Slicing Thread Before a Project Reset Frees Its Print (#16762)
Closing the app, starting a new project or opening another one while a
slice was still generating perimeters or infill deleted the plate prints
under the running background thread, which crashed with a segfault or a
corrupted heap. Deleting a Print only cancels the thread once a
print-level step has started, so stop the background process before
reinit() deletes the prints.
2026-10-23 15:48:15 +08:00
Ian Chua 0439578fca Merge branch 'main' into fix/plugin-network-permissions 2026-10-23 13:56:09 +08:00
Ian Chua 557feba649 feat: introduce plugin APIs for mutable presets (#16518)
* feat: introduce plugin APIs for mutable presets

* fix: tests

* fix: tests

* doc: HLSD for preset plugin APIs

* feat: preset APIs

* fix: remove async behavior and clang-tidy

* fix: update demo plugins
2026-10-23 13:54:08 +08:00
SoftFever b3a8762b11 Keep the bed at first-layer filament temperatures with By Highest Temp (#16770)
# Description

With Bed temperature type set to By Highest Temp, the bed now stays at
the highest temperature of the filaments printed on the first layer for
the whole print. A filament that only starts higher up, such as a PETG
support interface on a PLA part, no longer heats the bed from layer 2 on
and softens the part standing on it. This matches BambuStudio's handling
of the same option.

Fixes #16644

Only By Highest Temp prints that use a filament above the first layer
change; By First filament and the first layer itself are unaffected.

# Screenshots/Recordings/Graphs

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

## Tests

Added a regression test that slices a supported overhang with the
support interface on a second filament with a higher bed temperature; it
fails before the change and passes after. Slicing the project attached
to the issue now keeps the bed at 45 °C after the first layer instead of
switching to 70 °C.

<!--
> 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)
2026-10-23 13:03:36 +08:00
Lam Wei Lun 49b433b69b Keep the Move coordinate system across selection updates
change_cs_by_selection() read obejct_idx and volume_idx without
initializing them when the selection has no single volume. The stale
values were compared with the last seen key, so a later scene refresh,
such as the one after an align, could reset Object back to World.

Initialize both to -1, and reset the last seen key to -2 on open so the
first update always applies the default. Apply the same fix to the Scale
gizmo, which has the same read.

Refs #16676
2026-10-23 11:30:03 +08:00
Lam Wei Lun d333be76f8 Align and distribute along the Object coordinate system
With the Object coordinate system selected in the Move panel, align and
distribute ignored it and always worked on world axes.

Measure each item in the frame of the selection's instance rotation, the
same reference the Move gizmo's Object mode uses, and convert displacements
back to world before applying them. The align preview is drawn in that
frame too.

Plate alignment stays on world axes, since the bed has no orientation.

Refs #16676
2026-10-23 11:30:03 +08:00
Lam Wei Lun 6c710577b3 Fix Move gizmo align mode after selection changes
The align mode was forced to "Plate" when the selection could not align
within itself, and was never restored when the selection grew. The
Distribute row is only shown in "Selection" mode, so it stayed hidden
after selecting an assembly while the tool was open.

Track whether the selection can align within itself and reset the mode
when that changes.

Refs #16676
2026-10-23 11:30:03 +08:00
Noisyfox 7d0ba0a5aa Merge upstream/main into option-unavailability-reasons
Keep option availability reasons while adopting the ArcFittingMode enum.
2026-10-23 09:43:58 +08:00
Hanan V af7084def7 Fix a crash slicing painted objects: two classes named Slic3r::IslandLocator (#16774)
#15985 added a file-local IslandLocator class to MultiMaterialSegmentation.cpp, and #16291 added a different Slic3r::IslandLocator in ConnectedBodies.hpp. Their implicit destructors have the same symbol, so the linker keeps only one of them. When it keeps the ConnectedBodies one, merge_segmented_layers destroys its locator with the wrong destructor and frees memory it never allocated. On builds where that destructor is not inlined, slicing any painted object crashes.

Put the MultiMaterialSegmentation class in an unnamed namespace so it is private to its file.
2026-10-22 19:45:26 -05:00
Paul 86445094cc Add additional SHS filament profiles
Adds Matte PLA, Silk PLA, Marble PLA, TPU 95A, Matte PETG and Transparent PETG profiles.
2026-10-22 18:41:46 -04:00
Paul fb70f14a5c Merge branch 'OrcaSlicer:main' into main 2026-10-22 18:28:24 -04:00
yw4z 76ddcab0ab Match style of Texture Import Dialog (#16768)
* Update TextureImportDialog.cpp

* fix tidy

* fix color count buttons

* add margin to Auto / Apply
2026-10-22 23:28:27 +03:00
SoftFever 19e42d8dce Keep the bed at first-layer filament temperatures with By Highest Temp 2026-10-23 01:42:08 +08:00
bwees c100a39b08 fix: include the headers EncodedFilament uses directly 2026-10-22 11:05:52 -05:00
bwees a3e4841796 fix: look up filament color codes by Bambu id for any printer agent 2026-10-22 11:05:52 -05:00
bwees 961f55a21e fix: keep vendor data files when shipping preset caches 2026-10-22 11:05:52 -05:00
Ian Bassi 373ffaa13f Add a Sparse infill only mode to Arc fitting (#16747) 2026-10-22 12:51:44 -03:00
Kris Austin 3f8ff53e65 Keep keys away from the 3D view while ImGui has the keyboard (#16673)
The 3D view decided whether to run its shortcuts from ImGui's "wants the
keyboard" flag, which is updated a frame late. The first key typed after
clicking into a field could still reach the canvas.

The canvas now leaves every key to ImGui while an ImGui text field is
active, while a popup (dropdown, menu or modal) is open, or while a
slider or button is held with the mouse. A focused sidebar text field
works the same way. Global shortcuts still run unless they edit text.
Every key still goes to ImGui.

- ImGuiWrapper::claim_key_event() decides on the key-down. The key's
  repeats, char event and release follow that decision, so a key never
  both runs a shortcut and types.
- Esc closes an open dropdown or menu before the gizmo.
- Esc and Tab during a slider drag no longer close the gizmo or switch
  views.
- text_input_active() reads ImGui's text input request, so a slider
  that once had a value typed into it no longer counts as a text field
  when dragged.
- A modifier whose key-up went to a dialog no longer stays stuck. The
  canvas releases held modifiers when it loses the focus, and ImGui
  takes its modifiers from each mouse event.
- The macOS Edit menu's key equivalents follow the same rule.
2026-10-22 10:22:23 -05:00
Noisyfox 8b8f2ca909 Explain disabled preset compatibility conditions 2026-10-22 23:06:26 +08:00
Noisyfox aea6b9c02d Explain filament override retraction dependencies 2026-10-22 23:06:26 +08:00
Noisyfox 3b5fc939fc Show availability reasons in object table settings 2026-10-22 23:06:26 +08:00
Noisyfox a07d1f2f62 Keep motion limit availability consistent with disabled controls 2026-10-22 23:06:26 +08:00
Noisyfox e3b9be506f Deduplicate availability reasons in row tooltips 2026-10-22 23:06:26 +08:00
Noisyfox 49d109f846 Fix availability tooltips for synthetic options 2026-10-22 23:06:26 +08:00
Noisyfox 2246f5fce7 Reuse repeated option availability reasons 2026-10-22 23:06:26 +08:00
Noisyfox ae065a0dd6 Declare settings owner lookup in the Tab header 2026-10-22 23:04:17 +08:00
Noisyfox 55cd101ef6 Explain printer and filament option restrictions 2026-10-22 23:04:17 +08:00
Noisyfox 4eac8f70a0 Explain print option dependency restrictions 2026-10-22 23:01:01 +08:00
Noisyfox 12c578fd80 Explain support and raft option restrictions 2026-10-22 23:01:01 +08:00
Noisyfox 1bf53e3a19 Show option restriction reasons in settings search 2026-10-22 23:01:01 +08:00
Noisyfox ffb1a0b6cc Explain option restrictions in field and label tooltips 2026-10-22 23:01:01 +08:00
Noisyfox 3573195780 Record option availability reasons per settings tab 2026-10-22 23:01:01 +08:00
SoftFever f92f75e0fa Feat: Add multiple and 3D bed exclusion volumes (#13777)
# Description

This PR adds opt-in, height-aware exclusion volumes to OrcaSlicer,
including multi-nozzle handling, object and generated-geometry
validation, final G-code collision checking, and travel rerouting.

It grew from the original object-placement prototype into a
collision-aware slicing pipeline with documented limitations. The
central compatibility decision is that Orca's existing
`bed_exclude_area` keeps its historical meaning, while the new
`bed_exclude_volumes` setting explicitly enables the stronger
collision-aware behavior.

<img width="935" height="707" alt="Travel paths routed around exclusion
volumes"
src="https://github.com/user-attachments/assets/22925e5c-a3b1-4c26-be1a-8a89d9970cb5"
/>

Related issues: #5922, #10579, #10638 and #12774.

## Why this is useful

The existing 2D exclusion area prevents object placement in areas such
as the filament-cutter corner on Bambu printers. It cannot describe low
bed clips, raised tool docks, camera arms, flying-gantry hardware, or
other obstacles that occupy only part of the printer's Z range.

Treating every existing area as a physical motion obstacle would also be
unsafe for compatibility: some printers deliberately move into their
excluded material area. This PR therefore separates the two concepts
rather than changing the meaning of existing profiles.

| Setting | Purpose | Existing motion affected? |
| --- | --- | --- |
| `bed_exclude_area` | Existing bed-fixed material/placement keep-out |
No G-code checking or travel rerouting |
| `bed_exclude_volumes` | Shared 3D collision volumes |
Object/generated-material checks, G-code validation and travel rerouting
|
| `extruder_bed_exclude_volumes` | Per-extruder 3D collision volumes |
Same collision behavior, resolved for the active physical nozzle |

Bed areas and collision volumes are additive. A printer can retain an
existing cutter/material keep-out while adding separate physical
collision volumes. Belt printers retain the existing projection of bed
areas onto the tilted belt surface; collision volumes remain in model
coordinates.

## Configuration and syntax

`bed_exclude_volumes` accepts one or more polygonal prisms:

```text
XxY,XxY,...
```

defines a full-height collision volume.

```text
REGION|REGION|REGION
```

defines multiple independent volumes.

```text
ZMIN..ZMAX;XxY,XxY,...
```

defines a volume active only across that Z range. Either Z bound may be
omitted:

```text
..10;20x20,40x20,40x40,20x40
30..;20x20,40x20,40x40,20x40
```

For example:

```text
20x0,45x0,45x18,20x18|8..22;115x20,145x20,145x48,115x48
```

defines one full-height volume and one volume active from Z=8 mm to Z=22
mm. Z ranges are validated and clamped against the configured printable
height, and decimal parsing is locale-independent.

The CLI exposes the same distinction:

```text
--bed-exclude-area
--bed-exclude-volumes
```

Existing scripts using `--bed-exclude-area` retain the original polygon
format and behavior.

## Backward compatibility and migration

- Existing profiles and projects using only `bed_exclude_area` keep its
material/placement keep-out meaning; they do not implicitly enable
collision-volume checking or travel rerouting.
- Stock printer motion is not checked or rerouted against bed areas.
This is important for machines that deliberately enter an excluded
material area during cutting or loading.
- The new syntax is stored under separate config keys, so an older Orca
build does not try to deserialize a volumetric string as the existing
point-list option.
- In **Printer settings → Basic information → Printable space**,
**Excluded bed area** remains a normal editable field with Orca's
standard reset controls. **Toolhead collision volumes** is a separate
field directly below it. There is no Convert/Copy button and neither
setting clears the other.
- A bed-area polygon can be manually copied into the collision-volume
field to describe a full-height physical obstacle. Pasting volume syntax
into the bed-area field instead prompts for confirmation before adding
it to the appropriate volume definitions. The saved bed area, existing
volumes and selected nozzle mode are preserved; cancelling leaves them
unchanged.
- If a user does not configure the new volume keys, the new G-code
checker, rerouter, support trimming and nozzle-specific brim behavior
remain inactive.

This gives existing profiles a stable compatibility boundary while
allowing users and maintainers to migrate deliberately to full collision
checking over time.

## Multi-nozzle behavior

For multi-nozzle printers, the collision-volume mode selects one of
three behaviours. In individual mode, each extruder's definition is
edited on its own Extruder settings page. These modes apply only to
collision volumes; the excluded bed area stays shared and bed-fixed.

Collision volumes support three modes:

<img width="549" height="441" alt="Exclusion volume behavior selector"
src="https://github.com/user-attachments/assets/6ca8c2e2-d00e-4b32-9b12-bfbff0928966"
/>

### Shared

Every physical nozzle uses the same collision-volume definition.

<img width="2353" height="1633" alt="Shared exclusion volumes"
src="https://github.com/user-attachments/assets/96fe938b-07b4-4cd9-b587-e31f2ebba5f8"
/>

### Toolhead-relative (nozzle offsets)

The shared definition is treated as relative to the toolhead. Orca
derives the other nozzles' collision regions using their configured XY
offset from the reference nozzle. This is useful where the same physical
carriage must avoid an obstacle but its position changes when a
different offset nozzle prints at the same model coordinate.

<img width="1084" height="803" alt="Toolhead-relative exclusion volumes"
src="https://github.com/user-attachments/assets/e0790ee4-68b5-444f-90ac-22a5eba05eec"
/>

### Individual per extruder

Each physical extruder/nozzle has its own independent volume definition.
This supports machines whose valid region differs by tool and cannot be
derived from a simple nozzle offset.

<img width="1123" height="761" alt="Independent exclusion volumes for
three extruders"
src="https://github.com/user-attachments/assets/c6404ceb-9958-4df8-93ed-5ff2ac7dc658"
/>

Object validation resolves logical filament assignments to the physical
nozzle or nozzles that may print the object, including automatic Bambu
mapping. If an object may use several nozzles through painting,
feature-level assignments, modifiers, support or interface material, the
complete object is conservatively checked against every relevant
nozzle's volumes.

## Object validation and 3D preview

Object collision detection uses a cheap XY/Z broad phase followed by an
exact mesh-versus-prism test. The exact test:

- Avoids rejecting an object whose XY shadow overlaps a raised volume
while its real mesh remains clear.
- Detects normal surface crossings.
- Detects a volume completely enclosed inside a solid model.
- Respects object-instance and model-volume transforms.
- Separates the collision decision from optional preview-mesh
generation.

When a collision is found, Orca reports the relevant extruder where
possible and renders the intersecting model surface in red. The bed
preview shows a neutral grey footprint, a thin nozzle-colored ownership
border where appropriate, and a translucent 3D prism when a nearby
object makes the volume relevant. Raised volumes keep their ownership
outline on the bed rather than floating at their starting Z.

<img width="578" height="534" alt="Red model and exclusion-volume
intersection preview"
src="https://github.com/user-attachments/assets/d409f574-1790-48e5-b4a3-703273439954"
/>

Single-nozzle/shared geometry remains visually neutral; nozzle colors
are used when they convey distinct tool ownership.

The default automatic preview limits the translucent 3D geometry to
nearby object height to avoid obscuring the workspace. **View → Show all
collision volumes** displays the complete configured Z ranges, including
on an empty bed. Its default shortcut is **Ctrl+Shift+V**
(**Command+Shift+V** on macOS), and it can be changed in the shortcut
settings. Orca remembers this application-level display preference
independently of printer presets; it does not change collision checks or
slicing.

## Arrange and Fill Bed

Arrange and Fill Bed receive Z-aware, nozzle-aware obstacles, so an
object may occupy a footprint belonging only to another nozzle or pass
below a raised volume when its height permits it.

- Existing objects remain obstacles when Fill Bed creates new copies.
- Convex volume footprints are passed through accurately.
- Orca's current libnest2d path supports convex NFP obstacles only, so
non-convex volumes use a documented conservative bounding box until
convex decomposition is implemented.
- Orca's existing final alignment and normal unplaced-item behavior are
retained.

<img width="1097" height="846" alt="Fill Bed with multiple tools and
exclusion volumes"
src="https://github.com/user-attachments/assets/8c0ee5cf-624b-42a6-b57a-13c73400ac5c"
/>

## Brim and support generation

When collision volumes are enabled, object and support brims are clipped
against the relevant first-layer volume footprints before their final
extrusion paths are generated. Brim ownership is retained so touching
object and support brims cannot be merged and silently reassigned to a
nozzle whose volume they intersect. Established bed-edge and bed-area
brim clipping remains unchanged when collision volumes are not
configured.

<img width="1139" height="770" alt="Object and support brims clipped
around nozzle-specific volumes"
src="https://github.com/user-attachments/assets/2913ff31-53e4-4e43-8b27-1afba7e3bafb"
/>

Normal support and raft polygon categories are trimmed against the
relevant volumes over each support layer's actual vertical slab.
Support-material resolution accounts for explicit support/interface
tools, “current filament” behavior, alternating material layers,
automatic physical-nozzle mapping, support brims, and shared support
geometry.

TreeSupport3D receives active exclusion geometry during branch planning
so its existing avoidance machinery can steer branches around obstacles
rather than merely cutting finished paths.

## Final G-code collision validation

The final emitted G-code is checked as a safety backstop after slicing.
The checker tracks:

- The active physical nozzle and its XY offset.
- Absolute and relative XY/Z motion.
- Travel, extrusion and other parsed motion types.
- Tool selection and physical/nozzle mapping.
- Explicit motion in start, filament-change and tool-change G-code.
- Coordinate resets and common `G28` forms, including bare, spaced,
compact and parameterized axis selections.

Material keep-outs from `bed_exclude_area` are deliberately ignored by
the motion checker. Only explicit collision volumes constrain motion.

If Z is genuinely unknown, the check is conservative across all relevant
heights and the warning identifies that fact and includes the relevant
G-code line. The artificial first segment that the preview draws from
`(0,0)` is not treated as a real machine move.

## Travel rerouting

Generated travel moves are rerouted around active collision volumes when
a valid route exists.

Routing is:

- Aware of the travel's actual Z slab and planned lift/Z-hop.
- Resolved for the active physical nozzle.
- Constrained so any detour vertices added by Orca remain inside the
printable bed.
- Able to accept firmware-established start/end points on or beyond the
nominal bed edge.
- Revalidated before the replacement path is emitted.

The implementation covers ordinary generated travels, the first
generated move after start G-code, and moves following physical or
same-nozzle filament changes. Explicit movement commands in custom
start/tool-change G-code update the tracked position so the next
generated travel begins from the correct point without defeating Orca's
post-toolchange Z restoration.

Obstacle geometry is cached by extruder and active Z-region set, with
bounding-box rejection before expensive polygon work. Clear travels
therefore avoid repeatedly unioning and offsetting the same obstacles.

If no safe route can be found, Orca leaves the original move for the
final checker to report rather than emitting an assumed-safe detour.
Extrusion paths are validated but never rerouted.

<img width="1286" height="706" alt="Travel rerouting from start G-code
across multiple Z-aware volumes"
src="https://github.com/user-attachments/assets/a68cd98f-5576-4f78-af43-697e9f687a9b"
/>

And here is an example of independent nozzle travel rerouting:
<img width="2532" height="876" alt="image"
src="https://github.com/user-attachments/assets/28b0c26e-59d6-42b9-a64f-4c2205c4ea3f"
/>


## Testing and review status

Targeted Catch2 coverage now includes:

- Bed-area/volume parsing, validation, confirmed paste handling,
additive behavior and CLI options.
- Belt-surface projection of bed areas through both static and dynamic
region resolution, including the reported cube positions, with collision
volumes left unprojected.
- Shared, toolhead-relative and individual per-extruder resolution.
- Physical-nozzle and filament mapping.
- Exact object intersection, including fully enclosed prisms and
transformed instances.
- 3MF persistence.
- Arrange behavior for convex and non-convex obstacles.
- Brim bed-boundary and volume clipping regressions.
- Support and interface-material masks across support polygon
categories.
- G-code motion classification, coordinate tracking, homing forms and
tool selection.
- Safe travel rerouting, Z-aware activation, nozzle selection, off-bed
firmware endpoints and failure cases.

The reviewed `929beaee15` revision passed the CI checks, and review
testing confirmed that the unit tests and earlier arrange, tool-change Z
restoration, support, brim and brim-ownership regressions still pass.
Stock-output comparisons covered 12 printers × 3 jobs plus 17 project
files and produced G-code identical to `main` when the new feature was
not configured.

The belt projection correction and its regression coverage are included
in the latest update. Please use the checks below for the current head's
build and test status; earlier successful runs do not substitute for
validation of a new revision.

Review also compared CLI output against `main` across stock printers and
multi-filament projects. The compatibility regressions found during that
review—including stock Bambu cutter motion, preset dirty state,
unintended bed-area brim/support changes, tool-change Z restoration,
stale post-change origins, arrange rejection, router cost, locale
parsing and bed-edge brim clipping—have been addressed.

## Known limitations and follow-up work

The implementation deliberately favors conservative safety. A false
positive or some unused build volume is preferable to emitting a
movement that may collide with the machine. Collision warnings are not
an automatic repair or a guarantee of safe output.

- Skirts and draft shields are not regenerated or detoured around
collision volumes. The final checker can report an intersection, but
producing a valid closed loop around internal obstacles while remaining
inside the bed needs a dedicated solution.
- Extrusion paths are checked but not rerouted.
- Spiral Z-hop's circular XY sweep is generated after the primary travel
route has been planned. That sweep is not currently rerouted; the final
G-code checker can report a collision, but does not repair it.
- Orca cannot infer movement hidden inside an opaque firmware macro. A
deterministic macro endpoint should be exposed with explicit `G90`/`G91`
and `G0`/`G1` motion in Orca's custom G-code so the following travel can
be routed from a known position. Movements inside custom G-code are
checked, but only the generated travel after them is rerouted.
- Negative model parts are not applied to the raw object-intersection
mesh, so geometry removed only by a negative part can produce a
conservative false positive.
- Multi-nozzle object validation applies every relevant nozzle's volume
to the complete object rather than only its visibly painted surface.
- Support shared by several instances uses a conservative union of
relevant plate-space exclusions.
- Support avoidance trims or steers generated geometry but does not
perform structural support re-planning. Support above a raised volume
may resume over a void; native tree-support paths not using
TreeSupport3D are not yet volume-aware.
- Raised-only collision volumes are not yet fully represented in
prime/wipe-tower placement validation; the final G-code checker remains
the safety backstop.
- Existing cross-object support-to-support overlap behavior is outside
this PR.
- “No tool selected” carriage-only exclusions are not represented by
Orca's current backend and remain a possible future extension.

## Origin

This work began with the [Muon3D
M1](https://www.youtube.com/watch?v=jBatFQpTM6g), whose notched glass
bed leaves usable print volume above a low obstruction. Upstreaming the
capability lets other printers describe low clips, raised docks,
toolchanger hardware and per-tool clearance limits without requiring a
permanent fork.

Thank you to everyone who tested the implementation, reviewed the
architecture, identified regressions and helped improve the test
coverage—especially the multi-tool and macOS testers. Further
real-hardware feedback remains welcome, but the current implementation
and compatibility behavior are ready to merge.

Harry Loud  
Muon3D
2026-10-22 22:04:40 +08:00
Ian Chua 2410112046 feat: add wildcard permissions for fs 2026-10-22 20:49:57 +08:00
SoftFever e5bb802378 Bake texture displacement on every painted part of an object (#16721)
# Description

Texture displacement read the layer stack and the bake target from an
object's first model part, so a multibody object was displaced only
there while the paint on its other parts was kept and ignored. The bake,
prepare and preview jobs now each carry a vector of parts and run them
in one job, under one progress bar and one undo step; remesh and
subdivide cover every part too

# Screenshots/Recordings/Graphs
<img width="3515" height="1838" alt="image"
src="https://github.com/user-attachments/assets/227cd067-4b04-476a-982e-b52c4fdcca23"
/>

# Other
Fixes #16559

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-10-22 18:45:27 +08:00
SoftFever c6f3b766c0 Merge branch 'main' into fix/texture-displacement-multibody 2026-10-22 18:41:46 +08:00
SoftFever 7f201f4dba Bake one continuous texture across every part and stop Close from crashing
Removing a layer clears its paint on every part, tiled and view-projected
textures run on across parts, the projection tools paint every visible part,
relief under a raised part reaches down to where the object rests, and closing
the tool no longer crashes the app.
2026-10-22 18:27:32 +08:00
Robert Baker c174890376 Merge branch 'OrcaSlicer:main' into ankermake-header-gcode 2026-10-22 02:42:50 -07:00
Lam Wei Lun b1540f331a Fix include order 2026-10-22 17:36:31 +08:00
Lam Wei Lun b53cbd5b6d Fix missing includes 2026-10-22 17:36:31 +08:00
Lam Wei Lun 37e3ce6013 Keep the web Device page loaded when its tab is reselected
Selecting the web Device tab, or changing the printer preset, called
load_url with the same URL. That navigated the webview again and reloaded
the printer UI, dropping its in-page state such as zoom.

PrinterWebView now remembers the URL, API key and host type of its last
finished load and skips navigation when all three match. A host type change
still reloads, since it selects the page handler. A failed load is not
remembered, so the next selection retries.

Fixes #16752
2026-10-22 17:36:31 +08:00
SoftFever a83abad59c Merge branch 'main' into fix/texture-displacement-multibody 2026-10-22 16:42:11 +08:00
Robert Baker 501c72dc3e Merge branch 'OrcaSlicer:main' into ankermake-header-gcode 2026-10-22 01:18:10 -07:00
SoftFever 664f734e22 Fixes for arrange, scale to fit and lay on face (#16691)
# Description

Three fixes that all come from the same root cause: code that assumes
the bed is the one at the plate origin.

**Arrange**

- An item whose outline fits the printable area could never be placed.
The arrange bed is inset by `bed_shrink` (1 mm per side) and the item is
inflated by its brim width, and `update_selected_items_inflation()` only
relaxed that inflation when there were more than 5 mm to spare. An item
scaled to fit the print volume was rejected every time, and arrange
looked like it did nothing. The bed margin is now given back where the
largest selected item needs it (never below the skirt distance) and the
inflation is capped at the printable area.
- When an item came back `UNARRANGED`,
`PartPlateList::postprocess_arrange_polygon()` parked it on a virtual
bed that was never created, moving it a whole plate stride off the
plate. The instance is left where the user had it instead.
- When nothing could be placed at all, `ArrangeJob::finalize()` still
cleared plate membership and rebuilt the plates, which re-homed a too
large item to whichever plate it happened to reach over. It now returns
before touching anything.
- Arrange no longer recycles plates. It must not delete a plate the user
created, even when the arrange leaves it empty.

**Scale to Fit Print Volume**

`Selection::scale_to_fit_print_volume()` centred the selection on
`bed.build_volume()`, the bed at the origin. Scaling a model that sat on
plate 2 moved it back to plate 1. The centre of the active plate is
passed in instead (and the print circle is shifted by it for circular
beds). Every plate shares the bed size, so only the centre differs.

It also fitted the whole bed, which on a multi-nozzle printer is larger
than any nozzle can reach. On the H2D the left nozzle covers X 0-325 and
the right X 25-350, so a model that filled the 350 mm bed in X sat
outside both, and the plater warned "The position or size of the model
exceeds the right nozzle's printable range" immediately after the user
asked it to fit. It now fits `PartPlate::get_build_volume(true)`, the
volume every nozzle shares and the same region Arrange already places
items in.

It now also keeps clear of rectangular exclusion zones
(`bed_exclude_area`). The fit volume is the shared bed minus each
exclusion: every rectangle spanned by bed and exclusion edges that
overlaps no exclusion. Candidates no wider than the bed padding are
dropped, otherwise a sliver at the bed edge wins and the model is scaled
to nothing. The candidate allowing the largest scale is used and the
selection is centred on it. Before this, a model could be fitted onto
the Qidi Q2's front-left notch. Circular beds are unchanged.

**Lay on Face**

Laying a face that already points straight up down needs a half turn,
and every horizontal axis does the job. `setFromTwoVectors()` resolved
that through an SVD whose null space is the whole XY plane, so the axis
followed rounding noise: the object landed at an arbitrary angle in the
plate plane, often large enough that a part which fitted the plate no
longer did ("Following objects are laid over the boundary of plate...").
Such a face is now turned over about X, which keeps the footprint, and
the rotation is shared between the gizmo and the `--ground-*` options
instead of duplicated in `Selection::flattening_rotate()` and
`lay_on_face()`.

# Screenshots/Recordings/Graphs

Fit to print volume now excludes exclusion areas and ensure it fits
within shared nozzle areas
<img width="1674" height="1408" alt="image"
src="https://github.com/user-attachments/assets/30bebe17-ee2c-454a-b361-cdb504ad4043"
/>

Lay On Face for faces that are pointing straight up does not cause weird
rotation anymore


https://github.com/user-attachments/assets/adfc0cb4-56e0-4768-873d-ef6c0fb940d9

Auto Arrange now does not remove empty plates anymore


https://github.com/user-attachments/assets/188cada1-304f-4505-a1df-4339f9dad2df




## Tests

New unit tests in `tests/libslic3r`:

- `test_arrange.cpp`: an item filling the printable area is now arranged
(it fails without the margin clamp), an item larger than the printable
area is still refused, and an item that cannot be placed keeps the
position it came in with.
- `test_lay_on_face.cpp`: a box laid on its top face ends up as `diag(1,
-1, -1)` with its 40 x 20 footprint and on the bed, instead of whichever
axis the noise picked.

The GUI side (arrange job, plate rebuild, scale to fit, gizmo) has no
test suite and was verified by reproducing each report and re-running
it. I have not built this branch locally.

Manual checks used while developing:

1. Scale a Benchy to fit the print volume, move it on Y, Arrange: it
centres and stays on the plate.
2. Add a plate, move a too large object onto it, Arrange: nothing moves,
no plate is removed.
3. Scale to fit on plate 2: the model stays on plate 2.
4. Lay on Face on the top face of a flat part: it flips over X and stays
inside the plate footprint.
5. Scale to fit a model that fills the bed in X on a dual-nozzle H2D
(bed 350x320, nozzles 0-325 and 25-350): it now fits the shared 300 mm
area, and the left/right nozzle printable range warnings stay closed.
Before the change the fit produced a 350 mm wide model that was outside
both nozzle areas.
6. Scale to fit on a Qidi Q2 (front-left exclusion 0-11 x 0-16 mm): the
model stays clear of the notch and is fitted to the largest free area.
7. Scale to fit a cube on a Qidi X-Max 4 (four corner exclusions): it
lands in the free central area at a sensible scale instead of going to
0%.
2026-10-22 16:14:08 +08:00
SoftFever 639ed05884 Merge branch 'main' into fix/arrange-scale-fit-lay-on-face 2026-10-22 15:59:09 +08:00
HanifKoh 5941c5603d Show Track-Switch AMS Units Under Both Nozzles in the Calibration Wizard (#16632)
* Show Track-Switch AMS Units Under Both Nozzles in the Calibration Wizard

With a Filament Track Switch installed the device layer pins every AMS to
the main extruder and records the real binding in GetBindedExtruderSet(),
but the calibration preset page still split the AMS units by
GetExtruderId(). Every AMS landed under the right nozzle and the left
nozzle only offered its external spool.

Split the panels by the bound extruder set, blank the external spools when
the switch is installed, and take a selected filament's extruder from the
panel it was picked in rather than from its AMS.

* Run the Flow Rate Fine Pass on the Extruder the Coarse Pass Used

When the fine pass starts from the coarse page the filament comes from
the cached preset, but the extruder was resolved from whatever the
preset page currently has selected. After a restart or reconnect, or if
the selection was changed, that no longer matches and the lookup falls
back to the per-AMS map, which with a Filament Track Switch pins every
AMS to the main extruder. Take the extruder from the cache in that path;
it already records the one the coarse pass was sent with.
2026-10-22 15:31:23 +08:00
SoftFever 43c76f1f52 Keep Layer Pauses on Their Own Layer in the Preview (#16718)
# 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?
-->

Fixes #16693. After slicing, the Preview listed layer pauses one or more
layers too high, and with two adjacent pauses one of them showed as
layer 0. The G-code was always right: every pause is written at the
correct height, before the correct layer. Only the Preview's layer
numbering was wrong.

## Cause

When the G-code processor reads a pause, color change or custom G-code
tag, `OptionsZCorrector::set()` stores the index of that vertex in the
move list. At the first extrusion after it, `update()` moves the vertex
to that point so it renders at the new layer's height.

A pause (and a color change) first flushes the time planner. The flush
inserts actual speed moves ahead of the flushed blocks' moves, which all
come before the vertex, so the stored index goes stale and points at an
earlier move: the previous layer's last extrusion. `update()` then moves
that extrusion past the travel to the next layer, with its old layer id,
and erases a real move. The erase also shifts every later move down one,
so the time blocks still queued for the travel and unretract after the
pause point one move off; a Debug build trips
`assert(curr_move.actual_feedrate == 0.0f)` in
`TimeMachine::calculate_time` on a Marlin profile.

This has been possible since actual speed moves were added. It became
visible with the belt printer change that renumbers the Preview's layers
on every change of a move's layer id (`f64b49ab52`): the out-of-order
move now turns into two extra layers, the layer heights stop being
sorted, and the legend's lookup misses. 2.4.2 is not affected.

## Changes

- `OptionsZCorrector::on_moves_inserted()`, called at the end of
`GCodeProcessor::calculate_time`, shifts the stored index by the moves
the flush inserted before it, read from the block id map the same
function already builds for the queued blocks.
- `OptionsZCorrector::update()` returns the index it erased, and
`process_G1` moves the queued blocks after it down by one.

No change to the G-code, the time estimates of prints without pauses, or
project files.

# Screenshots/Recordings/Graphs

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

The reporter's cube with pauses at layers 55 and 56 (Z 11 and 11.2):
main lists them at layers 56 and 60 and shows 132 layers for a 128-layer
print; with this change they are at 55 and 56, and the slider shows 128
layers.

Before:
<img width="480" height="560" alt="legend-before-main"
src="https://github.com/user-attachments/assets/d9604038-91c0-4574-8496-a7d9f49268cf"
/>

After:
<img width="480" height="560" alt="legend-after-fix"
src="https://github.com/user-attachments/assets/0ad4be7e-a258-4eaa-ae94-8eb66ef01fae"
/>

## Tests

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

- New test in `tests/fff_print/test_gcodeprocessor.cpp`, "A pause keeps
the moves around it in order and on their own layers": three layers with
a pause before the second; checks the pause's height and that layer ids
and G-code lines never go backwards. It fails on main (the pause stays
at Z 0.2 and a layer-0 extrusion lands after layer-1 moves) and passes
with the change.
- `fff_print` suite passes (484 tests, Release, Linux), including the
`[GCodeTiming]` cases.
- On Linux, sliced the issue's project with one and two pauses on the
Anycubic Kobra 3 (Klipper) profile and checked the Preview legend and
layer slider. Marlin is covered by the new test, which runs the
processor with Marlin.
- clang-tidy check passes.

<!--
> 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)
2026-10-22 15:00:12 +08:00
SoftFever db1824dd5d Speed up slicing of finely detailed models (#16741)
# Description

Slicing finely detailed models such as HueForge reliefs is up to twice
as fast. Two steps that ran on a single core
dominated these slices. G-code export spent most of its time working out
which object each extrusion belongs to, and
internal bridge detection stalled for tens of seconds on layers printed
over fully dense infill. On the relief
"Mensch oder Gott 2", the slice goes from 108 s to 54 s on an M5 Max and
from 116 s to 65 s on Windows.

Over a lower layer printed at full density, bridge detection now settles
most layers with a cheaper check before it
falls back to the full computation. That check can disagree with the
full computation in one case, which is accepted:
a solid sliver thinner than about 16 µm that Clipper's own offset
simplification folds. There, internal bridges can
come out differently from main.

No change to slicing output on any project tested. G-code and object
masses are identical to main.

# Screenshots/Recordings/Graphs

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

## Tests

New unit tests compare the bridge-detection helper with the full
computation, and cover the box-only island lookup.
Main and this branch were compared on the projects below. They were also
compared on OrcaCube variants that set each
density option below 100%, plus a spiral vase, a crowded plate and a
two-part assembly. Every case slices to
byte-identical G-code, ignoring the timestamp line, and to identical
object and body masses. Slice times are for the
CLI, two runs each, on an M5 Max:

| Project | main | this PR |
|---|---:|---:|
| Mensch oder Gott 2 | 107.7 s, 108.8 s | 54.3 s, 54.4 s |
| Stranger Things 169×250 | 100.6 s, 100.6 s | 65.2 s, 66.0 s |
| RDR Front 229×256 | 12.6 s, 12.6 s | 8.6 s, 8.6 s |
| Lupo+AMS | 13.0 s, 13.1 s | 10.0 s, 10.0 s |
| Eagle 200×200 | 34.6 s, 34.0 s | 33.7 s, 34.0 s |

and on Windows with an Intel Core Ultra 7 270K Plus (Release build,
clang-cl), where the G-code is identical to main's
too:

| Project | main | this PR |
|---|---:|---:|
| Mensch oder Gott 2 | 121.2 s, 111.7 s | 68.2 s, 61.0 s |
| Stranger Things 169×250 | 100.7 s, 93.0 s | 59.7 s, 65.1 s |
| RDR Front 229×256 | 13.9 s, 13.4 s | 10.3 s, 10.1 s |
| Lupo+AMS | 19.9 s, 13.9 s | 20.9 s, 11.4 s |
| Eagle 200×200 | 38.9 s, 37.5 s | 38.1 s, 37.1 s |

Eagle uses about 15 s less CPU on both machines, but its export is bound
by G-code generation, so its slice time does
not change. Lupo's first run on Windows was slow with both builds. Peak
memory is the same within run-to-run spread,
except that it is about 0.1–0.2 GB higher on Stranger Things on the M5
Max and about 0.1 GB higher on Mensch oder Gott 2
on Windows.

<!--
> 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)
2026-10-22 14:38:36 +08:00
ExPikaPaka e7e705877e Merge branch 'main' into fix/texture-displacement-multibody
main has since given texture displacement a model UV channel of its own
(ModelVolume::texture_uv). That channel belongs to a part rather than to
the object, so it joins base_mesh and the paint masks in the per-part
entry each job now carries, and every part maps through its own layout.

Also kept from main in the panel: panel_tooltip() in place of the wrapped
ImGui tooltip, and the plural forms of the triangle-count note - with the
count still summed over the parts the bake will act on.
2026-10-22 08:28:16 +02:00
Ian Chua 0ae2b4840b Merge branch 'main' into fix/plugin-network-permissions 2026-10-22 13:55:07 +08:00
Ian Chua 4441bcc065 fix(test): keep embedded Python alive across slic3rutils cases (#16732)
* fix(test): keep embedded Python alive across slic3rutils cases

* fix: clang-tidy
2026-10-22 13:40:14 +08:00
Ian Chua 59e96b71d0 fix: shim python create thread to audit threads (#16682)
* fix: shim python create thread to audit threads

* fix: Python thread audit shim kwargs forwarding
2026-10-22 13:39:48 +08:00
HanifKoh 6b51185fd6 Fix Flow Ratio Calibration Crash When the Default Line Width Is 0 (#16725)
The flow ratio calibration capped its top surface and internal solid
infill speeds with a Flow built from the profile's line width and layer
height. A line width of 0 (auto) made that Flow throw for negative
spacing, which left the main loop and terminated the app.

Build the Flow from the width and height the calibration actually
prints, nozzle x 1.2 by nozzle / 2, as 2.4.2 did. This also corrects the
cap for non-zero widths, which was computed for a narrower line than the
one printed and let the test exceed the filament's max volumetric speed.
2026-10-22 13:27:32 +08:00
HanifKoh 30bfa0ef08 Only Give a Cone Wall Prime Tower a Stabilization Cone (#16726)
A Type2 tower with a rib or rectangle wall still carried the cone from
wipe_tower_cone_angle (30 degrees by default, hidden unless the wall type
is Cone) in two places that model the tower: the fake tower used by the
G-code path conflict check, and first_layer_wipe_tower_corners, which feeds
the first-layer convex hull and the skirt. On a tall tower that phantom cone
reported conflicts with objects the tower never reaches, enlarged the
first-layer print area, and could push a combined skirt off the bed.

Both now use the angle only for a Type2 tower with a cone wall, the same
rule construct_mesh and the footprint estimate already follow.
2026-10-22 13:26:53 +08:00
HanifKoh 5dc9bc6cee Keep a Decimal Point in the Wipe Tower's Travel Feedrate (#16717)
merge_tcr formatted the feedrate of the travel that joins two wipe tower
blocks with std::to_string, which follows the numeric locale. The GUI slices
on a thread that keeps the user's locale, so a comma-decimal locale wrote
moves such as 'G1 Y249.463 F5400,000000', which Klipper rejects. Format it
with float_to_string_decimal_point like the X and Y beside it; the output in
the C locale is unchanged.

The comma-locale test helper moves to the shared test header so the wipe
tower test can use it.
2026-10-22 13:20:39 +08:00
HanifKoh 7fa9c4b4fa Move a Re-Placed Prime Tower Clear of Objects and Say So (#16728)
When a saved prime tower position no longer fits the estimated tower, the
load-time clamp moved it to the comfort-margin bound with no regard for the
objects on the plate, and stored it without telling the user. A tower saved
in a corner could land on the model and produce a G-code conflict the user
never caused.

The GUI reload clamp and the CLI pre-slice clamp now keep the re-placed spot
only when it is clear of every printable object and its brim. Otherwise they
take the clear spot nearest the saved position, keeping the comfort margin
where the plate allows, and only fall back to the old spot when no space is
left. The GUI shows a notification whenever a saved tower is moved, and the
CLI logs a warning.
2026-10-22 13:19:51 +08:00
HanifKoh aa89cfaff5 Give macOS DMG Images an Explicit Size (#16736)
hdiutil create -srcfolder sizes the image from the source folder and sometimes leaves too little room, failing every retry with "No space left on device" while packaging the profile validator DMG. Pass -size as the source size plus 20% and 50 MB; the free space compresses away in UDZO.
2026-10-22 12:51:37 +08:00
Kris Austin 14a1aa333b Fix custom G-code placeholders missing on some paths and in the editor (#16680)
Some calls of the same script set fewer placeholders than the others,
so a placeholder the editor offers could stop the slice with "Variable
does not exist" on one path only:

- layer_change_gcode set max_layer_z after processing the template.
- Belt brim layers ran layer_change_gcode without
  most_used_physical_extruder_id or the mass values. Both layer change
  paths now share one helper.
- Printers that aren't bed slingers ran time_lapse_gcode with only
  layer_num, layer_z and max_layer_z. Both timelapse paths now share
  one helper for the snapshot placeholders, which picks the snapshot
  position only when the template uses it.
- The Type 1 wipe tower ran filament_start_gcode without layer_num,
  layer_z and max_layer_z, and filament_end_gcode without
  filament_extruder_id and max_layer_z. filament_extruder_id is the
  filament being unloaded, as in the Type 1 filament start G-code and
  the end-of-print filament end G-code.
- The first filament start G-code on Bambu Lab printers had no layer_z
  or max_layer_z.

The editor looks up a script's placeholder list by its option key, but
the timelapse list was keyed timelapse_gcode while the option is
time_lapse_gcode, so the editor showed no timelapse placeholders. The
list and the name passed to placeholder_parser_process, which the
placeholder validator looks up by, are now both time_lapse_gcode.

previous_extruder and next_extruder hold filament indexes, and
previous_extruder is -1 before any filament is loaded.
filament_extruder_id is the extruder index in filament end G-code at a
tool change outside the Type 1 wipe tower, and machine end G-code gets
the value from the last end-of-print filament end G-code. layer_num is
-1 before the first layer. total_wipe_tower_filament is a length in mm.
2026-10-21 15:05:16 -05:00
Fernando Marino` b8e9147107 Fix: route BBL-only NetworkAgent calls through the BBL cloud agent (#15908)
Since #13414 (v2.4.0), NetworkAgent calls default to the Orca cloud agent, whose Bambu-only methods are stubs that return empty data. These call sites didn't pass a provider, so firmware info, the MakerWorld task list, the cloud camera URL in Part Skip and Send to Printer, and the MakerWorld rating flow got empty data instead of calling the Bambu plugin. Pass get_printer_cloud_provider() at each one, as #13756, #14688 and #15911 did for the other call sites.
2026-10-21 14:57:54 -05:00
Ian Bassi 9b37da699b Sparse infill smoothing: round corners in equal turns, flattened to the resolution (#16694)
Co-authored-by: raistlin7447 <kris.austin@gmail.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-10-21 16:08:29 -03:00
Ian Bassi 01ae2dd49a Port Bambu Studio's gap fill ordering for monotonic surfaces (#16743) 2026-10-21 16:05:44 -03:00
Ian Bassi 24a6b150da Drop the no-op simplify of the honeycomb infill paths (#16742)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-10-21 13:04:49 -03:00
SoftFever 0a1a9c0371 Merge branch 'main' into feature/speed-up-detailed-model-slicing-4746e1 2026-10-21 23:25:29 +08:00
SoftFever 0ad175c42b Speed up internal bridge detection over fully dense layers 2026-10-21 22:47:11 +08:00
Mitchell Mashburn 7f3c9b8a28 Change seam_gap to '10%' in JSON configuration
Updated seam_gap value to include percentage.
2026-10-21 09:20:45 -05:00
SoftFever b797ceb7fa Speed up G-code export of finely detailed objects 2026-10-21 22:12:48 +08:00
Andrew 1bc39fd358 fix: preserve POSIX refresh lock ownership (#14781)
Use flock instead of fcntl for the refresh token lock on POSIX. An fcntl lock is held per process, so a second thread took it without waiting, and closing that thread's fd released it for the first thread too. Another Orca instance could then send the same refresh token while the first one was still rotating it.
2026-10-21 08:51:25 -05:00
SoftFever 0773f717cd Speed up slicing of objects with many parts (#16733)
# Description

Objects made of thousands of parts slice many times faster. Nearly all
of their slicing time went into deciding which parts touch for the brim,
and on macOS that cost was far higher, so an M5 Max took 2.5× longer
than a Windows desktop on the painted city map from @raistlin7447
https://github.com/OrcaSlicer/OrcaSlicer/pull/15985#issuecomment-6277850280.
That model is one object with 6,948 parts. It now slices in under 21 s
on both machines.

| `painted_city_map.3mf`, CLI slice | main | this PR |
|---|---|---|
| macOS, Apple M5 Max | 265 s | 18.4 s |
| Windows, Intel Core Ultra 7 270K Plus | 101.8 s | 20.1 s |

No change to slicing output: the G-code is byte-identical to main's.

# Screenshots/Recordings/Graphs

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

## Tests

G-code matches main's, apart from the timestamp line, for the city map
on macOS and Windows and for four other projects on macOS (13 files in
all). A new test checks that the brim groups an object's parts by
contact: overlapping and touching parts share a group, and a part 0.5 mm
away gets its own. It passes on main and on this branch, and so does the
rest of the `fff_print` suite.

<!--
> 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)
2026-10-21 21:34:07 +08:00
Ian Chua 1086b771b5 fix: tets 2026-10-21 19:12:28 +08:00
SoftFever 2e64ab3db5 Speed up brim grouping for objects with many parts 2026-10-21 19:04:43 +08:00
Lam Wei Lun 857896dc6b Make Ctrl+Q quit the application on Linux and Windows
Quit was only bound to Cmd+Q on macOS. Add a Quit entry to the shortcut
registry bound to Ctrl+Q and handle it in the global key handler, so the
shortcut reaches the app regardless of focus. The File menu shows it as
display text. The macOS-only key check is removed; Cmd+Q now goes through
the registry.
2026-10-21 17:52:48 +08:00
Ian Chua 1abb2a0fd9 fix: flatpak audit denial because of config in path (#16685) 2026-10-21 17:48:19 +08:00
Ian Chua b728e79f26 fix: expand request_permissions API to accept other permission types (#16688) 2026-10-21 17:46:56 +08:00
Lam Wei Lun 9b4ca9ab65 Scale to Fit Print Volume: keep clear of rectangular exclusion zones
The fit box was the whole bed, so a model could sit on a bed_exclude_area
such as the corner notch on the Qidi Q2.

Fit into the bed minus each rectangular exclusion: every rectangle
spanned by bed and exclusion edges that overlaps no exclusion. Candidates
no wider than the bed padding are dropped, otherwise a sliver at the bed
edge wins and the model is scaled to nothing. Selection::fit_rectangle
keeps the candidate that allows the largest scale.
2026-10-21 17:12:13 +08:00
Robert Baker 8bcea13a18 Fix unit for filament used in start G-code 2026-10-21 01:46:40 -07:00
Lam Wei Lun df9685e738 Merge branch 'main' into fix/arrange-scale-fit-lay-on-face 2026-10-21 16:04:37 +08:00
Ian Chua 9f030a9559 Merge branch 'main' into fix/plugin-network-permissions 2026-10-21 15:46:07 +08:00
ExPikaPaka 0725413752 Bake texture displacement on every painted part of an object
The texture displacement gizmo took the object's layer stack, its options
and its bake target from the first model part, so a multibody object was
displaced only on that part. The brush paints across every part, so the
user's paint on the others was kept and then quietly ignored, and with
only a later part painted the Bake button stayed disabled.

The bake, prepare and preview jobs now each carry a vector of parts and
run them in one job, under one progress bar, one Cancel and one undo
step. Remesh and subdivide cover every part as well, since a part left
coarse has no vertices for a height map to move. The per-unwrap fields of
a layer (LSCM seam edges, island placements, their join groups and the uv
overrides) index the owning part's mesh and chart ids, so they are dropped
for the other parts and each part unwraps on its own; everything else in
the stack applies unchanged.

The layer stack, the options and the UV and seam editors stay on the
first model part - they are object-wide settings kept on one part, not a
per-part thing - and the Fast view still shades that part alone.

Fixes #16559
2026-10-21 08:33:50 +02:00
Hanif Koh 7b05bc5ea1 Keep Layer Pauses on Their Own Layer in the Preview
The G-code processor remembers where a pause, color change or custom
G-code vertex sits in the move list, so it can move that vertex to the
first extrusion after it. A pause flushes the time planner first, which
inserts actual speed moves ahead of the vertex, so the remembered index
pointed at an earlier move: the previous layer's last extrusion was
moved instead, a real move was erased, and the time blocks queued after
the vertex were left one move off.

Shift the remembered index by the moves each flush inserts before it,
and shift the queued blocks after the erase. The Preview numbers layers
from the move order, so the stray move showed up as extra layers and
listed pauses on the wrong layer.
2026-10-21 13:50:40 +08:00
Lam Wei Lun 30b6a8ebc3 Merge branch 'main' into fix/arrange-scale-fit-lay-on-face 2026-10-21 13:05:07 +08:00
Robert Baker a97e2760ed Update Anker version to 02.04.00.07 2026-10-20 20:27:42 -07:00
Robert Baker 715106765e Update ankermake m5/m5c file_start_gcode with additional parameters
filament used and weight are shown on the m5 touchscreen.
2026-10-20 20:26:08 -07:00
Lam Wei Lun 017521ba78 Merge branch 'main' into fix/arrange-scale-fit-lay-on-face 2026-10-21 10:43:27 +08:00
Lam Wei Lun c71e456b95 Scale to Fit Print Volume: fit the area every nozzle reaches
Each nozzle reaches only part of the bed on a multi-nozzle printer (H2D:
left 0-325, right 25-350 in X), but the command fitted the whole 350 mm
bed. A model that filled the bed in X therefore landed outside both
nozzles' printable range, and right after the user asked to fit it the
plater warned "The position or size of the model exceeds the right
nozzle's printable range".

Fit the volume every nozzle shares instead -- the same region Arrange
already places items in -- and centre on it rather than on the bed.
2026-10-20 19:09:01 +08:00
Ian Chua 4afd257371 remove test plugin 2026-10-20 18:33:48 +08:00
Lam Wei Lun f048ede640 Lay on Face: flip a face pointing straight up about X, not an arbitrary axis
Laying a face that already points up down needs a half turn, and every
horizontal axis does the job. setFromTwoVectors() resolved the choice through an
SVD whose null space is the whole XY plane, so the axis followed rounding noise:
the object landed at an arbitrary angle in the plate plane, and a part that fit
the plate no longer did. Turn such a face over about X, which keeps the
footprint, and share the rotation between the gizmo and the --ground-* options
instead of duplicating it.
2026-10-20 18:24:23 +08:00
Lam Wei Lun 07fa713f0c Scale to Fit Print Volume: centre on the active plate
The command centred the selection on the bed at the origin, so scaling a model
that sat on plate 2 moved it back onto plate 1. Every plate shares the bed size,
so only the centre differs: pass the active plate's centre and, for a circular
bed, shift the print circle by it.
2026-10-20 18:24:20 +08:00
Lam Wei Lun 4c85d0e80a Arrange: place items that fill the printable area, and leave plates alone on failure
An item whose outline fits the printable area could still never be placed: the
arrange bed is inset by bed_shrink (1 mm per side) and the item is inflated by
its brim width, and the clamp meant to relax that only kicked in with more than
5 mm to spare. An item scaled to fit the print volume was therefore rejected
every time. Give the bed margin back where the largest selected item needs it,
never below the skirt distance, and cap the inflation at the printable area.

When an item comes back UNARRANGED, the GUI parked it on a virtual bed that was
never created, moving it a whole plate stride off the plate. Keep the instance
where it is instead, and when nothing could be placed at all, skip the plate
rebuild so a too large item cannot be re-homed to another plate.

Arrange no longer recycles plates: it must not delete a plate the user created,
even when the arrange leaves it empty.
2026-10-20 18:23:29 +08:00
Ian Chua 4a0d5e5edd Merge branch 'main' into fix/plugin-network-permissions 2026-10-20 18:23:02 +08:00
Harry Loud 4083b7996c Avoid text-editing chord for collision-volume preview shortcut 2026-10-20 11:17:46 +01:00
Ian Chua 6c791532c6 fix: update api to allow requesting network permissions 2026-10-20 01:15:14 +08:00
Rodrigo Faselli c67a46a277 Merge branch 'main' into feat-3D-Exclusion-Volumes 2026-10-19 09:59:50 -03:00
Rodrigo Faselli 786c9b31d9 Merge branch 'main' into RJAudas/fix-kobra2-layer-markers 2026-10-19 09:07:03 -03:00
Harry Loud 9bbb7ff2c4 Preserve additive bed areas across preview arrange and cutter paths 2026-10-19 12:07:01 +01:00
Harry Loud 20ef416b37 Preserve belt bed-area projection in resolved exclusion regions 2026-10-17 11:54:14 +01:00
Harry Loud 929beaee15 Fix merged IMEX placement check and explicit header dependencies 2026-10-16 09:29:22 +01:00
Noisyfox 337460fea5 Unify single-color and gradient AMS checkerboards 2026-10-16 10:11:56 +08:00
Noisyfox 47b6a118cd Fix rounded corners on translucent AMS gradient cards 2026-10-16 09:09:45 +08:00
Harry Loud 247e903cbe Merge upstream/main and resolve exclusion volume integration conflicts 2026-10-15 18:05:19 +01:00
Noisyfox 99ca7732c7 Remove filament swatch rendering fallbacks 2026-10-15 23:35:35 +08:00
Noisyfox 206552674b Flatten filament preview bitmaps to opaque RGB for native labels 2026-10-15 23:25:23 +08:00
Harry Loud dc9d499434 Simplify collision volume settings layout 2026-10-15 16:24:52 +01:00
Noisyfox 78de3ad9cd Show gradient alpha checkerboard in AMS circles and cards 2026-10-15 23:09:09 +08:00
Noisyfox 9a866ab916 Render translucent filament preview icons over checkerboard 2026-10-15 23:00:39 +08:00
Noisyfox 4efd8bfde1 Show checkerboard under translucent AMS custom colors 2026-10-15 22:49:22 +08:00
Noisyfox dea5a0dd32 Limit AMS gradient editing to four configurable picker colors 2026-10-15 22:35:02 +08:00
Noisyfox 7270e454a1 Fix full gradient rendering in AMS custom color swatch 2026-10-15 22:07:04 +08:00
Noisyfox 87bf836699 Add alpha and gradient editing for custom AMS colors 2026-10-15 21:41:11 +08:00
SoftFever 7f22894e33 Merge branch 'main' into main 2026-10-15 16:14:24 +08:00
Robert J Audas 19dc9e1f33 Fix Kobra 2 layer-change G-code comments 2026-10-11 15:04:31 -06:00
Harry Loud 2c0ce5c38b Merge upstream/main and refine exclusion-volume configuration UI 2026-10-09 18:27:44 +01:00
Paul 9b7c7cfef3 Fixed syntax errors
Following up: I found and fixed two things in OrcaFilamentLibrary.json (JSON syntax errors from a bad paste, and outdated non-minted filament_ids). After those fixes, `profile_tool` passes cleanly with zero errors.

However, `validate_system` and `validate_filament_subtypes` both crash with exit code -1073741515 (STATUS_DLL_NOT_FOUND pattern). Reproduced with:
- Scoped to just OrcaFilamentLibrary (-v OrcaFilamentLibrary)
- Unscoped, against the entire profile tree
- Calling OrcaSlicer_profile_validator.exe directly with just -p <profiles> -l 0/-l 2, no other flags
- With Norton (antivirus) fully disabled, to rule out AV interference

All reproduce the identical crash with zero output captured (empty log file). profile_tool already validates my files cleanly, so this doesn't appear related to my specific content. Happy to provide more diagnostics if useful, but wanted to flag this in case it's a known issue with the current nightly validator build on Windows.
2026-09-30 01:55:46 -04:00
Paul 289764c68b Merge branch 'OrcaSlicer:main' into main 2026-09-30 00:56:50 -04:00
Harry Loud 1841de5f88 Merge remote-tracking branch 'upstream/main' into feature/exclusion-volume-tests
# Conflicts:
#	src/libslic3r/PrintBase.hpp
2026-09-29 17:41:28 +01:00
Harry Loud 2616041a80 Isolate brim boundary regression coverage 2026-09-29 16:17:09 +01:00
Harry Loud f2e17c7f6d Fix headless brim boundary clipping 2026-09-28 11:15:00 +01:00
Harry Loud a0f7170b83 Fix exclusion preview build against current main 2026-09-25 10:58:37 +01:00
Harry Loud 7481fdcdae Fix exclusion conversion and legacy brim clipping 2026-09-24 13:54:26 +01:00
Harry Loud 432debfc74 Restore shared printer option variable 2026-09-24 09:09:03 +01:00
Harry Loud 0b8ce26bd3 Preserve legacy exclusion behavior for opt-in volumes 2026-09-23 18:20:39 +01:00
Harry Loud c69687c5f0 Correct Z-only homing test expectation 2026-09-22 14:17:54 +01:00
SoftFever e160253380 Merge branch 'main' into main 2026-09-22 20:50:56 +08:00
Harry Loud c3087a92f7 Fix exclusion conversion row for current widget API 2026-09-21 13:41:54 +01:00
Harry Loud 82e670cc3b Merge remote-tracking branch 'upstream/main' into feature/exclusion-volume-tests
# Conflicts:
#	src/slic3r/GUI/GLCanvas3D.cpp
#	tests/libslic3r/test_3mf.cpp
2026-09-21 10:42:34 +01:00
Harry Loud f832cae2eb Separate legacy bed areas from collision volumes 2026-09-21 10:28:26 +01:00
Harry Loud e49840d0c6 Fix exclusion clipping warning-as-error 2026-09-14 15:19:14 +01:00
Rodrigo Faselli 6b87197d72 Merge branch 'main' into feat-3D-Exclusion-Volumes 2026-09-14 10:50:35 -03:00
Harry Loud ef7348995c Avoid rebuilding mesh trees for exclusion containment 2026-09-14 12:27:58 +01:00
Harry Loud ac2c33b43b Make exclusion 3MF test portable 2026-09-14 12:27:58 +01:00
Harry Loud cca51293a4 Fix enclosed exclusion volume detection 2026-09-14 12:27:58 +01:00
Harry Loud c00909e687 Add comprehensive exclusion volume tests 2026-09-14 12:27:57 +01:00
Harry Loud 3d04d78f11 Remove exclusion volume tests 2026-09-14 12:27:34 +01:00
Harry Loud 8fcf9dd3c4 Keep extended exclusion regions out of legacy point data 2026-09-14 12:27:34 +01:00
Harry Loud 9d88932c81 Use neutral exclusion preview for single-nozzle printers 2026-09-14 12:27:34 +01:00
Harry Loud fd55cc77d3 Make support generation exclusion-volume aware 2026-09-14 12:27:34 +01:00
Harry Loud 5ec9169bc7 Route exclusion travels at planned lift height 2026-09-14 12:27:34 +01:00
Harry Loud 7ad51860af Fix exclusion routing after nozzle changes 2026-09-14 12:27:33 +01:00
Harry Loud 0804b849a9 Make generated brims avoid exclusion volumes 2026-09-14 12:27:33 +01:00
Harry Loud 333a9be86e Add multi-nozzle exclusion volume travel routing 2026-09-14 12:27:33 +01:00
Harry Loud 11906bd670 Add multi-nozzle exclusion volume G-code checks 2026-09-14 12:27:33 +01:00
Harry Loud 785aa2637b Add exclusion-aware arrange and fill 2026-09-14 12:27:33 +01:00
Harry Loud 21760cc979 Fix multi-nozzle exclusion collision mapping 2026-09-14 12:27:33 +01:00
Harry Loud dbae415127 Add multi-nozzle exclusion volume modes 2026-09-14 12:27:33 +01:00
Harry-Loud e21bd886eb Let vector growth handle exclusion preview fragments
Remove the manual geometric reserve helper from clipped exclusion preview mesh accumulation. The append path now avoids exact per-fragment reserve calls and relies on std::vector amortized growth through emplace_back, matching standard container guidance.
2026-09-14 12:27:33 +01:00
Harry-Loud 1acd9ce1d2 Document exclusion intersection preview modes
Clarify that exclusion intersection checks run as either boolean early-out tests or full clipped-mesh collection for the red GUI preview. Also document why clipped preview buffers use geometric growth.
2026-09-14 12:27:33 +01:00
Harry-Loud e81ec0ffc2 Avoid pathological exclusion preview mesh growth
Grow clipped exclusion-intersection preview buffers geometrically instead of reserving the exact next size for each clipped polygon. This avoids repeated reallocation and copying when high-poly meshes produce many red preview fragments.
2026-09-14 12:27:33 +01:00
Harry-Loud e76255e0a7 Cache exclusion volume previews behind dirty state
Avoid rebuilding the exclusion-volume preview cache key from the render path on every frame. The preview now refreshes only after relevant plate, config, object membership, or drag-completion changes while still clearing stale red intersections during active dragging.
2026-09-14 12:27:33 +01:00
Harry-Loud 0b258b4c07 Return bed-level exclusion footprints for 2D helpers
Build get_bed_excluded_area from the unified bed exclusion region parser and filter it to regions that touch the bed surface. This preserves legacy 2D consumers for plain pipe-separated regions and bed-starting Z ranges while keeping elevated-only volumes out of bed-shape calculations.
2026-09-14 12:27:32 +01:00
Harry-Loud ee593c2d5a Fix pipe-separated exclusion areas
Treat pipe-separated bed_exclude_area strings as extended exclusion syntax even when no Z range is present. ConfigOptionPoints now preserves and parses plain multi-region strings like XxY,...|XxY,... instead of flattening them into a single polygon.

Remove the stale bed_exclude_area_3d config option and related preset/UI plumbing now that Z-limited and multi-region exclusions are represented through the existing bed_exclude_area field.
2026-09-14 12:27:32 +01:00
Harry-Loud 19a454746a Add multiple and height-aware bed exclusion volumes
Extend bed exclusion handling so the existing bed_exclude_area field can express multiple independent exclusion regions and optional Z-limited volumes while keeping the original XxY polygon syntax backward compatible.

The parser now accepts | separated regions and ZMIN..ZMAX; prefixed polygons. Legacy 2D regions are normalized internally as full-height exclusion volumes, and Z bounds may be omitted to default to the bed surface or printable height.

Collision handling now uses a broad 2D convex-hull footprint check as a cheap initiator, followed by direct model-triangle clipping against triangulated exclusion prisms. This removes false positives where a model shadow overlaps an exclusion footprint but the mesh does not intersect the configured Z range.

The plater preview renders bed-level regions with the existing grey floor preview, above-bed volumes with an inset grey outline, contextual translucent prism previews, and red mesh highlights for exact intersecting triangles. Preview cache keys include Z ranges and instance transforms so Z-only edits update correctly.
2026-09-14 12:27:32 +01:00
Paul ef4a3773e4 Add official School House Spools PLA and PETG filament profiles
Adds School House Spools PLA and PETG to the global Orca Filament Library.
2026-08-29 01:04:02 -04:00
1168 changed files with 110944 additions and 116337 deletions
+3 -1
View File
@@ -27,6 +27,7 @@ CheckOptions:
# are included through clipper2/clipper.h, or clipper2_z.hpp, which defines
# USINGZ first. minilzo's config
# headers are internal to minilzo.h.
# The boost/process headers are only included through Utils/BoostProcessCompat.hpp.
# FFmpeg's C headers are left alone because they are only included inside
# extern "C", which an inserted include would miss. OS-specific headers (GLib,
# GTK, D-Bus, POSIX, the Windows SDK) are only used inside platform #if blocks,
@@ -72,4 +73,5 @@ CheckOptions:
mcut[/\\]platform\.h;
boost[/\\]polygon[/\\].*;
clipper2[/\\]clipper\.(core|engine|offset|minkowski|rectclip|export|triangulation|version)\.h;
lzo(conf|defs)\.h
lzo(conf|defs)\.h;
boost[/\\]process[/\\].*
+7 -5
View File
@@ -37,7 +37,8 @@ for `python3`.
1. **Bump the `version` of every bundle you change**, `OrcaFilamentLibrary.json` included when affected.
Increment the last component and carry `.99` into the third (`02.04.00.99` → `02.04.01.00`). The
updater installs only a strictly newer version, and CI does not check the bump.
updater installs only a strictly newer version; `version-check` (the `version_bump` check in CI
and `check_profile`) fails a changed bundle whose version is not newer than the branch's base.
2. **Register every preset, bases included, parents before children.** `update-index` writes the four
`*_list` arrays from the files on disk; `check` fails unless the index equals its output. Each index
entry's `name` must equal the file's `name`.
@@ -89,8 +90,7 @@ for `python3`.
multi-extruder printer whose extruders need different values
([widths](references/extruder-variants.md#widths)).
12. **Run the full checks before reporting completion.** A `--vendor` run is only a development loop.
Review also covers version bumps, assets, non-default processes and hardware tuning, which CI cannot
establish.
Review also covers assets, non-default processes and hardware tuning, which CI cannot establish.
## Names
@@ -145,8 +145,10 @@ filename rules are in [naming.md](references/naming.md).
On Windows use `scripts\check_profile.bat -Vendor "<Vendor>"` / `scripts\check_profile.bat`. Logs
land in a per-user cache dir ([validation.md](references/validation.md)). Id checks stay tree-wide
under `--vendor`, and filament-only bundles skip the default slice check. Under `--vendor` read only
`profile_tool` and `validate_slice`: the other three checks fail on library presets that name other
vendors' printers ([why](references/validation.md#the-five-checks)).
`profile_tool`, `version_bump`, `legacy_compat` and `validate_slice`: the validator checks fail on
library presets that name other vendors' printers ([why](references/validation.md#the-seven-checks)). `version_bump`
compares the working tree with the commit the branch left `upstream/main` (else `origin/main`) at;
pass `--base <ref>` to compare with another.
6. **Verify the changed behaviour.** Slice newly added non-default processes and filaments
[explicitly](references/validation.md#checking-a-copy-of-the-tree), and
[test in the app](references/validation.md#testing-in-the-app) for selection or UI behaviour. Report
@@ -6,7 +6,7 @@ affected preset types. The table lists the gaps CI cannot see, so only a reviewe
| Not checked by CI | Consequence |
| --- | --- |
| The `version` bump | The change never reaches an upgrading user; an absent `version` hides the vendor from the setup wizard |
| A `version` bump of the wrong size, or one that only reaches a version a nightly or OTA test already shipped | `version_bump` checks only that the version is newer than the branch's base, so the change still never reaches a user whose installed version is higher |
| A misspelled setting key | The setting silently has no effect |
| A filename Windows cannot check out, or one that differs from its `sub_path` only in case | Works on the author's machine, breaks the bundle on another platform |
| `bed_model` / `bed_texture` / `hotend_model` / cover pointing at a missing asset | A missing bed model renders a generic custom bed and a missing texture renders none, the hotend falls back to the generic model, the cover shows a placeholder |
@@ -29,10 +29,11 @@ For **every** bundle whose folder the diff touches, `resources/profiles/<Vendor>
`version` incremented: last component, carrying `.99` into the third component. A library change means
bumping `OrcaFilamentLibrary.json`.
*Why:* nothing in CI checks it, and the app reinstalls a bundled profile set only when its version is
newer than the installed one: without a bump the change reaches neither an upgrading user nor the
author's own running app. Without any `version` the vendor vanishes from the setup wizard, and neither
`check` nor the validator reports it.
*Why:* the app reinstalls a bundled profile set only when its version is newer than the installed one:
without a bump the change reaches neither an upgrading user nor the author's own running app. CI's
`version_bump` fails a changed bundle whose version is not newer than the branch's base, or that has
no `version` at all, but it cannot know what users have installed: a version a nightly or an OTA test
already shipped, then reverted, has to be passed again, not merely incremented.
## 2. Was the index rebuilt, and does the diff contain only this change?
@@ -261,8 +262,8 @@ hold ([shared bases](shared-bases.md)), and a filename that disagrees with the p
A finding is **one defect**: its file (or quoted lines), what breaks at runtime or in CI, and the fix.
Split independent defects into separate findings even when they live in one file: five id problems in
one bullet get one fix and four survivors. Say which findings `check` or the validator reports and which
only a reader catches: a missing version bump, a misspelled key and wrong temperatures pass CI, so a
contributor who only reruns the tools fixes what CI flags and resubmits the rest.
only a reader catches: a misspelled key and wrong temperatures pass CI, so a contributor who only
reruns the tools fixes what CI flags and resubmits the rest.
Severity discriminates only if it is earned:
@@ -49,11 +49,13 @@ Copying the cached `profile-fixtures/` into the new dir reuses the fixture archi
`--work-dir`. Only a `.lock` with no `check_profile` process alive is a crash leftover; delete it by
hand.
## The five checks
## The seven checks
| Check | Command it runs | Catches |
| --- | --- | --- |
| `profile_tool` | `python3 scripts/orca_profile_tool.py check` | index coverage **both ways**, preset-name collisions, files `normalize` / `update-index` would still rewrite, duplicate JSON keys, filament `compatible_printers`, `filament_type` array, conflict keys, variant strings and array widths and layout keys, dangling `default_materials`, id length, **all `setting_id` and `filament_id` rules** ([below](#orca_profile_toolpy-check)) |
| `version_bump` | `python3 scripts/orca_profile_tool.py version-check --base <ref>` | a bundle with a changed file (`<Vendor>.json` or anything under `<Vendor>/`, assets included) whose `version` is not newer than at the base, or not four numbers; CI's base is the branch the PR merges into, the script's is where the branch left `upstream/main` (else `origin/main`) unless `--base` says otherwise |
| `legacy_compat` | `python3 scripts/orca_profile_tool.py legacy-compat --base <v2.4.2 profiles> --check` | `resources/info/legacy_compatible_printers.json` no longer matching what the tree implies against the 2.4.2 profiles, after a filament preset rename or a narrowed `compatible_printers` |
| `validate_system` | `validator -p resources/profiles -l 2` | load errors, missing filament `compatible_printers`, dangling `inherits` / `compatible_*`, duplicate `filament_id` per printer (`Ambiguous AMS filament match`), printer defaults that name no compatible system filament |
| `validate_slice` | `validator -p … -s -l 2` | custom G-code expansion and unresolvable printer defaults, by slicing |
| `validate_filament_subtypes` | `validator -p … -l 2 -f` | nothing extra; see below |
@@ -67,8 +69,9 @@ flag is present") does not reflect that default.
OrcaFilamentLibrary and nothing else, so every library tune whose `compatible_printers` names another
vendor's printers fails `validate_system`, `validate_filament_subtypes` and each `validate_custom`
fixture with thousands of `references unknown compatible_printers "Bambu Lab …"` lines. Under
`--vendor`, `profile_tool` and `validate_slice` are the meaningful results; for the other three, filter
the log for your vendor's files and treat only those lines as findings. The unscoped run is the CI
`--vendor`, `profile_tool`, `version_bump`, `legacy_compat` and `validate_slice` are the meaningful
results; for the other three, filter the log for your vendor's files and treat only those lines as
findings. The unscoped run is the CI
result; run it before the PR.
### `validate_custom`: the backward-compatibility gate
@@ -393,7 +396,7 @@ clean-install check; preserve the normal configuration and user presets.
| `contains incorrect keys: <keys>, which were removed` | a key valid for a different preset type |
| `defines invalid printer variant "<v>"` | not a token of the model's `nozzle_diameter` list |
| `has printer_variant "<v>" that does not match its nozzle_diameter` | [the set comparison](machine-profiles.md#printer_model-and-printer_variant) |
| `references unknown compatible_printers "<p>"` | the printer was renamed or deleted, or a `machine_model` name was used instead of a variant name: fix the reference. Under `--vendor`, usually another vendor's printer ([why](#the-five-checks)) |
| `references unknown compatible_printers "<p>"` | the printer was renamed or deleted, or a `machine_model` name was used instead of a variant name: fix the reference. Under `--vendor`, usually another vendor's printer ([why](#the-seven-checks)) |
| `references renamed compatible_printers "<old>" (now "<new>")` | in-tree references must name the current preset; `renamed_from` does not excuse them |
| `Filament preset "<f>" is missing compatible_printers setting` | non-library filaments need a non-empty list in their **own** file; the resolved-vs-own-key trap is in [filament-profiles.md](filament-profiles.md#compatible_printers) |
| `Ambiguous AMS filament match: N filament presets share filament_id "X" and are all compatible with printer "Y"` | make the lists disjoint by [specificity](filament-profiles.md#overlapping-coverage-one-variant-one-profile-per-product): the specialized profile keeps the variant, the general ones drop it; prefer this over deleting a profile. Or fix an `inherits` pointing at another product's `@base`. `orca_profile_tool.py check` does not catch this; only `validate_system` does |
@@ -65,8 +65,10 @@ Four components, `MM.mm.pp.bb`, compared as a version number in which the fourth
third (`patch × 100 + build`). Write all four components, zero-padded.
- **Bump the version for every bundle the change touches.** The app installs bundled profiles only
when their version is newer than the installed one, and the `.opc` preset cache is also keyed on
the version. Nothing in profile CI checks the bump.
when their version is newer than the installed one, the `.opc` preset cache is also keyed on
the version, and the OTA profile update is named after it. `version-check` (CI's `version_bump`)
fails a bundle with a changed file whose version is not newer than at the branch's base, or is
not four numbers; a bundle the base does not have passes.
- **Keep the last component ≤ 99.** `02.04.00.100` and `02.04.01.00` both read as
`2.4.100`. A bundle that
reaches `.99` carries into the third component (`02.03.02.99` → `02.03.03.00`).
+85 -11
View File
@@ -1,6 +1,6 @@
---
name: orca-translations
description: Use when updating, filling, reviewing or fixing OrcaSlicer translations in localization/i18n — running scripts/run_gettext --full, translating empty or new msgids in the .po catalogs, AI translation passes and their "# AI Translated" / "# Needs human review" comments, plural forms, msgctxt homonyms, and keeping catalogs consistent with the localization glossary (OrcaSlicer_WIKI developer_reference/glossary), including adding new glossary terms. Also use for msgfmt or run_gettext failures, placeholder or line-break mismatches, and reviewing a translation PR against the glossary.
description: Use when updating, filling, reviewing or fixing OrcaSlicer translations in localization/i18n — running scripts/run_gettext --full, translating empty or new msgids in the .po catalogs, reviewing and fixing a language's existing translations for wrong meanings, competing terms and unnatural wording, AI translation passes and their "# AI Translated" / "# Needs human review" comments, plural forms, msgctxt homonyms, and keeping catalogs consistent with the localization glossary (OrcaSlicer_WIKI developer_reference/glossary), including adding new glossary terms. Also use for msgfmt or run_gettext failures, placeholder or line-break mismatches, and reviewing a translation PR against the glossary.
---
# OrcaSlicer translations
@@ -51,9 +51,10 @@ scripts\run_gettext.bat --full # Windows (PowerShell: & .\scripts\run_
```
It must exit 0. New msgids arrive empty, and removed ones become obsolete `#~` entries. A msgid that
comes back gets its old translation revived from `#~`, which is one reason never to purge obsolete
entries. It also compiles the `.mo` files (gitignored). The bundled Windows gettext may re-wrap a long
`#:` reference line. That churn is harmless.
comes back gets its old translation revived from `#~`, and `pending` offers obsolete entries as similar
earlier translations, so they stay until the translations are done and are purged in step 5. It also
compiles the `.mo` files (gitignored). The bundled Windows gettext may re-wrap a long `#:` reference
line. That churn is harmless.
Then take stock: `python3 $T status`.
@@ -112,22 +113,35 @@ For each language:
- `note`: the developer's `TRN` comment.
- `flags`: `c-format` or `boost-format`.
- `description`: present when a sense has to be chosen.
- `refs`, `code` and `nearby`: where the source uses the string, the lines around that use (for
short strings and placeholder strings), and the translations of the short strings used next to
it, such as the label a tooltip describes or the other items of a menu. The catalogs carry no
source references, so this is the only place the context shows. Read it before writing; the
rules file's *Context* says what to take from it.
- `similar`: earlier translations of similar English. `"human": true` marks a person's work: when
the English barely changed, patch that translation instead of translating again (see the rules).
3. Read every apply message:
- **REJECTED:** a hard rule broke. Fix the translation and apply the corrected items again.
- **WARNING:** something worth a second look, such as a glossary rendering not found, ending
punctuation, or snake_case. A glossary warning on an inflected form you checked is fine.
punctuation, or snake_case. A glossary warning is fine on an inflected form you checked, and
on a word the string uses in another sense than the row's description (the printer's `Model:` is
not the glossary's 3D *Model*).
Otherwise correct the translation (`apply --overwrite` replaces your own entry), or add a
`review` reason.
`apply` adds `# AI Translated` to every entry it writes, and `# Needs human review: <reason>` where an
item has `review`. On an `--overwrite`, `"review": ""` removes an earlier note. Never add either to a translation a person wrote. `--human` is for applying their
text.
text, and for a fix that keeps their words; it also drops a stale AI mark. `apply` rejects text that
strays from a person's translation more than the English change explains, unless the item says why
with `"rewrite": "<reason>"`.
**The work is large:** every new string, times every language. When subagents are available, give each
one a language or a few. Each agent only touches its own catalogs, so they can run
in parallel. Settle step 3 first. Give each agent the language list, this skill's path, the rules file,
and these instructions:
- Fill every empty entry.
- Fill every empty entry, reading each one's `code` and `nearby` first.
- Patch a person's earlier translation (`"human": true` in `similar`) instead of translating again, and
keep their words when fixing their entries.
- Don't add glossary rows.
- Report what it could not translate, the review notes it added, and any term it thinks the glossary
still lacks.
@@ -140,6 +154,8 @@ Add the terms they report yourself, then have the affected languages revisit the
python3 $T check --lang <L> --warnings # every AI-translated entry, plus msgfmt --check-format
```
- **Remove the obsolete entries:** `python3 $T purge-obsolete` drops every `#~` entry, with its
comments, from every catalog (`--lang L` for a pass limited to some languages).
- **Run the full gettext again.** It must exit 0 and leave the catalogs as the pass left them.
- **Run `python generate_glossary.py --check` in the wiki clone.**
- **Errors on entries you didn't write predate the pass.** Report them rather than fixing them in the
@@ -157,6 +173,61 @@ The catalogs (and `OrcaSlicer.pot`) and the glossary (`developer_reference/gloss
separate changes in separate repositories. The wiki change should land with, or before, the catalog
change. Commit or open PRs only when asked.
## Workflow: review and fix an existing catalog
When the user asks for more than a fill (review a language, fix its translations, a complete pass),
fill it first with the workflow above, then audit what the catalog already holds. The request is what
allows existing entries to change (rule 4). Work one language at a time, and stop to ask only about
established glossary terms (step 4); fix everything else directly.
1. **Save a copy of the catalog** in the scratch directory, to diff the audit against.
2. **Read the catalog area by area,** one pass each:
- the 3D view, navigation, camera and rendering;
- gizmos, CAD and mesh tools;
- printer hardware and the device tab;
- print-process settings and their tooltips;
- errors, warnings and dialogs.
The catalogs carry no `#:` references, so split them with `lookup --lang <L> . --file '<regex>'
--limit 0`, which keeps the entries used in matching source files (`Gizmos/`, `Device`,
`PrintConfig`), and add `--code` to see each use. Read every pair in an area: short labels in full,
with their code, and long tooltips at least for their terms. When subagents are available, give
each one an area, the rules file and the term decisions made so far, have it return findings rather
than edits, and merge them yourself.
3. **Look for:**
- **Competing renderings of one term.** For each recurring English term, list every rendering it
has (`lookup --lang <L> "<term>"`, then `lookup --msgstr` for each rendering found), and settle on
one per sense: the glossary's where it has a row, otherwise by the rules file's order of sources.
A recurring term the glossary lacks goes into it with `glossary-set`, as in step 3 of the fill.
- **Wrong meanings:** a word that means something else in context, the wrong sense of a homonym
(one `msgctxt` translated with another's word), a setting quoted differently from its own label.
A short msgid used in several places must fit every use `--code` lists; when no wording can,
report the missing `msgctxt`.
- **Sets that don't read as one:** the items of a menu, a choice or a toolbar in different
grammatical forms, or two items translated alike.
- **Broken entries:** a lost `\n`, text left over from another string, untranslated fragments,
a `msgstr` left identical to the English (a symbol, token or bare placeholder may be), typos.
`check --lang <L> --scope all --warnings` finds the mechanical ones.
- **Unnatural wording,** judged by the rules file's *Style*.
4. **Hold back changes to established glossary terms.** When the right fix changes a term the
glossary already fixes, leave those entries and the cell alone and keep a list. After the whole
audit, ask the user once: each term, the proposed rendering, why, and how many entries it touches,
with a recommendation. Apply the approved ones as in *Changing an established term*.
5. **Fix the rest** with `apply --overwrite`, from items `{"id": ..., "msgstr": ...}`.
- The patch rules for a person's translation still hold: change only what is wrong. When more than
a patch is needed, add `"rewrite": "<what was wrong>"`; it becomes the entry's review note.
- Entries you rewrite are marked `# AI Translated`; a patch that keeps a person's words goes in
with `--human`. Add `review` where unsure.
6. **Verify** as in step 5 of the fill workflow. Then compare every glossary cell for the language
with the final catalog (`check --scope all --warnings` reports renderings not found), and list the
disagreements left.
7. **Report:**
- the changes grouped by area, with representative before → after examples;
- the term decisions and the sources behind them;
- the review notes added;
- the source problems found;
- the glossary changes made, and the disagreements left.
## Rules
1. **Run the full gettext first.** Translate against the regenerated template, never a stale one.
@@ -166,12 +237,14 @@ change. Commit or open PRs only when asked.
3. **New recurring terms go into the glossary before the translations that use them.** Without a wiki
clone, stop and tell the user (step 3).
4. **Fill, don't rewrite.** A fill pass writes only empty and fuzzy entries.
- Existing translations, human or AI, change only on request (`--overwrite`).
- A glossary violation in a human translation is reported, not changed.
- Existing translations, human or AI, change only on request (`--overwrite`), as in the review
workflow.
- Outside that workflow, a glossary violation in a human translation is reported, not changed.
5. **Machine output is labelled.** Every AI translation gets `# AI Translated`; uncertain ones also get
`# Needs human review: <reason>`. Never use `fuzzy`.
6. **Never edit `msgid`, `msgctxt`, the header, or obsolete `#~` entries,** and never fix the English in
a translation. Report source problems (see the rules file).
a translation. Report source problems (see the rules file). Obsolete entries are only removed whole,
with `purge-obsolete` at the end of a pass.
7. **Write catalogs only through `po_tool.py` or gettext.** PO libraries such as polib reflow unrelated
entries, and hand edits skip the validation.
@@ -195,9 +268,10 @@ inherits the mistake, so fix both in the same change:
Review it for these:
- glossary compliance (`check --scope all --warnings` on the language, then read the hits);
- the sense of each changed short string where it is used (`lookup --code`);
- placeholders and line breaks (`check` errors);
- `# AI Translated` kept on text a person rewrote, or added to text a person wrote;
- purged obsolete entries;
- obsolete entries left in the catalogs, or removed other than by `purge-obsolete`;
- reflowed unrelated entries;
- plural forms short of `nplurals`.
@@ -11,7 +11,8 @@ can detect; everything else is on the translator.
A rejected entry is not written. Fix it and apply again.
- **Placeholders stay exactly as written:** `%s`, `%d`, `%.1f`, `%1$d`, `%1%`, `%%`. Never `%1 %`, never
`%` for `%%`. Plain printf placeholders keep their order; only positional ones (`%1$s`, `%1%`) may move.
`%` for `%%`. Plain printf placeholders keep their order; only positional ones (`%1$s`, `%1%`) may move,
and one the msgid repeats may appear just once.
A broken placeholder crashes the app.
- **Line breaks:** the same number of `\n`, with the same leading and trailing ones. Don't add breaks to fit
text, least of all in parameter names.
@@ -26,6 +27,26 @@ A rejected entry is not written. Fix it and apply again.
ja/ko/zh/th/vi, 3 for ru/cs/pl/lt, 4 for uk). Each form is really inflected for its quantity. Repeating
one sentence is a bug in Slavic and Baltic languages, but correct in Turkish and Hungarian.
## A person's translation: patch it, don't rewrite it
A translator's wording is kept unless it is wrong. Machine output never replaces it wholesale.
- **A reworded string:** `pending` lists earlier translations of similar English under `similar`, and
marks a person's work with `"human": true`. When the English barely changed, start from that
translation and change only what the English change requires: a renamed term, an added clause, a
period. Keep the translator's wording, word order, terms and line structure. If they already wrote what
the new English says, the translation does not change at all.
- **A fix in a person's translation:** for a check error (a line break, a space, placeholder order, a
missing clause), change only what the error needs. Keep the rest of their words, even where they differ
from the glossary or from how you would phrase it. Report such glossary differences instead.
- **Rewrite only what is plainly wrong:** another string's text, a cut-off sentence, a mistranslation.
Say why with `"rewrite": "<what was wrong>"` in the item; the reason becomes the review note.
- `apply` enforces this. It rejects text that strays further from a person's translation than the
English change explains (below 85% alike for a fix, or clearly less alike than the English for a
reworded string), unless the item carries `rewrite`.
- Apply a fix that keeps the person's words with `--human`, so the entry stays theirs. Text you wrote
gets the default `# AI Translated`.
## Mechanical: not detectable, still required
- Edit only `msgstr`. Never change `msgid`, `msgctxt`, the header or another entry's text.
@@ -36,6 +57,49 @@ A rejected entry is not written. Fix it and apply again.
control.
- Don't use `fuzzy` for uncertainty. Fuzzy entries are hidden, and users then see English.
## Context: know what the string is before choosing its words
English reuses one word for different things, and a string seen alone often reads several ways. Settle
what each entry is before translating it. `pending` gives every entry the context the source holds:
`refs` (where it is used), `code` (the lines around the use, for short strings and placeholder
strings) and `nearby` (the translated short strings used next to it). `lookup --code` shows the same
for existing entries. The catalogs themselves carry no source references.
- **What kind of text it is,** from `code`: a button or menu item is a command, a field label or column
header names a value, a checkbox states something that is on or off, and a tooltip, status line,
error or dialog title each have their own register. Keep a label as short as a label.
- **What it belongs to.** A setting's strings sit together in `PrintConfig.cpp`: `this->add("<key>", …)`,
then `label`, `category`, `tooltip`, `sidetext`. The tooltip describes that option, and quotes the
label exactly as `nearby` shows it translated. The items of one menu, choice or toolbar
(`enum_labels`, `Append`, an array of names) are a set: give them one grammatical form, and words that
tell them apart.
- **`msgctxt` separates homonyms.** `Back` in *Camera View* is the rear view, and `Back` in
*Navigation* is the go-back button. Translate each context on its own.
- **Overloaded English: translate the meaning.**
- *Flow ratio* is a multiplier, *Flow Rate* is throughput, and *Flow Dynamics* is pressure
compensation. These are three different terms.
- *Extruder* can mean the toolhead, the feeder motor ("High extruder current on filament swap") or
the nozzle ("all extruders must have the same diameter").
- *Home* is the homing move ("Please home all axes"), the home page, or the Home key (*Keyboard
Shortcut*), which takes the name printed on that language's keyboards. *Fill* is infill, gap fill,
or the paint tools' bucket and smart fill. *Normal* is the ordinary kind ("Normal support",
"Normal printing") or the surface normal ("Normal X", "Smooth normals"). *Model* is the 3D model,
or the printer model in "Model:". *Process* is the process preset, or an operation under way ("the
slicing process").
- The glossary's rows record the senses that recur (`Plate` versus `Bed / Build plate`, `Feature
(print)` versus `Feature (Design)`); the code tells which one a string means.
- **Check the meaning in the code** when the English leaves it open: read the call site, and further
in the file when `code` is not enough.
- See what each placeholder is filled with. A fallback string substituted into a sentence must
fit the slot it fills.
- Settle the semantics the English blurs: a ratio or a difference, which way a rotation turns,
which control a hint names.
- **A msgid used in several places** (`left` is a view name and a hotend; `Sphere` is a primitive
and a paint brush) needs a wording that fits every use. When none can, report the missing
`msgctxt` as a source problem.
- **When the context still leaves two readings,** take the likelier one and add a review note naming
the other.
## Choosing the words
- **The glossary is binding.** Use the language's rendering for every glossary term the `pending`
@@ -52,24 +116,63 @@ A rejected entry is not written. Fix it and apply again.
glossary page's *Kept in English* table.
- **Language specifics** on the glossary page (`po_tool.py glossary --lang L` prints them) override
general habits for that language.
- **Consistency beyond the glossary:** before translating a label, or a tooltip that names a setting,
run `lookup` for the setting name. Quote the label's existing translation exactly, so the tooltip and
the field match. Reuse obsolete (`#~`) entries as a translation memory.
- **`msgctxt` separates homonyms.** `Back` in *Camera View* is the rear view, and `Back` in
*Navigation* is the go-back button. Translate each context on its own.
- **Overloaded English: translate the meaning.**
- *Flow ratio* is a multiplier, *Flow Rate* is throughput, and *Flow Dynamics* is pressure
compensation. These are three different terms.
- *Extruder* can mean the toolhead, the feeder motor ("High extruder current on filament swap") or
the nozzle ("all extruders must have the same diameter").
- When a short label is ambiguous, grep `src/` for the msgid to see the widget it labels.
- **The catalog's existing words come next.** A tooltip or message that names a setting, a button or a
menu item quotes that control's translation exactly, so the text matches what the user sees. `nearby`
shows the controls next to the string; `lookup` finds the rest. For a recurring term the glossary
lacks, `lookup` the English and `lookup --msgstr` the rendering you intend, and use the one the
catalog already settled on in that sense. Reuse obsolete (`#~`) entries as a translation memory.
- **No settled term: look outside the catalog, in this order.**
1. **Other slicers' shipped catalogs** for the same language:
[BambuStudio](https://github.com/bambulab/BambuStudio) `bbl/i18n/<lang>/BambuStudio_<lang>.po`
and [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer)
`resources/localization/<lang>/PrusaSlicer_<lang>.po` (a local clone, if there is one). Orca
shares much of its UI with both, so their translators have often rendered the same string
already. Their choice is evidence, not a rule: the glossary and Orca's own catalog win.
2. **The 3D-printing community in that language:** manuals, wikis and forums of printer vendors
(Bambu Lab, Prusa, Creality, Snapmaker) and their users. Take the term printers actually use,
a loanword where they use the loanword.
3. **Neighbouring fields,** when printing has no term of its own: CAD (SolidWorks, Fusion,
Onshape, AutoCAD), CNC/CAM and machining, then engineering and mathematics. General UI
vocabulary (*Settings*, *Preferences*, *Undo*, *Browse*, *Quit*, *Copy*, *Paste*) follows the
operating systems' own translations, which users already know.
4. **English,** when nothing is established: brand names, acronyms, file formats, G-code tokens,
variables, and Orca-specific feature names with no equivalent.
Translate paired terms as a pair, so they read as the two sides of one choice (direct drive and
Bowden, inner and outer wall). Name the sources a term came from in the report.
- **Each field keeps its own vocabulary.** 3D-view and CAD strings follow CAD software and drafting
standards: the standard view names, *isometric*, *orbit*, *pan* and *zoom*, *cut plane* versus
*section plane*, the primitive names. The camera of the 3D view (the viewpoint) and the printer's
camera (the device) are different things and take different words wherever the language has two.
- **A regional variant is its own language.** Never derive one from the other character by character
or word by word: zh_TW and zh_CN differ in vocabulary, not only in script. Start from the
variant's own glossary column and catalog. A converter (OpenCC `s2twp` for zh_CN → zh_TW) gives a
draft at most; review every entry it produced.
- **Boilerplate stays uniform.** `Failed to connect to …`, `Are you sure you want to …?` and
`If expressed as a %, it will be computed over …` each get one template in the language, even where
the English varies.
## Style
- **Localize, don't translate word-for-word.** Know what the string controls before translating it.
- **Localize, don't translate word-for-word.** Translate what the string means where it appears (see
*Context*), not each English word.
- **Write native UI text.** The result should read as if the app had been written in that language.
- Restructure the sentence instead of following English word order.
- Break up long noun chains.
- Drop passive and filler constructions the language doesn't use in UI text.
- Don't calque English idioms or compounds where the language has its own expression.
- Don't carry English Title Case over: capitalize as the language does (sentence case in most,
German nouns as German writes them).
- Use the language's own punctuation. Don't carry English marks over, such as ` — ` or straight
quotes where the language has its own. ASCII quotes around a literal value the user types or
the app matches stay as written.
- **Follow the catalog's conventions,** which a new entry must match:
- formal or informal address;
- full-width or half-width punctuation;
- spacing between scripts (CJK next to Latin letters or digits);
- the separator sibling labels use before their value;
- the verb form of buttons and menu commands (infinitive, imperative or noun);
- the form of a confirmation question.
- **Simplify developer phrasing** when the meaning survives. *"This option determines whether
OrcaSlicer should apply the retract reduction on infill"* reads better as *"Disable retractions while
printing infill."* Introduce nuances in following sentences, not in one packed clause.
@@ -77,14 +180,17 @@ A rejected entry is not written. Fix it and apply again.
descriptions is for human translators, who can confirm the extra content.
- **Write for both audiences:** professionals and people with a printer at home. Keep the established
terminology, used as plainly as the string allows.
- **Read the batch back without the English** before applying it, as a user of the app would see it.
Rewrite whatever reads like a translation, is ambiguous on its own, or uses a word differently from
the strings around it.
## When to add a review note
Add `"review": "<what to check>"` to an item when the translation is probable but unconfirmed. It
becomes `# Needs human review: …`, and the entry still ships. Typical reasons:
- The English is ambiguous out of context: "Tile" as a verb or a noun.
- A short label's role only shows in the app.
- The English stays ambiguous even with its code: "Tile" as a verb or a noun.
- A short label's role shows only in the running app, not in its code.
- Two established terms compete, or the glossary cell is unsettled.
- The string's grammar depends on a value substituted at runtime: `%zu %s` counts with no plural entry.
@@ -96,6 +202,7 @@ right for the whole row."*
Report these; don't work around them in a catalog.
- **The English is wrong.** Never "fix" it in the translation only.
- **A hint names a control that doesn't exist,** or a user-visible literal isn't wrapped in `_L`.
- **One msgid needs two translations.** The source needs `_L_CONTEXT` / `_u8L_CONTEXT` (a code change).
- **A literal `%` in a string xgettext flagged `possible-c-format`** fails `msgfmt`. The fix is a
`// xgettext:no-c-format, no-boost-format` comment above the string in the source, not `%%` in the
@@ -5,11 +5,14 @@ Standard library only. Edits a catalog in place, rewriting just the entries it
changes in the layout `msgmerge --no-wrap` writes, so every other byte stays put.
status [--lang L ...] per-catalog counts
pending --lang L [--offset N --limit N] [--out FILE] [--no-include-fuzzy] (adds similar earlier translations)
pending --lang L [--offset N --limit N] [--out FILE] [--no-include-fuzzy] (adds similar earlier
translations, where the source uses each msgid, and the translated labels near it)
apply --lang L --input FILE [--overwrite] [--dry-run] adds "# AI Translated"
check [--lang L ...] [--scope ai|all] [--warnings]
lookup --lang L PATTERN [--msgstr] existing translations with ids, obsolete ones included
glossary --lang L [TERM] the language's glossary column and notes
lookup --lang L PATTERN [--msgstr] [--code] [--file RX] existing translations with ids, obsolete
ones included; --file keeps those used in matching source files
purge-obsolete [--lang L ...] drop the obsolete (#~) entries, every catalog by default
glossary --lang L [TERM] the language's glossary column and notes
candidates [--min-count N] [--limit N] recurring untranslated phrases not in the glossary
glossary-set --term T [--description D] --set L=VALUE ... [--replace]
@@ -23,6 +26,7 @@ import hashlib
import json
import os
import re
import shutil
import subprocess
import sys
import tempfile
@@ -74,7 +78,7 @@ class Entry:
self.lines = lines
self.first_line = first_line # 0-based index in the file
self.obsolete = all(l.startswith("#~") for l in lines if not l.startswith("#") or l.startswith("#~"))
self.tcomments, self.xcomments, self.flags = [], [], []
self.tcomments, self.xcomments, self.flags, self.refs = [], [], [], []
self.fields = {} # keyword -> [value, start, end)
self.order = []
current = None
@@ -91,6 +95,8 @@ class Entry:
self.xcomments.append(line[2:].strip())
elif line.startswith("#,"):
self.flags += [f.strip() for f in line[2:].split(",") if f.strip()]
elif line.startswith("#:"):
self.refs += [(f, int(n)) for f, n in re.findall(r"(\S+):(\d+)", line[2:])]
elif line == "#" or line.startswith("# "):
self.tcomments.append(line[2:])
continue
@@ -177,6 +183,11 @@ class Entry:
while pos < len(lines) and (lines[pos] == "#" or lines[pos].startswith("# ")):
pos += 1
add = []
if not ai: # a person's words: drop a stale AI mark
lines = [l for l in lines if l != "# " + AI_TAG]
pos = 0
while pos < len(lines) and (lines[pos] == "#" or lines[pos].startswith("# ")):
pos += 1
if review is not None: # "" clears an earlier note, a reason replaces it
lines = [l for l in lines if not l.startswith("# " + REVIEW_TAG)]
pos = 0
@@ -248,6 +259,77 @@ def all_langs():
return sorted(d.name for d in I18N.iterdir() if (d / f"OrcaSlicer_{d.name}.po").exists() and d.name not in SKIP_LANGS)
# ---------------------------------------------------------------------------
# Source locations
class Sources:
"""Where the source uses each msgid. The catalogs are extracted with --no-location, so this runs
xgettext again over localization/i18n/list.txt with the keywords scripts/run_gettext.sh passes."""
def __init__(self):
self.refs = {} # (msgctxt, msgid) -> [(file, line)]
self.keys = {} # file -> [(line, key)]
self._lines = {}
xgettext = shutil.which("xgettext") or next((str(t) for t in [REPO / "tools" / "xgettext.exe"] if t.exists()), None)
keywords = sorted(set(re.findall(r"--keyword=\S+", (REPO / "scripts" / "run_gettext.sh").read_text(encoding="utf-8"))))
if not xgettext or not keywords:
print("note: xgettext not found; entries carry no source context", file=sys.stderr)
return
listed = (REPO / "localization" / "i18n" / "list.txt").read_text(encoding="utf-8").splitlines()
files = [f.strip() for f in listed if f.strip() and not f.startswith("#") and (REPO / f.strip()).is_file()]
with tempfile.TemporaryDirectory() as d:
lst, pot = Path(d) / "list.txt", Path(d) / "located.pot"
lst.write_text("\n".join(files) + "\n", encoding="utf-8")
r = subprocess.run([xgettext, *keywords, "--from-code=UTF-8", "--boost", "--no-wrap", "-f", str(lst), "-o", str(pot)],
cwd=REPO, capture_output=True, text=True)
if r.returncode or not pot.exists():
print(f"note: xgettext failed; entries carry no source context\n{r.stderr.strip()}", file=sys.stderr)
return
for e in Catalog(pot).active():
self.refs[e.key()] = e.refs
for f, n in e.refs:
self.keys.setdefault(f, []).append((n, e.key()))
def lines(self, f):
if f not in self._lines:
self._lines[f] = (REPO / f).read_text(encoding="utf-8", errors="replace").splitlines()
return self._lines[f]
def spread(self, key, n):
"""Up to n uses, from as many different places as possible, so a msgid that a gizmo and a
menu share shows both."""
picked = []
for place in (lambda f: f.rsplit("/", 1)[0], lambda f: f):
for f, line in self.refs.get(key, []):
if len(picked) < n and place(f) not in {place(p) for p, _ in picked}:
picked.append((f, line))
return picked
def code(self, key, n=3):
"""The lines around a msgid's uses: the widget or option it belongs to, and what fills its
placeholders."""
out = []
for f, line in self.spread(key, n):
lines = self.lines(f)
end = line # through the end of the statement, where the placeholder arguments are
while end < min(len(lines), line + 8) and ";" not in lines[end - 1]:
end += 1
around = [l.strip()[:160] for l in lines[max(line - 3, 0):end] if l.strip()]
out.append({"at": f"{f}:{line}", "code": "\n".join(around)})
return out
def nearby(self, key, translated, span=6, limit=4):
"""Translated short msgids used within a few lines of this one: the label a tooltip describes,
the other items of a menu or a choice. Their wording is what this one must agree with."""
dist = {}
for f, line in self.refs.get(key, []):
for n, k in self.keys.get(f, []):
if k != key and k in translated and len(k[1]) <= 80 and abs(n - line) <= span:
dist[k] = min(dist.get(k, span), abs(n - line))
return [dict({"msgctxt": k[0]} if k[0] else {}, msgid=k[1], msgstr=translated[k])
for k in sorted(dist, key=dist.get)[:limit]]
# ---------------------------------------------------------------------------
# Glossary
@@ -402,9 +484,9 @@ def validate(e, msgstrs, nplurals, glossary=None, lang=None):
b1, c1 = _placeholders(src, flags)
b2, c2 = _placeholders(s, flags)
positional = any("$" in p for p in c1)
c_bad = sorted(c1) != sorted(c2) if positional else c1 != c2
c_bad = set(c1) != set(c2) if positional else c1 != c2
bad = []
if sorted(b1) != sorted(b2):
if set(b1) != set(b2):
bad.append(f"boost placeholders {b1} -> {b2}")
if c_bad:
bad.append(f"printf placeholders {c1} -> {c2}" + ("" if positional else " (order must match)"))
@@ -504,15 +586,44 @@ def similar_entries(c, e, pool, cutoff=0.72):
sm = difflib.SequenceMatcher(autojunk=False)
sm.set_seq2(e.msgid)
best = []
for other, msgstr, obsolete in pool:
for other, msgstr, obsolete, human in pool:
sm.set_seq1(other)
if sm.real_quick_ratio() < cutoff or sm.quick_ratio() < cutoff:
continue
r = sm.ratio()
if r >= cutoff and other != e.msgid:
best.append((r, other, msgstr, obsolete))
best.append((r, other, msgstr, obsolete, human))
best.sort(key=lambda t: -t[0])
return [{"msgid": o, "msgstr": s, "obsolete": ob, "similarity": round(r, 2)} for r, o, s, ob in best[:2]]
return [dict({"msgid": o, "msgstr": s, "obsolete": ob, "similarity": round(r, 2)}, **({"human": True} if h else {}))
for r, o, s, ob, h in best[:2]]
def similar_pool(c):
return [(x.msgid, x.msgstrs()[0], x.obsolete, not x.ai) for x in c.entries
if not x.is_header and x.msgstrs() and x.msgstrs()[0] and not x.fuzzy and 8 < len(x.msgid) < 600]
def human_drift(e, strs, pool):
"""Why a translation strays from a person's text more than the English change explains, or None."""
import difflib
alike = lambda x, y: difflib.SequenceMatcher(None, x, y, autojunk=False).ratio()
new, old = "\n".join(strs), "\n".join(e.msgstrs())
if old.strip() and not e.ai:
r = alike(old, new)
if r < 0.85:
return (f"replaces a person's translation with text only {r:.0%} like it: keep their words and change "
f"only what the fix needs, or give \"rewrite\": \"<reason>\"")
return None
if old.strip() or len(e.msgid) <= 8:
return None
for s in similar_entries(None, e, pool, cutoff=0.85):
if s.get("human"):
r = alike(s["msgstr"], new)
if r < s["similarity"] - 0.1:
return (f"the English is {s['similarity']:.0%} like a string a person translated, but this translation is "
f"only {r:.0%} like theirs: patch their translation, or give \"rewrite\": \"<reason>\"")
break
return None
def cmd_pending(a):
@@ -520,8 +631,9 @@ def cmd_pending(a):
g = Glossary(a.wiki, langs=[a.lang])
todo = [e for e in c.active() if needs_translation(e, c.nplurals, a.include_fuzzy)]
batch = todo[a.offset:a.offset + a.limit] if a.limit else todo[a.offset:]
pool = [(x.msgid, x.msgstrs()[0], x.obsolete) for x in c.entries
if not x.is_header and x.msgstrs() and x.msgstrs()[0] and not x.fuzzy and 8 < len(x.msgid) < 600]
pool = similar_pool(c)
src = Sources()
translated = {e.key(): e.msgstrs()[0] for e in c.active() if e.msgstrs() and e.msgstrs()[0] and not e.fuzzy}
items = []
for e in batch:
item = {"id": e.id(), "msgctxt": e.msgctxt, "msgid": e.msgid}
@@ -539,6 +651,13 @@ def cmd_pending(a):
item["fuzzy"] = True
if e.msgstrs()[0]:
item["previous_translation"] = e.msgstrs()[0]
refs = src.refs.get(e.key(), [])
if refs:
item["refs"] = [f"{f}:{n}" for f, n in refs[:4]] + ([f"+{len(refs) - 4} more"] if len(refs) > 4 else [])
# Code only where it settles the meaning: short labels, and what fills the placeholders.
if len(e.msgid.split()) <= 8 or {"c-format", "boost-format"} & set(flags):
item["code"] = src.code(e.key()) or None
item["nearby"] = src.nearby(e.key(), translated) or None
if len(e.msgid) > 8:
sim = similar_entries(c, e, pool)
if sim:
@@ -561,6 +680,7 @@ def cmd_apply(a):
items = data["entries"] if isinstance(data, dict) else data
idx = c.index()
by_id = {c.entries[i].id(): i for i in idx.values()}
pool = similar_pool(c)
applied, skipped, rejected, warned = 0, 0, [], []
for it in items:
if "msgid" in it:
@@ -588,9 +708,16 @@ def cmd_apply(a):
if errors:
rejected.append((label, errors))
continue
drift = None if it.get("rewrite") else human_drift(e, strs, pool)
if drift:
rejected.append((label, [drift]))
continue
if warnings:
warned.append((label, warnings))
c.changes[i] = e.rewrite(strs, ai=not a.human, review=it.get("review"))
review = it.get("review")
if it.get("rewrite") and not review:
review = "Rewrote a person's translation: " + it["rewrite"]
c.changes[i] = e.rewrite(strs, ai=not a.human, review=review)
applied += 1
if not a.dry_run and c.changes:
c.save()
@@ -636,7 +763,7 @@ def cmd_check(a):
if msgfmt:
fd, mo = tempfile.mkstemp(suffix=".mo") # Windows msgfmt cannot write to "nul"
os.close(fd)
r = subprocess.run([msgfmt, "--check-format", "-o", mo, str(c.path)], capture_output=True, text=True)
r = subprocess.run([msgfmt, "--check-format", "--check-header", "-o", mo, str(c.path)], capture_output=True, text=True)
os.unlink(mo)
if r.returncode:
print(f"{lang}: msgfmt --check-format failed\n{r.stderr.strip()}")
@@ -648,9 +775,29 @@ def cmd_check(a):
return status
def cmd_purge_obsolete(a):
"""Drop the obsolete (#~) entries, with their comments and the blank line before each."""
for lang in a.lang or sorted(set(all_langs()) | SKIP_LANGS):
c = Catalog(catalog_path(lang))
# a block of comments alone also parses as obsolete, so require a #~ line
gone = [e for e in c.entries if e.obsolete and any(l.startswith("#~") for l in e.lines)]
drop = set()
for e in gone:
start = e.first_line
while start > 0 and c.lines[start - 1].strip() == "":
start -= 1
drop.update(range(start, e.first_line + len(e.lines)))
if drop:
c.lines = [l for i, l in enumerate(c.lines) if i not in drop]
c.save()
print(f"{lang}: {len(gone)} obsolete entries removed")
def cmd_lookup(a):
c = Catalog(catalog_path(a.lang))
rx = re.compile(a.pattern, re.I)
src = Sources() if a.code or a.file else None
in_files = re.compile(a.file) if a.file else None
n = 0
for e in c.entries:
strs = [s for s in e.msgstrs() if s]
@@ -659,11 +806,19 @@ def cmd_lookup(a):
texts = strs if a.msgstr else [e.msgid, e.msgid_plural or ""]
if not any(rx.search(t) for t in texts):
continue
if in_files and (e.obsolete or not any(in_files.search(f) for f, _ in src.refs.get(e.key(), []))):
continue
mark = "obsolete " if e.obsolete else f"{e.id()} " + ("AI " if e.ai else "")
ctx = f"[{e.msgctxt}] " if e.msgctxt else ""
print(f"{mark}{ctx}{json.dumps(e.msgid, ensure_ascii=False)}\n -> {json.dumps(strs[0] if len(strs) == 1 else strs, ensure_ascii=False)}")
if a.code and not e.obsolete:
refs, uses = src.refs.get(e.key(), []), src.code(e.key())
if len(refs) > len(uses):
print(" used in " + " ".join(f"{f}:{l}" for f, l in refs))
for use in uses:
print(f" {use['at']}\n" + "\n".join(" | " + l for l in use["code"].splitlines()))
n += 1
if n >= a.limit:
if a.limit and n >= a.limit:
print("... (limit reached)")
break
@@ -881,11 +1036,17 @@ def main():
s.add_argument("--no-glossary", action="store_true")
s.set_defaults(func=cmd_check)
s = sub.add_parser("purge-obsolete")
s.add_argument("--lang", action="append", help="default: every catalog")
s.set_defaults(func=cmd_purge_obsolete)
s = sub.add_parser("lookup")
s.add_argument("--lang", required=True)
s.add_argument("pattern")
s.add_argument("--msgstr", action="store_true", help="search the translations instead of the English")
s.add_argument("--limit", type=int, default=40)
s.add_argument("--code", action="store_true", help="show where the source uses each hit")
s.add_argument("--file", help="only entries used in source files matching this regex (e.g. 'Gizmos/')")
s.add_argument("--limit", type=int, default=40, help="0 for no limit")
s.set_defaults(func=cmd_lookup)
s = sub.add_parser("glossary")
@@ -867,6 +867,8 @@ append_shortcut_item(export_menu, Shortcut::ExportSlicedFile, true, _L("Export p
itself; never keep a raw pointer (`interface/wx/tipwin.h:20-110`).
- `wxRichToolTip` is not a window: each `ShowFor()` creates a new one, and the native MSW version
only applies to text controls (`interface/wx/richtooltip.h:70-192`).
- On Wayland, a GTK tooltip of a widget inside a shown popup maps as a grabbing `xdg_popup` and takes the
keyboard focus from the toplevel, which reports a deactivation → `references/popups-menus.md` §9.
| Static [source] | MSW | GTK | macOS |
|---|---|---|---|
@@ -373,7 +373,7 @@ current `boost::any m_value`. Virtuals: `BUILD()`, `set_value(any, change_event)
`toggle(en)` enables only when not `readonly`. Subclasses: `TextCtrl`, `CheckBox`, `SpinCtrl`, `Choice`,
`ColourPicker`, `PointCtrl`, `StaticText`, `SliderCtrl`, `PrinterAgentChoice`, `PluginField`,
`PluginConfigField`. `Field::Create<T>(parent, def, id)` constructs, runs `PostInitialize()` (em unit,
`parent_is_custom_ctrl`, `BUILD()`, readonly → `disable()`, Ctrl+1..4 tab shortcuts on the window) and returns a
`parent_is_custom_ctrl`, `BUILD()`, readonly → `disable()`) and returns a
`std::unique_ptr<Field>` owned by `OptionsGroup::m_fields`. The subclass `CheckBox` shadows the global `::CheckBox`
widget inside `Slic3r::GUI` wherever `Field.hpp` is visible, which is why widget code there writes `::CheckBox`
(and qualifies `::TextInput` / `::ComboBox` the same way) (`references/orca-widgets.md`).
@@ -541,6 +541,14 @@ Pitfall:
`set_option_label` (rename a row at runtime, e.g. `brim_width` → "Brim ear radius").
`Tab::get_config_manipulation()` builds the callbacks (variant index → `+256`, see [Variants](#per-extruder-variant-options));
`Tab` also records each public toggle in its own `OptionStateRegistry` before looking up a field.
The optional reason is localized text; false stores or replaces it, true removes only that kind of
restriction. Keys are kept exactly as supplied, independently of the separate variant index. Direct
field toggles are not recorded. The registry's `description` composes the localized restriction
text; public toggles refresh the field tooltip, and `OG_CustomCtrl` reads the same registry for the
row label. The label is the portable hover target for a disabled field. Markdown tips prepend this
dynamic text to the loaded document and include it in their content-change check.
`TabX::toggle_options()` calls the `toggle_*` function and adds tab-local tweaks. They run on every page activation,
after every `update()`, and after a variant switch.
@@ -592,10 +600,21 @@ English and translated label/group/category, so search matches either. `UnsavedC
name settings from the same index and skip a changed key the index lacks; only the extruder-transfer view
(`UnsavedChangesDialog::update_tree(type, config, from, to)`) falls back to the def's label/category, then "Others".
`get_tab_for_option` resolves the model tab when it has the key, otherwise the global tab; search
availability descriptions and `Sidebar::jump_to_option` use that same owner. The settings search
shows recorded restrictions below the result title and in its tooltip without changing fuzzy name
matching. The Speed Dial retains recorded hidden settings and puts their explanations in the detail
strip. Restrictions absent from the registry keep their existing row filter.
`Sidebar::jump_to_option(key, type, category)` → (model tab if it has the key, else switch to global) →
`Tab::activate_option`, which selects the page by translated category, focuses the field and blinks it
`Tab::activate_option`, which selects the page by translated category, reruns `toggle_options()`,
then either shows the registry's hidden reason or focuses the field and blinks it
(`get_custom_ctrl_with_blinking_ptr`). `Tab::apply_searcher()` refreshes the index for one tab.
Pitfall: the registry is only as fresh as the last `toggle_options()` of the page owning the key, and
its keys carry no extruder index. A check made before navigating refuses settings that a printer edit
or another extruder has made visible; check after the page and extruder are selected and the rules rerun.
Pitfalls:
- **Rule:** Create tab groups with a non-empty English title; a key that should be findable must be on a tab.
**Why:** `append_options` skips entries with an empty group or category, so `page->new_optgroup("")` rows and
@@ -372,14 +372,17 @@ form a chain of parents. Window icons come from the `.desktop` file. The full li
`references/mouse-keyboard-focus.md`;
- GL blending must keep destination alpha at 1 (d8369e5f75);
- GL post-init must retry until the surface is committed (d2c24fdabb) →
`references/webview-gl-aui-media.md`.
`references/webview-gl-aui-media.md`;
- a shown GTK tooltip is the topmost `xdg_popup`, so it must be hidden before a popup maps
(`PopupWindow::Show`) → `references/popups-menus.md` §9.
### XWayland (GTK3 X11 backend inside a Wayland session)
Users opt in with `GDK_BACKEND=x11…`. GTK then talks X11, so `is_running_on_x11()` is true and Orca
uses GLX through `PreferGLX()`. `CLI::run` prepares this path before GTK starts (PRIME variables,
`XInitThreads()`, no WebKit compositing workaround; the source comment says multi-monitor handling
is compromised there) → [Runtime detection](#runtime-x11wayland-detection),
uses GLX through `PreferGLX()`. `CLI::run` prepares this path before GTK starts (`XInitThreads()`, no
WebKit compositing workaround; GPU choice is the `prefer_discrete_gpu` preference on either backend;
the source comment says multi-monitor handling is compromised there) →
[Runtime detection](#runtime-x11wayland-detection),
`references/webview-gl-aui-media.md` §WebKitGTK on Linux sessions. Intel's XWayland GL exposes a
smaller `GL_MAX_TEXTURE_SIZE`, so the ImGui font atlas is re-packed to fit (22e121f4e4) →
`references/webview-gl-aui-media.md`.
@@ -409,7 +412,8 @@ start there when looking for prior art. The sites below are exemplars, cited by
(`focus_left_popup(...)`) instead of hit-testing `wxGetMousePosition()`.
- `PopupWindow::Create`: on GTK it binds the top-level `wxEVT_ACTIVATE` to `topWindowActiavate` →
`DismissAndNotify()`, gated by the virtual `ShouldDismissOnTopWindowDeactivate()`, which `DropDown`
overrides for Wayland popup chains. On `__WXOSX__` with `wxPU_CONTAINS_CONTROLS`,
overrides for Wayland popup chains. `PopupWindow::Show` (GTK) hides visible GTK tooltips before mapping
on Wayland. On `__WXOSX__` with `wxPU_CONTAINS_CONTROLS`,
`PopupWindow::OnMouseEvent2` hit-tests children, re-dispatches mouse events and synthesises
enter/leave.
- `SidePopup::Popup` (`Widgets/SideMenuPopup.cpp`): on `__APPLE__` the menu is anchored flush against
@@ -633,7 +637,7 @@ headers. Rows marked [source] or "protocol" come from the implementation or from
| `wxBitmap(const wxCursor&)` | creates an invalid bitmap | `interface/wx/bitmap.h:393-395` | — |
| OpenGL | only EGL; `PreferGLX()` has no effect. Without EGL in the build, wxGTK's `wxGLCanvas` shows a fatal message and refuses to work [source: `src/gtk/glcanvas.cpp` `IsAvailable`]. The EGL surface is a subsurface over the canvas, ready only after map and a frame callback [source: `src/unix/glegl.cpp`] | `interface/wx/glcanvas.h:1094-1095` | `CLI::run` forces X11 when wx lacks EGL; overlays are drawn in GL/ImGui, never as wx children over the canvas → `references/webview-gl-aui-media.md` |
| AUI | the doc note "live resize is always used … for wxOSX and wxGTK3 when using Wayland" is obsolete: "As of wxWidgets 3.3.0 this function always returns false", and `wxAUI_MGR_LIVE_RESIZE` is in the default flags. Floating panes need global positions | `interface/wx/aui/framemanager.h:336-345` | `Plater::priv::priv` clears `wxAUI_MGR_ALLOW_FLOATING`; `sanitize_window_layout_for_wayland` strips floating state from the saved layout → `references/webview-gl-aui-media.md` §wxAuiManager |
| Popups | a GTK popup is an `xdg_popup` only for COMBO/DROPDOWN/POPUP_MENU hints, so wx creates popups with `GDK_WINDOW_TYPE_HINT_COMBO` [source]. A chained popup's parent must be the mapped popup, and mapping it with a grab deactivates the toplevel (Orca's comments in `DropDown::mouseMove`, `DropDown::ShouldDismissOnTopWindowDeactivate`) | `src/gtk/popupwin.cpp:110-114` | `DropDown` transient-for chain, `ShouldDismissOnTopWindowDeactivate` → `references/popups-menus.md` |
| Popups | a GTK popup is an `xdg_popup` only for COMBO/DROPDOWN/POPUP_MENU hints, so wx creates popups with `GDK_WINDOW_TYPE_HINT_COMBO` [source]. A chained popup's parent must be the mapped popup, and mapping it with a grab deactivates the toplevel (Orca's comments in `DropDown::mouseMove`, `DropDown::ShouldDismissOnTopWindowDeactivate`). A GTK tooltip of a widget in a shown popup maps as that popup's grabbing child and deactivates the toplevel the same way | `src/gtk/popupwin.cpp:110-114` | `DropDown` transient-for chain, `ShouldDismissOnTopWindowDeactivate`, the tooltip check in `PopupWindow::topWindowActiavate` → `references/popups-menus.md` |
| Fractional scale | arrives as an integer GDK scale | `docs/doxygen/overviews/high_dpi.md:348-351` | → `references/dpi-bitmaps-fonts.md` |
| Window decorations | some desktop environments draw a title bar on undecorated windows anyway | — | [Undecorated windows](#wayland-undecorated-top-level-windows-splash) |
| `wxWebViewChromium` | X11 only | `interface/wx/webview_chromium.h:133-146` | not built (`wxUSE_WEBVIEW_CHROMIUM` OFF) |
@@ -73,6 +73,14 @@ Contents: [Rules](#rules) · [1. Choosing the window kind](#1-choosing-the-windo
27. Build `MenuFactory` menus once. Pass `parent` to `append_menu_item` only for items that persist. (§16)
28. macOS: bind `wxID_EXIT` on `OSXGetAppleMenu()` to `Close()`, only insert into the Apple menu, and always
`Skip()` a frame's `wxEVT_ACTIVATE`. (§15)
29. On Wayland, a popup that can open while a GTK tooltip is shown hides every visible tooltip window before
it maps. `PopupWindow::Show` does it for every Orca popup; a popup outside `PopupWindow` opened from a
widget with a GTK tooltip must do it itself. Only a popup that cannot map while a GTK tooltip is visible,
such as one opened from the GL canvas (whose tooltips are ImGui), needs nothing. (§9)
30. On Wayland, a hook that dismisses a popup when its toplevel deactivates ignores the deactivation while a GTK
tooltip of a widget in that popup, or in a popup opened from it, is on screen: the tooltip has taken the
keyboard while the user is still on the popup. `PopupWindow::topWindowActiavate` does it for every Orca popup;
a popup outside `PopupWindow` with such a hook must do it itself. (§9)
## 1. Choosing the window kind
@@ -390,6 +398,10 @@ compensates for (§6).
on older GTK and GTK2. On hide: `gdk_seat_ungrab` + `gtk_grab_remove` (`popupcmn.cpp:335-403`).
`gdk_seat_ungrab` releases the *seat's* grab, whichever popup took it, so hiding a sub-popup also drops the
parent popup's pointer grab.
- The window is mapped before the grab is taken (`wxPopupWindow::Show` at `popupcmn.cpp:370`, the grab from
375). Under Wayland the popup itself therefore maps as an `xdg_popup` without an explicit grab, while GDK
records the grab seat on its window, and a popup mapped later as its transient child (a sub-dropdown, a GTK
tooltip of a widget inside it) inherits that seat and maps with `xdg_popup.grab` (§9).
- An outside press arrives at the grab widget. `gtk_popup_button_press` sends `wxEVT_KILL_FOCUS` to the popup
and **consumes the click** (`return TRUE`, `src/gtk/popupwin.cpp:28-58`). Presses older than the popup's
creation time are ignored (33-34).
@@ -439,6 +451,9 @@ class PopupWindow : public wxPopupTransientWindow {
public:
PopupWindow(wxWindow* parent, int style = wxBORDER_NONE);
bool Create(wxWindow* parent, int flags = wxBORDER_NONE);
#ifdef __WXGTK__
bool Show(bool show = true) override; // hides GTK tooltips first on Wayland (§9)
#endif
#ifdef __WXMSW__
void BindUnfocusEvent(); // opt-in
#endif
@@ -451,7 +466,7 @@ What it adds per platform:
| Port | Behaviour |
|---|---|
| GTK | `Create` binds `wxEVT_ACTIVATE` on `GetTopParent(parent)`. `topWindowActiavate` calls `event.Skip()`, then `DismissAndNotify()` if the toplevel deactivated, the popup is shown and `ShouldDismissOnTopWindowDeactivate()` returns true. This supplies the app/toplevel deactivation dismissal that stock wxGTK lacks. |
| GTK | `Create` binds `wxEVT_ACTIVATE` on `GetTopParent(parent)`. `topWindowActiavate` calls `event.Skip()`, then `DismissAndNotify()` if the toplevel deactivated, the popup is shown, `ShouldDismissOnTopWindowDeactivate()` returns true and, under Wayland, no GTK tooltip of the popup's own is on screen (§9). This supplies the app/toplevel deactivation dismissal that stock wxGTK lacks. Under Wayland, `Show(true)` on a hidden popup first hides every visible GTK tooltip window (§9). |
| MSW | Nothing automatic. `BindUnfocusEvent()` binds the toplevel's `wxEVT_ACTIVATE`/`wxEVT_ICONIZE`/`wxEVT_SHOW` to `Dismiss()` (no `OnDismiss`). It is for default-style popups: they are desktop children that Windows does not hide with the frame, and stock wx closes them on deactivation or minimizing only if a focus message reaches a wx window (§4, §5). `topWindowActivate` does **not** `Skip()`, so while the popup lives it swallows the frame's `wxEVT_ACTIVATE`, and with it `wxTopLevelWindowMSW::OnActivate`'s focus save and restore (`src/msw/toplevel.cpp:1326-1360`). |
| macOS | Only with `wxPU_CONTAINS_CONTROLS`: `OnMouseEvent2`, bound on the popup for `LEFT_DOWN/UP/DCLICK`, `MOTION` and `MOUSEWHEEL`, hit-tests the children (static `HitTest`) and re-dispatches the event to the deepest child under the cursor with `ProcessEventLocally`. On `MOTION` it synthesizes `ENTER`/`LEAVE` for the hovered target. This compensates for the capture rerouting in §5. |
@@ -721,6 +736,85 @@ fights the grab and focus model (§10). Two more [source] facts:
`DropDown::Popup`, applied when `!mainDropDown && m_widget`).
- **Rule:** Don't open a grabbing popup on hover on Linux if the opener must stay clickable.
Cite: `MainFrame` slice-button hover handlers (`#ifndef __linux__`).
- **Rule:** On Wayland, hide every visible GTK tooltip window right before mapping a popup that can open
while one is shown.
**Why:** A GTK3 tooltip is a `GTK_WINDOW_POPUP` with the `tooltip` type hint, placed with
`gdk_window_move_to_rect` (`gtktooltip.c:974-983`), so GDK Wayland maps it as an `xdg_popup` of the
hovered widget's toplevel (`should_map_as_popup`, `gdkwindow-wayland.c:3198-3199`). GDK refuses to map a
popup whose parent is not the last popup it mapped, warning "Tried to map a popup with a non-top most
parent" (`gdkwindow-wayland.c:3040-3046`), and the window stays invisible while wx believes it is shown.
GTK hides the tooltip on a button or key press, but only after the event has been propagated to the
widgets (`gtkmain.c:1949-1961`, `_gtk_tooltip_handle_event`). A dropdown opened from the click is therefore
mapped while the opener's tooltip is still up, and the click that opens it after the tooltip delay does
nothing. The same holds for a sub-dropdown opened on hover while the main dropdown shows an item tooltip.
GTK hides the current tooltip the same way before mapping its own menus (`gtk_menu_popup_internal`,
`gtkmenu.c:1837`), but through the private `_gtk_tooltip_hide_in_display` (`gtktooltip.c:1297`); apps have
no public call, so hide the window: `gtk_widget_hide` unmaps the `xdg_popup` at once, and GtkTooltip treats
the tooltip as no longer visible (`GTK_TOOLTIP_VISIBLE`, `gtktooltip.c:135`). Its own hide on the press
then returns early, before it times out browse mode (`gtk_tooltip_hide_tooltip`, `gtktooltip.c:1078`,
1092), so the next tooltip shows after the 60 ms browse delay instead of 500 ms. A tooltip GTK tries to
show while a popup is open fails to map with the same warning and stays hidden, unless its widget is in
the topmost popup (a dropdown's own item tooltip maps as that popup's child); that happens with or without
this step and is harmless. X11 has no popup stacking rule, so the step is gated on
`is_running_on_wayland()`. (Line numbers are GTK 3.24.52.)
```cpp
// Wrong: map the popup with the opener's tooltip still on top
drop.Popup(&drop);
// Right (wxGTK, Wayland): PopupWindow::Show does this before every map
GList* toplevels = gtk_window_list_toplevels();
for (GList* l = toplevels; l; l = l->next)
if (gtk_window_get_type_hint(GTK_WINDOW(l->data)) == GDK_WINDOW_TYPE_HINT_TOOLTIP && gtk_widget_get_visible(GTK_WIDGET(l->data)))
gtk_widget_hide(GTK_WIDGET(l->data));
g_list_free(toplevels);
```
Cite: `PopupWindow::Show` (#16595).
- **Rule:** On Wayland, don't dismiss a shown popup on a toplevel deactivation while a GTK tooltip of one of its
widgets is on screen.
**Why:** GTK makes a tooltip transient for the toplevel of the widget it describes (`gtktooltip.c:974`), which
for a widget inside a popup, or the popup itself (`DropDown` sets its item tooltips on itself), is the popup's
own `GtkWindow`. The popup's window holds the seat grab (§5), and `find_grab_input_seat` walks the transient
parents to it (`gdkwindow-wayland.c:3142-3147`), so GDK maps the tooltip with an explicit `xdg_popup.grab`
(3100); the walk passes through every popup in a chain, so a tooltip in a popup opened from inside another
popup grabs too. The compositor gives the keyboard to the topmost grabbing popup: KWin sends `wl_keyboard.leave`
for the main window and `enter` for the tooltip (observed with `WAYLAND_DEBUG=client`). wxGTK turns the
toplevel's focus-out into `wxEVT_ACTIVATE(false)` (`src/gtk/toplevel.cpp:192-205`), so a deactivation hook closes
the popup as the tooltip appears, and GDK warns "Tried to unmap the parent of a popup"
(`gdkwindow-wayland.c:3429`) because the tooltip is still mapped as its child. The focus returns to the toplevel
when the tooltip hides. Ask GDK whether the tooltip is mapped (`gdk_window_is_visible`): when the compositor
dismisses a tooltip, `xdg_popup_done` hides only its `GdkWindow` (`gdkwindow-wayland.c:2289`,
`gdkwindow.c:5684-5690`), and `gtk_widget_get_visible` stays TRUE until GTK hides the tooltip itself. Alt+Tab with
a tooltip showing still closes the popup (observed): the Alt press reaches the app, which hides the tooltip after
handling the key (`gtkmain.c:1949-1961`). X11 tooltips never take the focus, so the check is gated on
`is_running_on_wayland()`. (Line numbers are GTK 3.24.52.)
**Limit:** wxGTK sends `wxEVT_ACTIVATE(false)` only while it holds an active frame and then clears it
(`g_activeFrame`, `src/gtk/toplevel.cpp:196-202`), so a deactivation ignored this way is never repeated. If the
app loses the focus while the tooltip holds it, without Orca seeing a key or the pointer leave first (another
app's window taking the focus, a gesture), the popup stays open until the user returns, and the first click
closes it (observed with a dialog from another app). Closing that gap means waiting for the compositor to
reactivate the toplevel, which takes a timer or a blocking round trip.
```cpp
// Wrong: every toplevel deactivation dismisses, including the one the popup's own tooltip causes
if (!event.GetActive() && IsShown() && ShouldDismissOnTopWindowDeactivate())
DismissAndNotify();
// Right (wxGTK): Wayland only, skip it while a tooltip of this popup or of a popup opened from it is mapped
static bool own_tooltip_mapped(GtkWindow *popup)
{
bool mapped = false;
for_each_tooltip_window([popup, &mapped](GtkWindow *win) { // GDK_WINDOW_TYPE_HINT_TOOLTIP toplevels
GdkWindow *gdk_win = gtk_widget_get_window(GTK_WIDGET(win));
if (!gdk_win || !gdk_window_is_visible(gdk_win))
return;
for (GtkWindow *w = gtk_window_get_transient_for(win); w && !mapped; w = gtk_window_get_transient_for(w))
mapped = w == popup;
});
return mapped;
}
if (!event.GetActive() && IsShown() && ShouldDismissOnTopWindowDeactivate() &&
!(Slic3r::GUI::is_running_on_wayland() && own_tooltip_mapped(GTK_WINDOW(m_widget))))
DismissAndNotify();
```
Cite: `PopupWindow::topWindowActiavate` (#16800).
## 10. Frameless dialog instead of a popup
@@ -587,9 +587,15 @@ sets the DMABUF workarounds and then branches on `GDK_BACKEND`:
default-path case that really runs through XWayland; `DISPLAY` and `WAYLAND_DISPLAY` alone do not
identify it, because a native Wayland app inherits both. `XInitThreads()` runs only when `DISPLAY` is
set.
- **`GDK_BACKEND=x11…` opt-in path**: sets `DRI_PRIME=1` (and the NVIDIA PRIME variables when
`/proc/driver/nvidia/version` exists), calls `XInitThreads()`, and deliberately does **not** disable
- **`GDK_BACKEND=x11…` opt-in path**: calls `XInitThreads()` and deliberately does **not** disable
compositing, which keeps hardware acceleration for Device / Setup Wizard / login pages.
- **GPU selection** is independent of the backend. The Linux preference `prefer_discrete_gpu` ("Render on
the discrete GPU", default off) makes `apply_discrete_gpu_preference()` export `DRI_PRIME=1` and, when
`/proc/driver/nvidia/version` exists, the NVIDIA render-offload variables before GTK opens the display;
it reads the saved configuration through `AppConfig::peek_bool` because no `AppConfig` exists yet. The
desktop entries carry no `PrefersNonDefaultGPU` hint, so a menu launch renders on the display GPU like
a terminal launch; the hint made hybrid laptops on Wayland render through zink on the other GPU with
an empty 3D view.
Runtime backend detection elsewhere uses Orca's `is_running_on_wayland()` / `is_running_on_x11()`
(see `references/platforms.md`), not these environment variables.
+108
View File
@@ -0,0 +1,108 @@
name: Approve PR checks
# The repository makes a maintainer approve workflow runs on pull requests from first-time
# contributors, and that setting covers every workflow at once. This approves the pending runs of
# Check profiles, Check locale and clang-tidy at the head of each open pull request from a fork, so
# they report without waiting; Build all and the other workflows still wait for a maintainer. It
# does not read the approval setting, so a stricter one does not hold these three back either.
#
# Its token can approve runs and pull_request_target needs no approval, so it must never check out
# or run pull request code. It reads run, pull request and git tree metadata only.
on:
# Approves the runs for a pull request's new head right away. No paths filter: clang_tidy.yml
# runs on every pull request into these branches.
pull_request_target:
branches:
- main
- release/*
# Looks at every pending run: one not listed yet when the job above looked, and all of them when
# pull_request_target is blocked by an Actions event policy.
schedule:
- cron: '7,17,27,37,47,57 * * * *'
workflow_dispatch:
permissions: {}
jobs:
approve:
name: Approve PR checks
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
actions: write # list and approve workflow runs
contents: read # compare commits and read git trees
pull-requests: read # list open pull requests
steps:
- name: Approve pending runs
# A failed job would leave a red check on the pull request, which blocks pr-merge-bot.
# The sweep retries and reports the failure instead.
continue-on-error: ${{ github.event_name == 'pull_request_target' }}
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
# Both empty for the sweep, which then considers every pending run.
PR_NUMBER: ${{ github.event.pull_request.number }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
# The workflows approved here, found by file name.
workflows="check_profiles.yml check_locale.yml clang_tidy.yml"
# Prints the tree of a commit's .github/, or nothing if it has none; fails if the commit
# cannot be read.
github_tree() {
gh api "repos/${GH_REPO}/git/trees/$1" --jq '.tree[] | select(.path == ".github") | .sha'
}
# The approve endpoint is for pull requests from forks, so runs from this repository's own
# branches are left to a maintainer. Each workflow is listed on its own, so pending runs of
# other workflows cannot fill the endpoint's 1000-result window. A failed listing exits
# rather than passing for an empty one.
runs=$(for workflow in $workflows; do
gh api --paginate "repos/${GH_REPO}/actions/workflows/${workflow}/runs?event=pull_request&status=action_required&per_page=100${HEAD_SHA:+&head_sha=${HEAD_SHA}}" \
--jq '.workflow_runs[] | select(.head_repository.full_name != .repository.full_name) | [.id, .workflow_id, .head_sha, .name] | @tsv' \
|| exit 1
done)
if [ -z "$runs" ]; then
echo "No run of these workflows is waiting for approval."
exit 0
fi
# Runs for superseded commits and closed pull requests are left alone.
if [ -n "$PR_NUMBER" ]; then
open_heads=$(gh api "repos/${GH_REPO}/pulls/${PR_NUMBER}" --jq 'select(.state == "open") | .head.sha')
else
open_heads=$(gh api --paginate "repos/${GH_REPO}/pulls?state=open&per_page=100" --jq '.[].head.sha')
fi
failed=0
while IFS=$'\t' read -r run_id workflow_id sha name; do
grep -qx "$sha" <<< "$open_heads" || continue
# The approved run takes its workflow from the head merged into the base branch. A head
# whose .github/ is the one it branched from main with changes no workflow, so that
# merge runs only workflow code already on this repository's branches. A maintainer
# approves the rest.
if ! newest=$(gh api "repos/${GH_REPO}/actions/workflows/${workflow_id}/runs?event=pull_request&head_sha=${sha}&per_page=1" --jq '.workflow_runs[0].id') \
|| ! base=$(gh api "repos/${GH_REPO}/compare/main...${sha}" --jq .merge_base_commit.sha) \
|| ! head_tree=$(github_tree "$sha") || ! base_tree=$(github_tree "$base"); then
echo "::warning::Could not read the ${name} runs or the .github/ trees for ${sha}."
failed=1
continue
fi
# Reopening a pull request leaves an older run at the same head; only the newest runs.
[ "$newest" = "$run_id" ] || continue
if [ -z "$head_tree" ] || [ "$head_tree" != "$base_tree" ]; then
echo "::notice::Leaving ${name} run ${run_id} to a maintainer: ${sha} changes .github/."
continue
fi
if gh api -X POST "repos/${GH_REPO}/actions/runs/${run_id}/approve" > /dev/null; then
echo "Approved ${name} run ${run_id} for ${sha}."
# A maintainer or another run of this workflow may have approved it first.
elif ! conclusion=$(gh api "repos/${GH_REPO}/actions/runs/${run_id}" --jq .conclusion) \
|| [ "$conclusion" = action_required ]; then
echo "::warning::Could not approve ${name} run ${run_id} for ${sha}."
failed=1
else
echo "${name} run ${run_id} no longer waits for approval."
fi
done <<< "$runs"
exit "$failed"
+8
View File
@@ -23,6 +23,8 @@ on:
- 'scripts/test_check_exception_throw_info.ps1'
- 'build_release_macos.sh'
- 'scripts/build_preset_cache.*'
- 'scripts/prune_cached_presets.ps1'
- 'scripts/test_prune_cached_presets.ps1'
- 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'tests/**'
@@ -47,6 +49,8 @@ on:
- 'scripts/test_check_exception_throw_info.ps1'
- 'build_release_macos.sh'
- 'scripts/build_preset_cache.*'
- 'scripts/prune_cached_presets.ps1'
- 'scripts/test_prune_cached_presets.ps1'
- 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'tests/**'
@@ -92,6 +96,10 @@ jobs:
shell: powershell
run: .\scripts\test_check_exception_throw_info.ps1
- name: Run the preset prune tests
shell: powershell
run: .\scripts\test_prune_cached_presets.ps1
build_linux:
strategy:
fail-fast: false
+22 -6
View File
@@ -253,6 +253,17 @@ jobs:
run: |
./build_release_macos.sh -u -x ${{ !vars.SELF_HOSTED && '-j 3' || '' }} -a universal -t 10.15
# xcrun stapler fetches the notarization ticket over HTTP/3 (UDP 443),
# which GitHub-hosted macOS runners drop, failing with Error 68
# (actions/runner-images#14924). Blocking UDP 443 makes it fall back to
# TCP. Skipped on self-hosted runners, where the pf rules would outlive
# the job.
- name: Force stapler onto TCP
if: github.repository == 'OrcaSlicer/OrcaSlicer' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && runner.os == 'macOS' && inputs.macos-combine-only && !vars.SELF_HOSTED
run: |
echo "block return out quick proto udp from any to any port 443" | sudo pfctl -f -
sudo pfctl -E
# Thanks to RaySajuuk, it's working now
- name: Sign app and notary
if: github.repository == 'OrcaSlicer/OrcaSlicer' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && runner.os == 'macOS' && inputs.macos-combine-only
@@ -264,8 +275,9 @@ jobs:
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
CERTIFICATE_ID: ${{ secrets.MACOS_CERTIFICATE_ID }}
run: |
# Load the `retry` helper (retries flaky commands such as `hdiutil create`).
# Load the `retry` and `create_dmg` helpers.
source ${{ github.workspace }}/scripts/retry.sh
source ${{ github.workspace }}/scripts/create_dmg.sh
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
@@ -319,7 +331,7 @@ jobs:
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/*
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/Applications
retry hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_dmg -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
create_dmg "OrcaSlicer" ${{ github.workspace }}/build/universal/OrcaSlicer_dmg OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
codesign --deep --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS" --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
# Create separate OrcaSlicer_profile_validator DMG if the app exists
@@ -328,7 +340,7 @@ jobs:
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/*
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications
retry hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
create_dmg "OrcaSlicer Profile Validator" ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
codesign --deep --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS" --sign "$CERTIFICATE_ID" OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
fi
@@ -346,13 +358,14 @@ jobs:
if: github.ref != 'refs/heads/main' && runner.os == 'macOS' && inputs.macos-combine-only
working-directory: ${{ github.workspace }}
run: |
# Load the `retry` helper (retries flaky commands such as `hdiutil create`).
# Load the `retry` and `create_dmg` helpers.
source ${{ github.workspace }}/scripts/retry.sh
source ${{ github.workspace }}/scripts/create_dmg.sh
mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_dmg
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/*
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/Applications
retry hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_dmg -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
create_dmg "OrcaSlicer" ${{ github.workspace }}/build/universal/OrcaSlicer_dmg OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
# Create separate OrcaSlicer_profile_validator DMG if the app exists
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
@@ -360,7 +373,7 @@ jobs:
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/*
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications
retry hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
create_dmg "OrcaSlicer Profile Validator" ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
fi
# Delete the per-arch bundles only after signing/DMG creation succeeded, so a
@@ -637,6 +650,9 @@ jobs:
chmod +x "$appimage"
"$appimage" --appimage-extract
./scripts/build_preset_cache.sh -b build build/package/resources/profiles squashfs-root/resources/profiles
# The runtime extracts every directory as 0700, and appimagetool (continuous
# build 333 onwards) refuses to pack a tree other users cannot read.
chmod -R a+rX squashfs-root
appimagetool=$(find build -name "appimagetool.AppImage" | head -1)
ARCH=$(uname -m) "$appimagetool" --appimage-extract-and-run squashfs-root "$appimage"
rm -rf squashfs-root
+6 -1
View File
@@ -1,6 +1,8 @@
name: Check locale
on:
# approve_pr_checks.yml approves these runs for first-time contributors and finds this
# workflow by its file name.
pull_request:
branches:
- main
@@ -12,6 +14,9 @@ jobs:
check_translation:
name: Check translation
runs-on: ubuntu-latest
# approve_pr_checks.yml starts first-time contributors' runs without a maintainer looking
# at the pull request first. A run takes under a minute; this bounds one that msgfmt stalls on.
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v7
@@ -33,7 +38,7 @@ jobs:
if [ -f "$dir/OrcaSlicer_${lang}.po" ]; then
mkdir -p ./resources/i18n/${lang}/
msgfmt --check-format -o ./resources/i18n/${lang}/OrcaSlicer.mo $dir/OrcaSlicer_${lang}.po
msgfmt --check-format --check-header -o ./resources/i18n/${lang}/OrcaSlicer.mo $dir/OrcaSlicer_${lang}.po
# Check the exit status of the msgfmt command
if [ $? -ne 0 ]; then
echo "Error encountered with msgfmt command for language ${lang}."
+33 -2
View File
@@ -1,5 +1,7 @@
name: Check profiles
on:
# approve_pr_checks.yml approves these runs for first-time contributors and finds this
# workflow by its file name.
pull_request:
# release/* is included because pr-merge-bot.yml lets delegates merge into
# it, and it gates on this workflow's result. Without it a delegated merge
@@ -37,6 +39,9 @@ jobs:
# delegated merge. Renaming it silently disables that gate.
name: Check profiles
runs-on: ubuntu-24.04
# approve_pr_checks.yml starts first-time contributors' runs without a maintainer looking
# at the pull request first. A run takes 2-6 minutes; this bounds a runaway one.
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v7
@@ -60,6 +65,21 @@ jobs:
python3 ./scripts/orca_profile_tool.py check 2>&1 | tee ${{ runner.temp }}/profile_tool.log
exit ${PIPESTATUS[0]}
# The app installs a bundled profile only when its version is newer than the installed
# one, and the OTA profile update is named after it, so a changed bundle whose
# <Vendor>.json keeps its version never reaches users. HEAD is the PR's merge commit, so
# HEAD^1 is the base it merges onto.
- name: Check that changed bundles bumped their version
id: version_bump
if: ${{ github.event_name == 'pull_request' }}
continue-on-error: true
run: |
set -o pipefail
{
git fetch --no-tags --depth=2 origin "$(git rev-parse HEAD)" &&
python3 ./scripts/orca_profile_tool.py version-check --base HEAD^1 --head HEAD
} 2>&1 | tee ${{ runner.temp }}/version_bump.log
# The app migrates user filament presets made against 2.4.2 back to the printers their
# parent listed then, from resources/info/legacy_compatible_printers.json. A PR that
# renames a filament preset or narrows its compatible_printers changes what that map
@@ -258,7 +278,7 @@ jobs:
touch "$results/gcode_diff_done.txt"
- name: Prepare comment artifact
if: ${{ always() && github.event_name == 'pull_request' && (steps.profile_tool.outcome == 'failure' || steps.legacy_compat.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
if: ${{ always() && github.event_name == 'pull_request' && (steps.profile_tool.outcome == 'failure' || steps.version_bump.outcome == 'failure' || steps.legacy_compat.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
run: |
{
# Marker matched by check_profiles_comment.yml to delete prior comments.
@@ -275,6 +295,17 @@ jobs:
echo ""
fi
if [ "${{ steps.version_bump.outcome }}" = "failure" ]; then
echo "### Profile Version Not Bumped"
echo ""
echo '```'
head -c 30000 ${{ runner.temp }}/version_bump.log || echo "No output captured"
echo '```'
echo ""
echo 'Every changed bundle needs a newer `version` in its `resources/profiles/<Vendor>.json`, or the app never installs the change.'
echo ""
fi
if [ "${{ steps.legacy_compat.outcome }}" = "failure" ]; then
echo "### Legacy Compatible Printers Map Out of Date"
echo ""
@@ -335,7 +366,7 @@ jobs:
retention-days: 1
- name: Fail if any check failed
if: ${{ always() && (steps.profile_tool.outcome == 'failure' || steps.legacy_compat.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
if: ${{ always() && (steps.profile_tool.outcome == 'failure' || steps.version_bump.outcome == 'failure' || steps.legacy_compat.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_slice.outcome == 'failure' || steps.validate_filament_subtypes.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
run: |
echo "One or more profile checks failed; see the step logs above."
echo 'Reproduce the whole run locally with scripts/check_profile.sh (scripts\check_profile.bat on Windows).'
+7
View File
@@ -8,6 +8,9 @@ name: clang-tidy
# No paths filter: the job is a required check, and a workflow skipped by a
# paths filter leaves a required check pending forever. A PR with no C++
# changes finishes after the first step.
#
# approve_pr_checks.yml approves this workflow's runs for first-time
# contributors and finds it by its file name.
on:
pull_request:
branches:
@@ -36,6 +39,10 @@ jobs:
# that gate.
name: clang-tidy
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
# approve_pr_checks.yml starts first-time contributors' runs without a
# maintainer looking at the pull request first. The deps-cache wait alone may
# take 100 minutes; this bounds a runaway run without cutting a real one.
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v7
+1 -1
View File
@@ -158,7 +158,7 @@ jobs:
sudo apt-get install -y --no-install-recommends \
libopengl0 libgl1 libegl1 libwebkit2gtk-4.1-0
- uses: actions/setup-python@v6
- uses: actions/setup-python@v7
with:
python-version: "3.12"
+25 -14
View File
@@ -50,6 +50,12 @@ jobs:
'documentation'
];
const pr = context.payload.pull_request;
// First-time contributors also get a link to the contributing guide
const greeting = ['FIRST_TIME_CONTRIBUTOR', 'FIRST_TIMER'].includes(pr.author_association)
? `Hi @${pr.user.login}, thanks for contributing to OrcaSlicer! ` +
`[How to Contribute](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute) explains what reviewers need from a PR.\n\n` +
`You can`
: `Hi @${pr.user.login}, you can`;
const labelsList = `${allowedLabels
.slice(0, -1)
.map((label) => `\`${label}\``)
@@ -72,7 +78,7 @@ jobs:
repo: context.repo.repo,
issue_number: pr.number,
body:
`Hi @${pr.user.login}, you can manage the labels for this PR by \`/bot add-label\` and \`/bot remove-label\`\n\n` +
`${greeting} manage the labels for this PR by \`/bot add-label\` and \`/bot remove-label\`.\n\n` +
`Allowed labels are:\n${labelsList}\n\n` +
`Examples:\n${examplesText}`
});
@@ -118,19 +124,24 @@ jobs:
return;
}
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: ['Localization']
});
core.info('Applied Localization label.');
} catch (error) {
if (isPermissionDenied(error)) {
core.warning('Cannot add Localization label because token cannot write.');
} else {
throw error;
// The label marks translation-only PRs: every changed file is a .po or .pot catalog
if (!files.every((file) => /\.pot?$/.test(file.filename))) {
core.info('Files other than .po/.pot catalogs changed; skipping Localization label.');
} else {
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: ['Localization']
});
core.info('Applied Localization label.');
} catch (error) {
if (isPermissionDenied(error)) {
core.warning('Cannot add Localization label because token cannot write.');
} else {
throw error;
}
}
}
+66
View File
@@ -3,6 +3,7 @@ name: Publish to draft release
# Manually pulls the platform binaries produced by a "Build all" run and uploads
# them to an existing DRAFT release. Decoupled from the build so you can test a
# build first, then publish exactly that run's artifacts once you're happy.
# It also writes an ordered download table into the draft's release notes.
#
# Trigger: Actions tab -> "Publish to draft release" -> Run workflow.
# Locked to a single person: the first step aborts unless the actor matches the
@@ -129,3 +130,68 @@ jobs:
gh release upload "$TAG" upload/* --repo "$GITHUB_REPOSITORY" --clobber
echo "Uploaded to draft release: $TAG"
gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name'
# GitHub lists release assets alphabetically by filename whatever order they
# are uploaded in, so the platform order users see comes from this table in
# the release notes. The table sits between the two markers: a rerun
# replaces it in place, and notes without markers get it appended. Text
# outside the markers is kept. Links use the tag's download URL, which only
# resolves once the draft is published.
- name: Write download table into release notes
run: |
set -euo pipefail
start='<!-- downloads:start -->'
end='<!-- downloads:end -->'
# Sort key and label of an asset, in the order the table lists them.
describe() {
case "$1" in
*Windows_Installer_*_x64.exe) echo "01|Windows installer (x64)" ;;
*Windows_Installer_*_arm64.exe) echo "02|Windows installer (ARM64)" ;;
*_x64_portable.zip) echo "03|Windows portable (x64)" ;;
*_arm64_portable.zip) echo "04|Windows portable (ARM64)" ;;
*.dmg) echo "05|macOS (Apple Silicon and Intel)" ;;
*_aarch64_*.AppImage) echo "07|Linux AppImage (aarch64)" ;;
*.AppImage) echo "06|Linux AppImage (x86_64)" ;;
*_x86_64.flatpak) echo "08|Linux Flatpak (x86_64)" ;;
*_aarch64.flatpak) echo "09|Linux Flatpak (aarch64)" ;;
Debug_PDB_*) echo "10|Windows debug symbols (for developers)" ;;
*) echo "99|$1" ;;
esac
}
{
echo "$start"
echo
echo "## Downloads"
echo
echo "| Platform | File |"
echo "| --- | --- |"
gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name' | while read -r name; do
echo "$(describe "$name")|$name"
done | sort | while IFS='|' read -r _ label name; do
echo "| $label | [$name](https://github.com/$GITHUB_REPOSITORY/releases/download/$TAG/$name) |"
done
echo
echo "$end"
} > table.md
gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json body --jq '.body' > notes.md
starts=$(grep -cF "$start" notes.md || true)
ends=$(grep -cF "$end" notes.md || true)
if [ "$starts" -ne "$ends" ] || [ "$starts" -gt 1 ]; then
echo "::error::The release notes must contain each download-table marker exactly once, or neither. Fix them by hand and rerun."
exit 1
fi
if [ "$starts" -eq 1 ]; then
awk -v start="$start" -v end="$end" '
index($0, start) { while ((getline line < "table.md") > 0) print line; skip = 1; next }
index($0, end) { skip = 0; next }
!skip
END { exit skip }
' notes.md > notes.new || { echo "::error::The download-table end marker must be on its own line, after the start marker."; exit 1; }
else
{ cat notes.md; echo; cat table.md; } > notes.new
fi
gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes-file notes.new
cat table.md
+58
View File
@@ -0,0 +1,58 @@
name: Stale issues and PRs
on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch:
permissions:
actions: write # save the run state in the actions cache
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v11
with:
# Each new stale label costs about 2 operations. Runs that stop early
# continue from the same place the next day.
operations-per-run: 300
ascending: true
stale-issue-label: stale
stale-pr-label: stale
remove-stale-when-updated: true
# Issues
days-before-issue-stale: 90
days-before-issue-close: 14
close-issue-reason: not_planned
exempt-issue-labels: enhancement
exempt-all-issue-assignees: true
exempt-all-issue-milestones: true
stale-issue-message: |
This issue has had no activity for 90 days, so it will be closed in 14 days.
If it still happens on the latest OrcaSlicer release, please leave a comment with the version you tested and it will stay open.
close-issue-message: |
This issue was closed because there was no activity after the reminder.
If it still happens on the latest release, leave a comment here and a team member can reopen it, or open a new issue with the details.
# PRs: only PRs where we asked the author for something
only-pr-labels: "wait for response"
days-before-pr-stale: 90
days-before-pr-close: 14
exempt-draft-pr: true
exempt-all-pr-assignees: true
exempt-all-pr-milestones: true
delete-branch: false
stale-pr-message: |
We asked for changes or more information on this PR, and there has been no activity for 90 days. It will be closed in 14 days.
To keep it open, leave a comment. If you push new commits, please also leave a short comment, because a push alone does not reset this. If you no longer have time for it, that is fine, just let us know.
close-pr-message: |
This PR was closed because we did not hear back after the reminder. Thank you for the work you put into it.
If you want to continue, push your changes and reopen it, or open a new PR.
+18
View File
@@ -49,6 +49,16 @@ jobs:
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
useLocalCache: true
useCloudCache: true
# Skips self-hosted runners, where this machine-wide setting would stay after the job ends.
- name: Enable Crash Dumps
if: runner.os == 'Windows' && !vars.SELF_HOSTED
shell: pwsh
run: |
$key = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps'
New-Item -Path $key -Force | Out-Null
New-ItemProperty -Path $key -Name DumpFolder -PropertyType ExpandString -Value "$env:RUNNER_TEMP\crash-dumps" -Force | Out-Null
New-ItemProperty -Path $key -Name DumpType -PropertyType DWord -Value 2 -Force | Out-Null
New-ItemProperty -Path $key -Name DumpCount -PropertyType DWord -Value 5 -Force | Out-Null
- name: Unpackage and Run Unit Tests
timeout-minutes: 20
shell: bash
@@ -64,6 +74,14 @@ jobs:
with:
name: unit-test-logs-${{ inputs.artifact }}
path: ${{ inputs.test-dir }}/**/*.log
- name: Upload Crash Dumps
if: ${{ failure() && runner.os == 'Windows' && !vars.SELF_HOSTED }}
uses: actions/upload-artifact@v7
with:
name: crash-dumps-${{ inputs.artifact }}
path: ${{ runner.temp }}/crash-dumps
retention-days: 5
if-no-files-found: ignore
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
+5 -1
View File
@@ -58,6 +58,10 @@ ctest --test-dir ./tests/fff_print -C Release
- Profile/format changes need version migration handling
- Dependencies built separately in `deps/build/`, then linked to main app
## Pull requests
Before opening a pull request or posting on GitHub, read [CONTRIBUTING.md](CONTRIBUTING.md), including its "If you are an AI agent" section.
## Code review focus areas
- Changes must not cause regressions in existing functionality, defaults, profiles, or project compatibility.
@@ -112,5 +116,5 @@ See `.claude/skills/orca-translations/references/source-audit.md` for the full c
### Verifying
- `scripts/run_gettext.bat --full` (Windows) regenerates the template, merges every catalog and compiles the `.mo` files. It must exit 0.
- Or check a single catalog with `msgfmt --check-format -o <out>.mo localization/i18n/<lang>/OrcaSlicer_<lang>.po`.
- Or check a single catalog with `msgfmt --check-format --check-header -o <out>.mo localization/i18n/<lang>/OrcaSlicer_<lang>.po`. Without `--check-header`, msgfmt skips the placeholder check in plural forms.
- Fuzzy entries are not shown to users. If you correct one, clear its `fuzzy` flag, otherwise the fix never ships.
+19 -7
View File
@@ -130,6 +130,8 @@ set(ORCA_BUNDLED_UV_EXECUTABLE "" CACHE FILEPATH "Path to a uv executable to bun
# be reproducible and the download verified. To upgrade, bump ORCA_UV_VERSION
# and refresh every hash below from the release's .sha256 assets, e.g.:
# curl -sL https://github.com/astral-sh/uv/releases/download/<ver>/uv-<triple>.tar.gz.sha256
# The Flatpak copy in scripts/flatpak/com.orcaslicer.OrcaSlicer.yml pins the
# same version and hashes and must be bumped with them.
set(ORCA_UV_VERSION "0.11.21")
set(ORCA_UV_SHA256_aarch64-apple-darwin "1f921d491ba5ffeea774eb04d6681ecee379101341cbb1500394993b541bf3f4")
set(ORCA_UV_SHA256_x86_64-apple-darwin "f3c8e5708a84b920c18b691214d54d2b0da6b984789caae95d47c95120cb7765")
@@ -152,6 +154,15 @@ if(ORCA_BUNDLED_UV_EXECUTABLE MATCHES "/\\.uv/")
set(ORCA_BUNDLED_UV_EXECUTABLE "" CACHE FILEPATH "Path to the auto-downloaded uv executable" FORCE)
endif()
# A Flatpak build has no network and cannot download below: the orca_deps module
# in scripts/flatpak/com.orcaslicer.OrcaSlicer.yml fetches the same pinned uv and
# installs it into the app resources, where the runtime looks for it.
set(ORCA_UV_FLATPAK_BINARY "${CMAKE_INSTALL_FULL_DATAROOTDIR}/OrcaSlicer/tools/uv/uv")
if(FLATPAK AND NOT ORCA_BUNDLED_UV_EXECUTABLE AND EXISTS "${ORCA_UV_FLATPAK_BINARY}")
message(STATUS "Using Flatpak-provided uv: ${ORCA_UV_FLATPAK_BINARY}")
set(ORCA_BUNDLED_UV_EXECUTABLE "${ORCA_UV_FLATPAK_BINARY}")
endif()
if(NOT ORCA_BUNDLED_UV_EXECUTABLE)
if(NOT EXISTS "${ORCA_UV_BINARY}")
# Select uv by TARGET arch. On macOS universal builds each leg sets a single
@@ -195,10 +206,8 @@ if(NOT ORCA_BUNDLED_UV_EXECUTABLE)
list(GET ORCA_UV_DL_STATUS 0 ORCA_UV_DL_CODE)
list(GET ORCA_UV_DL_STATUS 1 ORCA_UV_DL_MSG)
if(NOT ORCA_UV_DL_CODE EQUAL 0)
# Network failure keeps the historical graceful degradation (uv is
# optional at build time) -- but a hash mismatch below is fatal.
message(WARNING "Failed to download uv: ${ORCA_UV_DL_MSG}")
file(REMOVE "${ORCA_UV_ARCHIVE}")
message(FATAL_ERROR "Failed to download uv: ${ORCA_UV_DL_MSG}")
else()
file(SHA256 "${ORCA_UV_ARCHIVE}" _orca_uv_actual_sha256)
if(NOT _orca_uv_actual_sha256 STREQUAL "${ORCA_UV_SHA256_${ORCA_UV_ARCH}}")
@@ -818,7 +827,6 @@ find_package(TBB REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
find_package(Freetype REQUIRED)
if (SLIC3R_GUI)
# LibDataChannel's installed export references its bundled dependencies,
@@ -1131,7 +1139,6 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
"SLIC3R_CAD setting as this project.")
endif ()
file(COPY ${_occt_dlls}
${CMAKE_PREFIX_PATH}/bin/freetype.dll
${CMAKE_PREFIX_PATH}/bin/avformat-61.dll
${CMAKE_PREFIX_PATH}/bin/avcodec-61.dll
${CMAKE_PREFIX_PATH}/bin/swresample-5.dll
@@ -1144,7 +1151,6 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
${_out_dir}/libmpfr-4.dll
${_out_dir}/WebView2Loader.dll
${_out_dir}/freetype.dll
${_out_dir}/avformat-61.dll
${_out_dir}/avcodec-61.dll
${_out_dir}/swresample-5.dll
@@ -1304,7 +1310,13 @@ elseif (SLIC3R_FHS)
PATTERN "*/udev" EXCLUDE
)
if(ORCA_BUNDLED_UV_EXECUTABLE)
install(PROGRAMS "${ORCA_BUNDLED_UV_EXECUTABLE}" DESTINATION "${SLIC3R_FHS_RESOURCES}/tools/uv" RENAME "${ORCA_BUNDLED_UV_FILENAME}")
# A Flatpak build finds uv at this exact path, installed by the orca_deps
# module before this one configures (see ORCA_UV_FLATPAK_BINARY above).
# Installing it there again would copy the file onto itself.
set(_orca_uv_fhs_binary "${SLIC3R_FHS_RESOURCES}/tools/uv/${ORCA_BUNDLED_UV_FILENAME}")
if(NOT ORCA_BUNDLED_UV_EXECUTABLE_CONFIG STREQUAL _orca_uv_fhs_binary)
install(PROGRAMS "${ORCA_BUNDLED_UV_EXECUTABLE}" DESTINATION "${SLIC3R_FHS_RESOURCES}/tools/uv" RENAME "${ORCA_BUNDLED_UV_FILENAME}")
endif()
endif()
install(FILES src/dev-utils/platform/unix/com.orcaslicer.OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
foreach(SIZE 32 128 192)
+105
View File
@@ -0,0 +1,105 @@
# Contributing to OrcaSlicer
Thanks for wanting to help! OrcaSlicer is built by volunteers.
Review is the slowest part of getting a PR merged. A small group of reviewers works through hundreds of open PRs in their spare time. If a PR has what they need, it is reviewed sooner and is more likely to be merged. [How to Contribute](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute) on the wiki has the details for each kind of PR.
For questions about using OrcaSlicer, please ask on [Discord](https://discord.gg/P4VE9UY9gJ) or in [Discussions](https://github.com/OrcaSlicer/OrcaSlicer/discussions), not in an issue or PR.
Opening an issue? See [Opening an Issue](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#opening-an-issue).
## The short version
- Search open PRs and issues before you start. Someone may already be working on it.
- Keep each PR to one topic. Put changes that belong together in one PR, and unrelated changes in separate PRs. Focused PRs are reviewed and merged much faster.
- Don't open many PRs at once. If you already have several open, wait until some are merged.
- Explain why the change is needed, and show how you tested it. Add an automated test when the code can be tested.
- AI tools are welcome. You are still responsible for the change, so test it and make sure you understand it.
- Keep your PR up to date and reply to review comments.
## Write a description reviewers can use
Use the [PR template](.github/pull_request_template.md), and keep its "How to Download Pull Requests Artifacts" link as the last line. Testers use that link. In the template, answer these questions:
- **What does this change, and why is it needed?** If it fixes an issue, write `Fixes #1234` in the description, so GitHub closes the issue when the PR is merged. If it fixes only part of an issue, mention `#1234` without `Fixes`, so the issue stays open.
- **Are there related PRs or issues?** If another PR touches the same code or bug, explain how yours is different.
- **How did you test it?** Give the OS, the printer profile and the steps. Attach a project file if the result depends on a model or settings. Name any automated tests you added. The best test fails without your change and passes with it. See [tests/AGENTS.md](tests/AGENTS.md) for where a test goes.
- **What could you not test?** For example another OS, or a printer you don't own.
Use short, plain sentences, because many reviewers read English as a second language. Your own English is fine, and so is a translation tool.
## What each kind of PR needs
| Kind of PR | Label | Reviewers need to see |
|---|---|---|
| [Bug fix](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#bug-fixes) | `bug-fix`, `crash` | The cause, before and after, a test if possible |
| [Security fix](SECURITY.md) | `SECURITY` | A private report to the maintainers first |
| [New feature or setting](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#new-features-and-settings) | `enhancement`, `QoL` | Why users need it, that it is off by default, real results |
| [Performance](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#performance) | `optimization` | Measurements, and proof the output did not change |
| [Refactor](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#refactors) | `optimization` | That behavior and output did not change |
| [GUI change](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#gui-changes) | `UI/UX` | Screenshots before and after, on each platform you tested |
| [Printer profile](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#printer-profiles) | `profile` | The validator passing, the version bump, real print results |
| [Translation](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#translations) | `Localization` | Glossary terms used, placeholders unchanged |
| [Build, CI or dependencies](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#build-ci-and-dependencies) | `build`, `dependencies` | Which platforms you built on |
| [Tests](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#tests) | `test` | That the test fails when the behavior breaks |
| [Documentation](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#documentation) | `documentation` | That it matches the current code |
## Rules that are easy to miss
- **Don't reformat existing code or make unrelated edits.** `.clang-format` is for new files. In existing files, match the code around your change.
- **Include what you use.** Because of the precompiled header, a local build can succeed with a missing include. Run `scripts/run_clang_tidy.sh` (or `.ps1`) before you push.
- **New behavior is off by default.** When the new option is off, existing output must not change.
- **Keep old projects and profiles working.** Never change what an existing setting means. Add a new key, and convert old values in `handle_legacy`.
- **Write each UI message as one translatable string** with placeholders, never as joined fragments. See "Writing translatable strings in the source" in [AGENTS.md](AGENTS.md).
- **Only edit `msgstr` in translations.** Keep every placeholder and `\n` exactly as in the `msgid`.
- **Bump the vendor version when you change profiles.** Change `version` in `resources/profiles/<Vendor>.json` for every vendor you change, and run `scripts/check_profile.sh` (or `.bat`).
The code style and the full list of what reviewers check are in [AGENTS.md](AGENTS.md).
## Using AI tools
AI tools are welcome here, and many contributors and maintainers use them. Reviewers can only spend time on PRs that a person has already tested.
- **You are responsible for the change.** Before you ask for review, build the change, run it, and confirm that it works. Be ready to explain each change and why it is needed.
- **Keep it short and true.** AI tools tend to write long descriptions, and sometimes describe tests that never ran. Remove generated code that isn't needed, too. A short description of what you actually did helps more.
- **Read what you post.** Please don't paste a review comment into an AI tool and post its answer without checking it.
- **Don't let an agent open PRs or post comments on its own.** Read everything before it is posted.
- **Use the repository's skills.** `.claude/skills/` (also reachable as `.agents/skills/`) has instructions for AI tools on parts of OrcaSlicer. The top of each skill's `SKILL.md` describes when to use it. Some tools load them automatically. With others, point the tool to the skill that matches your change.
### If you are an AI agent
If you are an AI agent working for a contributor, please follow these steps:
1. Show the contributor this guide before you open a PR or post a comment.
2. Search open PRs for the same change before you start.
3. If the contributor already has several open PRs, wait until some are merged before you open another.
4. Before you change code, check `.claude/skills/` for a skill that matches the change, and follow it.
5. If the code can be tested, add an automated test, and check that it fails without the change and passes with it.
6. Ask the contributor to test the change by hand. For a bug fix, they should build the code without the change and reproduce the bug. Then they should build the branch and check that the bug is gone.
7. Write the PR description in the [PR template](.github/pull_request_template.md). A body passed with `gh pr create --body` replaces the template, so start from the template's text.
8. If you couldn't build or run something, say so in the PR.
## After you open the PR
- **Add labels.** A bot will comment with instructions. Reply with the labels from the table above, for example `/bot add-label bug-fix, UI/UX`.
- **Leave "Allow edits by maintainers" turned on**, so a reviewer can push small fixes directly.
- **Mark the PR ready for review when it's finished.** Draft PRs are not merged.
- **Push new commits to the same PR.** Please don't open a new PR for the same change.
- **Don't force-push once a reviewer has commented.** Add new commits instead, so reviewers can see what changed since they last looked. To fix merge conflicts, merge `main` into your branch. PRs are usually squash-merged, so extra commits are fine.
- **Reply to every review comment**, including automated ones. You don't have to agree, but please say why.
Reviewers are volunteers, and a first response can take a while. If you already have several PRs open, please wait until some are merged before you open more. Review comments on one PR often apply to the others too. While you wait, there are [other ways to help](https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute#other-ways-to-help).
## If your PR is closed
There are more PRs than reviewers can handle, so we may close a PR that doesn't meet this guide. For example, it may have no explanation of how it was tested, duplicate another PR, or look generated and untested. When we close a PR, we'll say why in a comment.
You're welcome to open a new PR once the change meets this guide. Please link the old PR in the description, so reviewers can see the earlier discussion. Thank you for the time you put into it.
## Security issues
Please don't report security problems in a public issue. See [SECURITY.md](SECURITY.md).
## Thank you
Thanks again for helping. We're glad you're here.
+7 -1
View File
@@ -54,7 +54,7 @@ while getopts ":dpa:snt:xbc:i:j:Tuh" opt; do
echo " -u: Build universal app only (requires existing arm64 and x86_64 app bundles)"
echo " -n: Nightly build"
echo " -t: Specify minimum version of the target platform, default is 12.0"
echo " -x: Use Ninja Multi-Config CMake generator, default is Xcode"
echo " -x: Use Ninja Multi-Config CMake generator, default is Xcode (requires ninja; install with 'brew install ninja')"
echo " -b: Build without reconfiguring CMake"
echo " -c: Set CMake build configuration, default is Release"
echo " -i: Add a prefix to ignore during CMake dependency discovery (repeatable), defaults to /opt/local:/usr/local:/opt/homebrew"
@@ -122,6 +122,12 @@ if [ -z "$CMAKE_IGNORE_PREFIX_PATH" ]; then
export CMAKE_IGNORE_PREFIX_PATH="/opt/local:/usr/local:/opt/homebrew"
fi
if [[ "$SLICER_CMAKE_GENERATOR" == Ninja* || "$DEPS_CMAKE_GENERATOR" == Ninja* ]] && ! command -v ninja >/dev/null 2>&1; then
echo "Error: Ninja is required when using the -x generator option."
echo "Install it with Homebrew: brew install ninja"
exit 1
fi
CMAKE_VERSION=$(cmake --version | head -1 | sed 's/[^0-9]*\([0-9]*\).*/\1/')
if [ "$CMAKE_VERSION" -ge 4 ] 2>/dev/null; then
export CMAKE_POLICY_VERSION_MINIMUM=3.10
-8
View File
@@ -351,7 +351,6 @@ if(FLATPAK)
find_package(EXPAT)
find_package(CURL)
find_package(JPEG)
find_package(Freetype)
find_package(OpenSSL 1.1...<3.2)
find_package(CURL)
endif()
@@ -441,12 +440,6 @@ if (NOT FLATPAK)
set(WXWIDGETS_PKG "dep_wxWidgets")
endif()
set(FREETYPE_PKG "")
if(NOT FREETYPE_FOUND)
include(FREETYPE/FREETYPE.cmake)
set(FREETYPE_PKG "dep_FREETYPE")
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
RESULT_VARIABLE REV_PARSE_RESULT
@@ -482,7 +475,6 @@ set(_dep_list
dep_CGAL
dep_GLFW
dep_OCCT
${FREETYPE_PKG}
${PNG_PKG}
${ZLIB_PKG}
${EXPAT_PKG}
-29
View File
@@ -1,29 +0,0 @@
if(WIN32)
set(library_build_shared "1")
else()
set(library_build_shared "0")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_ft_disable_zlib "-D FT_DISABLE_ZLIB=FALSE")
else()
set(_ft_disable_zlib "-D FT_DISABLE_ZLIB=TRUE")
endif()
orcaslicer_add_cmake_project(FREETYPE
URL https://github.com/SoftFever/orca_deps/releases/download/freetype-2.12.1.tar.gz/freetype-2.12.1.tar.gz
URL_HASH SHA256=efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938
#DEPENDS ${ZLIB_PKG}
#"${_patch_step}"
CMAKE_ARGS
-D BUILD_SHARED_LIBS=${library_build_shared}
${_ft_disable_zlib}
-D FT_DISABLE_BZIP2=TRUE
-D FT_DISABLE_PNG=TRUE
-D FT_DISABLE_HARFBUZZ=TRUE
-D FT_DISABLE_BROTLI=TRUE
)
if(MSVC)
add_debug_dep(dep_FREETYPE)
endif()
+16
View File
@@ -1,7 +1,23 @@
# libjpeg-turbo carries its own old copy of GNUInstallDirs, which installs into lib64 on
# any 64-bit Linux that is not Debian-based. CMake does not search lib64 on Arch, where
# find_package(JPEG) would then skip this copy and take the system libjpeg, whose ABI
# version differs from these headers. Install into lib like every other dep.
set(_jpeg_platform_args "")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# WebKitGTK loads the system libjpeg into the same process. Linked with GNU ld, the
# executable exports the functions of this static copy that a linked shared library
# references, so code built against the system libjpeg (WebKitGTK, GStreamer's jpeg
# plugin) would call them and fail their ABI version check. Hidden visibility keeps
# this copy private to the executable that embeds it.
set(_jpeg_platform_args -DCMAKE_C_VISIBILITY_PRESET=hidden)
endif ()
orcaslicer_add_cmake_project(JPEG
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.2.0.zip
URL_HASH SHA256=1b4c2cb6cba1ca5e53b9e85eeeab02154cab4b70894c96e97a9c747a26d19d63
CMAKE_ARGS
-DENABLE_SHARED=OFF
-DENABLE_STATIC=ON
-DCMAKE_INSTALL_LIBDIR=lib
${_jpeg_platform_args}
)
+1 -4
View File
@@ -36,7 +36,6 @@ orcaslicer_add_cmake_project(OCCT
# (Open-Cascade-SAS/OCCT#572); remove the patch once an OCCT release includes the fix.
PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-BRepMesh-seam-pcurve-at-edge-parameter.patch
#DEPENDS dep_Boost
DEPENDS ${FREETYPE_PKG}
CMAKE_ARGS
-DCMAKE_CXX_STANDARD=17
-DBUILD_LIBRARY_TYPE=${library_build_type}
@@ -49,7 +48,7 @@ orcaslicer_add_cmake_project(OCCT
-DINSTALL_DIR_CMAKE=lib/cmake/occt
-DUSE_TK=OFF
-DUSE_TBB=OFF
#-DUSE_FREETYPE=OFF
-DUSE_FREETYPE=OFF
-DUSE_FFMPEG=OFF
-DUSE_VTK=OFF
-DBUILD_DOC_Overview=OFF
@@ -62,5 +61,3 @@ orcaslicer_add_cmake_project(OCCT
-DBUILD_MODULE_Visualization=OFF
${_occt_compiler_args}
)
# add_dependencies(dep_OCCT ${FREETYPE_PKG})
-54
View File
@@ -1,54 +0,0 @@
diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake
index 7f229cde96..d8e20f8fe9 100644
--- a/cmake/OpenCVDetectCXXCompiler.cmake
+++ b/cmake/OpenCVDetectCXXCompiler.cmake
@@ -171,8 +171,10 @@ elseif(MSVC)
set(OpenCV_RUNTIME vc15)
elseif(MSVC_VERSION MATCHES "^192[0-9]$")
set(OpenCV_RUNTIME vc16)
- elseif(MSVC_VERSION MATCHES "^193[0-9]$")
+ elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
set(OpenCV_RUNTIME vc17)
+ elseif(MSVC_VERSION MATCHES "^195[0-9]$")
+ set(OpenCV_RUNTIME vc18)
else()
message(WARNING "OpenCV does not recognize MSVC_VERSION \"${MSVC_VERSION}\". Cannot set OpenCV_RUNTIME")
endif()
diff --git a/cmake/templates/OpenCVConfig.root-WIN32.cmake.in b/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
index b0f254ebe8..8f0178b0ae 100644
--- a/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
+++ b/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
@@ -137,7 +137,7 @@ elseif(MSVC)
set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version
endif()
endif()
- elseif(MSVC_VERSION MATCHES "^193[0-9]$")
+ elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
set(OpenCV_RUNTIME vc17)
check_one_config(has_VS2022)
if(NOT has_VS2022)
@@ -151,6 +151,24 @@ elseif(MSVC)
endif()
endif()
endif()
+ elseif(MSVC_VERSION MATCHES "^195[0-9]$")
+ set(OpenCV_RUNTIME vc18)
+ check_one_config(has_VS2026)
+ if(NOT has_VS2026)
+ set(OpenCV_RUNTIME vc17)
+ check_one_config(has_VS2022)
+ if(NOT has_VS2022)
+ set(OpenCV_RUNTIME vc16)
+ check_one_config(has_VS2019)
+ if(NOT has_VS2019)
+ set(OpenCV_RUNTIME vc15) # selecting previous compatible runtime version
+ check_one_config(has_VS2017)
+ if(NOT has_VS2017)
+ set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version
+ endif()
+ endif()
+ endif()
+ endif()
endif()
elseif(MINGW)
set(OpenCV_RUNTIME mingw)
-54
View File
@@ -1,54 +0,0 @@
From 893b8113f04d408cc6177c6de19c9889a48faa24 Mon Sep 17 00:00:00 2001
From: Zixu Wang <zixu_wang@apple.com>
Date: Thu, 18 Jan 2024 11:12:00 -0800
Subject: [PATCH] Fix unused platform check and configuration for macOS
In a similar manner as zlib (https://github.com/madler/zlib/pull/895),
libpng contains a header configuration that's no longer valid and
hasn't been exercised for the macOS target.
- The target OS conditional macros are misused. Specifically
`TARGET_OS_MAC` covers all Apple targets, including iOS, and it
should not be checked with `#if defined` as they would always be
defined (to either 1 or 0) on Apple platforms.
- `#include <fp.h>` no longer works for the macOS target and results
in a compilation failure. macOS ships all required functions in
`math.h`, and clients should use `math.h` instead.
This problem has not been noticed until a recent extension in clang
(https://github.com/llvm/llvm-project/pull/74676) exposed the issue
and broke libpng builds on Apple platforms. The failure can be
reproduced now by adding `#include <TargetConditionals.h>` before the
block.
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
---
AUTHORS | 2 ++
pngpriv.h | 14 ++------------
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h
index 6c7280cf53..190eb85cbf 100644
--- a/3rdparty/libpng/pngpriv.h
+++ b/3rdparty/libpng/pngpriv.h
@@ -556,18 +556,8 @@
*/
# include <float.h>
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
- * as it seems it doesn't agree with <fp.h>, yet we should really use
- * <fp.h> if possible.
- */
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
-# include <fp.h>
-# endif
-# else
-# include <math.h>
-# endif
+# include <math.h>
+
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881
+16 -8
View File
@@ -17,16 +17,18 @@ if ("${DEPS_ARCH}" STREQUAL "arm64" AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(_disable_carotene "-DWITH_CAROTENE=OFF")
endif ()
if (IN_GIT_REPO)
set(OpenCV_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV)
# clang-cl parses template bodies at the end of each file. In softfloat.cpp that
# is after OpenCV's own float32_t, which then hides the NEON one in arm_neon.h.
set(_clang_cl_flags "")
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(_clang_cl_flags "-DOPENCV_EXTRA_CXX_FLAGS=-fno-delayed-template-parsing")
endif ()
orcaslicer_add_cmake_project(OpenCV
${_options}
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
PATCH_COMMAND git apply ${OpenCV_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
DEPENDS ${JPEG_PKG}
URL https://github.com/opencv/opencv/archive/refs/tags/4.14.0.tar.gz
URL_HASH SHA256=ee8fb9b30eb60850431b4656447080e3737b56e45719c92b67f245950609f86e
DEPENDS ${JPEG_PKG} ${PNG_PKG}
CMAKE_ARGS
-DBUILD_SHARED_LIBS=0
-DBUILD_PERE_TESTS=OFF
@@ -35,13 +37,13 @@ orcaslicer_add_cmake_project(OpenCV
-DBUILD_EXAMPLES=OFF
-DBUILD_JASPER=OFF
-DBUILD_JAVA=OFF
# Share Orca's libjpeg to avoid conflicting codec symbols in the application.
# Share Orca's libjpeg and libpng to avoid conflicting codec symbols in the application.
-DBUILD_JPEG=OFF
-DBUILD_PNG=OFF
-DBUILD_APPS_LIST=version
-DBUILD_opencv_apps=OFF
-DBUILD_opencv_java=OFF
-DBUILD_OPENEXR=OFF
-DBUILD_PNG=ON
-DBUILD_TBB=OFF
-DBUILD_WEBP=OFF
-DBUILD_ZLIB=OFF
@@ -74,6 +76,11 @@ orcaslicer_add_cmake_project(OpenCV
-DWITH_WEBP=OFF
-DWITH_TIFF=OFF
-DBUILD_TIFF=OFF
# Codecs and HALs added after 4.6 that default to ON. AVIF would link any
# system libavif it finds, and KleidiCV is downloaded at configure time.
-DWITH_AVIF=OFF
-DWITH_IMGCODEC_GIF=OFF
-DWITH_KLEIDICV=OFF
-DENABLE_PRECOMPILED_HEADERS=OFF
-DINSTALL_TESTS=OFF
-DINSTALL_C_EXAMPLES=OFF
@@ -94,5 +101,6 @@ orcaslicer_add_cmake_project(OpenCV
-DWITH_WIN32UI=OFF
-DHAVE_WIN32UI=FALSE
${_disable_carotene}
${_clang_cl_flags}
)
-29
View File
@@ -1,29 +0,0 @@
--- a/pngpriv.h 2025-04-20 19:36:04.000000000
+++ b/pngpriv.h 2025-04-20 19:35:55.000000000
@@ -511,24 +511,14 @@
* DBL_DIG Maximum number of decimal digits (can be set to any constant)
* DBL_MIN Smallest normalized fp number (can be set to an arbitrary value)
* DBL_MAX Maximum floating point number (can be set to an arbitrary value)
*/
# include <float.h>
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
- * as it seems it doesn't agree with <fp.h>, yet we should really use
- * <fp.h> if possible.
- */
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
-# include <fp.h>
-# endif
-# else
-# include <math.h>
-# endif
+# include <math.h>
+
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881
*/
# include <m68881.h>
# endif
+3 -40
View File
@@ -1,51 +1,14 @@
if (APPLE)
# Only disable NEON extension for Apple ARM builds, leave it enabled for Raspberry PI.
set(_disable_neon_extension "-DPNG_ARM_NEON=off")
elseif ("${DEPS_ARCH}" STREQUAL "arm64" AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
# libpng's CMake ignores PNG_ARM_NEON on Windows ARM64 and skips the NEON
# sources, but pngpriv.h enables NEON anyway.
set(_disable_neon_extension "-DCMAKE_C_FLAGS=/DWIN32 /D_WINDOWS /DPNG_ARM_NEON_OPT=0")
else ()
set(_disable_neon_extension "")
endif ()
if(APPLE AND IS_CROSS_COMPILE)
# TODO: check if it doesn't create problem when compiling from arm to x86_64
orcaslicer_add_cmake_project(PNG
GIT_REPOSITORY https://github.com/glennrp/libpng.git
GIT_TAG v1.6.35
orcaslicer_add_cmake_project(PNG
URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.59.zip
URL_HASH SHA256=6fd97a1e5e2ac55cec0a538a9800a351eb3844086736291844ebd12db72ba433
DEPENDS ${ZLIB_PKG}
PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/macos-arm64.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
CMAKE_ARGS
-DPNG_SHARED=OFF
-DPNG_STATIC=ON
-DPNG_PREFIX=prusaslicer_
-DPNG_TESTS=OFF
-DDISABLE_DEPENDENCY_TRACKING=OFF
${_disable_neon_extension}
)
else ()
set(_patch_step "")
if (APPLE)
set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch)
endif ()
orcaslicer_add_cmake_project(PNG
# GIT_REPOSITORY https://github.com/glennrp/libpng.git
# GIT_TAG v1.6.35
URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip
URL_HASH SHA256=3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f
DEPENDS ${ZLIB_PKG}
"${_patch_step}"
CMAKE_ARGS
-DPNG_SHARED=OFF
-DPNG_STATIC=ON
-DPNG_PREFIX=prusaslicer_
-DPNG_TESTS=OFF
-DDISABLE_DEPENDENCY_TRACKING=OFF
${_disable_neon_extension}
)
endif()
if (MSVC)
add_debug_dep(dep_PNG)
-26
View File
@@ -1,26 +0,0 @@
Common subdirectories: ../libpng-1.6.35-orig/arm and ./arm
Common subdirectories: ../libpng-1.6.35-orig/contrib and ./contrib
Common subdirectories: ../libpng-1.6.35-orig/intel and ./intel
Common subdirectories: ../libpng-1.6.35-orig/mips and ./mips
Only in ./: PNG.patch
diff -u ../libpng-1.6.35-orig/pngrutil.c ./pngrutil.c
--- ../libpng-1.6.35-orig/pngrutil.c 2018-07-15 20:58:00.000000000 +0200
+++ ./pngrutil.c 2021-03-24 15:59:38.687108444 +0100
@@ -422,13 +422,6 @@
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
}
-#if ZLIB_VERNUM >= 0x1290 && \
- defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
- if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
- /* Turn off validation of the ADLER32 checksum in IDAT chunks */
- ret = inflateValidate(&png_ptr->zstream, 0);
-#endif
-
if (ret == Z_OK)
png_ptr->zowner = owner;
Common subdirectories: ../libpng-1.6.35-orig/powerpc and ./powerpc
Common subdirectories: ../libpng-1.6.35-orig/projects and ./projects
Common subdirectories: ../libpng-1.6.35-orig/scripts and ./scripts
Common subdirectories: ../libpng-1.6.35-orig/tests and ./tests
-90
View File
@@ -1,90 +0,0 @@
Based on https://github.com/vespakoen/libpng to work around until
https://github.com/glennrp/libpng/pull/354 is resolved.
also added patch from PS2.4 (PNG.pach) in pngrutil.c
---
CMakeLists.txt | 28 ++++++++++++++++++++--------
pngrutil.c | 7 -------
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4db9bb87d..9099d1edf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,10 +82,22 @@ option(PNG_HARDWARE_OPTIMIZATIONS "Enable Hardware Optimizations" ON)
set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names")
set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
+# CMake currently sets CMAKE_SYSTEM_PROCESSOR to one of x86_64 or arm64 on macOS,
+# based upon the OS architecture, not the target architecture. As such, we need
+# to check CMAKE_OSX_ARCHITECTURES to identify which hardware-specific flags to
+# enable. Note that this will fail if you attempt to build a universal binary in
+# a single cmake invokation.
+if (APPLE AND CMAKE_OSX_ARCHITECTURES)
+ set(TARGET_ARCH ${CMAKE_OSX_ARCHITECTURES})
+else()
+ set(TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
+endif()
+
+
if(PNG_HARDWARE_OPTIMIZATIONS)
# set definitions and sources for arm
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
+if(TARGET_ARCH MATCHES "^arm" OR
+ TARGET_ARCH MATCHES "^aarch64")
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations:
check: (default) use internal checking code;
@@ -114,8 +126,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
endif()
# set definitions and sources for powerpc
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*" )
+if(TARGET_ARCH MATCHES "^powerpc*" OR
+ TARGET_ARCH MATCHES "^ppc64*" )
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
set(PNG_POWERPC_VSX "on" CACHE STRING "Enable POWERPC VSX optimizations:
off: disable the optimizations.")
@@ -138,8 +150,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
endif()
# set definitions and sources for intel
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*" )
+if(TARGET_ARCH MATCHES "^i?86" OR
+ TARGET_ARCH MATCHES "^x86_64*" )
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations:
off: disable the optimizations")
@@ -162,8 +174,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
endif()
# set definitions and sources for MIPS
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*" )
+if(TARGET_ARCH MATCHES "mipsel*" OR
+ TARGET_ARCH MATCHES "mips64el*" )
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
set(PNG_MIPS_MSA "on" CACHE STRING "Enable MIPS_MSA optimizations:
off: disable the optimizations")
diff --git a/pngrutil.c b/pngrutil.c
index 7001f1976..91930f1f2 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -422,13 +422,6 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
}
-#if ZLIB_VERNUM >= 0x1290 && \
- defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
- if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
- /* Turn off validation of the ADLER32 checksum in IDAT chunks */
- ret = inflateValidate(&png_ptr->zstream, 0);
-#endif
-
if (ret == Z_OK)
png_ptr->zowner = owner;
--
2.33.0.windows.1
@@ -1,29 +0,0 @@
diff --git a/src/osx/cocoa/colour.mm b/src/osx/cocoa/colour.mm
index 31515d146f..86b33e94a2 100644
--- a/src/osx/cocoa/colour.mm
+++ b/src/osx/cocoa/colour.mm
@@ -125,3 +125,3 @@
wxOSXEffectiveAppearanceSetter helper;
- if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] )
+ if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpace:[NSColorSpace sRGBColorSpace]] )
return [colRGBA redComponent];
@@ -134,3 +134,3 @@
wxOSXEffectiveAppearanceSetter helper;
- if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] )
+ if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpace:[NSColorSpace sRGBColorSpace]] )
return [colRGBA greenComponent];
@@ -143,3 +143,3 @@
wxOSXEffectiveAppearanceSetter helper;
- if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] )
+ if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpace:[NSColorSpace sRGBColorSpace]] )
return [colRGBA blueComponent];
@@ -152,3 +152,3 @@
wxOSXEffectiveAppearanceSetter helper;
- if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] )
+ if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpace:[NSColorSpace sRGBColorSpace]] )
return [colRGBA alphaComponent];
@@ -160,3 +160,3 @@
{
- return [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] != nil;
+ return [m_nsColour colorUsingColorSpace:[NSColorSpace sRGBColorSpace]] != nil;
}
+2 -12
View File
@@ -29,22 +29,12 @@ else ()
set(_wx_precomp ON)
endif ()
set(_wx_patch_command "")
if (APPLE)
set(_wx_patch_command
${GIT_EXECUTABLE} checkout -f -- src/osx/cocoa/colour.mm
COMMAND ${GIT_EXECUTABLE} apply --verbose
${CMAKE_CURRENT_LIST_DIR}/0001-macos-use-srgb-colour-components.patch
)
endif ()
orcaslicer_add_cmake_project(
wxWidgets
GIT_REPOSITORY "https://github.com/SoftFever/Orca-deps-wxWidgets"
GIT_TAG v3.3.2
GIT_REPOSITORY "https://github.com/OrcaSlicer/Orca-deps-wxWidgets"
GIT_TAG b44c39c100975a0ac0e46f937aa3f3eae5e18631
GIT_SHALLOW ON
GIT_SUBMODULES 3rdparty/catch 3rdparty/pcre 3rdparty/libwebp
PATCH_COMMAND ${_wx_patch_command}
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${JPEG_PKG}
CMAKE_ARGS
-DwxBUILD_PRECOMP=${_wx_precomp}
@@ -78,6 +78,12 @@ public:
std::vector<int> extrude_ids;
int filament_temp_type = -1; // -1 means unset. otherwise should be {0,1,2}
double height{ 0 };
double z_min{ 0 };
double z_max{ 0 };
bool has_z_range{ false };
bool is_bed_exclusion{ false };
std::vector<int> bed_exclusion_extruder_ids;
int bed_exclusion_extruder_id{ -1 };
double print_temp{ 0 };
double bed_temp{ 0 };
double vitrify_temp{ 0 }; // vitrify temperature
@@ -123,6 +123,10 @@ struct NfpPConfig {
std::function<void(const ItemGroup &, NfpPConfig &config)> on_preload;
// Return false when a packed item does not constrain this candidate.
// By default every pair participates in the 2D collision calculation.
std::function<bool(const _Item<RawShape>&, const _Item<RawShape>&)> should_check_collision;
//BBS: sort function for selector
std::function<bool(_Item<RawShape>& i1, _Item<RawShape>& i2)> sortfunc;
//BBS: excluded region for V4 bed
@@ -579,7 +583,14 @@ private:
{
using namespace nfp;
Shapes nfps(items_.size());
std::vector<Item *> collision_items;
collision_items.reserve(items_.size());
for (Item &item : items_) {
if (!config_.should_check_collision || config_.should_check_collision(trsh, item))
collision_items.emplace_back(&item);
}
Shapes nfps(collision_items.size());
// /////////////////////////////////////////////////////////////////////
// TODO: this is a workaround and should be solved in Item with mutexes
@@ -590,21 +601,21 @@ private:
trsh.rightmostTopVertex();
trsh.leftmostBottomVertex();
for(Item& itm : items_) {
itm.transformedShape();
itm.referenceVertex();
itm.rightmostTopVertex();
itm.leftmostBottomVertex();
for (Item *item : collision_items) {
item->transformedShape();
item->referenceVertex();
item->rightmostTopVertex();
item->leftmostBottomVertex();
}
// /////////////////////////////////////////////////////////////////////
__parallel::enumerate(items_.begin(), items_.end(),
[&nfps, &trsh](const Item& sh, size_t n)
__parallel::enumerate(collision_items.begin(), collision_items.end(),
[&nfps, &trsh](Item *const &sh, size_t n)
{
auto& fixedp = sh.transformedShape();
auto& fixedp = sh->transformedShape();
auto& orbp = trsh.transformedShape();
auto subnfp_r = noFitPolygon<NfpLevel::CONVEX_ONLY>(fixedp, orbp);
correctNfpPosition(subnfp_r, sh, trsh);
correctNfpPosition(subnfp_r, *sh, trsh);
nfps[n] = subnfp_r.first;
});
+4 -2
View File
@@ -224,12 +224,14 @@ compare_prerelease (char *x, char *y) {
if (x == NULL && y) return 1;
// Orca: Special handling for 'dev'
// Nightly builds stay on x.y.z-dev after the alpha and beta are tagged, so 'dev'
// ranks above every other prerelease and below the release.
if (strcmp(x, "dev") == 0 && strcmp(y, "dev") == 0)
return 0;
if (strcmp(x, "dev") == 0 && strcmp(y, "dev") != 0)
return -1;
if (strcmp(x, "dev") != 0 && strcmp(y, "dev") == 0)
return 1;
if (strcmp(x, "dev") != 0 && strcmp(y, "dev") == 0)
return -1;
lastx = x;
lasty = y;
+26 -11
View File
@@ -35,9 +35,9 @@ what will be printed, so its markers come from the toolpaths, whose mass depends
and flow as well. There the solid markers are for what is printed up to the top layer the layer
slider shows: for the plate with brim, raft and supports, where the weight rests at that point of
the print; for an object or a body, its own extrusions. Each has a faded twin for the same at the
end of the print, so the slider shows the weight moving toward where it ends, and at the top layer
the two meet. In Prepare the plate has the model alone, as brim, raft and supports exist only once
sliced.
end of the print, so the slider shows the weight moving toward where it ends. At the top layer what
is printed is the finished print, whose markers then show alone and solid. In Prepare the plate has
the model alone, as brim, raft and supports exist only once sliced.
## Prepare: from the meshes
@@ -94,8 +94,8 @@ extrudes it, so a print of several materials weighs each as it is. Flow ratio, l
and purging into infill all count
as printed. Its mass spreads evenly along the segment the bead's center runs, half the layer height
below the nozzle, in the frame of the stored moves: plate offset added, Z offset removed. Such a
segment from `a` to `b` adds `m (a + b) / 2` to the moments and `m (a² + a b + b²) / 3` to the second
moments along each axis, and its box widened by half the bead's height to the bounding box; not by
segment from `a` to `b` adds `m (a + b) / 2` to the moments and `m (2 a aᵀ + a bᵀ + b aᵀ + 2 b bᵀ) / 6`
to the second moments, and its box widened by half the bead's height to the bounding box; not by
half its width, which the processor only estimates, so that a box runs along the walls' center lines. Arcs are already split into segments by the processor. Walls, infill, top and bottom surfaces, ironing
and gap fill make the parts. The brim and the support roles, the raft among them, count only in what
the plate prints. The skirt, the prime tower and custom G-code count nowhere.
@@ -127,6 +127,15 @@ of which is the faded marker's, so the solid marker for any slider position is a
the moves carry, which are also the layers of libvgcode and of the slider; in a print by object they
follow the order of printing, so the solid markers show the objects printed so far as they are.
The belt printers' upright view draws the toolpaths through the affine map that takes the moves back
to the model's frame: `BeltTransformPipeline::build_gcode_back_transform()`, then a translation that
lays them on the model. `GCodeViewer` maps the masses with it as well: their mass and volume stay as
printed, and their moments and second moments follow the map. The map shears, so mapping the corners
of a mass's box would give a box far larger than the moves. On a belt print the processor therefore
keeps a second box for each mass, of the ends of each segment, half the bead's height below and
above, mapped by the linear part of the map, which depends on the config alone; the translation then
moves it into place. The raw view draws the moves as they are, and the masses with them.
## Drawing
`smooth_sphere()` with a resolution divisible by four leaves every triangle within one octant, so it
@@ -145,7 +154,9 @@ The markers are part of the cached scene, so toggling them, or changing a filame
they are shown, marks the scene dirty, and moving the layer slider redraws the scene with the solid
markers where they belong. In Prepare they are hidden while any gizmo other than Move, Rotate, Scale
and Lay on face is open, since the others work on the surface a marker would cover, and a hidden
object has no markers.
object has no markers. The section view (see section-view.md) cuts a marker away whole when its
center lies on the cut side, as it does the toolpaths' option markers, and it cannot be clicked
then.
## Details
@@ -153,19 +164,23 @@ The markers drawn last are kept, and a left click is tested against them before
center and a point a radius to its right are projected to the screen, and the click hits a marker
within that distance. The solid markers are tested before the faded ones and the smaller kinds
before the larger, the order in which they cover each other. A hit opens the details of that marker
and keeps the click from changing the selection; a click anywhere else closes them. The box is an
and keeps the click from changing the selection; a click anywhere else, or Esc, closes them. The box is an
ImGui window beside the marker, redrawn with the overlay from the markers of the last scene, so it
follows a dragged object, and in Preview the layer slider. It closes when its marker is gone, or when
the number of markers of its kind changes, as then it may stand for something else.
the number of markers of its kind changes, as then it may stand for something else. As it moves with
the view, zooming toward the cursor can bring it under the mouse, so the wheel zooms over it rather
than going to ImGui.
Its title says what the marker stands for: the plate, an object, an assembly or a part, the body of
an assembly. The G-code export lists the object instances for the processor, marking assemblies, as
it hands it the locator.
Each marker carries its sums: mass, volume, first moments and the second moments about the origin
along each axis, `Σ m x²`, `Σ m y²` and `Σ m z²`, which add up from parts to objects to plates. The
moment of inertia about the axis through the center parallel to x is then
`m (σy² + σz²)`, with `σ² = Σ m x² / m - c²` along each axis, and likewise for y and z. Masses are
along each axis, `Σ m x²`, `Σ m y²` and `Σ m z²`, and across them, `Σ m x y`, `Σ m x z` and `Σ m y z`,
which add up from parts to objects to plates. Together they make the symmetric `Σ m x xᵀ`, which a
shear such as the belt's maps only whole. The moment of inertia about the axis through the center
parallel to x is then `m (σy² + σz²)`, with `σ² = Σ m x² / m - c²` along each axis, and likewise for
y and z. Masses are
kept in mg, volume times density in g/cm³, and shown in g, volumes in cm³ and moments of inertia in
g·mm². In Preview the box tells the finished print from what is printed up to the layer shown, the
two weighing differently, and both are placed in the bounding box of everything the marker holds
+43 -9
View File
@@ -27,18 +27,34 @@ parent-centering constraint and reapplies its native position after showing,
bypassing wxGTK's requested-position cache. Absolute top-level placement remains
subject to the window manager; Wayland compositors control it. The official filament palette's
existing placement is independent of this custom panel.
A solid selection contains one color; a gradient contains exactly two ordered
endpoints. The bridge represents these as `{"type":"solid|gradient",
A solid selection contains one color; a gradient contains two through
`COLOR_PICKER_MAX_GRADIENT_COLORS` ordered colors (currently seven). The bridge
represents these as `{"type":"solid|gradient",
"colors":["#RRGGBBAA", ...]}`. RGB input is also accepted and becomes opaque.
Native validation rejects malformed hex and incorrect cardinality.
`ColorPickerOptions::max_gradient_colors` lets each caller lower the editing limit;
it defaults to seven and is clamped to two through seven. Native selection validation
and the page use the same effective limit. Shared favorites retain up to seven colors
regardless of the current caller's limit.
The project filament color action and the official filament picker's More Colors
action enable two-endpoint gradients and independent endpoint alpha. The preset
action enable ordered gradients and independent alpha for each color. The preset
combo box reads project colors in their stored vector order locally and applies
changes through `sync_colour_config`,
retaining the existing RGB/RGBA profile/project formats and dirty marking.
Sidebar gradient and segmented multicolor swatches draw colors in the supplied
order without sorting them.
The filament rack, Change Filament menus, object-list icons and selectors, and
feature-filament selectors share the numbered extruder-color icons. Nonopaque
single colors, gradients and multicolor layouts composite over the same checkerboard
as AMS custom colors. Two- and three-color stripes and four-color quadrants retain
their layouts. Icon caches distinguish gradient and segmented modes and include
every RGBA component; label contrast uses the composited color for single colors.
All composited filament preview bitmaps use opaque RGB storage, including single,
gradient, segmented and vertical-ramp swatches. The color's alpha affects its
appearance over the checkerboard; the finished preview carries no alpha channel.
On Windows this also prevents GDI label drawing from leaving alpha bytes that
native menu conversion treats as transparent text.
Opaque colors use `#RRGGBB`; nonopaque colors use `#RRGGBBAA`, including fully
transparent alpha `00`. Initial selections, alpha-only edits and cancellation
retain stored alpha. Ordered
@@ -47,7 +63,7 @@ official swatch retains its existing palette behavior.
The Linux sidebar's Change extruder color menu uses this same custom editor and
the filament swatch anchor, including alpha, ordered gradients and configuration syncing.
Striped colors and gradients with more than two endpoints cannot be represented
Striped colors and gradients exceeding the configured color limit cannot be represented
by this editor. A notice explains that the current selection is retained; the
editor starts from the first color, and unchanged confirmation is a no-op.
Cancellation is also a no-op. If the WebView backend cannot initialize, a local
@@ -62,11 +78,29 @@ changes. Programmatic assignments remain silent, and reading a field never
writes legacy favorites.
AMS material settings retain their fixed/AMS swatches and first-level popup. Only
its custom-color action opens the solid, opaque editor, anchored to that custom
control. The transient popup releases its grab while the modal is open and returns
to the same selection on cancellation. Confirmation uses the existing default-color
and packed RGBA event path. Device permission/status checks remain at the first-level
entry.
its custom-color action opens the editor with alpha enabled, anchored to that custom
control. Firmware advertising manual multi-color support (`fun2[23]`) also enables
ordered gradients with at most four colors, matching the AMS manual-write limit.
AMS and preset swatches exceeding four colors are unavailable for selection;
the editor also filters oversized palette entries and favorites without deleting them.
Other printers only offer single-color swatches and favorites.
The transient popup releases its grab while the modal is open and returns
to the same selection on cancellation. Unchanged confirmation is a no-op. Existing striped
or oversized selections start from their first color with the preservation notice.
Confirmed edits retain the complete ordered RGBA list and color type in the popup;
the existing packed RGBA event carries the representative first color. Device
permission/status checks remain at the first-level entry. Saving uses `RRGGBBAA`
for `tray_color` and, on capable firmware, `cols`, with `ctype=0` for gradients and
`ctype=2` for single colors. The edited tray updates locally while device status
is pending. AMS custom swatches interpolate every gradient stop. Single colors,
gradients and segmented swatches with any nonopaque component composite over a
rounded checkerboard, including the shared AMS preview renderer. The circular
settings and palette previews and the device panel's gradient cards also use this
renderer, including AMS Lite, external spools, remaining-material regions and
four-slot thumbnails. Each keeps its existing shape and material bounds.
Opaque swatches retain their existing background.
Rounded gradient and segmented swatches use the same graphics-context renderer.
Alpha rendering requires a graphics-capable DC, and callers invoke this renderer directly.
Texture import's color-mapping Add Material action opens a solid, opaque editor
anchored to the mapping row. The existing filament limit is checked before opening.
+52
View File
@@ -87,6 +87,58 @@ tasks, such as a tab, a dialog, the Prepare tab's settings page one option group
time, the Prepare page's layout at the size the book gives its pages, or the 3D view's GL
resources.
### Settings option restrictions
Each settings `Tab` owns an `OptionStateRegistry` independent of its page controls.
`toggle_line` records a hidden reason and `toggle_option` records a disabled reason
before looking for controls. Each restriction is stored only while its toggle is false;
setting it true removes that restriction without affecting the other one. Repeated calls
replace the previous reason, including an empty reason from a caller without explanatory
text. Loading a preset clears the previous preset's records.
Keys are the exact strings supplied to the public toggles. The registry does not expand
an option to its row siblings or distinguish indices passed separately from the key.
It records executed public calls, so direct field operations and rules that have not run
are outside its coverage. Keeping it with the Tab lets reasons survive page control
recycling without retaining a Field or window pointer.
The registry formats the current restrictions for both controls and their labels.
Public toggles refresh the active input's tooltip, and each page's `OG_CustomCtrl`
reads its owning Tab's registry when the pointer rests on a row label. The label
remains a hover target when the input is disabled. For rows with multiple options,
identical restriction descriptions appear once, in their first occurrence order.
Markdown tips prepend the same restriction text to their document and refresh
when that text changes, even when
the document identifier stays the same. Callers without a reason receive a generic
current-configuration explanation. Dependency rules supply complete translated
messages describing their prerequisites; compound rules can choose the message for
the failed prerequisite. The same recorded text reaches tooltips and search results.
Filament setting overrides record retraction-length dependency restrictions separately
from override selection. Leaving an override unchecked does not add a restriction reason.
Compatibility condition fields explain that the "All" checkbox must be selected before
editing a condition; both checkbox changes and reloads refresh the restriction.
The object table's settings form owns a separate registry because it builds option
groups outside a Tab. Its dependency callbacks retain their reasons and refresh
both input and native label tooltips. Rebuilding the form or reevaluating dependencies
clears its records, so restrictions follow the current object and effective configuration.
Settings search resolves the same owning Tab as option navigation: a matching model
Tab in object mode, otherwise the global preset Tab. Results show the first line of
the registry description beneath the option name, with the complete description in
the tooltip. Availability text is not part of fuzzy name matching. The Speed Dial
keeps settings with a recorded hidden reason in its catalog and prepends their
restrictions to its detail strip. Settings hidden only by an unrecorded row
restriction retain the Speed Dial's existing filtering.
A page's rules run only while that page is shown, and the registry keys carry no
extruder index, so a listed restriction reflects the configuration and extruder of
the last time its page was shown. Navigation therefore never trusts it: selecting a
setting from search or the Speed Dial opens its page (and extruder), reruns that
page's rules, and only a setting still hidden then displays its explanation instead
of focusing an invisible input.
### The 3D view's GL resources
OpenGL is loaded on the Prepare tab's canvas. When the start page is not Prepare, loading
+2 -2
View File
@@ -44,8 +44,8 @@ Two consequences follow from deriving rather than storing:
## Geometry kernel and dependency surface
The kernel is OCCT, which OrcaSlicer **already** links — `Format/STEP.cpp`, `Format/svg.cpp`
and `Shape/TextShape.cpp` use it upstream. The Design tab adds no third-party dependency; it
The kernel is OCCT, which OrcaSlicer **already** links — `Format/STEP.cpp` and `Format/svg.cpp`
use it upstream. The Design tab adds no third-party dependency; it
widens the existing OCCT build by one module flag in `deps/OCCT/OCCT.cmake`:
```cmake
+69
View File
@@ -0,0 +1,69 @@
# Bed exclusions and toolhead collision volumes
## Purpose and configuration
Bed exclusions have two distinct meanings. A material keep-out prevents model
placement without prohibiting deliberate machine travel, such as entering a
filament cutter. A toolhead collision volume represents an obstacle that travel
and extrusion must avoid. Keeping separate settings preserves existing printer
profiles, project files and command-line usage without enabling new motion
constraints implicitly.
- `bed_exclude_area` remains a points-array polygon and a shared, bed-fixed
material/placement keep-out.
- `bed_exclude_volumes` contains collision-volume polygons, with optional
`ZMIN..ZMAX;` prefixes and `|` separators. A polygon without a Z prefix applies
over the printable height.
- `bed_exclude_volume_mode` selects shared volumes, toolhead-relative volumes
derived from nozzle XY offsets, or individually configured extruder volumes.
- `extruder_bed_exclude_volumes` stores the individual definitions. These are
selected by physical extruder, not simply by filament slot.
Material keep-outs and collision volumes are additive. Nozzle offsets apply only
to collision volumes in toolhead-relative mode. The existing bed area never moves
or disappears when collision volumes are configured.
On belt printers, the region resolver projects material keep-outs onto the
tilted bed surface before placement and tower validation. Collision volumes
remain in model coordinates; the bed-surface projection is not applied to them.
The printer settings expose the bed area as a normal editable field with Orca's
standard reset controls. Collision volumes appear directly below it in Printable
space, as a separate field. A bed-area polygon can be manually copied into this
field to define a full-height collision volume. Pasted volume syntax in the
area field requires confirmation before it is added to the volume settings;
declining or invalid input leaves the stored area intact.
## Geometry and slicing
The region resolver retains the distinction between material keep-outs and
collision volumes, and supplies nozzle-specific regions to placement, arrangement,
generated geometry and motion consumers. An object is checked conservatively
against the collision volumes for every nozzle it uses, over its complete geometry
rather than only a painted portion. Shared support geometry likewise uses a
conservative union of the relevant nozzle and instance exclusions.
Collision-volume footprints are selected by their overlap with the applicable Z
slab. Brim and supported support-generation paths subtract these footprints before
extrusion generation. The travel router attempts to avoid active collision
volumes; the final G-code checker validates emitted motion independently.
The checker cannot infer movements inside opaque firmware macros. Homing leaves
the affected coordinates unknown until explicit coordinates establish them.
Skirts and draft shields are not rebuilt around obstacles, extrusion is not
rerouted, and the circular XY sweep of spiral Z-hop is not available to the travel
router when it plans the primary travel. The final checker can warn about these
violations; that warning is not an automatic repair or a guarantee of safe output.
## Preview
Ground footprints remain visible. Nozzle-specific collision volumes have thin
nozzle-coloured borders; shared volumes and single-nozzle configurations do not
imply ownership by a particular filament. Automatic 3D previews are limited to
nearby object height to avoid obscuring the workspace.
**View → Show all collision volumes** displays each volume over its complete
resolved Z range, including on an empty bed. Its default shortcut is Ctrl+Shift+K
(Command+Shift+K on macOS), configurable through Orca's shortcut settings. The
application remembers this display preference independently of printer presets;
it changes neither collision checking nor slicing results.
+33 -6
View File
@@ -61,19 +61,21 @@ tray's. On a miss it falls back by filament type: a system `Generic <type>` pres
failing that, any compatible system preset, else the slot is skipped — every fallback
selection surfaces a user-visible notice.
Today only the Bambu AMS integration follows this pattern end to end — the device itself
Today the Bambu AMS integration follows this pattern end to end — the device itself
reports the id, `BBLPrinterAgent` translates it out of Bambu's catalog into ours, and the
pipeline does all the matching. The other device integrations still synthesize a preset id
client-side in their agents (by type, brand, or color lookups against the loaded presets)
before the pipeline runs; they are intended to converge on the same pattern, with the
device-reported tray material id flowing through the shared matcher.
pipeline does all the matching. Klipper lanes follow it whenever the host integration supplies
our id (see [Moonraker `lane_data`](#moonraker-lane_data)). The other device integrations, and
Klipper lanes without an id, still synthesize a preset id client-side in their agents (by type,
brand, or color lookups against the loaded presets) before the pipeline runs; they are intended
to converge on the same pattern, with the device-reported tray material id flowing through the
shared matcher.
| Ecosystem | Where the tray id comes from today |
| --- | --- |
| Bambu AMS | the device itself (RFID / user tray setting), in Bambu's own `GF*` catalog; `BBLPrinterAgent` rewrites it into our id before the matcher sees it (see [The Bambu catalog map](#the-bambu-catalog-map)) |
| Qidi box | composed at runtime as `QD_<series>_<vendor>_<typeidx>` — vendor and type indices from the device's per-slot saved variables, the series digit inferred client-side from the printer model/name. No preset carries a `QD_*` value, so the slot currently resolves by filament type; mapping the composed id onto the filament's minted id belongs in the agent |
| Creality CFS | runtime brand/type scoring returns the winning preset's id |
| Klipper (AFC / Happy Hare) | runtime lookup by filament type |
| Klipper (AFC / Happy Hare) | the lane's `filament_id` in Moonraker's `lane_data` namespace, when the host integration writes one of ours (see [Moonraker `lane_data`](#moonraker-lane_data)); otherwise runtime lookup by filament type |
| Snapmaker | runtime color/vendor/type match |
Tray-to-preset matching is printer-scoped, but **several consumers match globally by id alone,
@@ -108,6 +110,31 @@ Two more consumer-side facts worth knowing:
failing one survive, and every vendor bundle whose filaments inherit from the library is
then discarded for want of a base). CI's structure check catches this before it ships.
## Moonraker `lane_data`
Klipper has no tray-id protocol of its own, so `MoonrakerPrinterAgent` reads Moonraker's
`lane_data` database namespace instead: one JSON object per lane, written by whichever MMU host
integration or companion tool manages the printer's lanes (AFC, Happy Hare, spoolman-lane-sync).
The schema is not standardized across the Klipper ecosystem. The agent reads these fields of each
entry and never the entry's own key (`lane1`, `lane2`, ...):
| Field | Type | Required | Used for |
| --- | --- | --- | --- |
| `lane` | string holding a non-negative integer | yes — an entry without one is dropped | the tray's 0-based slot index |
| `material` | string | no | the filament type; an empty one marks the lane as empty |
| `filament_id` | string | no | the tray id handed to the shared matcher |
| `color` | string | no | the tray color |
| `bed_temp`, `nozzle_temp` | integer | no | temperature hints for the tray |
A lane's `filament_id` reaches the shared matcher unchanged, as a Bambu tray's translated id
does, so it resolves only when a compatible root preset carries it. Bambu's own `GF*` codes miss:
only `BBLPrinterAgent` translates them. A lane whose id misses takes the matcher's type fallback
and its notice; a lane without one is matched by `material` in the agent
(`PresetCollection::filament_id_by_type`) before the matcher runs.
Only a JSON string counts as an id. Happy Hare writes Spoolman's numeric filament record id under
`filament_id`, and the agent treats it as absent.
## Do I need a new id? The one-question test
> **Would a user consider this a different spool product than anything already in the tree?**
+68
View File
@@ -0,0 +1,68 @@
# Infill corner smoothing — High Level Design
## Purpose and scope
`sparse_infill_smooth_factor` rounds the corners of the sparse infill paths of
the patterns `is_smoothable_infill_pattern()` lists, so the toolhead does not
slow to near a stop in every corner. `FillCornerSmoothing` does the rounding for
every pattern; the fills only call it on their paths before clipping and before
`multiline_fill()` copies them.
The design is shaped by how firmware plans speed. Klipper, Marlin 2 with
junction deviation and OrcaSlicer's estimator limit the speed at the junction of
two moves by how much the path turns there, and by the length of the moves for
the centripetal part. A curve is printed as straight moves, so its speed depends
on how it is cut into moves as much as on its shape, and the cut decides the size
of the G-code.
## The curve
Each corner is replaced by a curve that runs from `reach` before it along the
incoming leg to `reach` after it along the outgoing one, `reach` being the factor
times half of the shorter leg, so the curves of two corners never overlap.
The curve is a quintic Bézier curve whose first three control points on each leg
are equally spaced, 0.3 of the reach apart, which makes its curvature zero at the
legs: the toolhead eases into the turn. A circular arc takes fewer vertices within
the resolution and prints slower, and a septic curve, whose rate of curvature is
also zero at the legs, prints no faster than the quintic one and takes longer to
slice. Tuning the spacing to the turn angle lowers the peak curvature of sharp
turns but made no measurable difference to print time.
## The vertices
A corner is printed as the polygon of the curve's tangents taken at equal steps
of direction: every vertex turns by the same angle, which spends each vertex
where the planner needs it. Uniform steps of the curve parameter put vertices
where the curve is nearly straight and leave the sharpest turn in the middle.
The number of vertices follows the G-code resolution (`resolution`), as the rest
of the G-code does: it is the fewest that keep the polygon within the resolution
of its curve. The arc of the curve's peak curvature gives the first count, which
the flatter parts of the curve may raise. The count is never so high that a
vertex stands out of the chord of its neighbours by less than the resolution, as
`LayerRegion::simplify_*` simplifies the infill to it afterwards and would drop
that vertex again.
The vertices depend on the geometry and the resolution only, not on the printer.
A finer resolution splits a corner into more and gentler turns, which a planner
takes faster, for a larger G-code file.
A corner of a given turn and vertex count is the same shape at any reach and
resolution, scaled. Each thread builds a shape once at unit reach and all its
`CornerSmoother`s share it, as some fills start a smoother for every path, every
layer starts its own, some patterns (Octagram Spiral) change the reach at every
corner, and searching the tangents of the curve is what slicing spends its time
on.
## Constraints
- At 100% every corner gets the largest curve its legs allow: the factor sets
the shape of the corners, not their speed. A large curve split into few
vertices can print slower than the sharp corner, as every vertex is a slowdown
and the short moves between them leave no room to accelerate.
- With the factor at 0 the paths are unchanged, and the fills keep their order of
operations, so that rounding to the integer grid does not move a point.
- The plane-path fills (Hilbert Curve, Octagram Spiral) produce their path point
by point in units of the line distance, so `CornerSmoother` takes points one
at a time, with the resolution in the same units.
+30 -4
View File
@@ -56,9 +56,34 @@ combo boxes), so it opens the dial from the canvases and the tab strip only.
`MainFrame::handle_global_shortcut` skips a chord that `KeyChord::edits_text()` reports
while a text field has the focus (a wx text entry, spin control, web view or ImGui
InputText), and skips every chord while an ImGui modal is open, as a wx modal dialog
would. `ImGuiWrapper::owns_key()` reads the active InputText and the popup stack
directly, since `WantCaptureKeyboard` lags a frame, and is called only when the focus is on
a visible canvas from `OpenGLManager::create_wxglcanvas()`.
would. `ImGuiWrapper::owns_key()` reads the text input request and the popup stack of the
last drawn frame, since `WantCaptureKeyboard` and `WantTextInput` only catch up when the
next frame starts, and is called only when the focus is on a visible canvas from
`OpenGLManager::create_wxglcanvas()`.
The `Plater`, `Preview` and `Painting` shortcuts act on the 3D view, so they run only while
the 3D view has the keyboard. `GLCanvas3D` feeds every key event to ImGui and asks
`ImGuiWrapper::claim_key_event()` whether to act on it as well. While an ImGui popup (a
dropdown, a menu or a modal) is open or an ImGui InputText is active, ImGui claims every key,
as a focused sidebar text field or an open native dropdown keeps every key from the canvas.
Esc then closes the topmost dropdown or menu, since this ImGui closes popups on Esc only
through keyboard navigation, which is off; a modal handles Esc itself. A second Esc reaches
the canvas once nothing claims it. A slider or button held with the mouse also claims every
key until it is released, since a shortcut that switches the view or closes the tool would
leave the drag behind. One side handles a key from its key-down to its release. Its
repeats, its char event and its release follow the key-down's decision even when a field or
modal opens or closes in between, so a key never both runs a shortcut and types, and a
keyboard move of the selection always sees the release of the key that started it.
Key-ups go to whatever window has the focus, so a shortcut that opens a dialog, such as
Ctrl+P, takes the release of its modifier with it. When the canvas loses the focus it sends
itself a key-up for each Shift, Ctrl or Alt still held, which ends a gizmo's Shift mode and
clears ImGui's own copy of the modifier, and then drops its record of held keys.
`ImGuiWrapper::update_mouse_data()` also takes ImGui's modifiers from each mouse event, which
carries the real state, since a stale Ctrl would turn every slider click into a Ctrl+click
and open the slider's text box. The macOS
Edit menu, whose key equivalents run before the canvas sees the key, follows the same rule
as the canvas.
## Which event a chord matches
@@ -131,7 +156,8 @@ Control on the Global page, and from the `?` key on the page of the view that re
the dialog should list it; the row's section heading is the `section_table` entry
above it, so a new section needs an entry there too. Pick a default that does not
collide inside its contexts; the `[Shortcuts]` tests check every default against the
others.
others. An empty chord `{}` leaves a shortcut unbound until the user picks a key,
as the jump-to-tab shortcuts are.
2. Handle it in the dispatcher of its context: `MainFrame::handle_global_shortcut`,
`GLCanvas3D::handle_shortcut`, `ObjectList::dispatch_shortcut`, or a gizmo's
`on_tool_shortcut`. A gizmo that opens on a key sets `m_shortcut` in its constructor.
+252
View File
@@ -0,0 +1,252 @@
# Preset Plugin API — High Level Design
## Purpose and scope
The preset plugin API lets Python plugins update the presets OrcaSlicer is using,
so users do not have to perform every routine setting change by hand. It covers
process, printer, and filament presets. All three use one staged update lifecycle;
the way a target is selected is specific to the preset type.
The API edits Orca's managed edited preset, not a detached copy or a saved preset
behind the UI's back. It does not save to disk. Saving, discarding, and transferring
unsaved edits remain under Orca's existing preset workflow.
The API does not create or delete presets or provide off-tab editing. For filament,
choosing a different `preset_name` as the update target also selects that preset for
the requested slot, following the normal UI flow. A standalone slot-assignment or
preset-fork operation is outside this API's contract.
## Preset and slot model
Each preset collection maintains a managed edited copy for its selected preset.
Settings tabs apply changes to that copy and own the normal dirty-state, validation,
save/discard/transfer, and downstream refresh behavior. Plugin updates must use the
same path so that the settings tab, dirty indicators, and effective print
configuration observe a consistent state.
Filament selection adds a slot-to-preset mapping. `PresetBundle::filaments` is the
catalog, while `PresetBundle::filament_presets` maps each slot to a preset name.
Several slots may refer to the same preset. A filament update edits that shared
preset, so all slots referring to it are affected. Slot numbers exposed by the API
are 1-based, matching the UI.
## API shape
Each preset API exposes `begin_update()`, which selects and binds one target, and
returns a transaction. The transaction stages setting changes using `set()` and
applies them only on explicit `commit()`.
```python
# Filament is targeted by its 1-based slot. Omitting preset_name keeps the
# preset currently assigned to the slot; providing it selects that preset for
# the slot before staging updates.
tx = orca.host.preset.filament.begin_update(
slot_number=2,
preset_name="Generic PLA"
)
tx.set("filament_flow_ratio", "0.98")
tx.set("filament_retract_length", "0.8")
result = tx.commit()
# Process and printer default to their active presets. A caller can request a
# different preset that is selectable in the corresponding UI dropdown.
tx = orca.host.preset.process.begin_update(
preset_name="0.20mm Standard"
)
tx.set("layer_height", "0.2")
tx.commit()
```
The example is the API contract, and the Python bridge provides it. `begin_update()`
is synchronous: it blocks the background Script worker until the target selection and
any unsaved-edit dialog settle, then returns the bound transaction. Orca's UI thread
stays responsive because the Script capability runs on its own worker. `set()` and
`commit()` run synchronously on that same worker. The Script worker and its optional
coroutine loop are described in
[python-plugin-async-bridge.md](python-plugin-async-bridge.md).
### Target resolution
- **Filament:** `slot_number` identifies the slot. If `preset_name` is omitted,
the transaction targets the preset currently assigned to that slot. If supplied,
it requests that preset for the slot and selects it through the normal UI flow;
the name must be among the presets offered by that slot's dropdown, with one
exception: the preset currently assigned to the slot stays targetable even when the
slot's dropdown hides it (for example an incompatible-but-selected preset). Selecting
a different preset changes the slot-to-preset mapping. In both cases the transaction
edits the shared preset, not an isolated slot override.
- **Process and printer:** omitting `preset_name` targets the currently active
preset. Supplying `preset_name` requests the preset by the name shown in its
dropdown. It must be one of the choices the dropdown currently offers, rather
than merely any preset present in the collection. This is particularly important
for process presets, whose selectable choices can depend on the current context.
- A transaction targets exactly one preset. Multi-preset transactions are not
supported: applying them would require switching among targets while the
application has only one managed edited copy per collection.
Targets are resolved through Orca's normal preset-selection model. The API should
not accept raw preset pointers or filesystem paths as target identities. A missing,
unavailable, or ambiguous target fails explicitly instead of silently selecting a
different preset.
## Selection and user interaction
`begin_update()` resolves its target through shared binding helpers
(`bind_preset_target` for process/printer, `bind_filament_target` for filament) and
performs the selection only when the requested target differs from the active target;
otherwise it returns a transaction without switching. The helpers use Orca's normal
preset selection flow, `Tab::select_preset()`, including updating a filament slot
assignment when requested. If the normal selection flow requires user input, it opens
the relevant existing dialog(s), including unsaved-edit choices such as save, discard,
or transfer. The call remains blocked on the Script worker until those interactions
finish; it returns the bound transaction, or raises on a cancellation, without
applying staged settings. A canceled selection does not change the requested target or
filament slot assignment, but it does not roll back decisions the user already accepted
in an earlier dialog. The helpers then confirm that the requested preset actually
became the edited preset; a successful selection request alone is not sufficient. There
is no separate `switch_preset` plugin API.
If the requested target is already active, `begin_update()` returns without a
selection prompt, apart from the UI-thread dispatch needed to bind the transaction.
If a different preset is requested, Orca selects it through the normal UI flow. For
filament, this also updates the requested slot's assignment when `preset_name`
differs from its current assignment. When the current preset has unsaved changes,
the Script worker stays blocked until the user chooses among Orca's existing options,
such as transfer, discard, or cancel.
The API never suppresses that warning, chooses an option for the user, or switches
away from dirty edits silently. Cancel aborts the operation before any staged target
changes are applied. Process and printer updates follow this rule too when the
plugin requests a different `preset_name`; they normally return immediately when
the active preset is the target.
## Staging and commit semantics
`set(key, value)` stages a serialized config value and does not mutate the preset.
The transaction is the boundary for a related group of changes, avoiding
intermediate partially-updated states. `commit()` runs synchronously on the background
Script worker. At commit, the API validates keys and values against the target preset
type and applies the batch through `Tab::apply_preset_config_values`, the existing tab
and settings-group update path. Existing setting-specific validation, correction, and
callbacks remain authoritative; plugin updates do not create a parallel setter with
different behavior.
A successful commit updates dirty state and downstream configuration/Plater state
once for the batch. The edited preset remains unsaved; persistence continues through
Orca's normal save action. A validation or commit failure restores the edited preset's
config to its pre-batch state and recomputes the state derived from it (compatibility
marks, the preset selector, dependent tabs, the Plater and the printer agent), so no
staged setting is left partially applied. That guarantee is limited to the edited
preset and its config-derived state: an `on_change` callback is a GUI method, not a pure
function of the config, so the transaction does not reverse a preset or slot selection
made while resolving the target, a dialog decision the user already accepted, an undo
snapshot, a dependent preset's rewritten config, or anything already sent to a device.
Exact all-or-nothing across those external effects is not achievable while the
authoritative GUI callbacks run; the boundary is documented on
`Tab::apply_preset_config_values`. A filament slot assignment made as part of target
selection is likewise not a staged setting: after the user accepts the selection flow it
may remain changed even if a later commit fails, and the API does not switch back or
reverse the user's selection or any accepted transfer/discard decision for the previous
preset.
## Outcomes and consistency
The API distinguishes target resolution failures, invalid setting/value, user
cancellation, stale filament-slot mapping, and commit failure. A result identifies
the target preset, whether preset selection changed, and (for filament) whether the
slot assignment changed and which slots share the edited preset. A canceled
selection applies neither the requested slot assignment nor staged target changes;
a failed commit applies none of the staged target settings.
Filament slot assignments can change between `begin_update()` and `commit()`. The API
detects that and rejects a stale operation instead of silently editing the new
slot assignment. It must not hold raw preset pointers across reloads. Conflicting
duplicate writes to one setting in a transaction are rejected rather than resolved
by incidental call order.
The existing one-setting filament call,
`orca.host.preset.filament.update(slot_number, key, value)`, remains available as a
compatibility shorthand. It shares the staged API's target resolution, selection,
validation, and commit path, and it is synchronous like `begin_update()`: both block
the background Script worker while any selection dialog settles.
## Design principles
- **Reduce routine interaction, preserve agency.** Clean switches should be
seamless; unsaved user work must still receive the normal warning and decision.
- **One source of truth.** UI and plugins share the managed edited copy and setting
update path, including validation and callbacks.
- **The UI workflow is authoritative.** The API must enter through the same
selection and setting-change workflows as the UI, not reproduce their logic or
write config values directly. This keeps existing and future side effects active:
`on_change` handling for mutually exclusive, invalid, or out-of-range settings;
compatibility and dependent-preset updates; and printer-agent changes when the
selected printer changes.
- **Explicit target and explicit commit.** Plugins know which preset they edit and
when staged changes become visible.
- **No hidden persistence.** Plugin edits remain unsaved until the user saves them
through Orca.
- **Shared means shared.** Editing a filament preset through one slot affects every
slot assigned to it. Choosing another preset for a slot is explicit in
`preset_name`; slot-specific divergence would require a separate fork operation.
- **Consistent lifecycle, type-specific targeting.** Process, printer, and
filament share transaction and error semantics while respecting their existing
selection models.
## Implementation in the current codebase
The transaction API is implemented. The current plugin surface exposes `begin_update()`,
`PresetTransaction` with `set()`/`commit()`, and the per-setting `update()` compatibility
shorthand. For filament, `update_filament_slot()` resolves the preset already assigned
to a slot, selects it through `Tab::select_preset()`, and applies one setting through
`Tab::apply_preset_config_values()`; it does not change the slot assignment.
`begin_update()` and `update()` are synchronous blocking calls
(`begin_preset_update` / `begin_filament_update`). They marshal the target binding to
the UI thread and block the background Script worker until the selection settles, so
the wait never blocks the UI thread. They are valid only on that worker, never from the
UI thread or a slicing pipeline hook.
`Tab::select_preset()` is the basis for switching to process, printer, or filament
presets and for invoking the normal unsaved-edit flow. The flow is type-specific: a
process selection can trigger compatibility handling for filaments, and a printer
selection can involve technology changes and dependent preset compatibility. It may
therefore show more than one dialog. Cancellation of a later step does not necessarily
undo decisions the user already accepted in an earlier dialog. Target resolution
preserves those side effects and then verifies the resulting edited target.
Filament `preset_name` is an additional integration on top of `Tab::select_preset()`:
selecting a different name for a slot also updates the slot-to-preset mapping and its
dependent UI/configuration state, mirroring the filament branch of the Plater's normal
selection path (`PresetBundle::set_filament_preset()` plus the project/selection refresh,
the dynamic filament list, the conditional support-filament flushing recalc, the slot
combo refresh and its AMS sync badge). A mixed-color virtual slot is not targetable.
Process and printer dropdown choices are constrained by visibility and compatibility,
and compatibility may depend on the active context. Target resolution checks the tab
dropdown's actual items before the selection flow, so a target the user cannot pick
fails without raising that flow's unsaved-edit prompt; a name two entries carry is
rejected as ambiguous. A filament `preset_name` resolves against the requested slot's
own sidebar selector rather than the tab's, so that slot's compatibility filter is the
one that applies. A name the slot's dropdown does not show is rejected unless it names
that slot's current assignment (a hidden or incompatible-but-selected preset), which
stays targetable.
`commit()` applies its batch through `Tab::apply_preset_config_values`, which parses and
validates the whole batch before touching the edited preset and restores the edited
preset and its config-derived state on failure (see "Staging and commit semantics" for
the limit of that rollback). Since `begin_update()` performs target selection before the
caller stages values, invalid staged values can still follow a user-visible selection
prompt; that is a consequence of this API shape and remains explicit in its behavior.
## Integration boundary
The plugin API coordinates target resolution, preset selection, staged values, and
the settings commit path. It does not own or duplicate preset dirty-state logic,
selection prompts, setting validation, or persistence. Target changes flow through
the same UI selection path so dependent behavior—such as selecting the printer
agent—still runs. Setting changes flow through the same UI change path so `on_change`
and related validation/correction behavior still runs. The integration bridges UI
prompts to the Python operation through the blocking `begin_update()` and reuses
the normal Plater slot-selection behavior for explicit filament targets, and commits a
batch without losing existing per-setting behavior.
+8 -2
View File
@@ -100,8 +100,14 @@ the active printer agent because a normal LAN agent represents one physical prin
## Agent registration and selection
`NetworkAgentFactory` maintains the printer-agent registry. Each registry entry contains an agent ID,
a display name, and a factory function. Built-in agents register during application initialization.
Python printer-agent capabilities register dynamically and contribute an agent ID and factory entry.
a display name, a factory function, and whether the native Device and Calibration tabs apply to the
agent's printers. Built-in agents register during application initialization. Python printer-agent
capabilities register dynamically and contribute an agent ID and factory entry.
The tab flag is read from the registry rather than the live agent because the main window lays out its
tabs before the newly selected preset's agent is installed. It defaults to true. An agent that clears
it is one whose printers have their own web interface and nothing the Bambu-shaped Device and
Calibration tabs can show; for those printers the web Device page takes the Device tab's place.
The selected printer preset contains the printer-agent choice. If no explicit choice is stored, the
application preserves the existing default behavior: Bambu presets select the Bambu agent and other
+351
View File
@@ -0,0 +1,351 @@
# Python plugin async bridge — High Level Design
## Purpose and scope
The embedded Python plugin runtime runs most capability calls synchronously: a C++ call site acquires
the GIL and the capability's Python method runs to completion on the calling thread. The staged preset
update (`begin_update()` in [preset-plugin-api.md](preset-plugin-api.md)) is also synchronous, but
its target selection can open unsaved-edit dialogs. It therefore blocks the Script worker, not the UI
thread, and returns only when the selection settles.
This document describes the Script capability's background execution path, including the optional
per-invocation asyncio loop for an `async def execute`, and the blocking UI marshalling that host calls
use from that worker. The bridge is deliberately narrow: only the Script capability gains a
background/async execution path. Every other capability — including the SlicingPipeline hooks — stays
synchronous on its caller's thread.
## Execution baseline
### How a capability call runs
A capability instance is a Python object owned through `Slic3r::PluginInstanceHandle`
(`src/slic3r/plugin/PythonPluginBridge.cpp`) and handed to the rest of the program as a
`std::shared_ptr<Slic3r::PluginCapabilityInterface>`. Its identity (`name()`, `type()`,
`audit_plugin_key()`) is resolved once at materialization and cached in C++
(`PluginCapabilityInterface` in `src/slic3r/plugin/PythonPluginInterface.hpp`).
Every C++→Python call crosses a trampoline method. `PyPluginCommonTrampoline` and
`PyPluginInterfaceTrampoline` (`src/slic3r/plugin/PyPluginTrampoline.hpp`), and the per-type subclass
`PyScriptPluginCapabilityTrampoline`
(`src/slic3r/plugin/pluginTypes/script/ScriptPluginCapabilityTrampoline.hpp`), wrap the call in the
`ORCA_PY_OVERRIDE_AUDITED` macro. For one synchronous call that macro, in order:
1. constructs a `PluginCapabilityInterface::RefCounter`, which `increment()`s the capability's
reference count for the call's duration;
2. constructs a `PythonGILState`, which first acquires a `PythonRuntimeLease` and then
`PyGILState_Ensure()`;
3. opens a `ScopedPluginAuditContext(audit_plugin_key(), name())`;
4. dispatches into Python via `PYBIND11_OVERRIDE`/`PYBIND11_OVERRIDE_PURE`;
and unwinds those guards when the call returns.
`PythonGILState` and `PythonRuntimeLease` live in `src/slic3r/plugin/PythonInterpreter.hpp`. A lease is
a `shared_lock` on `PythonInterpreter::m_runtime_mutex`; `PythonInterpreter::shutdown()` takes the
exclusive side, so a thread that holds a lease can safely touch Python objects, and interpreter
finalization cannot run underneath it. `ScopedPluginAuditContext`
(`src/slic3r/plugin/PluginAuditManager.hpp`) stores the previous thread-local plugin/capability pair
and scoped filesystem roots, sets this call's, and restores them on destruction; the audit hook then
attributes every filesystem/socket/process event to the plugin currently executing on that thread.
### The Script capability
`Slic3r::ScriptPluginCapability` (`src/slic3r/plugin/pluginTypes/script/ScriptPluginCapability.hpp`)
declares one pure virtual method, `ExecutionResult execute()`. The async runtime invokes it through
`invoke_script_execute` (`src/slic3r/plugin/PyPluginTrampoline.hpp`), which replicates the audited
trampoline call (ref counter, audit scope, traceback-preserving rethrow) but returns a
`ScriptExecuteInvocation` instead of forcing a cast:
- a plain `def execute` runs to completion in `invoke_script_execute` and yields
`ScriptExecuteInvocation::result`;
- an `async def execute` (or any override that returns a coroutine, detected with
`inspect.iscoroutine`) yields the coroutine object in `ScriptExecuteInvocation::awaitable` without
running it, so the runtime can drive it.
`ScriptExecuteInvocation` is defined in `PyPluginTrampoline.hpp`; `py_is_coroutine` is the detection
helper.
### UI marshalling
`PluginHostUi::run_on_ui_thread` (`src/slic3r/plugin/host/PluginHostUi.cpp`) forwards to the
file-local `run_on_ui_blocking`:
- if the caller is already on the wx main thread, it runs the callable inline after a
`py::gil_scoped_release`;
- otherwise it sets up a `std::promise`/`std::future`, releases the GIL, posts the callable with
`GUI::wxGetApp().CallAfter`, and blocks on `future.get()`.
That is a blocking handoff: the caller's stack is parked on a thread while the UI thread runs the
callable. It is the correct primitive for the synchronous `update()`/`commit()` path and for
`reload_local_bundle`/`list_bundle_ids`, but it cannot be used by an operation that must suspend.
### Slicing hooks
`Print::set_slicing_pipeline_hook_fn` is installed by `src/slic3r/plugin/PluginHooks.cpp`. The hook
runs on the slicing worker thread and dispatches to `SlicingPipelinePluginCapability::execute(ctx)`
per capability, acquiring a `PythonGILState` per capability. `SlicingPipelineContext`
(`SlicingPipelinePluginCapability.hpp`) holds raw pointers into the live slicing graph
(`ctx.print`, `ctx.object`) that are valid only for the duration of `execute(ctx)`. The UI thread can
be blocked waiting on the slicing worker (`BackgroundSlicingProcess::stop()` parks it), so a
marshalled UI call from a hook can deadlock; `PluginHostSlicing.cpp`, `SlicingPipelinePluginCapability.hpp`
and `PluginHostUi.hpp` all document this.
## Script-only async execution
### Per-invocation worker and loop
`ScriptAsyncRuntime` (declared in `src/slic3r/plugin/PluginManager.hpp`, implemented in
`PluginManager.cpp`) drives every Script invocation off the caller's thread. Its `start()` creates a
`Run` and launches a detached worker thread that runs `Impl::run_invocation`. There is one worker
thread per invocation, so no invocation ever blocks the UI thread and no invocation is queued behind
another plugin's.
`run_invocation` runs detection and execution on the worker:
- it re-checks `cancel_requested` before anything (a cancellation that arrived before the run
started is honored without running the plugin);
- it calls `invoke_script_execute`; a plain `def execute` result is used directly, and an `async def`
coroutine is driven on a loop created for that invocation:
`asyncio.new_event_loop()` → `asyncio.set_event_loop(loop)` → `loop.create_task(coroutine)` →
`loop.run_until_complete(task)` → `loop.close()`, then `asyncio.set_event_loop(None)`.
The loop is per invocation, not global, and no loop outlives its invocation. The loop for the
calling thread is published in the thread-local `tl_script_loop` and exposed through
`ScriptAsyncRuntime::current_loop()` (GIL held). A host call such as `begin_update()` does not suspend
the loop: it blocks the worker thread while the UI settles, then returns a value the coroutine uses
directly.
`PluginManager::launch_script_capability` is the entry point: it resolves the capability, hands it to
`ScriptAsyncRuntime::start`, and sets `ScriptLaunchResult::launched_async`. The completion callback
runs on the GUI thread (or inline when there is no wx app), and `launch_script_capability` records a
run error through `set_plugin_error` before invoking the caller's `ScriptCompletionFn`.
`PluginManager::run_script_capability` is kept as a compatibility wrapper: it waits for the
completion callback, pumping `wxYield()` when it is itself on the GUI thread, and returns the
`ExecutionResult`.
### Capability, runtime, GIL and audit lifetime across a suspension
For the whole invocation — including an `async def` suspended at an `await` — `run_invocation` holds:
- a `PluginCapabilityInterface::RefCounter` per invocation and a `shared_ptr` to the capability in the
`Run`, so the capability and its module stay alive across awaits and unload cannot drop them;
- a `PythonRuntimeLease` (acquired before the GIL). `PythonInterpreter::shutdown()` cannot finalize
the interpreter while any invocation worker holds a lease;
- the GIL, acquired with `pybind11::gil_scoped_acquire` on the worker;
- a `ScopedPluginAuditContext(audit_plugin_key(), name())`, so filesystem/socket/process events
raised by the coroutine are attributed to the plugin.
The capability reference is released inside the GIL scope (`run->capability.reset()`), because
dropping the pybind holder from a non-Python thread would `DECREF` without the GIL. The loop is
closed and `tl_script_loop` cleared before the worker exits.
A consequence of running Script on a non-main thread: the audit permission prompt is fail-closed off
the main thread. `request_permission` in `src/slic3r/plugin/PluginAuditManager.cpp` posts the dialog
with `CallAfter` and denies the current event, persisting the grant when the user accepts, so a
Script sees a denial on the first attempt and can succeed on a later one. This matches the existing
behavior for the plugin-load worker and the slicing worker.
### Blocking UI continuation
`PluginHostUi::run_on_ui_thread` (in `src/slic3r/plugin/host/PluginHostUi.cpp`) is the primitive host
calls use from the Script worker. It forwards to `run_on_ui_blocking`:
- if the caller is already on the wx main thread, it runs the callable inline after a
`py::gil_scoped_release`;
- otherwise it sets up a `std::promise`/`std::future`, releases the GIL, posts the callable with
`GUI::wxGetApp().CallAfter`, and blocks on `future.get()`.
Because the Script capability owns a worker thread, blocking there does not freeze the UI. The same
primitive is used by `begin_update()`, `set()`/`commit()`, `reload_local_bundle()` and
`list_bundle_ids()`.
### Synchronous `begin_update()`
`begin_preset_update` and `begin_filament_update` (`src/slic3r/plugin/host/PluginHostPresets.cpp`) run
on the Script worker with the GIL held and block it:
1. the binding enters through `PluginHostUi::run_on_ui_thread`, which fails with a `RuntimeError`
before posting when there is no wx application;
2. the UI thread runs the target binding with the GIL released — `bind_preset_target` for
process/printer, `bind_filament_target` for filament — including `Tab::select_preset()` and any
unsaved-edit prompt;
3. the worker resumes with the name-based `PresetTransaction`, and nothing is staged until the
caller's later `set()`/`commit()`.
An unavailable target is rejected before selection and changes no preset. A selection the user
declines raises `RuntimeError` and creates no transaction; decisions already accepted in an earlier
dialog are not rolled back. No GUI or preset pointer outlives the call: the transaction holds only
copied category/name/slot values.
`set()` stages a serialized value without mutating the preset, and `commit()` applies the batch
through `Tab::apply_preset_config_values` on the UI thread. Both are synchronous and, per their
bindings, valid only on the background Script worker.
### Cancellation
`ScriptAsyncRuntime::cancel_plugin(plugin_key)` sets `cancel_requested` on every active run for the
plugin and, when a loop is live (`has_loop`), cancels the task with
`loop.call_soon_threadsafe(task.cancel)` while holding the GIL. A synchronous `def execute`
invocation has no loop, so only the flag is set (checked before the run starts).
A task cancellation cannot interrupt a blocking `begin_update()` native call: the worker is inside
that call, so the loop does not run the scheduled `task.cancel()` until the selection settles and the
call returns. The transaction is therefore delivered, and any accepted UI selection stands; the
cancellation is observed at the coroutine's next suspension point. A user-declined selection is an
ordinary `RuntimeError`, not `asyncio.CancelledError`.
A plugin's own `asyncio.CancelledError` is treated as a cancellation only when `cancel_requested` was
set; otherwise it stays a genuine error (see `run_invocation`), so a plugin that cancels its own task
does not masquerade as an unload cancellation.
### Unload and shutdown drain
Unloading or shutting down must guarantee that no plugin Python code runs after its module is
unloaded, and that a blocking UI selection cannot mutate presets after teardown.
- `PluginManager::cancel_and_wait_for_capabilities` calls `on_cancelled()` first (so the plugin can
observe state while the run is intact), then `ScriptAsyncRuntime::cancel_plugin`, then drains.
The drain is **unbounded while a Script invocation worker is outstanding** — its loop-exit
condition is `all_released && !invocation_active`. `has_active_run()` distinguishes a run that was
cancelled before it started from one whose worker is still live, and a worker blocked in
`begin_update()` keeps the run active until its UI callback returns. On the GUI thread the drain
pumps `wxYield()` so a modal selection can settle instead of being starved by the blocking wait.
Only the non-Script path keeps the historical bounded 2-second grace: when no invocation is active,
the drain stops waiting for capability references at the grace deadline and logs any remaining
ones.
- `PluginManager::shutdown` detaches the libslic3r hooks (`plugin_hooks::uninstall`), stops new
loads, waits for in-flight loads, unloads every plugin (draining the async runs above), then calls
`ScriptAsyncRuntime::instance().shutdown()`, which refuses new runs and waits without a deadline
for every invocation worker to finish — nothing is torn down by force. `ScriptAsyncRuntime::reset()`
re-arms the runtime so a later `initialize()` in the same process can start runs again.
Cancellation triggered by unload or shutdown is a separate, expected completion, not a plugin
failure. `run_invocation` marks a run whose `cancel_requested` was set as `completion.cancelled` and
clears any error, whatever the coroutine body did. `launch_script_capability` records a plugin error
only when `!completion.cancelled && !completion.error.empty()`; `run_script_capability` reports an
empty error for a cancelled completion; and the two GUI launchers treat `cancelled` as neither error
nor success (the speed dial stays silent, the Plugins dialog updates no status). A plugin's own
`CancelledError` is not counted as this expected termination unless `cancel_requested` is set, so a
self-cancelled plugin still records its failure.
## Supported and unsupported capabilities
| Capability | Async support | Reason |
| --- | --- | --- |
| Script | `def execute` and `async def execute` both run on the per-invocation worker | The runtime owns the worker and, for a coroutine, a per-invocation loop; nothing about a Script invocation borrows C++ state. |
| SlicingPipeline | Synchronous only | `execute(ctx)` borrows `Print`/`PrintObject` for the callback's duration, and the UI thread can be blocked on the slicing worker. `PluginHooks.cpp` rejects an async override: `cap->execute()` casts its Python result to `ExecutionResult`, and a coroutine object cannot be cast, so it surfaces as a `SlicingError` rather than being scheduled. |
| PrinterConnection, Pages, Analysis, Importer, Exporter, Visualization, ResourceTexture | Unchanged | Not part of this bridge; they keep their existing synchronous contract. |
## Deadlock constraints
- **Never block the UI thread on plugin work.** Every Script launch path goes through
`launch_script_capability`; the speed-dial `ActionRegistry` action and the Plugins dialog launcher
return immediately and report the outcome later (see Examples).
- **Never call `orca.host.ui.*` from a slicing hook.** The slicing worker runs while the UI thread
can be parked on it.
- **Marshal host UI work from the Script worker only.** `PluginHostUi::run_on_ui_thread` blocks the
calling worker while the UI thread runs the callback; calling it from the UI thread itself would
deadlock the marshalling path.
- **No pointer crosses a call boundary.** `begin_update()` returns copied category/name/slot values;
the `SlicingPipelineContext` graph is valid only within one synchronous `execute(ctx)`.
## File and symbol map
Script execution runtime:
- `src/slic3r/plugin/PluginManager.hpp` / `.cpp` — `ScriptAsyncRuntime` (`instance`, `start`,
`cancel_plugin`, `has_active_run`, `shutdown`, `reset`, `current_loop`), `ScriptCompletion`,
`ScriptCompletionFn`, `ScriptLaunchResult`, `launch_script_capability`, `run_script_capability`.
- `src/slic3r/plugin/PyPluginTrampoline.hpp` — `invoke_script_execute`, `ScriptExecuteInvocation`,
`py_is_coroutine`.
- `src/slic3r/plugin/pluginTypes/script/ScriptPluginCapability.hpp` / `ScriptPluginCapabilityTrampoline.hpp`
— `ScriptPluginCapability::execute`, `PyScriptPluginCapabilityTrampoline`.
Lifetime and GIL primitives:
- `src/slic3r/plugin/PythonInterpreter.hpp` — `PythonInterpreter`, `PythonRuntimeLease`,
`PythonGILState`.
- `src/slic3r/plugin/PythonPluginInterface.hpp` — `PluginCapabilityInterface`, `RefCounter`,
`increment`/`decrement`/`ref_count`.
- `src/slic3r/plugin/PluginAuditManager.hpp` / `.cpp` — `ScopedPluginAuditContext`,
`request_filesystem_read_permissions`, `request_permission` (fail-closed off the main thread).
UI marshalling:
- `src/slic3r/plugin/host/PluginHostUi.hpp` / `.cpp` — `PluginHostUi::run_on_ui_thread`, the
file-local `run_on_ui_blocking`, and `close_windows_for_plugin`.
- `GUI::wxGetApp().CallAfter` — the post-to-UI-thread primitive.
Preset targets:
- `src/slic3r/plugin/host/PluginHostPresets.cpp` — `PresetEditor`, `PresetTransaction`,
`bind_preset_target`, `bind_filament_target`, `begin_preset_update`, `begin_filament_update`,
`SelectionCancelled`, `resolve_combo_preset`/`resolve_preset_in_combo`.
- `src/slic3r/GUI/Tab.hpp` / `.cpp` — `Tab::select_preset`, `Tab::apply_preset_config_values`,
`Tab::commit_preset_config_value`.
Launch paths:
- `src/slic3r/GUI/ActionRegistry.cpp` — `PluginScriptAction::run`, `notify_script_outcome`.
- `src/slic3r/GUI/PluginsDialog.cpp` — `PluginsDialog::run_script_plugin_capability`.
Slicing (synchronous only):
- `src/slic3r/plugin/PluginHooks.cpp` — `install_slicing_pipeline_hook`.
- `src/slic3r/plugin/pluginTypes/slicingPipeline/SlicingPipelinePluginCapability.hpp` —
`SlicingPipelineContext`, `execute`.
Unload/shutdown:
- `src/slic3r/plugin/PluginManager.cpp` — `unload_plugin`, `unload_all_plugins`,
`cancel_and_wait_for_capabilities`, `shutdown`.
## Examples
An `async def execute` that updates a preset. `execute` runs on the background Script worker with its
own asyncio loop; `begin_update()` blocks that worker until any selection / unsaved-edit dialog is
answered, without blocking the UI thread; `set()`/`commit()` then run synchronously on the same
worker. This is the shape used by `sandboxes/orca_preset_transaction_demo.py`:
```python
import asyncio
import orca
class AutoTune(orca.script.ScriptPluginCapabilityBase):
def get_name(self):
return "Auto tune"
async def execute(self):
# begin_update() blocks this worker until the user answers any
# selection / unsaved-edit dialog. The UI thread stays responsive.
tx = orca.host.preset.process.begin_update(preset_name="0.20mm Standard")
tx.set("layer_height", "0.2")
tx.commit()
return orca.ExecutionResult.success("process preset updated")
```
The window-driven demo shows the same pattern where the plugin's own UI must hand work to the worker:
`on_message` fires on the UI thread and only enqueues onto the worker loop with
`loop.call_soon_threadsafe`; `execute` consumes that queue and calls `begin_update()` per command.
Sequence for one `begin_update(...)`:
```text
Script worker (owned, per invocation) UI thread
loop.run_until_complete(task)
begin_update() ───────────────────────► CallAfter(run_on_ui_blocking)
(blocked; not suspended) bind_*_target →
Tab::select_preset() … dialog
settles
promise set; worker resumes with PresetTransaction
set(); commit() (UI thread for the batch)
coroutine resumes at its next await
execute() returns ExecutionResult
```
A plain `def execute` needs no loop and runs to completion on the same worker; both kinds are
launched with `launch_script_capability`, so the caller (UI thread) never blocks. A launch failure is
reported inline; a started run reports its outcome through the completion callback — the speed dial
shows "started" and pushes a completion notification, and the Plugins dialog updates its status when
`finish` runs.
+280
View File
@@ -0,0 +1,280 @@
# Seam alignment on the loop — High Level Design
## Purpose and scope
SeamPlacer selects candidates, connects neighboring layers into strings, fits each string and
places the resulting seam on its own contour. Painted ranges are reconstructed separately for
green enforcers and red blockers. These stages do not alter candidate ranking.
String construction and fitting apply to Aligned, Aligned Back and Back (`spRear`).
Nearest and Random bypass this stage, but share the paint reconstruction rules.
## Concepts
- **Candidate (C).** The seam candidate chosen for a perimeter in a string. Candidates are the
polygon vertices plus points inserted near paint (see Painted ranges), so the chosen candidate
can move in discrete steps from layer to layer.
- **Fitted point (F).** The value of the string's fitted curve at the layer height. It need not
lie on the loop: where the loop size changes quickly between layers, as near the bottom of a
sphere, it lies up to a few millimeters off it.
- **Measured angle.** `local_ccw_angle` of a candidate. It is measured at polygon vertices on arms
at least one nozzle diameter long; inserted points have angle 0.
- **Blend.** `target = t·C + (1 − t)·F`. The angle weight `t = min(1, (|angle C| / 55°)^3)` pulls
the seam onto sharp corners; at 55° and above the seam is the candidate itself.
- **Enforced run.** The maximal sequence of consecutive Enforced candidates of the perimeter that
contains C, or the whole loop when every candidate is Enforced. With exact painted ranges it
follows its geometric bounds and surface proximity; otherwise it approximates the painted area with the candidate spacing.
## Painted ranges
The paint is a set of small triangles on the model surface. Its **contour** is the set of their
edges that belong to one painted triangle only, taken from the painted triangles with their T-joints
split (`get_facets_strict`), so that edges inside the painted area pair up. Each contour edge keeps
the direction from it into the paint. The contour is built once per object and stored in an AABB
tree.
Green and red paint use separate instances of the same contour and interval reconstruction.
An interval bounds paint membership but does not establish it: every classified candidate must
also lie within one line width of a triangle of the corresponding paint. A contour can leave the
painted surface between projected endpoints, especially at concavities and nearby surface folds.
The same proximity check used by the fallback prevents such a detour from acquiring synthetic
paint; exact interval bounds still exclude the fringe beyond the projected ends.
Red ranges classify candidates as Blocked, including the boundary itself (1 µm membership
tolerance), overriding green paint at an overlap. Inserted samples include both red ends, a
range midpoint, a gap midpoint and permitted guard samples up to 2 µm outside the red ends.
The guard distance is reduced to one quarter of a shorter gap; gaps at or below the membership
tolerance can remain closed. Candidate marks closer than 1 µm merge.
These adjacent permitted samples limit fitted and optimized movement to the geometric red
edge, with the small outward guard, rather than to a distant original gray vertex. Red ranges add
no penalty and do not change candidate ranking. Precise Seam modifiers apply after paint
classification and take priority over it.
Random placement samples an outgoing edge of its selected candidate. On loops with exact
green ranges, an Enforced candidate followed by a non-Enforced candidate contributes no outgoing
edge length: the endpoint belongs to the paint, but the following segment leaves the permitted run.
This also respects weak modifiers that retype part of a painted run as Blocked or Neutral.
On loops with exact red ranges, a permitted candidate followed by a Blocked candidate contributes no outgoing
edge length, so Random cannot sample toward the closed red boundary. A zero-length selected
edge keeps the candidate position.
The cumulative-length selection stops at the last viable edge and clamps its
remaining distance to that edge, preventing float rounding from overrunning the
candidate list or the permitted segment.
Exact green and red ends bound the seam center position without expanding the painted range
along the contour by the line width. A seam can therefore reach a red edge with no line-width
clearance. Paint can be extended to request a larger clearance; the boundary does not
guarantee that the finite-width extrusion or a seam blemish stays entirely outside red paint.
If boundary crossings cannot be paired, the corresponding color falls back to the line-width
proximity classification, including its possible fringe beyond the paint edge. The fallback is
independent for each color and loop. For red this includes paint not crossing the layer,
ambiguous contours and a completely red surface without boundary crossings. In the all-blocked case
best-effort placement still produces a seam; red paint does not suppress extrusion.
An exact red reconstruction does not suppress proximity-based green oversampling when green
boundaries remain uncertain.
On a layer, the contour edges crossing the slicing plane give the exact ends of the painted band.
Each crossing within the line width of the loop is moved to its closest loop point; the direction
into the paint, against the loop direction there, tells whether paint lies ahead or behind. At a
vertex the loop direction is the mean of the two edges, skipping edges shorter than 1 µm such as
the repeated closing point and the shared ends of extrusion paths, so the result does not depend on
where the loop starts. Along the loop, ends where paint begins and ends must alternate; each
pair bounds a **painted range**. Such a loop has **exact ends**:
- a vertex is Enforced if it lies in a range (within 1 µm);
- points are inserted at the range ends, at the range middle and every 0.2 mm from the range begin,
and one in the middle of each gap between ranges, so that ranges with no vertex between them stay
separate patches;
- the central candidate of the longest patch is the middle of its range, unless the patch has a
sharp corner, which keeps priority.
Before generating candidates, a fully painted closed surface is treated like an unpainted surface:
it imposes no choice of seam position. A loop on a partly painted object can also be normalized when
there are no exact range ends, no active Precise Seam modifier, no non-green facet bounding box in
the loop's XY box expanded by line width and its Z slab of the same reach, and every entire loop edge
is proven within paint reach. Neutral and blocked facets both prevent this local proof. Segment
coverage uses the triangle inequality at its midpoint and at most eight bisections; failure retains
the ordinary conservative paint treatment. This is a sufficient test, not a claim to recognize every
fully covered contour near unrelated surfaces.
A normalized loop keeps the original candidates, without paint oversampling, Enforced status,
central enforcer, extra fitting or positional weights, painted-corner blending or paint fixation. Sharp-angle and Precise Seam rules remain authoritative. Whole-surface painting and no
painting therefore feed identical candidates into alignment.
Otherwise, which includes paint not crossing the layer (a dot between layers, the top and bottom of
a band), ends that do not alternate and a contour running along the
loop, a point is Enforced if paint lies within the line width of it, and edges near paint get points
every 0.2 mm from their start vertex. Such a run reaches past the paint by up to the line width,
depending on the vertices, and its central candidate is the middle one by count; on a smooth band
both shift the seam off the middle of the paint.
## Seam strings
A string starts at a seam and is extended upward layer by layer while the next layer has a seam
within reach. After the upward search ends, the downward search begins at the layer immediately
below the start. This keeps a matching neighboring seam in the same aligned string.
## Geometric contour continuation
Seam strings resolve the next layer's boundary before comparing seam preferences.
Each perimeter retains whether it bounds material or a hole, its layer-local index,
and immutable candidate geometry. Occupancy does not participate in correspondence: the radius search skips occupied
members of the permitted set without expanding it to unrelated walls.
Each layer builds an AABB tree of contour bounds once. Nearby-contour queries,
fast bounds matching, material containment and boundary proximity use this index
before applying their exact predicates. Query results are sorted by the
original contour index, preserving deterministic tie-breaking. Index construction
checks cancellation between layers. The index avoids scanning unrelated contours
for each seed; overlapping global bounds can still require many exact checks.
Only closed extrusion loops provide a reliable boundary role. Open paths and
collection fallbacks retain unknown geometry rather than deriving a physical role
from an artificial closing edge. An unknown source, or an unknown path whose
bounding box intersects the local query box in either layer, leaves the radius
search unrestricted. This conservative box test also covers the material probes;
it may disable the filter even when the path's segments are farther away.
Reverse confirmation applies only to candidates that pass the applicable distance
and normal checks, plus material checks on the local path outside the noise band.
Unknown geometry encountered around such a candidate's foot during reverse confirmation
also leaves the entire radius search unrestricted, rather than discarding only
that candidate. A reliable reverse rejection still excludes the candidate.
Unknown paths outside these query boxes do not disable reliable correspondence.
Bounding-box extents within one nozzle diameter plus a quarter-diameter reserve
identify a potential fast match of the same boundary type. Acceptance also requires
a closest segment within one eighth of the source line width, consistent air-facing
normals, no competing near-coincident local boundary, and a reverse set containing
the source. Thus the inexpensive path certifies only a near-coincident wall, rather
than treating global bounds and the full search radius as sufficient evidence.
The fallback uses the caller's KD search radius, normally four seed-line widths,
for nearby boundaries of either type. With unchanged boundary type it finds the
nearest segment whose air-facing normal is compatible with the source, so the
opposite side of a thin contour cannot hide its facing side. Across a type change
the closest patch itself must agree; choosing another side can confuse translated annuli.
An open exterior wall can become a hole when a slit closes; boundary type alone
cannot reject that physical continuation. It checks air-facing
normals within 60 degrees and samples the connector between closest boundary points.
Away from boundary noise, the connector must lie in material of exactly one adjacent
layer, representing a swept wall rather than a crossing through shared material or
air. Three samples are a bounded heuristic, not a topological proof.
Each local candidate must map back to a set containing the source boundary. A candidate
is discarded only if another has both a distance advantage of at least a quarter of
the source line width and a normal-angle advantage of at least five degrees. Equal or
conflicting criteria retain multiple candidates; seam preferences choose within
this set. Air-facing normals and material checks distinguish wall sides without imposing
an invariant exterior/hole label across topology changes. They are geometric gates,
not numerical preference weights.
If no geometric candidate survives, the radius search is left unrestricted. Continuation
then follows seam preferences alone and can switch walls where geometry cannot resolve
the case. A nonempty geometric set is never
expanded because its contours are occupied or fail later seam preference checks.
Correspondence queries are cached per source vertex, direction and search radius
for alternative string starts. Geometry construction and the seed loop check
cancellation to keep large multi-island objects interruptible. Correspondence does not alter candidate
preference weights or their tolerance.
## Final position
For each member of a string:
1. **Sharp candidate** (`t = 1`): the seam is C. This is the cheapest check and comes first.
2. **Painted corner pull** (Enforced C only): `t = max(t, 0.4·k)` with the corner influence
`k ∈ [0, 1]` below. Retaining the pull near measured corners protects corners; fading it on
smooth contours reduces transmission of discrete candidate steps into the seam. If C's own angle
reaches `A1`, `k = 1` without a search.
3. **Place on the loop.** The target is mapped onto the loop, within the allowed arc around C.
### Corner influence
`k` is the largest contribution `a_j · w_j` among candidates `j` of the same perimeter within `R1`
of C along the loop, `d_j` being the distance along the loop:
- `a_j` rises smoothly from 0 at a measured angle of `A0` to 1 at `A1`, so weak bends count partly
and smooth contours not at all;
- `w_j` is 1 up to `R0` and falls smoothly to 0 at `R1`, so a corner entering or leaving the
neighborhood does not switch `t` abruptly.
`R0` is the larger of the perimeter's line width and the largest configured nozzle diameter: the
measured angle of a vertex reflects geometry within at least one nozzle diameter, so a candidate
inserted next to a corner usually still sees that corner. Within `R0` of a corner of at least
`A1`, `t` and the target are the same as with a fixed minimum of 0.4.
### Placing the target on the loop
The target is generally off the loop. Its closest loop point is a polygon vertex over a whole range
of target positions, so it snaps to vertices and steps between layers when the vertices differ from
layer to layer.
Instead the loop gets a continuous normal field. Each vertex has the normalized sum of the normals
of its two edges, taken to the nearest points at a different position, so that duplicated points
(shared ends of extrusion paths, a repeated closing point) get one normal. Along an edge the normal
blends linearly between its vertex normals. A **solution** is a loop point whose normal line passes
through the target; on each edge this is a quadratic equation in the edge parameter.
The seam is the solution closest to the target over the whole loop. If it lies outside the allowed
arc, the seam is the end of that arc closer to the solution, so a solution leaving the arc stays at
the end it leaves through. Without any solution, which takes a degenerate loop, the seam is C.
The search walks outward from C on both sides, the shorter walked side first. An edge farther from
the target than the best solution so far is skipped without solving.
Properties:
- On a regular polygon every normal line passes through the center. For a target other than the
center, the closest solution is the nearer of the two intersections of the loop with the line
through the center and the target, wherever the vertices are; the seam equals it when it lies
inside the allowed arc. With an even number of vertices the two intersections are symmetric about
the center, so the nearer one is on the ray from the center through the target.
- When the closest solution is unique and lies inside the allowed arc, the result depends on the
target and that arc only, not on which candidate inside the arc was chosen. A candidate step
therefore does not pass into the seam directly. At an exact distance tie, the first solution found
from C is kept.
- A selected solution varies continuously while its root branch remains nondegenerate, and so does
the seam when the solution leaves or enters the allowed arc. The seam may jump when the closest
solution changes (two solutions equally close, or the closest one disappearing together with
another where the target crosses the curve of centers of the normal field), or when a solution
outside the arc becomes equally close to both arc ends. Changes of the candidate types between
layers change the allowed arc.
### Allowed arc
- For an Enforced C on a loop with exact ends: the Enforced run itself, which ends at the paint.
- For another Enforced C: the Enforced run, extended past each open end by the oversampling distance
(0.2 mm) but never into a Blocked candidate. The run ends sit on candidates and move in sampling
steps between layers, and Rear tends to choose the candidate right at an end; without the
extension a target just past an end would copy those steps into the seam.
- For another C: the part of the loop between the Blocked candidates around it.
- For a Blocked C, or a loop with no limiting candidate: the whole loop.
## Numerical constants
| Constant | Value | Meaning |
| --- | --- | --- |
| Blend minimum near corners | 0.4 | Pull toward C on a painted corner |
| `A0`, `A1` | 15°, 30° | Measured angle where corner contribution starts and becomes full |
| `R0` | max(line width, largest nozzle diameter); 0.5 mm if both are zero | Full corner protection along the loop |
| `R1` | 2·`R0` | Corner influence ends |
| Run extension | 0.2 mm (`enforcer_oversampling_distance`); 0 with exact ends | How far the seam may go past an end of the Enforced run |
| Painted range tolerance | 1 µm (`enforced_end_tolerance`) | Loop positions this close are one point |
| Range end reach | line width | How far from the loop a contour crossing may lie |
| Coverage proof depth | 8 bisections per edge | Finite conservative proof for complete paint on a partly painted object |
| Solver threshold | 1e-12 | Absolute threshold on the equation coefficients that tells degenerate equations apart; not a distance tolerance |
## Constraints
Strong Precise Seam coordinates remain immutable. Angles of at least 55 degrees retain the
selected candidate. Ambiguous paint boundaries use the proximity fallback; an entirely
blocked perimeter still needs a printed seam. Mesh topology and candidate sampling can change
which first-approximation string is selected. Painting a verified complete perimeter introduces
no artificial center preference.
## Implementation and verification
`SeamPlacer.cpp` implements paint reconstruction, candidate selection, string traversal, fitting
and contour placement. `test_seam_placer.cpp` covers geometry, paint, string traversal and strong
Precise Seam invariants. `tests/libslic3r/test_seam_contour.cpp` independently checks
geometric correspondence, ambiguity and search-radius behavior.
+6 -1
View File
@@ -56,7 +56,10 @@ closes the open gizmo, so neither tab ever shows a stale cut.
- **Cut faces.** Clipping only discards fragments, which would leave the cut volumes hollow.
`_render_section_view_caps()` draws their cut faces with one `MeshClipper` per model part the
plane passes through. A clipper recomputes its face only when the plane or the volume moves.
Modifiers, the wipe tower and SLA auxiliaries get no face.
Each face is drawn unlit in its part's render colour, so it follows the part's selection and
disabled states. The lit faces of a part show between about a third of that colour and most of
it, so the cut face is darkened below that range, or lifted above it on a dark part, to read as
the inside. Modifiers, the wipe tower and SLA auxiliaries get no face.
- **Toolpaths.** libvgcode takes the plane through `Viewer::set_clipping_plane()`. It draws each
extrusion as only the faces of a diamond-section prism that turn towards the camera, so
discarding the fragments on the clipped side would leave open shells. Instead, the segment
@@ -71,6 +74,8 @@ closes the open gizmo, so neither tab ever shows a stale cut.
Preview shells are drawn by another shader and are not clipped.
- **Picking.** `get_raycaster_clipping_plane()` returns the same plane, so hover, selection and
the perspective pan anchor ignore what the user cannot see.
- **Center of mass markers.** Drawn without the depth test, they would show through the cut, so
each is cut away whole by its centre, as the option markers are.
## Gizmos
+159
View File
@@ -0,0 +1,159 @@
# Translucent filaments
## Purpose
A filament color can carry an opacity (`#RRGGBBAA`, see [color-picker.md](color-picker.md)). Prepare
draws the parts of such a filament see-through, and Preview their toolpaths, so the inside of a
translucent part and whatever lies behind it show through. Both tabs aim at the same look: the
opacity of the plastic the view ray crosses, matte without realistic view and glossy with it.
## Where the opacity applies
- Only the views that color toolpaths by filament: Filament, Summary and Tool. The other views
color by feature or by a value, and stay opaque.
- Only extrusions. Travels, wipes and option markers stay opaque, and so do the layers that hold a
pause or a custom G-code, which these views draw grey.
- A filament keeps its color down to 10% opacity, the floor `adjust_color_for_rendering()` gives it in
Prepare too, so that a fully clear filament is still drawn. A near-black filament is lifted to a grey
that rises with its transparency: a dark translucent surface shows nothing through itself, so without
the lift its layers blend into one flat black.
- The "Translucent filaments" preference (`preview_translucent_filaments`, on by default) turns all
of it off: every filament is then drawn opaque, the legend swatches included. It applies to the
loaded preview at once, through `Viewer::set_translucent_filaments()`.
- The legend swatches carry the same opacity, drawn over the white and grey checkerboard of the
sidebar's clear filament swatch so that they read on the dark legend.
- The opacity is that of 0.4 mm of the filament. Each translucent segment raises it to the length
of the view ray through the centre of its diamond section, `1 - (1 - a)^(path / 0.4)`, so thin
layers stacked under the camera add up as one thick layer would, and a wall seen side on keeps
about the filament's opacity whatever the layer height.
## Data
`libvgcode::convert_filament_colors()` decodes the filament color strings into a
`libvgcode::PaletteWithAlpha`. libvgcode keeps one RGBA8 color per vertex, in a `GL_RGBA8` texture
buffer, or in RGBA8 2D textures on OpenGL ES. The color depends on the view type, while the alpha
comes from the filament alone. The viewer also notes whether any vertex is translucent.
## Rendering
A segment takes the alpha of its first vertex. While any vertex is translucent,
`update_enabled_entities()` sorts the enabled segments by opacity, the opaque ones first, keeping
the print order within each group; on OpenGL ES, each texture of the list is sorted on its own.
Each pass draws its own group, from an offset into the list. Without a translucent vertex, the list
is not sorted and the second pass is skipped, so the first draws exactly what it drew before.
1. The opaque segments, with depth writes.
2. The option markers.
3. The translucent segments, in premultiplied color blended with `GL_ONE, GL_ONE_MINUS_SRC_ALPHA`,
depth tested but without depth writes. Opaque toolpaths and objects hide the translucent ones
behind them, and a translucent segment hides nothing. Drawing the markers first keeps those
inside a translucent part behind its surface, instead of on top of it.
`Viewer::render()` draws the first two; `Viewer::render_translucent()` draws the third, which
`GLCanvas3D::_render_gcode_translucent()` calls after the SSAO pass. Drawn that late, the pass turns the
depth test on itself, as the passes before it may leave it off. The occlusion that pass reads
from depth would otherwise shade a translucent surface as the surface behind it, as it would the
centre of mass marker. FXAA still comes after. The sequential view markers and the IDEX/IQEX
toolhead boxes, which `GCodeViewer::render_scene()` draws after the toolpaths, are translucent but
write depth, so while there are translucent toolpaths they wait for them, in
`GCodeViewer::render_translucent_toolpaths()`. Drawn before, they would hide the translucent toolpaths
behind them, and the print would show a hole around the tool position.
A translucent segment takes its diffuse light in its own color, scaled by its opacity. In
realistic view, whatever its other options, with its "Glossy toolpaths" setting on, every segment,
opaque or translucent, takes instead of the tinted highlight of the default shading an untinted one
computed per fragment, not scaled by the opacity, so that the filaments look alike and a clear one
keeps its gloss instead of fading into the background. `GLCanvas3D::_render_gcode()` switches it
with `Viewer::set_gloss()`. Without realistic view, or with the setting off, a translucent filament
is matte and an opaque one keeps the default shading. The
highlight takes the normal of the rounded extrusion a segment stands for, an ellipse of its height
and width around its centre line, rather than that of its facets: it then runs smoothly across a
joint, where the facets of two segments would catch it apart, and it fades out towards the tip of a
path end, whose normal runs along the extrusion. There
is no Fresnel term: an extrusion seen end-on would turn into a bright opaque stripe.
Each segment reaches half a line width past its ends, to fill the outside of a turn or round off a
path end, so two segments of a path overlap at their joint. Depth hides that between opaque ones,
but blending would draw the joint twice, and the highlight of realistic view shows the caps sticking
out of an opaque one. A translucent segment, and a glossy one, is therefore cut in the fragment
shader at the bisector plane of each joint of its path, keeping 0.02 mm past it: the
faces each segment turns to the camera do not quite meet without their caps. A vertex where two
segments of a path meet carries 0.5 on top of its layer in the w of its position, which the shaders
otherwise read as an int. That includes the joints across the vertex repeated in place that starts
a new path wherever the flow, acceleration or jerk changes (`starts_path()` in
`LibVGCodeWrapper.cpp`), which real G-code has at most of its joints: the shader then takes the
neighbour one vertex further, and the caps the angle of the joint, which the vertex data leaves at 0
there.
The translucent segments are not sorted by depth. The opaque pass draws the last printed segments
first when looking down, to cut overdraw. The direct translucent pass, which only some cases fall
back to (see below), draws them the other way round, so the farthest layers blend first.
## Order independent blending
Blended in print order, the order shows even with a single translucent color, since its surfaces are
shaded apart. A layer's infill, printed after its walls, blends over the walls in front of it: seen
from the side, the dark bridge under a deck draws a sawtooth over the hull's outer wall, as if a piece
of it were missing. So on desktop OpenGL the translucent segments blend order independently, in
`ViewerImpl::render_translucent_segments()`. The nearest
translucent surface of each pixel is drawn over a weighted blended order independent transparency
(McGuire and Bavoil, 2013) of the others. The mean alone would not do: the walls of a painted object
lie a fraction of a millimetre apart, so its depth weights barely differ, and the more opaque and more
numerous surfaces of one filament would hide the other filament's outer wall in front of them.
1. The depth of the scene drawn so far is copied into a texture. The fragment shader discards a
translucent fragment behind it, as there is no depth buffer to test against.
2. The translucent segments are drawn once into an `R32F` target cleared to 1, keeping with `GL_MIN`
the `gl_FragCoord.z` of the nearest. The segments shaders draw it built with `DEPTH_ONLY`, the same
geometry and joint cut without the shading and its varyings, so the nearest fragment of the next
pass finds its own depth there exactly.
3. They are drawn again. The nearest fragment of a pixel goes, premultiplied, to an `RGBA16F` target
of its own. Every other one adds its premultiplied color, times a weight, to an `RGBA16F` target,
and `-log(1 - alpha)` to an `R16F` target, with `GL_ONE, GL_ONE`. The weight is the opacity times
`max((1 - z)^3, 0.01)`, z being the depth across the extrusions' bounding box, so nearer surfaces
count more. Its ceiling keeps thousands of stacked surfaces within half float range, and its floor
keeps far ones out of the subnormals. A translucent segment's opacity stays below 1, else the
shader would take it for an opaque one and add it unweighted.
4. A full screen pass draws the nearest surface over the weighted mean color of the others, with
their coverage `1 - exp(-sum)`, over the scene.
Swapping the drawing order changes the result by at most 2 levels out of 255, against up to 246 in
the direct pass. The targets are single-sampled whatever the canvas, about 26 bytes per pixel.
Multisampled ones would take twice the time and four times the memory for edges FXAA can smooth, and
against a single-sampled depth pass an edge sample could miss its nearest depth and count twice.
OpenGL ES, whose float targets are optional, takes the direct pass, as does a multisampled framebuffer
object, whose depth cannot be copied into a texture.
## Cost and side effects
Without depth writes, every translucent surface on screen is shaded, so the cost of the second
pass grows with the number of translucent surfaces stacked on screen. Order independent blending
draws the translucent segments twice and writes 18 bytes of float data per pixel instead of 4, between
a tenth and two fifths more than the direct pass.
In realistic view, a translucent segment casts into a share of the shadow map texels as large as
its opacity, in an ordered 4x4 pattern that the 5x5 filter of the receivers reads as a lighter
shadow. The pattern shifts with the segment, so layers stacked along the light add up: a 1 mm
translucent box at 35% casts a shadow about 60% as dark as an opaque one, a 10 mm box nearly a full
one.
## Prepare
Prepare draws a part as a closed mesh, which would show a single surface at the filament's opacity,
far fainter and darker than the print of that part in Preview. The object shaders therefore shade a
visible model part whose filament color is translucent as the view ray crossing two shells of the
part, the front and the back one, of two 0.45 mm walls each, with the opacity rule of Preview:
`1 - (1 - a)^(1.8 / 0.4 / cos)`, cos being that of the angle between the view and the normal,
floored at 0.25. A filament at 35% is then about 86% opaque face on, and nearly opaque at the
silhouette, where the ray grazes the walls. See `translucent_filament_color()` in `gouraud.fs` and
`phong.fs`.
Such a part is drawn in premultiplied color, blended with `GL_ONE, GL_ONE_MINUS_SRC_ALPHA`, so that
in realistic view its highlight is not dimmed by its opacity; without realistic view it takes no
highlight. `GLVolumeCollection::render()` switches this per volume, and only with a shader that has
the `translucent_filament` uniform, the GLSL 1.40 ones: with the GLSL 1.10 and ES shaders, such a
part blends as a plain transparent volume. Modifiers, negative volumes and opaque parts are drawn as
they were.
The wireframe overlay draws translucent filament parts too, with blending off, so their lines stay
solid.
+19 -1
View File
@@ -10,7 +10,9 @@ things shorten the travel between infill paths:
- the fill generators join their lines into as few paths as they can, since
every separate path needs a travel to it;
- the G-code export refines the greedy chain with a local search that shortens
the straight-line travel between the paths.
the straight-line travel between the paths;
- a fill that keeps its order prints each piece of its gap fill where it passes
by, since the G-code export cannot reorder it.
The refinement covers every chain that `chain_and_reorder_extrusion_entities()`
builds from a start point: the infill and ironing of `GCode::extrude_infill()`
@@ -97,6 +99,22 @@ joined at different walls and the travel between them crossed the island. Lines
that cannot reverse, such as Grid's, only join the end of one to the start of the
next, and fills that keep their order are left alone.
## Gap fill in a fill that keeps its order
`Fill::_create_gap_fill()` adds the gap fill of a solid surface, where
`gap_fill_target` asks for it, after the lines of the fill. The chain mixes it
in with the lines of a sortable fill like any other path. A fill that keeps its
order, such as monotonic, would print all of its lines and then come back for
every piece of gap fill, most of which lies at the walls where the lines end.
So each piece, in turn, goes between the two extrusions of the fill where it
adds the least travel, flipped when that is shorter. A closed piece counts from
its point nearest the nozzle, where `GCode::extrude_loop()` starts it. The two
ends of the fill cost nothing, since the travel to and from them depends on what
is printed before and after. The fill's own extrusions keep their order and
direction, so a monotonic fill stays monotonic. When the result travels no less
than the gap fill printed after the lines in its own order, that order is kept.
## The search
A chain of up to eight paths is found exactly, by dynamic programming over the
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2
View File
@@ -166,6 +166,7 @@ src/slic3r/GUI/NotificationManager.cpp
src/slic3r/GUI/ObjectDataViewModel.cpp
src/slic3r/GUI/OpenGLManager.cpp
src/slic3r/GUI/OptionsGroup.cpp
src/slic3r/GUI/OptionStateRegistry.cpp
src/slic3r/GUI/PrintOptionsDialog.cpp
src/slic3r/GUI/SafetyOptionsDialog.cpp
src/slic3r/GUI/ParamsPanel.cpp
@@ -176,6 +177,7 @@ src/slic3r/GUI/Plater.cpp
src/slic3r/GUI/Preferences.cpp
src/slic3r/GUI/PresetComboBoxes.cpp
src/slic3r/GUI/PresetHints.cpp
src/slic3r/GUI/PrimitiveSizeDialog.cpp
src/slic3r/GUI/ProgressStatusBar.cpp
src/slic3r/GUI/PlateSettingsDialog.cpp
src/slic3r/GUI/PrivacyUpdateDialog.cpp
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Anker",
"version": "02.04.00.06",
"version": "02.04.00.07",
"force_update": "0",
"description": "Anker configurations",
"machine_model_list": [
@@ -6,7 +6,7 @@
"instantiation": "false",
"gcode_flavor": "marlin2",
"before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\n\n",
"file_start_gcode": ";TIME:{print_time_sec}s",
"file_start_gcode": ";TIME:{print_time_sec}s\n;Filament weight: {total_weight}g\n;Filament used: {used_filament}m\n;Layer height: {layer_height}\n;material_print_temperature_layer_0: {first_layer_temperature[0]}",
"machine_start_gcode": "M4899 T3 ; Enable v3 jerk and S-curve acceleration \nM104 S150 ; Set hotend temp to 150 degrees to prevent ooze\nM190 S{first_layer_bed_temperature[0]} ; set and wait for bed temp to stabilize\nM109 S{first_layer_temperature[0]} ; set final nozzle temp to stabilize\nG28 ;Home\n;LAYER_COUNT:{total_layer_count}",
"machine_end_gcode": "M104 S0\nM140 S0\n;Retract the filament\nG92 E1\nG1 E-1 F300\nG28 X0 Y0\nM18",
"change_filament_gcode": "M600",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Anycubic",
"version": "02.04.00.09",
"version": "02.04.00.10",
"force_update": "0",
"description": "Anycubic configurations",
"machine_model_list": [
@@ -108,7 +108,7 @@
],
"machine_start_gcode": "G90 ;Use absolute coordinates\nM83 ;Extruder relative mode\nM104 S[first_layer_temperature] ;Set extruder temp\nM140 S[first_layer_bed_temperature] ;Set bed temp\nM190 S[first_layer_bed_temperature] ;Wait for bed temp\nM109 S[first_layer_temperature] ;Wait for extruder temp\nG28 ;Move X/Y/Z to min endstops\nG1 Z0.28 ;Lift nozzle a bit\nG92 E0 ;Specify current extruder position as zero\nG1 Y3 F1800 ;Move Y to purge point\nG1 X60 E25 F500 ;Extrude 25mm of filament in a 5cm line\nG92 E0 ;Zero the extruded length again\nG1 E-2 F500 ;Retract a little\nG1 X70 F4000 ;Quickly wipe away from the filament line\nM117",
"machine_end_gcode": "M104 S0 ;Extruder off\nM140 S0 ;Heatbed off\nM107 ;Fan off\nG91 ;Relative positioning\nG1 E-5 F3000 ;Retract filament\nG1 Z+0.3 F3000 ;Lift print head\nG28 X0 F3000 ;Home X axis\nM84 ;Disable stepper motors",
"before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n[layer_num] @ [layer_z]mm\nG92 E0",
"layer_change_gcode": ";AFTER_LAYER_CHANGE\n[layer_num] @ [layer_z]mm",
"before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_num] @ [layer_z]mm\nG92 E0",
"layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_num] @ [layer_z]mm",
"scan_first_layer": "0"
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "Bambulab",
"url": "http://www.bambulab.com/Parameters/vendor/BBL.json",
"version": "02.08.00.15",
"version": "02.08.00.16",
"force_update": "0",
"description": "the initial version of BBL configurations",
"machine_model_list": [
@@ -5,6 +5,11 @@
"from": "system",
"setting_id": "GFSB00_36",
"instantiation": "true",
"activate_air_filtration": [
"0",
"0",
"0"
],
"chamber_temperatures": [
"65"
],
@@ -468,6 +468,7 @@
"319",
"319"
],
"support_air_filtration": "1",
"support_cooling_filter": "1",
"support_chamber_temp_control": "1",
"support_object_skip_flush": "0",
@@ -372,6 +372,7 @@
"319",
"319"
],
"support_air_filtration": "1",
"support_cooling_filter": "1",
"support_chamber_temp_control": "1",
"support_object_skip_flush": "0",
@@ -267,6 +267,7 @@
"30",
"30"
],
"support_air_filtration": "1",
"support_chamber_temp_control": "1",
"support_cooling_filter": "1",
"support_object_skip_flush": "1",
@@ -210,6 +210,7 @@
"18",
"18"
],
"support_air_filtration": "1",
"wipe_distance": [
"2",
"2"
@@ -267,6 +267,7 @@
"18",
"18"
],
"support_air_filtration": "1",
"support_object_skip_flush": "1",
"wipe_distance": [
"2",
@@ -213,6 +213,7 @@
"18"
],
"scan_first_layer": "1",
"support_air_filtration": "1",
"wipe_distance": [
"2",
"2"
@@ -208,6 +208,7 @@
"18"
],
"scan_first_layer": "1",
"support_air_filtration": "1",
"wipe_distance": [
"2",
"2"
@@ -189,6 +189,7 @@
"20",
"20"
],
"support_air_filtration": "1",
"support_chamber_temp_control": "1",
"upward_compatible_machine": [
"Bambu Lab A1 0.4 nozzle",
+137
View File
@@ -0,0 +1,137 @@
{
"name": "BenFab",
"version": "01.00.00.00",
"force_update": "0",
"description": "BenFab 450 printer configurations",
"machine_model_list": [
{
"name": "BenFab 450",
"sub_path": "machine/BenFab 450.json"
}
],
"process_list": [
{
"name": "fdm_process_common",
"sub_path": "process/fdm_process_common.json"
},
{
"name": "fdm_process_benfab_common",
"sub_path": "process/fdm_process_benfab_common.json"
},
{
"name": "fdm_process_benfab_04020",
"sub_path": "process/fdm_process_benfab_04020.json"
},
{
"name": "fdm_process_benfab_06030",
"sub_path": "process/fdm_process_benfab_06030.json"
},
{
"name": "fdm_process_benfab_08040",
"sub_path": "process/fdm_process_benfab_08040.json"
},
{
"name": "fdm_process_benfab_10050",
"sub_path": "process/fdm_process_benfab_10050.json"
},
{
"name": "0.20mm Standard @BenFab 450 0.4 nozzle",
"sub_path": "process/0.20mm Standard @BenFab 450 0.4 nozzle.json"
},
{
"name": "0.30mm Standard @BenFab 450 0.6 nozzle",
"sub_path": "process/0.30mm Standard @BenFab 450 0.6 nozzle.json"
},
{
"name": "0.40mm Standard @BenFab 450 0.8 nozzle",
"sub_path": "process/0.40mm Standard @BenFab 450 0.8 nozzle.json"
},
{
"name": "0.50mm Standard @BenFab 450 1.0 nozzle",
"sub_path": "process/0.50mm Standard @BenFab 450 1.0 nozzle.json"
},
{
"name": "0.12mm Fine @BenFab 450 0.4 nozzle",
"sub_path": "process/0.12mm Fine @BenFab 450 0.4 nozzle.json"
},
{
"name": "0.16mm Optimal @BenFab 450 0.4 nozzle",
"sub_path": "process/0.16mm Optimal @BenFab 450 0.4 nozzle.json"
},
{
"name": "0.20mm Strength @BenFab 450 0.4 nozzle",
"sub_path": "process/0.20mm Strength @BenFab 450 0.4 nozzle.json"
},
{
"name": "0.24mm Draft @BenFab 450 0.4 nozzle",
"sub_path": "process/0.24mm Draft @BenFab 450 0.4 nozzle.json"
},
{
"name": "0.28mm Extra Draft @BenFab 450 0.4 nozzle",
"sub_path": "process/0.28mm Extra Draft @BenFab 450 0.4 nozzle.json"
},
{
"name": "0.24mm Optimal @BenFab 450 0.6 nozzle",
"sub_path": "process/0.24mm Optimal @BenFab 450 0.6 nozzle.json"
},
{
"name": "0.36mm Draft @BenFab 450 0.6 nozzle",
"sub_path": "process/0.36mm Draft @BenFab 450 0.6 nozzle.json"
},
{
"name": "0.42mm Extra Draft @BenFab 450 0.6 nozzle",
"sub_path": "process/0.42mm Extra Draft @BenFab 450 0.6 nozzle.json"
},
{
"name": "0.24mm Fine @BenFab 450 0.8 nozzle",
"sub_path": "process/0.24mm Fine @BenFab 450 0.8 nozzle.json"
},
{
"name": "0.32mm Optimal @BenFab 450 0.8 nozzle",
"sub_path": "process/0.32mm Optimal @BenFab 450 0.8 nozzle.json"
},
{
"name": "0.48mm Draft @BenFab 450 0.8 nozzle",
"sub_path": "process/0.48mm Draft @BenFab 450 0.8 nozzle.json"
},
{
"name": "0.30mm Fine @BenFab 450 1.0 nozzle",
"sub_path": "process/0.30mm Fine @BenFab 450 1.0 nozzle.json"
},
{
"name": "0.40mm Optimal @BenFab 450 1.0 nozzle",
"sub_path": "process/0.40mm Optimal @BenFab 450 1.0 nozzle.json"
},
{
"name": "0.60mm Draft @BenFab 450 1.0 nozzle",
"sub_path": "process/0.60mm Draft @BenFab 450 1.0 nozzle.json"
}
],
"filament_list": [],
"machine_list": [
{
"name": "fdm_machine_common",
"sub_path": "machine/fdm_machine_common.json"
},
{
"name": "fdm_klipper_common",
"sub_path": "machine/fdm_klipper_common.json"
},
{
"name": "BenFab 450 0.4 nozzle",
"sub_path": "machine/BenFab 450 0.4 nozzle.json"
},
{
"name": "BenFab 450 0.6 nozzle",
"sub_path": "machine/BenFab 450 0.6 nozzle.json"
},
{
"name": "BenFab 450 0.8 nozzle",
"sub_path": "machine/BenFab 450 0.8 nozzle.json"
},
{
"name": "BenFab 450 1.0 nozzle",
"sub_path": "machine/BenFab 450 1.0 nozzle.json"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Some files were not shown because too many files have changed in this diff Show More