Commit Graph

30403 Commits

Author SHA1 Message Date
SoftFever
4aa0e1d60b Translate filament ids at the printer boundary
Orca content-addresses every system filament, Bambu's included, but a printer,
its AMS and its vendor's cloud know only that vendor's own catalog ids. The
printer agent now translates between the two: outbound MQTT and FTP traffic, the
AMS mapping sent with a print job, and the ids written into a 3mf bound for the
printer all leave in the printer's own ids, while status messages, loaded
projects and SD-card prints arrive in Orca's. An id with no mapping passes
through unchanged, and an agent whose printers already speak Orca's ids
translates nothing at all.

Bambu's map is generated from BambuStudio's own shipped bundle; a missing or
unreadable file leaves every lookup an identity rather than taking the app down.
The profile check validates the map's shape, and profile CI now runs on the paths
that can change it. docs/HLSD/filament_id.md records the places the map
deliberately does not reach.
2026-09-06 20:53:11 +08:00
SoftFever
ec207e67a3 Mint content-addressed ids for the Bambu bundle 2026-09-04 15:01:58 +08:00
SoftFever
db3d684ee0 Scope the filament AMS length check to presets the vendor bundle references
The tree-wide length check (freed from its BBL/OFL carve-out last commit)
was flagging 21 pre-existing SeeMeCNC files that no vendor index references
and that therefore never load, turning CI red for files with no bearing on
what ships. The rule now only fires on presets a vendor's filament_list
actually references; every .json under the vendor's filament directory is
still parsed through the duplicate-key hook, so that coverage is unchanged.

Also removed a duplicated BAMBU_MAP_PATH definition: update_bambu_filament_ids.py
now imports the constant from assign_filament_ids.py, which it already imports
several other constants from, instead of recomputing the same path independently.
2026-09-04 14:42:57 +08:00
SoftFever
40cc3340b1 Content-address Bambu filament ids and check profiles against the catalog map
Every vendor's filament_id declarations, Bambu's own bundle included, are now
minted and checked the same way: the GF* catalog space is reserved but
ownerless, format is validated unconditionally with no snapshot or BBL
exemption, and both --remint and the default assign pass treat a non-OF
declaration as one needing a fresh mint (so a future BambuStudio sync
self-heals instead of needing a manual pass). A new check validates
resources/printers/bambu_filament_ids.json against the tree it describes:
that it parses, carries its header, keys only OF ids, maps each Bambu id once,
and agrees with the tree on every product it shares. The redundant BBL/OFL
carve-out in the profile checker's length check is dropped too, so it runs
the same way for every vendor.

The BBL bundle itself hasn't been touched yet and still declares its old GF
ids, so TestRealTree.test_shipped_snapshot_matches_tree is expected to fail
here (209 declarations flagged) until the next commit re-mints the bundle
onto OF ids.
2026-09-04 14:25:00 +08:00
SoftFever
25e020f5c9 Add the generated map from Orca filament ids to Bambu catalog ids
scripts/update_bambu_filament_ids.py derives resources/printers/bambu_filament_ids.json
from BambuStudio's own shipped BBL bundle (cloned from upstream, or read from a local
checkout via --bambustudio-dir), pairing each Bambu catalog id with the Orca filament_id
we already ship for that product where we ship one, else a freshly generated one. Nothing
reads the map yet; later work uses it to translate ids at the Bambu printer boundary.
2026-09-04 13:31:19 +08:00
SoftFever
a4382ce3b3 reanme 2026-09-04 01:06:04 +08:00
SoftFever
df101ead91 fix more issues 2026-09-04 00:29:52 +08:00
SoftFever
7c9b38ba04 remove retired_filament_ids.json 2026-09-03 21:03:42 +08:00
SoftFever
fdc0ee18f1 fix vendor version 2026-09-03 17:47:29 +08:00
SoftFever
fa8edd0f69 Merge branch 'main' into feature/filament_id 2026-09-03 12:16:38 +08:00
SoftFever
e2b251c145 Fix generic PLA and default filaments on the Creality Hi 2026-09-03 12:14:14 +08:00
SoftFever
21fdd7028f Fix spurious slice-validation failures when checking all vendors
The sweep now validates each printer with the filament that printer ships, so a run
over every vendor reports what a single-vendor run does. Validator only - no change
to slicing output or shipped profiles.
2026-09-03 11:25:49 +08:00
Kris Austin
e6501bb1ce build: stop rebuilding the Flatpak dependencies on every run (#15501) 2026-09-02 21:45:16 -03:00
Vladislav Khmelevsky
53c26a5724 fix: save 3d mouse settings (#15397)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-09-02 20:21:27 -03:00
Rodrigo Faselli
3605614ee7 More Labels (#15511) 2026-09-02 19:06:01 -03:00
Kris Austin
8bf1d3ea84 fix: clear 12 warning sites that only appear away from Windows (#15437) 2026-09-02 18:18:17 -03:00
Kiss Lorand
51fd6327fe Fix omitted assembly parts with height ranges (#15499) 2026-09-02 18:15:18 -03:00
Ian Bassi
b81c0e30c1 Localization update (#15497)
* gettext

* AI Translated

* Update OrcaSlicer_es.po
2026-09-02 10:27:18 -03:00
Alexandre Folle de Menezes
640fd9f454 Fix misc. errors on GUI strings (#15468)
* Fix misc. errors on GUI strings

* Adding context to single-letter unit strings

* Fix duplicate strings on po files
2026-09-02 09:36:54 -03:00
SoftFever
ab90aec001 add per vendor support for check_profile check 2026-09-02 18:50:50 +08:00
Kris Austin
1749c293a6 build: clear 237 warnings - unused lambda captures (#15417)
* build: enable /Zc:lambda for MSVC

MSVC keeps its legacy lambda processor under /std:c++17, which rejects
reading a constexpr constant inside a lambda that does not capture it
(C3493). No other compiler requires that capture, and clang reports it as
an unused one, so the two cannot both be satisfied without the flag.

/Zc:lambda selects the conforming lambda parser that clang and GCC
already use. It is implied by /std:c++20 and /permissive-, so it is only
needed while we are on C++17. clang-cl is conforming already and does not
take the flag.

It requires VS2019 16.8, so build_release_vs.bat now says 16.8+.

* build: clear 237 unused lambda capture warnings

236 captures across 81 files, 142 of them `this`. Removing an unused
capture changes no behavior; clang does not report a capture whose type
has a non-trivial destructor, so nothing held only to extend an object's
lifetime is in this set.

Nine of them are the second half of the warning, "is not required to be
captured for this use", where the capture is a const or constexpr value
the body does read. Those depend on the /Zc:lambda change in the previous
commit. One of them, in FillRectilinear.cpp, had been worked around with
an #ifndef __APPLE__ guard around the capture list, which is now gone.

GUI_ObjectTableSettings.cpp captured its reset button only to read it
inside #ifdef __WXOSX_MAC__. That branch now takes the button from the
event it is already handling.

* build: fail configure on MSVC older than 19.28 instead of dropping /Zc:lambda

cl.exe answers an unrecognized /Zc: sub-option with warning D9002 and keeps
going, so on VS2019 before 16.8 the flag is silently ignored and the build
instead dies with C3493 in FillRectilinear.cpp, nowhere near the cause.

* fix: delete three locals that are now unused

Their only remaining use was the lambda capture this branch removed. The
Clang builds set -Wno-unused-variable, so the build never flagged them.

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-09-02 07:38:05 -03:00
SoftFever
7a0ca15df8 Merge branch 'main' into feature/filament_id 2026-09-02 15:34:20 +08:00
SoftFever
e523acc164 Add script to run full profile checks locally (#15496)
* Run the CI profile checks locally
2026-09-02 15:22:55 +08:00
Clifford
b6ef6cf1be fix: out-of-bounds write migrating per-variant values when switching printers (#15456)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 19:29:11 -03:00
Kiss Lorand
e8115658e0 Fix overhang fan control when overhang slowdown is enabled (#15158) 2026-09-01 18:07:02 -03:00
weng haishi
36228c4755 fix: prevent heap corruption when repairing models with auto-backup (#15395)
* fix: prevent heap corruption in model repair with auto-backup

The CGAL model repair (fix_model_with_cgal_gui) runs on a worker thread
that mutates the live ModelObject (split / delete_volume / set_mesh).
Those mutators transitively call save_object_mesh(), which hands the
object to the auto-backup manager. The manager clones and serializes the
object on its own thread via an internal Model documented as "visit only
in main thread". Running that path from the repair worker races the
backup thread on the shared model, causing use-after-free / heap
corruption -- EXC_BAD_ACCESS and libmalloc "corruption of free block"
aborts, always with the "cgal_fix_model" worker on the stack inside
add_object_mesh -> Model::add_object / delete_object.

Wrap the repair in a SaveObjectGaurd so the backup manager ignores the
object for the duration of the repair; a single backup is taken when the
guard is released on the main thread after the worker joins. This mirrors
existing batch-edit usage of SaveObjectGaurd (Model.hpp, GUI_ObjectList).

Repro: repair a multi-part / splittable object with auto-backup enabled
(Preferences > Backup); crashed within a few repairs on macOS arm64.

* Update FixModelByCgal.cpp

---------

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-09-01 16:39:12 -03:00
SoftFever
44a617a40d more fixes 2026-09-02 02:42:30 +08:00
Ian Bassi
e108ddfd56 Fix wrong JA jerk translation. (#15488)
Update OrcaSlicer_ja.po
2026-09-01 15:37:08 -03:00
Thomas
918d3914ba Fixed "jerk" translation inconsistency. (#15463)
* Fixed "jerk" translation inconsistency.

* Fixed an other "jerk" translation.
2026-09-01 15:05:10 -03:00
Kris Austin
21aa07b9cc build: add build_win.bat, a Windows build script for deps, slicer and toolchain setup (#15436)
* build: add build_win.bat, a Windows build script for deps, slicer and toolchain setup

build_release_vs.bat takes no options: what it builds is decided by editing
it. This adds build_win.bat alongside it, with short and long options, a
grouped help message, a dry-run mode that prints every command instead of
running it, and one option per thing a developer actually varies - the
configuration, the architecture, the compiler, the generator, the Visual
Studio release, how much gets rebuilt, and where the dependency tree lives.

It works from any directory, needs no developer command prompt in either
generator mode, and keeps CMake ahead of Strawberry Perl on PATH so a build
does not depend on how the user ordered their environment.

scripts/test_build_win.ps1 covers it with table-driven cases that run the
script under --dry-run and assert on the commands it prints, so nothing is
configured or built. The Windows build jobs wait on that suite.

Based on the script from OrcaSlicer#11097.

Co-authored-by: Ocraftyone <24759591+Ocraftyone@users.noreply.github.com>

* build: report what build_win.bat produced and what to do next

Every successful run now ends with a block naming what it built and the
commands to carry on with. Those commands repeat the flags that reproduce
the run, so a rebuild after a clang-cl Ninja build is not silently an MSVC
one. A failure gets a framed block naming the command that failed and a
retry scoped to the stage that failed, so a slicer error does not suggest
discarding an untouched dependency tree.

Installing is now opt-in behind -i. The install tree is a second full copy
of the build that exists mainly so the release can be zipped from it, while
the build tree is already runnable, with the DLLs beside the binary and
resources symlinked rather than copied.

Configuring against a dependency tree that was never built now names it
instead of failing several hundred lines into CMake's package resolution.

scripts/test_build_win.ps1 covers all of it, and gains -Name so one case
can be run without the full pass.

* build: let the test options stand alone, and say which build things apply to

--run-tests named two things to do and then did neither without -s, so
`build_win.bat -lx --run-tests` answered "Nothing to do". Both test
options now imply the slicer build they cannot happen without, unless
another action was already named, so -d --tests is still a dependency
build. --install-vs has turned on --install-deps the same way all along.

That makes them actions, so they move to the group that says so. -i goes
the other way, to the step toggles beside --no-configure and --no-gettext,
since it does not stand alone and adds a step rather than describing what
kind of build to make. An example shows the tests run with toolchain
flags, because flags pick which build gets tested and a bare --run-tests
would build and test a default tree the developer never asked for.

Two help lines named defaults that were not the defaults. --build-dir said
"instead of build/" and --deps-dir said "instead of deps/", but trees are
named for the configuration, compiler and architecture, so build/ is only
the default for a release x64 MSVC build, and deps/ is the source
directory rather than a tree anything is built in.

The hint for a missing dependency tree now carries the flags that
reproduce the run. It said "Build them with -d", which after a clang build
points at the MSVC tree, so following it left you no better off. Every
other suggestion the script makes already repeats them.

-k counted on the developer to read taskkill invocations as progress. It
now names each image and how many processes it is about to stop, which is
what explains the pause, and skips the ones that are not running instead
of printing taskkill's "not found" as though something had gone wrong. No
image can stop the rest.

The environment example set SLIC3R_ASAN, which -a already does, teaching
the long way round to a flag the script owns. It now sets options that
have no flag. The note under it said "Use these for a value containing
spaces. Ampersands are not supported", which named neither what "these"
were an alternative to nor where ampersands were a problem.

The test harness gains a NotExists field, because output cannot show what
a run did not create, and two cases needed to prove exactly that.

---------

Co-authored-by: Ocraftyone <24759591+Ocraftyone@users.noreply.github.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-09-01 15:02:19 -03:00
ndrwrbgs
ec06c8788d Minor display text fixes (#15454)
* Minor display text fixes

* Update in translations

---------

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-09-01 14:55:16 -03:00
Mikhail f. Shiryaev
96e85b1db5 Fix build with disabled precompiled headers (#15484)
Fix broken build with disabled PCH
2026-09-01 14:21:38 -03:00
SoftFever
afa806da18 Update Dremel and Ratrig filament profiles; remove deprecated entries and adjust versioning 2026-09-01 23:45:55 +08:00
Kris Austin
7eaff76cec build: use clang-cl for Windows CI builds (faster slicing and faster builds) (#15428)
* ci: build the Windows x64 dependencies and slicer with clang-cl

Passes -l -x from the Windows jobs, using the clang-cl and Ninja options
added in #15373. Ninja runs each dependency's build step as a plain command,
so the jobs set up a VC environment for OpenSSL's nmake. arm64 stays on MSVC
for now.

The deps cache key gains the compiler, so windows-x64 becomes
windows-x64-clang and windows-arm64 becomes windows-arm64-msvc.

* deps: select OpenSSL's ARM64 target from DEPS_ARCH

CMAKE_GENERATOR_PLATFORM is only set by -A, which Ninja never receives, so
the Ninja build selected the x64 target on ARM64. DEPS_ARCH is derived from
CMAKE_SYSTEM_PROCESSOR and is already independent of the generator.

* ci: build the Windows ARM64 dependencies and slicer with clang-cl

Three dependencies need handling first. libpng and OpenCV each build an ARM
SIMD path that does not compile with clang-cl, so those paths are off; PNG
already had the same opt-out for Apple ARM. OCCT is built with cl, since
clang-cl cannot emit one of its large generated files and there is no option
to turn that off. All three are gated to Windows ARM64 with clang.
2026-09-01 10:30:45 -03:00
SoftFever
bee0df825e fix filament_vendor 2026-09-01 18:36:44 +08:00
SoftFever
ab21af6b08 fix filament names 2026-09-01 17:44:12 +08:00
SoftFever
6ec904074b Give generic filaments one name and one identity across every vendor 2026-09-01 17:26:57 +08:00
SoftFever
e1c28a5f7c Merge branch 'main' into feature/filament_id 2026-09-01 11:43:57 +08:00
SoftFever
417a6d7c30 add log 2026-09-01 11:43:00 +08:00
SoftFever
261cc19c59 update doc
update doc
2026-09-01 11:43:00 +08:00
Kris Austin
9933cab59f build: drop the pkg-config requirement from the Windows build (#15469)
The FFmpeg camera view port made pkg-config a required build tool on
Windows. Windows does not ship one, so every Windows developer has to
install it before the build will configure:

  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
  Call Stack (most recent call first):
    CMakeLists.txt:480 (find_package)

Nothing on Windows needs it. FFmpeg there is a prebuilt zip unpacked
into the deps prefix, whose DLLs the top level CMakeLists already names
by exact soname. The version is fixed before configure runs, so
find_library against that prefix does the job, as on macOS.

Also drops the CI step that installed pkg-config, gated on !SELF_HOSTED
so it never ran on self-hosted runners, and re-comments the if(WIN32)
block that #15234 uncommented only for that find_package.
2026-09-01 09:19:58 +08:00
Kris Austin
5436e422b9 ci: build macOS with 3 parallel jobs instead of 1 (#15393) 2026-08-31 16:59:58 -03:00
Leo Lobato
ca903faa56 Fix uninitialized first_layer_time on CLI-sliced 3MF (#13429)
PartPlate::store_to_3mf_structure read first_layer_time from the indirect cali_bboxes_data struct,
which the GUI populates at Plater.cpp:10600 but the CLI never writes to. The result was uninitialized
memory leaking into slice_info.config

Read directly from get_slice_result()->initial_layer_time, which is populated by
GCodeProcessor::finalize() in both code paths and matches the pattern already used a few lines
above for gcode_prediction.

Also default-initialize PlateBBoxData::first_layer_time to 0.0f as a defense against any other consumer
reading it without an explicit write.
2026-08-31 16:36:55 -03:00
Kris Austin
fcf6f0a3a5 build: clear 54 warnings - dead private fields (#15423)
build: clear 54 dead private fields

54 of the 161 -Wunused-private-field warnings, across 31 files. These are
the ones needing no judgment. Each member is declared once and appears
nowhere else in src/, counting the .mm and .c sources as well as .cpp and
.hpp, so nothing writes them and nothing reads them. Every removal is a
whole line, and no declaration shares a line with another member.

The remaining 107 are left alone. Those members are mentioned elsewhere,
usually assigned and never read, where the fix might be deleting the
member or might be restoring a read that went missing.
2026-08-31 16:36:52 -03:00
SoftFever
e8b2a9fca0 Merge branch 'main' into feature/filament_id 2026-08-31 22:11:38 +08:00
Kris Austin
36740ffdd8 build: clear 53 warnings - discarded values and i18n markers (#15421)
build: clear 53 unused value warnings

49 of them are deliberate i18n markers. L(s) expands to s, so
L("Main Extruder"); is a string literal as a statement and its value is
discarded. The strings have to stay, because the real values come from
printers/*.json at runtime and xgettext cannot scan those. Each block is
now a static const char *const markers[], which uses the values rather
than discarding them. Extraction is unchanged: the xgettext invocation
from scripts/run_gettext.bat gives 76 msgids over the two marker files
before and after, with identical msgid and msgctxt sets.

The other 4 are statements with no effect. AMSItem.cpp:117 and :174
construct and drop a wxColour(255, 255, 255); AMS_TRAY_DEFAULT_COL is
that colour, and the line above already assigns it. UpgradePanel.cpp:865
reads a member and drops it.

wgtDeviceNozzleSelect.cpp:269 writes
if (item; auto ptr = m_nozzle_rack.lock()), which puts the null check in
the init-statement position where its value is discarded, so the check
never runs, and sGetNozzlePosId then dereferences item. Nothing reaches
that today, because the only sender of the event sets itself as the
event object and the dynamic_cast always succeeds. The check now runs.
2026-08-31 10:55:42 -03:00
SoftFever
5add7a5062 Show Orca Filament Library filaments in AMS and calibration dialogs
These dialogs treated a filament with no compatible_printers as compatible with
nothing, while the rest of the app treats it as compatible with everything, so
the entire Orca Filament Library was missing from the AMS material and
calibration filament lists. They now resolve compatibility the same way the
plater does, and a vendor profile still supersedes the library generic of the
same name.
2026-08-31 16:25:59 +08:00
Ian Chua
27e99ca713 feat: initial plugin auditing workflow (#14989)
# Description

This is an initial draft of the plugin audit workflow.

It focuses on the user experience and developer-facing permission
workflow. It does not yet include the complete implementation of every
operation that should be audited, such as the full filesystem,
networking, and process-spawning event coverage.

## User workflow

When a plugin is loaded:
1. The plugin’s register_capabilities() function is executed.
2. The plugin declares the permissions it requires.
3. OrcaSlicer displays a permission dialog listing the requested
resources.
4. If the user grants access:
  - The permission is persisted in the plugin’s .install_state.json.
  - Capability registration continues.
  - The plugin is materialized and loaded.
5. If the user denies access:
    - Plugin loading fails before capabilities are materialized.
    - on_load() is not called.
- The plugin’s install state is marked with "enabled": false to prevent
repeated automatic load attempts.

At runtime, if a plugin accesses a resource that was not approved during
loading, the audit hook displays another permission dialog. For
filesystem requests, the dialog identifies the requested filepath.
  - Granting access persists the permission and allows the operation.
  - Denying access raises a Python PermissionError.
- The error propagates to the host, which records the failure and
unloads the plugin.

Host-side traceback logging is performed outside the plugin audit
context so that logging does not generate additional permission dialogs.

## Developer-facing API

Plugins can declare filesystem read permissions through the new API:
```python

import orca
AUDIT_PATH = __file__


@orca.plugin
class ExamplePackage(orca.base):
   def register_capabilities(self):
        orca.request_permissions(
            fs_read=[AUDIT_PATH],
        )
        orca.register_capability(ExampleCapability)
```
orca.request_permissions() must be called from register_capabilities()
while the plugin is being loaded.

Currently supported permission:
orca.request_permissions(fs_read=[...])

The paths should be explicit filesystem paths that the plugin intends to
read. The host deduplicates repeated paths, presents the request after
registration completes, and persists granted paths in the plugin
install-state sidecar. This API is still experimental, and is by no
means the final implementation.

Support for additional permission categories, including filesystem write
access, networking, and process spawning, is reserved for subsequent
work.

# Screenshots/Recordings/Graphs

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

<img width="869" height="799" alt="image"
src="https://github.com/user-attachments/assets/8a5903cc-0cbb-45a8-b88a-706d6cba790f"
/>


## 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-08-31 14:29:36 +08:00
SoftFever
8994ab9f98 make the script executable 2026-08-30 20:56:12 +08:00
SoftFever
ea0242feda Merge branch 'main' into feature/filament_id 2026-08-30 20:54:33 +08:00