Compare commits

..
5588 changed files with 57273 additions and 197809 deletions
-10
View File
@@ -1,12 +1,2 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Shell scripts are run by Git Bash on Windows CI, which cannot read a script
# with CRLF line endings: it fails on the first line. Windows checkouts default
# to core.autocrlf=true, so keep these LF whatever the platform.
*.sh text eol=lf
# Batch files are read by cmd.exe, which tracks a byte offset into the file to
# resume after `call :label`. With LF endings that offset can land wrong and the
# label lookup fails, so keep these CRLF whatever the platform.
*.bat text eol=crlf
+23 -26
View File
@@ -1,5 +1,5 @@
name: 🐞 Bug Report
description: Something behaves incorrectly while Orca Slicer keeps running
description: File a bug report
labels: ["bug"]
body:
- type: markdown
@@ -10,8 +10,6 @@ body:
Please note that this is not the place to make feature requests or ask for help.
For this, please use the [Feature request](https://github.com/OrcaSlicer/OrcaSlicer/issues/new?assignees=&labels=&projects=&template=feature_request.yml) issue type or you can discuss your idea on our [Discord server](https://discord.gg/P4VE9UY9gJ) with others.
If Orca Slicer closes on its own, freezes or stops responding, please use the [Crash report](https://github.com/OrcaSlicer/OrcaSlicer/issues/new?assignees=&labels=&projects=&template=crash_report.yml) form instead. It asks for the logs a crash needs.
Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
- type: checkboxes
attributes:
@@ -34,22 +32,14 @@ body:
attributes:
label: OrcaSlicer Version
description: Which version of Orca Slicer are you running? You can see the full version in `Help` -> `About Orca Slicer`.
placeholder: e.g. 2.5.0
placeholder: e.g. 1.9.0
validations:
required: true
- type: input
id: working_version
attributes:
label: Regression compared to a previous version
description: Did it work in a previous version?
placeholder: e.g. 2.3.2
validations:
required: false
- type: dropdown
id: os_type
attributes:
label: "Operating System (OS)"
description: "What OSes are you experiencing issues on?"
description: "What OSes are you are experiencing issues on?"
multiple: true
options:
- Linux
@@ -88,7 +78,7 @@ body:
id: reproduce_steps
attributes:
label: How to reproduce
description: Please describe the detailed steps to reproduce this issue
description: Please described the detailed steps to reproduce this issue
placeholder: |
1. Go to '...'
2. Click on '...'
@@ -110,23 +100,28 @@ body:
description: What should happen after the above steps?
validations:
required: true
- type: markdown
id: file_required
attributes:
value: |
Please be sure to add the following files:
* Please upload a ZIP archive containing the **project file** used when the problem arise. Please export it just before or after the problem occurs. Even if you did nothing and/or there is no object, export it! (We need the configurations in project file).
You can export the project file from the application menu in `File`->`Save project as...`, then zip it
* A **log file** for crashes and similar issues.
You can find your log file here:
Windows: `%APPDATA%\OrcaSlicer\log` or usually `C:\Users\<your username>\AppData\Roaming\OrcaSlicer\log`
MacOS: `$HOME/Library/Application Support/OrcaSlicer/log`
Linux: `$HOME/.config/OrcaSlicer/log`
If Orca Slicer still starts, you can also reach this directory from the application menu in `Help` -> `Show Configuration Folder`
You can zip the log directory, or just select the newest logs when this issue happens, and zip them
- type: textarea
id: file_uploads
attributes:
label: Project file & Debug log uploads
description: |
Attach the files with the **Paste, drop, or click to add files** control directly underneath this box. Zip anything that is not a `.log`, `.txt` or image, since GitHub rejects other file types, and keep each file under 25 MB.
* The **project file** used when the problem happened, zipped. Export it just before or after the problem occurs. Even if you did nothing and there is no object on the plate, export it, since we need the configuration it carries. `File` -> `Save project as...`
* The **log folder**, zipped. `Help` -> `Show Configuration Folder` opens it, or find it at:
* Windows: `%APPDATA%\OrcaSlicer\log`, usually `C:\Users\<you>\AppData\Roaming\OrcaSlicer\log`
* macOS: `$HOME/Library/Application Support/OrcaSlicer/log`
* Linux: `$HOME/.config/OrcaSlicer/log`
* Flatpak: `$HOME/.var/app/com.orcaslicer.OrcaSlicer/config/OrcaSlicer/log`
* If the zip comes out over 25 MB, attach the newest logs from that folder on their own instead.
description: Drop the project file and debug log here
placeholder: |
Zipped project file
Zipped log folder
Project File: `File` -> `Save project as...` then zip it & drop it here
Log File: `Help` -> `Show Configuration Folder`, then zip the log directory, or just select the newest logs in `log` when this issue happens and zip them, then drop the zip file here
validations:
required: true
- type: checkboxes
@@ -141,5 +136,7 @@ body:
label: Anything else?
description: |
Screenshots? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
-183
View File
@@ -1,183 +0,0 @@
name: 💥 Crash Report
description: Orca Slicer closes on its own, freezes or stops responding
labels: ["crash"]
body:
- type: markdown
attributes:
value: |
**Thank you for taking the time to report a crash.**
Use this form when Orca Slicer closes on its own, freezes, or stops responding.
If the application stays open and only produces a wrong result, please use the [Bug report](https://github.com/OrcaSlicer/OrcaSlicer/issues/new?assignees=&labels=&projects=&template=bug_report.yml) form instead.
A printer whose toolhead collides with the print is also a bug report rather than a crash, since the application itself did not stop.
Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
- type: checkboxes
attributes:
label: Is this crash reproducible in the latest nightly build?
description: >
Please verify this crash still happens in the latest nightly build first. It may already be fixed there:
[Nightly builds](https://github.com/OrcaSlicer/OrcaSlicer/releases/tag/nightly-builds).
options:
- label: I have checked the latest nightly build and the crash is still reproducible
required: true
- type: checkboxes
attributes:
label: Is there an existing issue for this crash?
description: Please search to see if an issue already exists for the crash you encountered.
options:
- label: I have searched the existing issues
required: true
- type: input
id: version
attributes:
label: OrcaSlicer Version
description: Which version of Orca Slicer are you running? You can see the full version in `Help` -> `About Orca Slicer`.
placeholder: e.g. 2.5.0
validations:
required: true
- type: input
id: working_version
attributes:
label: Regression compared to a previous version
description: Did it work in a previous version?
placeholder: e.g. 2.3.2
validations:
required: false
- type: dropdown
id: os_type
attributes:
label: "Operating System (OS)"
description: "What OSes are you seeing the crash on?"
multiple: true
options:
- Linux
- macOS
- Windows
validations:
required: true
- type: input
id: os_version
attributes:
label: "OS Version"
description: "What OS version does this relate to?"
placeholder: "i.e. OS: Windows 7/8/10/11 ..., Ubuntu 22.04/Fedora 36 ..., macOS 10.15/11.1/12.3 ..."
validations:
required: true
- type: input
id: printer
attributes:
label: Printer
description: Which printer was selected
placeholder: Voron 2.4/VzBot/Prusa MK4/Bambu Lab X1 series/Bambu Lab P1P/...
validations:
required: true
- type: dropdown
id: crash_moment
attributes:
label: When does the crash happen?
description: Pick the point where Orca Slicer stops working.
options:
- Not sure
- On startup, before the main window appears
- When opening or importing a project or model
- While changing printer, filament or process settings
- While slicing
- In the 3D view, Preview or Assembly view
- When exporting G-code or sending a print to the printer
- On the Device tab, or connecting to a printer (camera, sync, login)
- While using a specific tool, dialog or calibration
- After resuming from sleep or changing monitors
- When closing the application
- No clear pattern
validations:
required: true
- type: dropdown
id: crash_frequency
attributes:
label: How often does it happen?
options:
- Not sure
- Every time
- Often, but not every time
- Rarely
- It only happened once
validations:
required: true
- type: dropdown
id: fresh_config
attributes:
label: Does it still crash with a fresh configuration?
description: >
Close Orca Slicer and rename your configuration folder (`%APPDATA%\OrcaSlicer` on Windows,
`$HOME/Library/Application Support/OrcaSlicer` on macOS, `$HOME/.config/OrcaSlicer` on Linux),
then start it again. Renaming keeps your settings, so you can put the folder back afterwards.
options:
- I have not tried this
- Yes, it still crashes
- No, the crash goes away
validations:
required: true
- type: textarea
id: reproduce_steps
attributes:
label: How to reproduce
description: Please describe the detailed steps that lead to the crash.
placeholder: |
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. Orca Slicer closes
validations:
required: true
- type: textarea
id: system_info
attributes:
label: Additional system information
description: >
Display card and driver version are worth adding for crashes on startup or in the 3D view.
CPU and memory are worth adding for crashes while slicing.
placeholder: |
CPU: 11th gen Intel r core tm i7-1185g7/AMD Ryzen 7 6800h/...
Memory: 32/16 GB...
Display Card: NVIDIA Quadro P400/...
validations:
required: false
- type: textarea
id: file_uploads
attributes:
label: Project file, logs and crash report uploads
description: |
A crash report without logs usually cannot be acted on. Attach the files with the **Paste, drop, or click to add files** control directly underneath this box. Zip anything that is not a `.log`, `.txt` or image, since GitHub rejects other file types, and keep each file under 25 MB.
* The **project file** used when the crash happened, zipped. Export it just before or after the crash, even if the plate is empty, since we need the configuration it carries. `File` -> `Save project as...`
* The whole **log folder**, zipped rather than single files picked out of it. `Help` -> `Show Configuration Folder` opens it, or find it at:
* Windows: `%APPDATA%\OrcaSlicer\log`, usually `C:\Users\<you>\AppData\Roaming\OrcaSlicer\log`
* macOS: `$HOME/Library/Application Support/OrcaSlicer/log`
* Linux: `$HOME/.config/OrcaSlicer/log`
* Flatpak: `$HOME/.var/app/com.orcaslicer.OrcaSlicer/config/OrcaSlicer/log`
* On Windows the crash itself is written to a separate `crash_*.log` in there, and that is the file we need most. If the zip comes out over 25 MB GitHub will refuse it, so attach the newest log and any `crash_*.log` on their own instead.
* The **operating system crash report**, on macOS and Linux, where Orca Slicer cannot write its own crash log. It is often the only record of where it died:
* macOS: Console.app -> Crash Reports, or `$HOME/Library/Logs/DiagnosticReports/`. The file starts with `OrcaSlicer` and ends in `.ips`. Zip it before attaching, GitHub does not accept `.ips` files.
* Linux: run `orca-slicer` from a terminal (Flatpak: `flatpak run com.orcaslicer.OrcaSlicer`) and paste everything it prints when it dies. On systemd systems `coredumpctl info orca-slicer` gives a backtrace.
placeholder: |
Zipped project file
Zipped log folder
Zipped macOS .ips crash report, or the terminal output on Linux
validations:
required: true
- type: checkboxes
id: file_checklist
attributes:
label: Checklist of files to include
options:
- label: Log folder
- label: Project file
- label: Operating system crash report (macOS and Linux)
- type: textarea
attributes:
label: Anything else?
description: |
Screenshots? References? Anything that will give us more context about the crash you are encountering!
validations:
required: false
+10 -131
View File
@@ -14,7 +14,6 @@ on:
- 'localization/**'
- 'resources/**'
- ".github/workflows/build_*.yml"
- 'scripts/build_preset_cache.*'
- 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'tests/**'
@@ -33,10 +32,7 @@ on:
- 'build_linux.sh'
- 'build_release_vs.bat'
- 'build_release_vs2022.bat'
- 'build_win.bat'
- 'scripts/test_build_win.ps1'
- 'build_release_macos.sh'
- 'scripts/build_preset_cache.*'
- 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'tests/**'
@@ -58,22 +54,6 @@ concurrency:
jobs:
# build_win.bat ships a test suite. Run it before the Windows builds.
check_build_script:
name: Windows build script tests
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
lfs: 'false'
# Windows PowerShell rather than pwsh: the suite drives build_win.bat
# through cmd, and the two differ in how they quote native arguments.
- name: Run the build script test suite
shell: powershell
run: .\scripts\test_build_win.ps1
build_linux:
strategy:
fail-fast: false
@@ -99,16 +79,14 @@ jobs:
# SELF_HOSTED skips arm64 (the self-hosted Windows server is x64-only).
matrix:
include: ${{ fromJSON(vars.SELF_HOSTED
&& '[{"arch":"x64","os":"orca-win-server","compiler":"clang"}]'
|| '[{"arch":"x64","os":"windows-latest","compiler":"clang"},{"arch":"arm64","os":"windows-11-vs2026-arm","compiler":"clang"}]') }}
needs: check_build_script
&& '[{"arch":"x64","os":"orca-win-server"}]'
|| '[{"arch":"x64","os":"windows-latest"},{"arch":"arm64","os":"windows-11-arm"}]') }}
# Don't run scheduled builds on forks:
if: ${{ !cancelled() && needs.check_build_script.result == 'success' && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
compiler: ${{ matrix.compiler }}
build-deps-only: ${{ inputs.build-deps-only || false }}
force-build: ${{ github.event_name == 'schedule' }}
secrets: inherit
@@ -169,7 +147,7 @@ jobs:
if: ${{ !cancelled() && success() && !vars.SELF_HOSTED }}
uses: ./.github/workflows/unit_tests.yml
with:
os: windows-11-vs2026-arm
os: windows-11-arm
artifact: ${{ github.sha }}-tests-windows-arm64
test-dir: build-arm64/tests
unit_tests_macos_arm64:
@@ -279,46 +257,21 @@ jobs:
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
shell: bash
- name: Compute the flatpak-builder cache key
id: fp_cache_key
run: echo "key=flatpak-builder-${{ matrix.variant.arch }}-${{ hashFiles('deps/**', 'scripts/flatpak/com.orcaslicer.OrcaSlicer.yml', 'scripts/flatpak/make_deps_tar.sh') }}" >> "$GITHUB_OUTPUT"
shell: bash
# Manage flatpak-builder cache externally so PRs restore but never upload.
# The compiler cache under it is keyed per run below, so it is left out.
# Manage flatpak-builder cache externally so PRs restore but never upload
- name: Restore flatpak-builder cache
if: github.event_name == 'pull_request'
uses: actions/cache/restore@v6
with:
path: |
.flatpak-builder/*
!.flatpak-builder/ccache
key: ${{ steps.fp_cache_key.outputs.key }}
path: .flatpak-builder
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.event.pull_request.base.sha }}
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
- name: Save/restore flatpak-builder cache
if: github.event_name != 'pull_request'
uses: actions/cache@v6
with:
path: |
.flatpak-builder/*
!.flatpak-builder/ccache
key: ${{ steps.fp_cache_key.outputs.key }}
path: .flatpak-builder
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.sha }}
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
# Compiler cache for the OrcaSlicer module, as in build_orca.yml. Pull
# requests only restore it; every other run (main, release branches, the
# nightly, a dispatch) saves it. orca_deps stays on the state cache above.
- name: Name the compiler cache leg
run: |
leg="Flatpak-${{ matrix.variant.arch }}"
echo "CCACHE_LEG=$leg" >> "$GITHUB_ENV"
echo "CCACHE_ENTRY=ccache-$leg-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_ENV"
shell: bash
- name: Restore compiler cache
id: ccache_restore
uses: actions/cache/restore@v6
with:
path: .flatpak-builder/ccache
key: ${{ env.CCACHE_ENTRY }}
restore-keys: ccache-${{ env.CCACHE_LEG }}-
- name: Disable debug info for faster CI builds
run: |
sed -i '/^build-options:/a\ no-debuginfo: true\n strip: true' \
@@ -329,87 +282,13 @@ jobs:
sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n build-options:\n env:\n git_commit_hash: \"$git_commit_hash\"|}" \
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
shell: bash
# flatpak-builder's --ccache only wraps cc and gcc, and the manifest builds
# with clang, so CMake's launcher runs ccache instead; --ccache is still what
# mounts the cache directory into the sandbox. The settings go into that
# directory's own config file, which the sandbox reads too.
- name: Enable compiler cache
run: |
printf ' %s\n' \
'CMAKE_C_COMPILER_LAUNCHER: ccache' \
'CMAKE_CXX_COMPILER_LAUNCHER: ccache' > "$RUNNER_TEMP/ccache-env.yml"
sed -i "/^ git_commit_hash: /r $RUNNER_TEMP/ccache-env.yml" \
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
grep -q '^ CMAKE_CXX_COMPILER_LAUNCHER: ccache$' scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
mkdir -p .flatpak-builder/ccache
export CCACHE_DIR=$PWD/.flatpak-builder/ccache
ccache --set-config=max_size=3G
# The compiler is reinstalled every run, so its mtime means nothing.
ccache --set-config=compiler_check=content
# Headers a fresh checkout has just written, the few files that use
# __DATE__ or __TIME__, and the precompiled header, whose macros ccache
# cannot see.
ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
# Hash the includes the compiler reports instead of preprocessing every
# miss before compiling it.
ccache --set-config=depend_mode=true
# The restored directory carries the previous run's counters.
ccache -z
shell: bash
- name: Check the manifest keeps orca_deps cacheable
run: ./scripts/flatpak/check_manifest_cacheable.sh
shell: bash
- name: Pack deps/ for the Flatpak manifest
run: ./scripts/flatpak/make_deps_tar.sh
shell: bash
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
with:
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
manifest-path: scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
# cache only turns on flatpak-builder --ccache; the caching itself is above.
cache: true
restore-cache: false
save-cache: false
cache: false
arch: ${{ matrix.variant.arch }}
upload-artifact: false
# The build has just touched everything it can use, so an object untouched
# for a week is dead, usually orphaned by a flag change.
- name: Compiler cache statistics
if: always()
run: |
export CCACHE_DIR=$PWD/.flatpak-builder/ccache
ccache --evict-older-than 7d
ccache -s -v || ccache -s
shell: bash
# Save the new entry first, then drop the older ones for this leg on this
# ref, so a failed save leaves the previous entry in place. A cancelled or
# failed build saves too, since what it compiled is still valid; a restore
# that did not finish does not, since the directory may be a truncated copy.
- name: Save compiler cache
id: ccache_save
if: ${{ always() && steps.ccache_restore.outcome == 'success' && github.event_name != 'pull_request' }}
uses: actions/cache/save@v6
with:
path: .flatpak-builder/ccache
key: ${{ env.CCACHE_ENTRY }}
- name: Drop older compiler cache entries
if: ${{ always() && steps.ccache_save.outcome == 'success' }}
# The container has no gh, so this is the list and delete over the REST API.
# Older means a lower run id, so two runs finishing close together keep
# the newer entry whichever of them cleans up last.
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
api="$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches"
curl -sSf -H "Authorization: Bearer $GH_TOKEN" \
"$api?ref=$GITHUB_REF&key=ccache-$CCACHE_LEG-&per_page=100" \
| jq -r --arg prefix "ccache-$CCACHE_LEG-" --argjson run "$GITHUB_RUN_ID" \
'.actions_caches[] | select((.key | ltrimstr($prefix) | split("-")[0] | tonumber?) < $run) | .id' \
| while read -r id; do
curl -sSf -X DELETE -H "Authorization: Bearer $GH_TOKEN" "$api/$id"
done
shell: bash
- name: Upload artifacts Flatpak
uses: actions/upload-artifact@v7
with:
+4 -9
View File
@@ -9,10 +9,6 @@ on:
arch:
required: false
type: string
compiler:
required: false
type: string
default: msvc
build-deps-only:
required: false
type: boolean
@@ -37,10 +33,10 @@ jobs:
- name: set outputs
id: set_outputs
env:
# Anything that changes how the tree is built belongs in the key, or a job
# restores one it cannot use. Linux amd64 passes no arch deliberately, so
# 'linux-clang' keeps the cache it already has.
cache-os: ${{ runner.os == 'macOS' && format('macos-{0}', inputs.arch) || (runner.os == 'Windows' && format('windows-{0}-{1}', inputs.arch, inputs.compiler) || format('linux-clang{0}', inputs.arch && format('-{0}', inputs.arch) || '')) }}
# Keep macOS/Windows cache keys architecture-specific. amd64 Linux passes
# no arch (key stays 'linux-clang', preserving the existing cache);
# aarch64 gets its own 'linux-clang-aarch64' key.
cache-os: ${{ runner.os == 'macOS' && format('macos-{0}', inputs.arch) || (runner.os == 'Windows' && format('windows-{0}', inputs.arch) || format('linux-clang{0}', inputs.arch && format('-{0}', inputs.arch) || '')) }}
# ARM64 builds use the build-arm64 tree (see build_release_vs.bat); x64/other use build.
dep-folder-name: ${{ runner.os == 'macOS' && format('/{0}', inputs.arch) || (runner.os == 'Windows' && inputs.arch == 'arm64') && '-arm64/OrcaSlicer_dep' || '/OrcaSlicer_dep' }}
output-cmd: ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
@@ -66,7 +62,6 @@ jobs:
valid-cache: ${{ needs.check_cache.outputs.valid-cache == 'true' }}
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
compiler: ${{ inputs.compiler }}
build-deps-only: ${{ inputs.build-deps-only }}
force-build: ${{ inputs.force-build }}
secrets: inherit
+4 -20
View File
@@ -16,10 +16,6 @@ on:
arch:
required: false
type: string
compiler:
required: false
type: string
default: msvc
build-deps-only:
required: false
type: boolean
@@ -139,22 +135,11 @@ jobs:
choco install strawberryperl
}
$arch = "${{ inputs.arch }}"
# -l selects clang-cl and -x Ninja; together they build the deps with clang.
$clang = "${{ inputs.compiler }}" -eq "clang"
$flags = if ($clang) { "-l", "-x" } else { @() }
if ($clang) {
# OpenSSL builds with nmake, which needs a VC environment.
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$devArch = if ($arch -eq "arm64") { "arm64" } else { "amd64" }
Import-Module "$vs\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath $vs -SkipAutomaticLocation -DevCmdArguments "-arch=$devArch"
}
if ($arch -eq "arm64") {
.\build_release_vs.bat deps arm64 @flags
.\build_release_vs.bat deps arm64
.\build_release_vs.bat pack arm64
} else {
.\build_release_vs.bat deps @flags
.\build_release_vs.bat deps
.\build_release_vs.bat pack
}
shell: pwsh
@@ -164,9 +149,9 @@ jobs:
working-directory: ${{ github.workspace }}
run: |
if [ -z "${{ vars.SELF_HOSTED }}" ]; then
brew install automake texinfo libtool pkgconf yasm nasm
brew install automake texinfo libtool
fi
./build_release_macos.sh -dx ${{ !vars.SELF_HOSTED && '-j 3' || '' }} -a ${{ inputs.arch }} -t 10.15
./build_release_macos.sh -dx ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15
(cd "${{ github.workspace }}/deps/build/${{ inputs.arch }}" && \
find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +)
@@ -219,5 +204,4 @@ jobs:
cache-path: ${{ inputs.cache-path }}
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
compiler: ${{ inputs.compiler }}
secrets: inherit
+3 -139
View File
@@ -13,10 +13,6 @@ on:
arch:
required: false
type: string
compiler:
required: false
type: string
default: msvc
macos-combine-only:
required: false
type: boolean
@@ -76,60 +72,6 @@ jobs:
if (-not (Test-Path "$cmakeBin\cmake.exe")) { throw "cmake.exe not found at $cmakeBin" }
Add-Content -Path $env:GITHUB_PATH -Value $cmakeBin
# Compiler cache. Pushes save it, so main keeps it warm; pull requests
# restore it and discard what they compiled. Objects are keyed on the
# preprocessed source, the compiler and the flags, so a leg only ever
# hits its own entries. A failed install costs the caching, not the build.
- name: Name the compiler cache leg
if: ${{ !inputs.macos-combine-only }}
shell: bash
run: |
leg="${{ runner.os }}-${{ inputs.arch || 'amd64' }}${{ runner.os == 'Windows' && format('-{0}', inputs.compiler) || '' }}"
echo "CCACHE_LEG=$leg" >> "$GITHUB_ENV"
echo "CCACHE_ENTRY=ccache-$leg-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_ENV"
# The action only installs and configures ccache. Restore and save go
# through actions/cache with one path string, since the cache service
# only matches entries saved under the identical path and the action
# spells it differently on Windows.
- name: Compiler cache
id: ccache
if: ${{ !inputs.macos-combine-only }}
continue-on-error: true
uses: hendrikmuhs/ccache-action@v1.2.24
with:
key: ${{ env.CCACHE_LEG }}
max-size: 3G
restore: false
save: false
# ccache -s runs as its own step; no summary table per job.
job-summary: ''
- name: Restore compiler cache
id: ccache_restore
if: ${{ steps.ccache.outcome == 'success' }}
uses: actions/cache/restore@v6
with:
path: ${{ github.workspace }}/.ccache
key: ${{ env.CCACHE_ENTRY }}
restore-keys: ccache-${{ env.CCACHE_LEG }}-
- name: Enable compiler cache
if: ${{ steps.ccache.outcome == 'success' }}
shell: bash
run: |
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> "$GITHUB_ENV"
echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> "$GITHUB_ENV"
# Headers a fresh checkout has just written, the few files that
# use __DATE__ or __TIME__, and the precompiled header, whose
# macros ccache cannot see.
echo "CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime" >> "$GITHUB_ENV"
# Hash the includes the compiler reports instead of preprocessing
# every miss before compiling it.
echo "CCACHE_DEPEND=1" >> "$GITHUB_ENV"
# The restored directory carries the previous run's counters.
ccache -z
- name: Get the version and date on Ubuntu and macOS
if: runner.os != 'Windows'
run: |
@@ -203,7 +145,7 @@ jobs:
env:
ORCA_TESTS_BUILD_ONLY: ${{ inputs.arch == 'arm64' && '1' || '' }}
run: |
./build_release_macos.sh -s -n -x ${{ !vars.SELF_HOSTED && '-j 3' || '' }} -a ${{ inputs.arch }} -t 10.15 ${{ inputs.arch == 'arm64' && '-T' || '' }}
./build_release_macos.sh -s -n -x ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15 ${{ inputs.arch == 'arm64' && '-T' || '' }}
- name: Pack unit tests mac
if: runner.os == 'macOS' && !inputs.macos-combine-only && inputs.arch == 'arm64'
@@ -220,14 +162,6 @@ jobs:
retention-days: 5
if-no-files-found: error
- name: Build system preset cache (macOS)
if: runner.os == 'macOS' && !inputs.macos-combine-only
working-directory: ${{ github.workspace }}
shell: bash
# The bundle was already packed from resources/, so the caches have to be
# installed into it here; the source tree keeps its JSONs for later jobs.
run: ./scripts/build_preset_cache.sh -b build/${{ inputs.arch }} build/${{ inputs.arch }}/OrcaSlicer/OrcaSlicer.app/Contents/Resources/profiles
- name: Pack macOS app bundle ${{ inputs.arch }}
if: runner.os == 'macOS' && !inputs.macos-combine-only
working-directory: ${{ github.workspace }}
@@ -262,7 +196,7 @@ jobs:
if: runner.os == 'macOS' && inputs.macos-combine-only
working-directory: ${{ github.workspace }}
run: |
./build_release_macos.sh -u -x ${{ !vars.SELF_HOSTED && '-j 3' || '' }} -a universal -t 10.15
./build_release_macos.sh -u -x ${{ !vars.SELF_HOSTED && '-1' || '' }} -a universal -t 10.15
# Thanks to RaySajuuk, it's working now
- name: Sign app and notary
@@ -453,27 +387,9 @@ jobs:
# "tests" builds the unit tests too; the unit_tests_windows_* jobs run them.
run: |
$arch = "${{ inputs.arch }}"
# -l selects clang-cl and -x Ninja; together they build the slicer with clang.
$clang = "${{ inputs.compiler }}" -eq "clang"
$flags = if ($clang) { "-l", "-x" } else { @() }
if ($clang) {
# Build against the same VC toolchain and SDK as the dependencies.
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$devArch = if ($arch -eq "arm64") { "arm64" } else { "amd64" }
Import-Module "$vs\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath $vs -SkipAutomaticLocation -DevCmdArguments "-arch=$devArch"
}
if ($arch -eq "arm64") { .\build_release_vs.bat slicer arm64 @flags tests } else { .\build_release_vs.bat slicer @flags tests }
if ($arch -eq "arm64") { .\build_release_vs.bat slicer arm64 tests } else { .\build_release_vs.bat slicer tests }
shell: pwsh
- name: Build system preset cache (Windows)
if: runner.os == 'Windows'
shell: cmd
# Shipped into both the already-installed tree (portable zip, MSIX) and
# the checkout cpack re-installs from when it builds the NSIS installer.
run: scripts\build_preset_cache.bat --prune-source "%BUILD_DIR%" "resources\profiles" "%BUILD_DIR%\OrcaSlicer\resources\profiles"
- name: Pack unit tests Win
if: runner.os == 'Windows'
working-directory: ${{ github.workspace }}
@@ -623,20 +539,6 @@ jobs:
retention-days: 5
if-no-files-found: error
- name: Build system preset cache (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
# Both were packed from resources/ before the caches existed, so the
# AppImage is unpacked first and the caches shipped into it and into
# the package tree; the source tree keeps its JSONs for later steps.
appimage=$(find build -maxdepth 1 -name "OrcaSlicer_Linux_AppImage*.AppImage" | head -1)
chmod +x "$appimage"
"$appimage" --appimage-extract
./scripts/build_preset_cache.sh -b build build/package/resources/profiles squashfs-root/resources/profiles
appimagetool=$(find build -name "appimagetool.AppImage" | head -1)
ARCH=$(uname -m) "$appimagetool" --appimage-extract-and-run squashfs-root "$appimage"
rm -rf squashfs-root
# Ship the freshly-built validator so slice_check_linux (build_all.yml)
# can slice-sweep the shipped profiles with this PR's engine. Taken from
# the aarch64 leg so the sweep also exercises the arm build; x86_64 on
@@ -724,41 +626,3 @@ jobs:
asset_name: orca_custom_preset_tests.zip
asset_content_type: application/octet-stream
max_releases: 1
# The build has just touched everything it can use, so an object
# untouched for a week is dead, usually orphaned by a flag change.
- name: Compiler cache statistics
if: ${{ always() && steps.ccache.outcome == 'success' }}
shell: bash
run: |
ccache --evict-older-than 7d
ccache -s -v || ccache -s
# Entries are immutable, so the new one is saved first and the older
# ones for this leg on this ref are dropped afterwards: a failed save
# leaves the previous entry in place. A cancelled or failed build saves
# too, since what it compiled is still valid; a restore that did not
# finish does not, since the directory may be a truncated copy.
- name: Save compiler cache
id: ccache_save
if: ${{ always() && steps.ccache_restore.outcome == 'success' && github.event_name != 'pull_request' }}
uses: actions/cache/save@v6
with:
path: ${{ github.workspace }}/.ccache
key: ${{ env.CCACHE_ENTRY }}
- name: Drop older compiler cache entries
if: ${{ always() && steps.ccache_save.outcome == 'success' }}
# A read-only token (fork PRs) cannot delete; that only costs storage.
# Older means a lower run id, so two runs finishing close together keep
# the newer entry whichever of them cleans up last.
continue-on-error: true
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh cache list --ref "$GITHUB_REF" --key "ccache-$CCACHE_LEG-" --limit 100 --json id,key \
| jq -r --arg prefix "ccache-$CCACHE_LEG-" --argjson run "$GITHUB_RUN_ID" \
'.[] | select((.key | ltrimstr($prefix) | split("-")[0] | tonumber?) < $run) | .id' \
| tr -d '\r' \
| while read -r id; do gh cache delete "$id"; done
+4 -15
View File
@@ -1,18 +1,10 @@
name: Check profiles
on:
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
# into a release branch would run no profile validation at all.
branches:
- main
- release/*
paths:
- 'resources/profiles/**'
# The extra JSON check also validates resources/printers/bambu_filament_ids.json,
# and lives in scripts/, so a PR touching only those must still run this workflow.
- 'resources/printers/**'
- 'scripts/**'
- ".github/workflows/check_profiles.yml"
workflow_dispatch:
@@ -28,8 +20,6 @@ permissions:
jobs:
check_profiles:
# This job name is the check-run name pr-merge-bot.yml requires before a
# delegated merge. Renaming it silently disables that gate.
name: Check profiles
runs-on: ubuntu-24.04
steps:
@@ -68,14 +58,13 @@ jobs:
set +e
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -s -l 2 2>&1 | tee ${{ runner.temp }}/validate_slice.log
exit ${PIPESTATUS[0]}
# All vendors' filament_id collisions were fixed (see scripts/filament_id_snapshot.json),
# so the duplicate-filament-subtype check runs tree-wide.
- name: validate filament subtype check
# For now run filament subtype check only for BBL profiles until we fix other vendors' profiles.
- name: validate filament subtype check for BBL profiles
id: validate_filament_subtypes
continue-on-error: true
run: |
set +e
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 -f 2>&1 | tee ${{ runner.temp }}/validate_filament_subtypes.log
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 -v BBL -f 2>&1 | tee ${{ runner.temp }}/validate_filament_subtypes.log
exit ${PIPESTATUS[0]}
- name: validate custom presets
@@ -222,7 +211,7 @@ jobs:
fi
if [ "${{ steps.validate_filament_subtypes.outcome }}" = "failure" ]; then
echo "### Filament Subtype Validation Failed"
echo "### BBL Filament Subtype Validation Failed"
echo ""
echo '```'
head -c 30000 ${{ runner.temp }}/validate_filament_subtypes.log || echo "No output captured"
+5 -12
View File
@@ -19,18 +19,11 @@ jobs:
permissions:
contents: read
steps:
# Doxygen with call graphs over all of src/ outgrows the runner's RAM;
# replace the runner's swapfile with an 8 GB one.
- name: Grow swap space
run: |
set -euo pipefail
sudo swapoff -a
sudo rm -f /swapfile
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h
- uses: thejerrybao/setup-swap-space@v1
with:
swap-space-path: /swapfile
swap-size-gb: 8
remove-existing-swap-files: true
- name: Checkout repository
uses: actions/checkout@v7
-219
View File
@@ -1,219 +0,0 @@
# Nightly parity checks from OrcaSlicer/orca-test-repo, kept out of the
# per-build "Run external slicer regression tests" step because they take far
# longer than that step's budget:
# effect - the CLI override sweep's full effect stage: every landed option
# re-sliced on its own to see whether it changes the G-code
# harness - the GUI-vs-CLI parity harness (metrics only, never fails)
# Both test the latest successful build_all.yml Linux AppImage from main, with
# sources checked out at the commit that build was made from. Nothing here
# gates a build or a PR.
name: Parity Nightly
on:
schedule:
# build_all.yml starts at 17:00 UTC and has finished by ~20:00
- cron: "0 21 * * *"
workflow_dispatch:
inputs:
test_repo_ref:
description: "orca-test-repo ref to run"
required: false
default: "main"
build_branch:
description: "branch whose latest successful build_all artifact to test"
required: false
default: "main"
fixtures:
description: "harness fixture ids, space-separated (empty = all)"
required: false
default: ""
cli_presets:
description: "harness lane C presets: flat = flatten inherits first, raw = leaf profile as-is"
required: false
default: "flat"
permissions:
contents: read
actions: read
jobs:
build:
name: Find the build to test
# Don't run scheduled checks on forks
if: github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer'
runs-on: ubuntu-24.04
outputs:
run_id: ${{ steps.find.outputs.run_id }}
head_sha: ${{ steps.find.outputs.head_sha }}
steps:
- id: find
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
gh run list --workflow build_all.yml \
--branch "${{ inputs.build_branch || 'main' }}" \
--status success --limit 1 --json databaseId,headSha \
--jq '"run_id=\(.[0].databaseId)\nhead_sha=\(.[0].headSha)"' \
>> "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
effect:
name: Override sweep effect stage (shard ${{ matrix.shard }})
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# orca-test-repo's parity/effect_routing.json holds a 2-way split,
# ~12.5 min a shard on this runner
shard: [0, 1]
steps:
- &checkout-suite
name: Check out the test suite
uses: actions/checkout@v7
with:
repository: OrcaSlicer/orca-test-repo
ref: ${{ inputs.test_repo_ref || 'main' }}
path: orca-test-repo
# The AppImage ships only packed preset caches, so profiles and the CLI
# option surface come from the sources the build was made from
- &checkout-slicer
name: Check out OrcaSlicer at the build's commit
uses: actions/checkout@v7
with:
ref: ${{ needs.build.outputs.head_sha }}
path: slicer
lfs: 'false'
- &extract-appimage
name: Download and extract the Linux AppImage
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
gh run download "${{ needs.build.outputs.run_id }}" --dir appimage \
--pattern "OrcaSlicer_Linux_ubuntu_2404*"
appimage=$(find appimage -name "*.AppImage" ! -name "*aarch64*" | head -1)
[ -n "$appimage" ] || { echo "no x86_64 AppImage in run ${{ needs.build.outputs.run_id }}"; exit 1; }
chmod +x "$appimage"
"$appimage" --appimage-extract > /dev/null
# The bare binary cannot find the AppImage's bundled libraries; AppRun
# sets them up and execs it, so exit codes and signals pass through
[ -x squashfs-root/AppRun ] || { echo "no AppRun in the AppImage"; exit 1; }
echo "ORCA_BIN=$PWD/squashfs-root/AppRun" >> "$GITHUB_ENV"
echo "ORCA_SOURCE=$PWD/slicer" >> "$GITHUB_ENV"
- name: Install the AppImage's host runtime dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libopengl0 libglu1-mesa libgl1 libegl1 libwebkit2gtk-4.1-0
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install suite dependencies
run: pip install -r orca-test-repo/requirements.txt
- name: Run the override sweep with the full effect stage
id: run
continue-on-error: true
working-directory: orca-test-repo
run: |
set -o pipefail
# -rA keeps the per-stage summaries, which pytest otherwise swallows
# for passing tests
python -m pytest test_cli_overrides.py -c pytest.ini -v -rA \
--effect-full --effect-shard ${{ matrix.shard }}/2 \
--orca-bin "$ORCA_BIN" --orca-source "$ORCA_SOURCE" \
2>&1 | tee ../sweep.log
- name: Publish job summary
if: always()
run: |
{
echo "## Override sweep effect stage, shard ${{ matrix.shard }}/2"
echo "Build ${{ needs.build.outputs.head_sha }} (run ${{ needs.build.outputs.run_id }})"
echo '```'
grep -E "\[override sweep" sweep.log || echo "no stage summaries, see the log"
grep -E "^=+ .*(passed|failed)" sweep.log | tail -1 || true
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload the override report
if: always()
uses: actions/upload-artifact@v7
with:
name: override-report-shard${{ matrix.shard }}
path: |
orca-test-repo/.pytest_cache/override_report.json
sweep.log
if-no-files-found: warn
retention-days: 30
# The sweep step continues on error so the summary and report still get
# published; this puts the failure back on the job
- name: Fail the job if the sweep failed
if: steps.run.outcome == 'failure'
run: |
echo "the override sweep failed, see the job summary and the uploaded report" >&2
exit 1
harness:
name: GUI-vs-CLI parity harness
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 180
steps:
- *checkout-suite
- *checkout-slicer
- *extract-appimage
- name: Install display tooling and the AppImage's host runtime
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
xvfb xdotool imagemagick openbox mesa-utils \
libopengl0 libglu1-mesa libgl1 libegl1 libwebkit2gtk-4.1-0
- name: Run the parity harness
run: |
set -euo pipefail
fixtures=()
for f in ${{ inputs.fixtures || '' }}; do
fixtures+=(--fixture "$f")
done
# 2 GUI displays: ~1.5 cores peak / ~1.9 GB on this 4-vCPU runner,
# and each fixture is fully isolated, so results match a serial run
python3 orca-test-repo/parity/run_parity.py \
--slicer-root "$ORCA_SOURCE" --bin "$ORCA_BIN" \
--cli-presets "${{ inputs.cli_presets || 'flat' }}" \
--gui-workers 2 --out "$PWD/parity-out" "${fixtures[@]}"
- name: Publish job summary
if: always()
run: |
if [ -f parity-out/report.md ]; then
cat parity-out/report.md >> "$GITHUB_STEP_SUMMARY"
else
echo "the harness produced no report, see the log" >> "$GITHUB_STEP_SUMMARY"
fi
- name: Drop per-lane datadirs before upload
if: always()
run: rm -rf parity-out/*/seed parity-out/*/datadir-* || true
- name: Upload the scorecard and evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: parity-scorecard
path: parity-out/
if-no-files-found: warn
retention-days: 30
+8 -24
View File
@@ -32,21 +32,13 @@ jobs:
}
const allowedLabels = [
// kind of change
'crash',
'bug-fix',
'enhancement',
'QoL',
'optimization',
// area
'UI/UX',
'profile',
'Localization',
// infrastructure
'build',
'test',
'dependencies',
'documentation'
'profile',
'QoL',
'UI/UX',
'dependencies'
];
const pr = context.payload.pull_request;
const labelsList = `${allowedLabels
@@ -190,21 +182,13 @@ jobs:
}
const allowedLabels = [
// kind of change
'crash',
'bug-fix',
'enhancement',
'QoL',
'optimization',
// area
'UI/UX',
'profile',
'Localization',
// infrastructure
'build',
'test',
'dependencies',
'documentation'
'profile',
'QoL',
'UI/UX',
'dependencies'
];
const issue = context.payload.issue;
-510
View File
@@ -1,510 +0,0 @@
name: PR Merge Bot
# Merges a pull request on request from a delegated vendor profile maintainer.
# The merge is performed by this workflow's GITHUB_TOKEN, so a delegate needs no
# repository access.
#
# Commands, posted as a comment on the PR:
# /bot merge squash-merge the PR
# /bot merge --dry-run report the verdict without merging
#
# Merges only when the commenter holds a grant covering every changed path, the
# PR targets main or release/*, and CI is green on the head commit. Otherwise it
# comments naming the files that fell outside the grant.
#
# Grants come from the FOLDER_MERGERS variable in the `merge-delegation`
# environment: one per line, `account: path`, `#` comments and blank lines
# allowed. Paths may contain spaces. A vendor takes two grants, the folder and
# its sibling bundle JSON:
#
# # Acme profiles
# vendor-maintainer: resources/profiles/Acme/
# vendor-maintainer: resources/profiles/Acme.json
#
# Edit the grant list (environment scope, so admin only):
# gh variable set FOLDER_MERGERS --env merge-delegation --body "$(cat folder-mergers.txt)"
# gh variable get FOLDER_MERGERS --env merge-delegation
#
# Stop all merging without touching this file:
# gh variable set MERGE_BOT_DRY_RUN --body true
on:
issue_comment:
types:
- created
# One merge attempt per PR at a time, so two quick comments cannot race.
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
cancel-in-progress: false
jobs:
merge:
# Skips the job unless a PR comment mentions the command.
if: >-
github.repository == 'OrcaSlicer/OrcaSlicer'
&& github.event.issue.pull_request != null
&& contains(github.event.comment.body, '/bot merge')
permissions:
contents: write # pulls.merge
pull-requests: write # pulls.merge
issues: write # feedback comment + reactions
actions: write # re-dispatch build_all.yml after the merge
runs-on: ubuntu-latest
timeout-minutes: 10
# Supplies FOLDER_MERGERS. Must carry no protection rules, or every
# delegated merge would wait for a human reviewer.
environment: merge-delegation
steps:
- name: Merge PR on behalf of a folder delegate
uses: actions/github-script@v9
env:
# Read as env vars, never interpolated into the script body.
FOLDER_MERGERS: ${{ vars.FOLDER_MERGERS }}
MERGE_BOT_DRY_RUN: ${{ vars.MERGE_BOT_DRY_RUN }}
with:
script: |
function isPermissionDenied(error) {
return error && error.status === 403 && /Resource not accessible by integration/i.test(error.message || '');
}
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const MARKER = '<!-- pr-merge-bot -->';
// No grant may reach outside this root.
const DELEGATABLE_ROOT = 'resources/profiles/';
const ALLOWED_BASE_BRANCH = /^(?:main|release\/.+)$/;
const MERGE_METHOD = 'squash';
const REQUIRED_CHECK = 'Check profiles'; // job name in check_profiles.yml
const MAX_CHANGED_FILES = 500; // policy cap, well under listFiles' 3000
const LISTFILES_CAP = 3000;
const MAX_REPORTED_FILES = 12;
const MERGEABLE_ATTEMPTS = 5;
const MERGEABLE_DELAY_MS = 2000;
const OK_CONCLUSIONS = new Set(['success', 'neutral', 'skipped']);
const REGULAR_FILE_MODES = new Set(['100644', '100755']);
// Paths refused whatever the grants say. Checked before grants, so
// delegating a new root means removing it from this list too.
const DENIED_PATTERNS = [
/^\.github\//,
/(^|\/)\.git(attributes|modules|ignore|config)$/,
/^(?:src|deps|deps_src|tests|tools|cmake|sandboxes|scripts|docs?|localization|bbl)\//,
/(^|\/)cmakelists\.txt$/,
/\.cmake$/,
/^build_[^/]*\.(?:sh|bat)$/,
/^version\.inc$/,
// Executables, including those inside the delegatable root.
/\.(?:sh|bash|bat|cmd|ps1|py|js|mjs|cjs|ts|rb|pl|php)$/
];
function parseGrants(raw) {
// GitHub login: 1-39 chars, alphanumerics with single interior hyphens.
const loginPattern = /^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$/;
const grantsByLogin = new Map();
const problems = [];
(raw || '').split(/\r?\n/).forEach((rawLine, index) => {
const line = rawLine.trim();
if (!line || line.startsWith('#')) {
return;
}
// Splits on the first colon only, so paths may contain ':' and spaces.
const separator = line.indexOf(':');
if (separator === -1) {
problems.push(`line ${index + 1}: expected \`account: path\``);
return;
}
const login = line.slice(0, separator).trim().replace(/^@/, '');
const path = line.slice(separator + 1).trim().replace(/\/+$/, '');
if (!loginPattern.test(login)) {
problems.push(`line ${index + 1}: \`${login}\` is not a valid GitHub account name`);
return;
}
if (/[\\*?\u0000-\u001f\u007f]/.test(path) || path.split('/').includes('..') || path.includes('//')) {
problems.push(`line ${index + 1}: invalid path (no globs, \`..\`, \`//\`, backslashes or control characters)`);
return;
}
// Rejects anything outside the root, and the bare root itself.
if (!path.startsWith(DELEGATABLE_ROOT) || path.length <= DELEGATABLE_ROOT.length) {
problems.push(`line ${index + 1}: \`${path}\` is not inside \`${DELEGATABLE_ROOT}\``);
return;
}
const key = login.toLowerCase();
grantsByLogin.set(key, (grantsByLogin.get(key) || []).concat(path));
});
return { grantsByLogin, problems };
}
function isDenied(path) {
if (/[\\\u0000-\u001f\u007f]/.test(path) || path.startsWith('/') || path.split('/').includes('..')) {
return true;
}
const normalized = path.normalize('NFKC').toLowerCase();
return DENIED_PATTERNS.some((pattern) => pattern.test(normalized));
}
// Byte-exact match on directory boundaries, so a grant of
// `.../Acme` covers neither `.../Acme Labs/x.json` nor `.../Acme.json`.
function isGranted(path, grants) {
return grants.some((grant) => path === grant || path.startsWith(`${grant}/`));
}
// Both endpoints of a rename; both must satisfy the grant.
function pathsFor(file) {
return [file.filename, file.previous_filename].filter(Boolean);
}
function formatList(items) {
const unique = [...new Set(items)];
const shown = unique.slice(0, MAX_REPORTED_FILES).map((item) => `- \`${item}\``);
if (unique.length > MAX_REPORTED_FILES) {
shown.push(`- …and ${unique.length - MAX_REPORTED_FILES} more`);
}
return shown.join('\n');
}
const { owner, repo } = context.repo;
const issue = context.payload.issue;
const comment = context.payload.comment;
if (!issue.pull_request) {
core.info('Ignoring comment that is not on a pull request.');
return;
}
// Ignores a comment whose sender is not its author.
if (context.payload.action !== 'created' || context.payload.sender.login !== comment.user.login) {
core.warning('Ignoring comment whose sender does not match its author.');
return;
}
if (comment.user.type !== 'User') {
core.info('Ignoring bot-authored command.');
return;
}
const commandLine = (comment.body || '')
.split('\n')
.map((line) => line.trim())
.find((line) => /^\/bot\s+merge\b/i.test(line));
if (!commandLine) {
core.info('No /bot merge command found.');
return;
}
const commenter = comment.user.login;
const { grantsByLogin, problems } = parseGrants(process.env.FOLDER_MERGERS);
const grants = grantsByLogin.get(commenter.toLowerCase()) || [];
for (const problem of problems) {
core.warning(`FOLDER_MERGERS ${problem}`);
}
// Says nothing to accounts with no grant, so it cannot be used to spam.
if (!grants.length) {
core.info(`Ignoring /bot merge from @${commenter}: not listed in FOLDER_MERGERS.`);
return;
}
// Warns instead of failing when the token cannot post feedback.
async function bestEffort(call, warning) {
try {
await call();
} catch (error) {
if (isPermissionDenied(error)) {
core.warning(warning);
return;
}
throw error;
}
}
const react = (content) => bestEffort(
() => github.rest.reactions.createForIssueComment({ owner, repo, comment_id: comment.id, content }),
`Cannot add the "${content}" reaction because the token cannot write.`);
const say = (body) => bestEffort(
() => github.rest.issues.createComment({ owner, repo, issue_number: issue.number, body: `${MARKER}\n${body}` }),
'Cannot post a comment because the token cannot write comments.');
// Declines the command: warns in the log, reacts, explains on the PR.
async function refuse(reason) {
const configNote = problems.length
? `\n\n\`FOLDER_MERGERS\` also has problems a maintainer needs to fix:\n${problems.map((problem) => `- ${problem}`).join('\n')}`
: '';
const grantsNote = `\n\n<details><summary>Your current grants</summary>\n\n${formatList(grants)}\n\n</details>`;
core.warning(`Refused /bot merge from @${commenter}: ${reason}`);
await react('-1');
await say(`@${commenter} I can't merge this PR: ${reason}${configNote}${grantsNote}`);
}
await react('eyes');
const args = (commandLine.match(/^\/bot\s+merge\s*(.*)$/i)[1] || '').trim().split(/\s+/).filter(Boolean);
const unknownArgs = args.filter((arg) => arg.toLowerCase() !== '--dry-run');
const dryRun = String(process.env.MERGE_BOT_DRY_RUN || '').toLowerCase() === 'true'
|| unknownArgs.length !== args.length;
if (unknownArgs.length) {
return refuse(
`I don't understand ${unknownArgs.map((arg) => `\`${arg}\``).join(', ')}. ` +
'Usage: `/bot merge` or `/bot merge --dry-run`.'
);
}
// Refuses everything while the grant list is malformed.
if (problems.length) {
return refuse(
'the `FOLDER_MERGERS` grant list has malformed lines, so I refuse every merge until it is fixed.'
);
}
let { data: pr } = await github.rest.pulls.get({
owner,
repo,
pull_number: issue.number
});
if (pr.merged) {
return refuse('it is already merged.');
}
if (pr.state !== 'open') {
return refuse(`its state is \`${pr.state}\`, not \`open\`.`);
}
if (pr.draft) {
return refuse('it is still a draft. Mark it ready for review first.');
}
if (!ALLOWED_BASE_BRANCH.test(pr.base.ref)) {
return refuse(`it targets \`${pr.base.ref}\`. Delegated merges are only allowed into \`main\` and \`release/*\`.`);
}
// ---- folder scope ----
const files = await github.paginate(github.rest.pulls.listFiles, {
owner,
repo,
pull_number: pr.number,
per_page: 100
});
if (!files.length) {
return refuse('it changes no files, so there is nothing to verify or merge.');
}
// Refuses when the file list is truncated or disagrees with the PR.
if (files.length >= LISTFILES_CAP || files.length !== pr.changed_files) {
return refuse(
`it reports ${pr.changed_files} changed files but the API listed ${files.length}, ` +
'so the file list is truncated and I cannot verify the folder scope. A maintainer must merge this one.'
);
}
if (pr.changed_files > MAX_CHANGED_FILES) {
return refuse(`it changes ${pr.changed_files} files; delegated merges are capped at ${MAX_CHANGED_FILES}.`);
}
const deniedFiles = [];
const outsideFiles = [];
for (const file of files) {
for (const path of pathsFor(file)) {
if (isDenied(path)) {
deniedFiles.push(path);
} else if (!isGranted(path, grants)) {
outsideFiles.push(path);
}
}
}
if (deniedFiles.length) {
core.error(`@${commenter} attempted a delegated merge touching protected paths: ${deniedFiles.join(', ')}`);
return refuse(
'it touches paths that are never delegatable, whatever the grants say ' +
`(CI, build, scripts or executable files):\n\n${formatList(deniedFiles)}\n\nA maintainer should look at this before it goes any further.`
);
}
if (outsideFiles.length) {
return refuse(
`${outsideFiles.length} changed path(s) fall outside your grants:\n\n${formatList(outsideFiles)}\n\n` +
'A vendor needs both grants: `resources/profiles/<Vendor>/` **and** `resources/profiles/<Vendor>.json`.'
);
}
// ---- file modes: rejects symlinks and submodules ----
// Fetches the delegatable subtree only; listFiles does not report modes.
const headSha = pr.head.sha;
const { data: tree } = await github.rest.git.getTree({
owner,
repo,
tree_sha: `${headSha}:${DELEGATABLE_ROOT.replace(/\/$/, '')}`,
recursive: 'true'
});
if (tree.truncated) {
return refuse('the git tree is too large to verify file modes. A maintainer must merge this one.');
}
// Entry paths are subtree-relative.
const modesByPath = new Map(tree.tree.map((entry) => [`${DELEGATABLE_ROOT}${entry.path}`, entry.mode]));
const irregularFiles = files
.filter((file) => file.status !== 'removed')
.map((file) => [file.filename, modesByPath.get(file.filename)])
.filter(([, mode]) => !REGULAR_FILE_MODES.has(mode))
.map(([path, mode]) => `${path} (mode ${mode || 'missing'})`);
if (irregularFiles.length) {
core.error(`@${commenter} attempted a delegated merge with non-regular files: ${irregularFiles.join(', ')}`);
return refuse(
`it adds symlinks, submodules or files I cannot verify:\n\n${formatList(irregularFiles)}\n\nA maintainer should look at this before it goes any further.`
);
}
// ---- mergeability: waits for GitHub to compute it ----
for (let attempt = 0; pr.mergeable === null && attempt < MERGEABLE_ATTEMPTS; attempt += 1) {
core.info(`Mergeability not computed yet; retrying in ${MERGEABLE_DELAY_MS}ms.`);
await sleep(MERGEABLE_DELAY_MS);
({ data: pr } = await github.rest.pulls.get({
owner,
repo,
pull_number: pr.number
}));
}
if (pr.mergeable === null) {
return refuse('GitHub is still working out whether it can be merged. Try `/bot merge` again in a minute.');
}
if (!pr.mergeable) {
return refuse(`it is not mergeable (\`${pr.mergeable_state}\`) - most likely a conflict with \`${pr.base.ref}\`.`);
}
// ---- CI on the head commit ----
const checkRuns = await github.paginate(github.rest.checks.listForRef, {
owner,
repo,
ref: headSha,
filter: 'latest',
per_page: 100
});
const pendingChecks = checkRuns.filter((run) => run.status !== 'completed');
const failedChecks = checkRuns.filter((run) => run.status === 'completed' && !OK_CONCLUSIONS.has(run.conclusion));
if (pendingChecks.length) {
return refuse(
`${pendingChecks.length} check(s) are still running on \`${headSha.slice(0, 7)}\`:\n\n` +
`${formatList(pendingChecks.map((run) => run.name))}\n\nRe-run \`/bot merge\` once they finish.`
);
}
if (failedChecks.length) {
return refuse(
`${failedChecks.length} check(s) are not green on \`${headSha.slice(0, 7)}\`:\n\n` +
formatList(failedChecks.map((run) => `${run.name} (${run.conclusion})`))
);
}
const { data: combined } = await github.rest.repos.getCombinedStatusForRef({
owner,
repo,
ref: headSha
});
// total_count 0 only means there are no legacy statuses.
if (combined.total_count > 0 && combined.state !== 'success') {
return refuse(
`the combined commit status on \`${headSha.slice(0, 7)}\` is \`${combined.state}\`:\n\n` +
formatList(combined.statuses.filter((status) => status.state !== 'success')
.map((status) => `${status.context} (${status.state})`))
);
}
// Requires the check to have actually run, not merely to have not failed.
const requiredCheck = checkRuns.find((run) =>
run.name === REQUIRED_CHECK &&
run.app && run.app.slug === 'github-actions' &&
run.status === 'completed' && OK_CONCLUSIONS.has(run.conclusion));
if (!requiredCheck) {
return refuse(
`the \`${REQUIRED_CHECK}\` check has not succeeded on \`${headSha.slice(0, 7)}\`. ` +
'If it never ran, a maintainer needs to approve the workflow run first.'
);
}
const scopeSummary = `${files.length} file(s), all within:\n${formatList(grants)}`;
if (dryRun) {
core.info('Dry run: every gate passed, not merging.');
await react('+1');
await say(
`@${commenter} **dry run** - this PR passes every gate and I *would* squash-merge it ` +
`at \`${headSha.slice(0, 7)}\`.\n\nVerified scope: ${scopeSummary}`
);
return;
}
// ---- re-validate, then merge ----
// An unchanged head SHA means the verified file list still holds.
const { data: fresh } = await github.rest.pulls.get({
owner,
repo,
pull_number: pr.number
});
if (fresh.head.sha !== headSha || fresh.base.ref !== pr.base.ref || fresh.state !== 'open' || fresh.merged || fresh.draft) {
return refuse('it changed while I was checking it. Nothing was merged - re-run `/bot merge`.');
}
let merged;
try {
// Pinned to the verified head: a moved head fails with 409.
({ data: merged } = await github.rest.pulls.merge({
owner,
repo,
pull_number: pr.number,
sha: headSha,
merge_method: MERGE_METHOD,
commit_title: `${pr.title} (#${pr.number})`,
commit_message:
`Merged by /bot merge on behalf of @${commenter} (id ${comment.user.id}).\n` +
`Grants: ${grants.join(', ')}\nHead: ${headSha}\n`
}));
} catch (error) {
const hint = {
403: 'the workflow token cannot write to the repository.',
405: 'GitHub refused the merge - branch protection, a required review or check, a newly added CODEOWNERS file, or squash merging being disabled.',
409: `the head commit moved after I verified it (was \`${headSha.slice(0, 7)}\`).`,
422: 'GitHub rejected the merge as invalid.'
}[error.status];
if (!hint) {
throw error;
}
await refuse(`${hint}\n\n> ${error.message}\n\nNothing was merged.`);
core.setFailed(`Delegated merge failed: ${error.status} ${error.message}`);
return;
}
core.info(`Merged #${pr.number} as ${merged.sha}.`);
await react('rocket');
await say(
`@${commenter} squash-merged into \`${pr.base.ref}\` as ${merged.sha}.\n\nVerified scope: ${scopeSummary}`
);
// ---- re-kick the build ----
// A GITHUB_TOKEN merge fires no push event, so build_all.yml would
// otherwise never see these files.
try {
await github.rest.actions.createWorkflowDispatch({
owner,
repo,
workflow_id: 'build_all.yml',
ref: pr.base.ref
});
core.info(`Dispatched build_all.yml on ${pr.base.ref}.`);
} catch (error) {
core.warning(`Merged successfully, but dispatching build_all.yml failed: ${error.message}`);
}
-5
View File
@@ -1,9 +1,7 @@
Build
Build.bat
/build*/
/out/
CMakeLists.txt.user
CMakeUserPresets.json
**/CMakeLists.txt.autosave
deps/build*
MYMETA.json
@@ -51,6 +49,3 @@ internal_docs/
# Python bytecode
__pycache__/
*.pyc
*.opc
/.test/
docs/superpowers/
+4 -37
View File
@@ -25,19 +25,11 @@ ctest --test-dir ./tests/libslic3r # individual suite
ctest --test-dir ./tests/fff_print
```
## Documentation
- Docs live in `docs/`; the high-level design of a subsystem goes in `docs/HLSD/<subsystem>.md`.
- Describe the design as it stands — what the subsystem does, why it exists, and the constraints that shape it. Not the route that got there: no phases, task lists, status markers, or "before/after this PR" framing.
- Planning and investigation output (brainstorms, superpowers design and plan docs) stays in `docs/superpowers/`, which is gitignored. Never commit it.
- Write a doc only when the design is not evident from the code, and when a change invalidates an existing one, update it in the same PR.
## Code Style
- C++17, selective C++20. PascalCase classes, snake_case functions/variables
- `#pragma once` for headers. Smart pointers and RAII preferred
- Parallelization via TBB — be mindful of shared state
- Always use `SetSizerAndFit(sizer)` instead of `SetSizer(sizer)` on top level window. Unless `SetSizer` must be called before the full layout is built, call `sizer->SetSizeHints(window)` afterwards in this case.
## Key Entry Points
@@ -63,36 +55,11 @@ ctest --test-dir ./tests/fff_print
- Add helper functions or utilities only when existing code cannot reasonably be reused. Avoid duplication.
- Keep code concise and clear. Manually simplify AI generated bloated codes before review.
- Include targeted tests or documented verification for behavior changes, especially in slicing logic, profiles, formats, and GUI defaults.
- For profile changes (`resources/profiles/<Vendor>/**`), check that `version` in the sibling `resources/profiles/<Vendor>.json` was bumped.
- For translation changes (`localization/i18n/**/*.po`), check that recurring terms match the [Localization glossary](https://github.com/OrcaSlicer/OrcaSlicer_WIKI/blob/main/guides/localization_glossary.md) for that language.
## Localization & translations
Catalogs live in `localization/i18n/<lang>/OrcaSlicer_<lang>.po`; the template is `OrcaSlicer.pot`.
See the [Localization guide](https://github.com/OrcaSlicer/OrcaSlicer_WIKI/blob/main/guides/localization_guide.md) for the human-facing version of these principles.
### Terminology
- Use the [Localization glossary](https://github.com/OrcaSlicer/OrcaSlicer_WIKI/blob/main/guides/localization_glossary.md) as the source of truth for recurring terms, so the same English term is always rendered the same way within a language, and terms that must stay in English (brand/product names, acronyms, materials, file formats, G-code tokens, macros/variables/identifiers) are not translated.
- If a term's established translation changes, update both the affected `.po` files and the glossary (`localization_glossary.tsv`, then regenerate) so they stay in sync.
- Translate the *meaning*, not the words. Check what the string actually controls before translating it — English reuses one word for different things. `Flow ratio` (multiplier), `Flow Rate` (throughput) and `Flow Dynamics` (pressure compensation) are three different terms; `extruder` may mean the toolhead, the feeder motor, or the nozzle depending on the string.
- Reuse one template per recurring message shape (`Failed to connect to …`, `Are you sure you want to …?`), even where the English wording varies.
### Editing rules
- Only edit `msgstr`**never** change `msgid`, and never "fix" wrong English in the translation alone. Report the source string instead.
- Preserve exactly: placeholders (`%s`, `%d`, `%1%`, `%zu`, `%%`), every `\n` (count *and* position, including leading/trailing), leading/trailing spaces, HTML tags, `℃`, and the file's encoding and line endings.
- **Never reorder positional arguments** in a `c-format` string. If the msgid is `%d` then `%s`, that order must hold — swapping them breaks at runtime.
- `msgctxt` separates homonyms — always read it. `Back`/`Camera View` is the rear view of the 3D navigator, while `Back`/`Navigation` is the go-back button; `Top` exists in the *Alignment*, *Layers* and *Camera View* senses.
- When a string needs disambiguating, add context in the source (`_L_CONTEXT`/`_u8L_CONTEXT`), don't work around it in the translation.
- A literal `%` inside a string xgettext flagged `possible-c-format` will fail `msgfmt`. Fix it with a `// xgettext:no-c-format, no-boost-format` comment above the string in the source — do not mangle the translation or use `%%` in text that is never passed through printf.
- Plural entries: read `nplurals` from the catalog's `Plural-Forms` header (it is **not** always 2 — ja/ko/zh/th/vi use 1, ru/cs/pl/lt use 3, uk uses 4). Each form must be genuinely inflected for its quantity; repeating one sentence across all forms is a bug in Slavic/Baltic languages, though it is correct for Turkish and Hungarian.
- An entry whose `msgstr` equals its `msgid` is untranslated even though it is not empty; a plural entry with any empty form is likewise incomplete.
- Mark machine-produced translations with an `# AI Translated` translator comment. Don't add it to a human translation you didn't actually rewrite.
- Don't reflow or re-wrap unrelated entries — keep the diff limited to the strings you changed.
### 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`.
- Fuzzy entries are not shown to users. If you correct one, clear its `fuzzy` flag, otherwise the fix never ships.
- Translation catalogs live in `localization/i18n/<lang>/OrcaSlicer_<lang>.po`.
- When creating or reviewing translations, use the [Localization glossary](https://github.com/OrcaSlicer/OrcaSlicer_WIKI/blob/main/guides/localization_glossary.md) as the source of truth for recurring terms, so the same English term is always rendered the same way within a language and terms that must stay in English (brand/product names, acronyms, file formats, G-code, macros/variables) are not translated.
- If a term's established translation changes, update both the affected `.po` files and the glossary so they stay in sync.
- Only edit `msgstr` (never `msgid`); keep placeholders (`%s`, `%1%`, `\n`), context (`msgctxt`), and file encoding/line endings intact.
+87 -268
View File
@@ -4,10 +4,6 @@ endif()
cmake_minimum_required(VERSION 3.13)
if(POLICY CMP0177)
cmake_policy(SET CMP0177 NEW)
endif()
# The following line used to be in tests/CMakeLists.txt
# Having it there causes rebuilds of all targets on any CMakeLists.txt change under tests/
@@ -63,13 +59,6 @@ if (APPLE)
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif ()
# Keep MSVC's default /W3 out of CMAKE_<LANG>_FLAGS so it can be applied to our own
# targets only. Silencing a bundled target would otherwise override a warning level,
# which cl reports as D9025 for every file it compiles.
if (POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif ()
project(OrcaSlicer)
# Backward compatibility for old CMake versions
@@ -91,14 +80,37 @@ endif()
if (DEFINED BBL_RELEASE_TO_PUBLIC)
add_compile_definitions("BBL_RELEASE_TO_PUBLIC=${BBL_RELEASE_TO_PUBLIC}")
if (BBL_RELEASE_TO_PUBLIC)
add_compile_definitions(WXINSPECTOR_DISABLE)
endif ()
else ()
add_compile_definitions("BBL_RELEASE_TO_PUBLIC=$<CONFIG:Release>")
add_compile_definitions("$<$<CONFIG:Release>:WXINSPECTOR_DISABLE>")
endif ()
find_package(Git)
if(DEFINED ENV{git_commit_hash} AND NOT "$ENV{git_commit_hash}" STREQUAL "")
message(STATUS "Specified git commit hash: $ENV{git_commit_hash}")
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
# Convert the given hash to short hash
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short "$ENV{git_commit_hash}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
# No .git directory (e.g., Flatpak sandbox) — truncate directly
string(SUBSTRING "$ENV{git_commit_hash}" 0 7 GIT_COMMIT_HASH)
endif()
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
elseif(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
# Check current Git commit hash
execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
endif()
if(DEFINED ENV{SLIC3R_STATIC})
set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC})
else()
@@ -110,11 +122,8 @@ option(SLIC3R_GUI "Compile OrcaSlicer with GUI components (OpenGL,
option(SLIC3R_FHS "Assume OrcaSlicer is to be installed in a FHS directory structure" 0)
option(SLIC3R_PROFILE "Compile OrcaSlicer with an invasive Shiny profiler" 0)
option(SLIC3R_PCH "Use precompiled headers" 1)
option(SLIC3R_WARNINGS "Emit compiler warnings for OrcaSlicer sources" 1)
option(SLIC3R_BUNDLED_WARNINGS "Emit compiler warnings for bundled third-party sources" 0)
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
option(SLIC3R_RELATIVE_DEBUG_PATHS "Record a relative compilation directory in debug info (clang-cl)" 0)
option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0)
# Python stubgen module
@@ -276,8 +285,6 @@ if (APPLE)
SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.orcaslicer.OrcaSlicer")
message(STATUS "Orca: IS_CROSS_COMPILE: ${IS_CROSS_COMPILE}")
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CMAKE_INSTALL_RPATH "$ORIGIN")
endif ()
# Proposal for C++ unit tests and sandboxes
@@ -324,47 +331,23 @@ if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
# clang-cl can interpret SYSTEM header paths if -imsvc is used
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-imsvc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall \
-Wno-old-style-cast -Wno-reserved-id-macro -Wno-c++98-compat-pedantic")
else ()
set(IS_CLANG_CL FALSE)
endif ()
if (MSVC)
# CMP0092 only applies when the cache is created; an existing tree keeps its /W3,
# which a silenced bundled target would then override (D9025, once per file).
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# /MP only matters for the VS generators, where CMake turns it into the
# MultiProcessorCompilation property. Ninja parallelises on its own, and
# clang-cl warns "argument unused" if the flag reaches it.
if (SLIC3R_MSVC_COMPILE_PARALLEL AND CMAKE_GENERATOR MATCHES "Visual Studio")
if (SLIC3R_MSVC_COMPILE_PARALLEL AND NOT IS_CLANG_CL)
add_compile_options(/MP)
endif ()
# Parse lambdas the way the standard says, as clang and GCC already do. Without it
# MSVC keeps its legacy lambda processor under /std:c++17 and rejects reading a
# constexpr constant inside a lambda that does not capture it (C3493), which no
# other compiler requires. 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. Requires VS2019 16.8 or newer.
if (NOT IS_CLANG_CL)
# cl.exe only warns (D9002) about an unknown /Zc: option, so without this the
# flag would be dropped and the first lambda reading a constexpr constant would
# fail with C3493 far from the cause.
if (MSVC_VERSION LESS 1928)
message(FATAL_ERROR "Visual Studio 2019 16.8 (MSVC 19.28) or newer is required; detected MSVC ${MSVC_VERSION}.")
endif ()
add_compile_options(/Zc:lambda)
endif ()
# /bigobj (Increase Number of Sections in .Obj file)
add_compile_options(-bigobj)
# error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm90' or greater
# Generate symbols at every build target, even for the release.
# -Zm520 fixes error C3859 but forces the compiler to pre-allocate that memory for every translation unit regardless
# combining /Zi with /FS frees up a significant amount of memory pressure across all parallel compile jobs and makes /MP faster overall.
if (SLIC3R_MSVC_PDB)
add_compile_options(/Zi /FS)
endif ()
add_compile_options(-bigobj /Zi /FS)
# Disable STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17.
#FIXME Remove this line after eigen library adapts to the new C++17 adaptor rules.
add_compile_options(-D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING)
@@ -382,16 +365,6 @@ if (MSVC)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG")
endif ()
# Without this every object names its build directory and two worktrees never
# share cache entries. The linker still writes absolute paths into the PDB.
if (SLIC3R_RELATIVE_DEBUG_PATHS)
if (IS_CLANG_CL)
add_compile_options(-ffile-compilation-dir=.)
else ()
message(WARNING "SLIC3R_RELATIVE_DEBUG_PATHS is only implemented for clang-cl")
endif ()
endif ()
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
add_compile_definitions(BOOST_NO_CXX98_FUNCTION_BASE _HAS_AUTO_PTR_ETC=0)
endif()
@@ -546,103 +519,63 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals" )
endif()
if ((NOT MSVC OR IS_CLANG_CL) AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
if (IS_CLANG_CL)
# clang-cl reads -Wall as MSVC /Wall, which clang maps to -Weverything. /W4 is
# its -Wall -Wextra and, unlike /clang:-Wall, is ordered with the -Wno-* below
# instead of after them. The -Wextra-only warnings are dropped again so the set
# matches what -Wall gives the GNU/Clang builds.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
add_compile_options(-Wno-unused-parameter -Wno-ignored-qualifiers -Wno-missing-field-initializers)
elseif (NOT MINGW)
if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
if (NOT MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder" )
# Every warning is an error unless it appears in one of the two lists below.
# disabled - never wanted. Off everywhere, so it never warns or errors.
# demoted - wanted, not cleared yet. Still warns, does not error.
# On GCC and Clang, no return from a non-void function is a warning only. Here, we make it an error.
add_compile_options(-Werror=return-type)
# Disabled.
set(warnings_disabled
reorder # members initialised in an order we chose
sign-compare # signed/unsigned comparisons throughout
misleading-indentation # false positives on mixed tabs and spaces
switch # unhandled enum value in a switch
unused-function # commented-out or conditionally compiled code
unused-variable # commented-out or conditionally compiled code
unused-but-set-variable # commented-out or conditionally compiled code
unused-label # commented-out or conditionally compiled code
unused-local-typedefs # commented-out or conditionally compiled code
)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND warnings_disabled deprecated-declarations) # legacy OpenGL calls
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
list(APPEND warnings_disabled ignored-attributes) # from Eigen headers marked SYSTEM
endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND warnings_disabled unknown-pragmas) # igl pragmas, GCC bug 66943
endif ()
foreach (w IN LISTS warnings_disabled)
add_compile_options(-Wno-${w})
endforeach ()
# Since some portions of code are just commented out or put under conditional compilation, there are
# a bunch of warning related to unused functions and variables. Suppress those warnings to not pollute
# compilers diagnostics output with warnings we not going to look at
add_compile_options(-Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-label -Wno-unused-local-typedefs)
# GCC is not built in CI, so don't throw errors CI won't catch.
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Werror=return-type)
else ()
# Turn everything else into an error. Dependency headers are exempt because the
# SYSTEM include flag (-imsvc on clang-cl, -isystem elsewhere) keeps their
# diagnostics out.
add_compile_options(-Werror)
endif ()
# Ignore signed/unsigned comparison warnings
add_compile_options(-Wno-sign-compare)
# Demoted. Remove a name once its category is cleared on every compiler.
set(warnings_demoted)
if (APPLE)
list(APPEND warnings_demoted
# MacDarkMode.mm makes two calls to AppKit's private titlebarViewController
# and one to a wxWidgets category on NSTableColumn whose header is not
# imported. Clearing it means declaring the private selectors ourselves, which
# needs a macOS build to verify.
objc-method-access
)
endif ()
if (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
list(APPEND warnings_demoted
# About two dozen GetProcAddress casts, most in the vendored dark_mode.hpp,
# retype FARPROC to a real signature. The __stdcall typedefs are identical to
# FARPROC on x64, so only arm64 reports them. Clearing them is a separate
# sweep.
cast-function-type-mismatch
)
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND warnings_demoted
# enum-constexpr-conversion is a Clang warning that defaults to an error,
# present through clang 20 and gone in clang 21.
enum-constexpr-conversion
)
endif ()
# The mismatch of tabs and spaces throughout the project can sometimes
# cause this warning to appear even though the indentation is fine.
# Some includes also cause the warning
add_compile_options(-Wno-misleading-indentation)
# The list mixes names not every compiler has, so add each exception only where the
# compiler knows the warning. Probe with the positive -W<name>, which an unknown
# warning fails on both compilers (GCC errors, Clang reports unknown-warning-option).
# An option that takes a =N argument rejects the bare -W<name>, so fall back to
# -W<name>=1 and demote with the trailing =.
include(CheckCXXCompilerFlag)
foreach (category IN LISTS warnings_demoted)
string(MAKE_C_IDENTIFIER "ORCA_HAS_W_${category}" _orca_has_w)
check_cxx_compiler_flag("-W${category}" ${_orca_has_w})
if (${_orca_has_w})
add_compile_options(-Wno-error=${category})
else ()
check_cxx_compiler_flag("-W${category}=1" ${_orca_has_w}_arg)
if (${${_orca_has_w}_arg})
add_compile_options(-Wno-error=${category}=)
endif ()
endif ()
endforeach ()
# Disable warning if enum value does not have a corresponding case in switch statement
add_compile_options(-Wno-switch)
# removes LOTS of extraneous Eigen warnings (GCC only supports it since 6.1)
# https://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
add_compile_options(-Wno-ignored-attributes) # Tamas: Eigen include dirs are marked as SYSTEM
endif()
# Clang reports legacy OpenGL calls as deprecated. Turn off the warning for now
# to reduce the clutter, we know about this one. It should be reenabled after
# we finally get rid of the deprecated code.
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_options(-Wno-deprecated-declarations)
endif()
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wno-error=enum-constexpr-conversion HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV)
if(HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV)
add_compile_options(-Wno-error=enum-constexpr-conversion)
endif()
endif()
#GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
# We will turn the warning of for GCC for now:
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
# We will turn the warning of for GCC for now:
add_compile_options(-Wno-unknown-pragmas)
endif()
# Compress the debug info with zstd to save space in Flatpak CI builds
if(FLATPAK)
@@ -652,6 +585,10 @@ if ((NOT MSVC OR IS_CLANG_CL) AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
endif()
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=template-id-cdtor" )
endif()
endif()
if (SLIC3R_ASAN)
@@ -1103,10 +1040,6 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
${CMAKE_PREFIX_PATH}/bin/occt/TKXDESTEP.dll
${CMAKE_PREFIX_PATH}/bin/occt/TKXSBase.dll
${CMAKE_PREFIX_PATH}/bin/freetype.dll
${CMAKE_PREFIX_PATH}/bin/avcodec-61.dll
${CMAKE_PREFIX_PATH}/bin/swresample-5.dll
${CMAKE_PREFIX_PATH}/bin/swscale-8.dll
${CMAKE_PREFIX_PATH}/bin/avutil-59.dll
DESTINATION ${_out_dir})
set(${output_dlls}
@@ -1142,111 +1075,15 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
${_out_dir}/TKXSBase.dll
${_out_dir}/freetype.dll
${_out_dir}/avcodec-61.dll
${_out_dir}/swresample-5.dll
${_out_dir}/swscale-8.dll
${_out_dir}/avutil-59.dll
PARENT_SCOPE
)
endfunction()
function(orcaslicer_copy_sos target config postfix output_sos)
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
get_target_property(_alt_out_dir ${target} RUNTIME_OUTPUT_DIRECTORY)
if (_alt_out_dir)
set(_out_dir "${_alt_out_dir}")
elseif (_is_multi)
set(_out_dir "${CMAKE_CURRENT_BINARY_DIR}/${config}")
else ()
set(_out_dir "${CMAKE_CURRENT_BINARY_DIR}")
endif ()
file(COPY ${CMAKE_PREFIX_PATH}/lib/libavcodec.so
${CMAKE_PREFIX_PATH}/lib/libavcodec.so.61
${CMAKE_PREFIX_PATH}/lib/libavcodec.so.61.3.100
${CMAKE_PREFIX_PATH}/lib/libavutil.so
${CMAKE_PREFIX_PATH}/lib/libavutil.so.59
${CMAKE_PREFIX_PATH}/lib/libavutil.so.59.8.100
${CMAKE_PREFIX_PATH}/lib/libswscale.so
${CMAKE_PREFIX_PATH}/lib/libswscale.so.8
${CMAKE_PREFIX_PATH}/lib/libswscale.so.8.1.100
${CMAKE_PREFIX_PATH}/lib/libswresample.so
${CMAKE_PREFIX_PATH}/lib/libswresample.so.5
${CMAKE_PREFIX_PATH}/lib/libswresample.so.5.1.100
DESTINATION ${_out_dir})
set(${output_sos}
${_out_dir}/libavcodec.so
${_out_dir}/libavcodec.so.61
${_out_dir}/libavcodec.so.61.3.100
${_out_dir}/libavutil.so
${_out_dir}/libavutil.so.59
${_out_dir}/libavutil.so.59.8.100
${_out_dir}/libswscale.so
${_out_dir}/libswscale.so.8
${_out_dir}/libswscale.so.8.1.100
${_out_dir}/libswresample.so
${_out_dir}/libswresample.so.5
${_out_dir}/libswresample.so.5.1.100
PARENT_SCOPE
)
endfunction()
# Bundled sources set their own warning flags, and a plain -Wall there means /Wall
# (= -Weverything) under clang-cl. Target options are applied after the ones a target
# set on itself, so these win. Targets are discovered rather than listed so a newly
# bundled library needs no maintenance here.
function(orcaslicer_silence_third_party_warnings _dir)
get_property(_subdirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
foreach (_subdir IN LISTS _subdirs)
orcaslicer_silence_third_party_warnings("${_subdir}")
endforeach ()
get_property(_targets DIRECTORY "${_dir}" PROPERTY BUILDSYSTEM_TARGETS)
foreach (_target IN LISTS _targets)
get_target_property(_type ${_target} TYPE)
if (NOT _type STREQUAL "INTERFACE_LIBRARY" AND NOT _type STREQUAL "UTILITY")
if (MSVC AND NOT IS_CLANG_CL)
# Drop any level the target set for itself, or -w overrides it and cl
# reports D9025 once per file.
get_target_property(_opts ${_target} COMPILE_OPTIONS)
if (_opts)
string(REGEX REPLACE "/W[0-4]|/Wall" "" _opts "${_opts}")
string(REGEX REPLACE ";;+" ";" _opts "${_opts}")
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${_opts}")
endif ()
# CMake maps a level into the VS generator's WarningLevel element, while a
# bare -w stays on the command line and trips D9025 there, once per file.
target_compile_options(${_target} PRIVATE /W0)
else ()
target_compile_options(${_target} PRIVATE -w)
endif ()
endif ()
endforeach ()
endfunction()
# libslic3r, OrcaSlicer GUI and the OrcaSlicer executable.
add_subdirectory(deps_src)
if (NOT SLIC3R_BUNDLED_WARNINGS)
orcaslicer_silence_third_party_warnings("${CMAKE_CURRENT_SOURCE_DIR}/deps_src")
endif ()
# Warning level for the targets added below: our sources, plus glad and libvgcode,
# which are vendored but live under src/. The deps_src libraries were configured just
# above. CMP0092 left MSVC without a default level, so it is set here.
if (NOT SLIC3R_WARNINGS)
add_compile_options(-w)
elseif (MSVC AND NOT IS_CLANG_CL)
# /we4715 is C4715, no return from a non-void function, an error on the GNU/Clang
# builds under -Werror. MSVC is not in that model, so this stays a single promoted
# warning.
add_compile_options(/W3 /we4715)
endif ()
add_subdirectory(src)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OrcaSlicer_app_gui)
@@ -1258,10 +1095,6 @@ endif()
if(BUILD_TESTS)
add_subdirectory(tests)
if (NOT SLIC3R_BUNDLED_WARNINGS)
# Catch2 is vendored under tests/ and sets its own warning flags too.
orcaslicer_silence_third_party_warnings("${CMAKE_CURRENT_SOURCE_DIR}/tests/catch2")
endif ()
endif()
if (NOT WIN32 AND NOT APPLE)
@@ -1306,20 +1139,6 @@ else ()
endif()
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LIBRARY_FILES
${LIBDIR_BIN}/libavcodec.so.61
${LIBDIR_BIN}/libavcodec.so.61.3.100
${LIBDIR_BIN}/libavutil.so.59
${LIBDIR_BIN}/libavutil.so.59.8.100
${LIBDIR_BIN}/libswresample.so.5
${LIBDIR_BIN}/libswresample.so.5.1.100
${LIBDIR_BIN}/libswscale.so.8
${LIBDIR_BIN}/libswscale.so.8.1.100
)
install(FILES ${LIBRARY_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
endif ()
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION ".")
configure_file(${LIBDIR}/dev-utils/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/dev-utils/platform/unix/fhs.hpp)
-4
View File
@@ -119,10 +119,6 @@ Download the **Windows Installer exe** for your preferred version from the [rele
- This file may already be available on your computer if you've installed visual studio. Check the following location: `%VCINSTALLDIR%Redist\MSVC\v142`
</details>
### Microsoft Store
Install from the [Microsoft Store](https://apps.microsoft.com/detail/9mv6gl23xm59) when you prefer a Store-signed package (helps on Windows 11 Smart App Control).
### Windows Package Manager
```shell
-3
View File
@@ -260,9 +260,6 @@ if [[ ! -f "./scripts/flatpak/com.orcaslicer.OrcaSlicer.yml" ]]; then
exit 1
fi
echo -e "${YELLOW}Packing deps/ for the manifest...${NC}"
./scripts/flatpak/make_deps_tar.sh
# Build the Flatpak
echo -e "${YELLOW}Building Flatpak package...${NC}"
echo -e "This may take a while (30+ minutes depending on your system)..."
-2
View File
@@ -567,8 +567,6 @@ if [[ -n "${BUILD_ORCA}" ]] || [[ -n "${BUILD_TESTS}" ]] ; then
print_and_run cmake --build $BUILD_DIR --config "${BUILD_CONFIG}" --target OrcaSlicer
echo "Building OrcaSlicer_profile_validator .."
print_and_run cmake --build $BUILD_DIR --config "${BUILD_CONFIG}" --target OrcaSlicer_profile_validator
echo "Building generate_system_cache ..."
print_and_run cmake --build $BUILD_DIR --config "${BUILD_CONFIG}" --target generate_system_cache
./scripts/run_gettext.sh
fi
if [[ -n "${BUILD_TESTS}" ]] ; then
+4 -4
View File
@@ -4,7 +4,7 @@ set -e
set -o pipefail
SECONDS=0
while getopts ":dpa:snt:xbc:i:j:Tuh" opt; do
while getopts ":dpa:snt:xbc:i:1Tuh" opt; do
case "${opt}" in
d )
export BUILD_TARGET="deps"
@@ -38,8 +38,8 @@ while getopts ":dpa:snt:xbc:i:j:Tuh" opt; do
i )
export CMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH:+$CMAKE_IGNORE_PREFIX_PATH;}$OPTARG"
;;
j )
export CMAKE_BUILD_PARALLEL_LEVEL="$OPTARG"
1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1
;;
T )
export BUILD_TESTS="1"
@@ -58,7 +58,7 @@ while getopts ":dpa:snt:xbc:i:j:Tuh" opt; do
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"
echo " -j: Set the number of parallel build jobs (CMAKE_BUILD_PARALLEL_LEVEL)"
echo " -1: Use single job for building"
echo " -T: Build and run tests (set ORCA_TESTS_BUILD_ONLY=1 to build without running)"
exit 0
;;
+5 -18
View File
@@ -20,18 +20,6 @@ for %%a in (%*) do (
if "%%a"=="-x" set USE_NINJA=1
)
@REM Check for clang-cl option (-l). Combined with -x it also builds the deps with
@REM clang-cl; on the Visual Studio generator it applies to the slicer only, because
@REM the dependency sub-builds have no toolset to inherit and stay on MSVC.
set CLANG_ARG=
set TOOLSET_ARG=
for %%a in (%*) do (
if "%%a"=="-l" (
set CLANG_ARG=-DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
set TOOLSET_ARG=-T ClangCL
)
)
@REM Check for unit-tests option ("tests")
set BUILD_TESTS=OFF
for %%a in (%*) do (
@@ -86,7 +74,7 @@ if "%VS_MAJOR%"=="16" (
set CMAKE_GENERATOR="Visual Studio 18 2026"
) else (
echo Error: Unsupported Visual Studio version: %VS_MAJOR%
echo Supported versions: VS2019 (16.8+^), VS2022 (17.x^), VS2026 (18.x^)
echo Supported versions: VS2019 (16.x^), VS2022 (17.x^), VS2026 (18.x^)
exit /b 1
)
@@ -139,13 +127,12 @@ if "%1"=="slicer" (
GOTO :slicer
)
echo "building deps.."
if defined CLANG_ARG if "%USE_NINJA%"=="0" echo Note: -l needs -x for the dependencies; building them with MSVC.
echo on
REM Set minimum CMake policy to avoid <3.5 errors
set CMAKE_POLICY_VERSION_MINIMUM=3.5
if "%USE_NINJA%"=="1" (
cmake ../ -G %CMAKE_GENERATOR% %CLANG_ARG% -DCMAKE_BUILD_TYPE=%build_type%
cmake ../ -G %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%build_type%
cmake --build . --config %build_type% --target deps
) else (
cmake ../ -G %CMAKE_GENERATOR% -A %arch% -DCMAKE_BUILD_TYPE=%build_type%
@@ -164,10 +151,10 @@ cd %build_dir%
echo on
set CMAKE_POLICY_VERSION_MINIMUM=3.5
if "%USE_NINJA%"=="1" (
cmake .. -G %CMAKE_GENERATOR% %CLANG_ARG% -DORCA_TOOLS=ON %SIG_FLAG% -DBUILD_TESTS=%BUILD_TESTS% -DCMAKE_BUILD_TYPE=%build_type%
cmake --build . --config %build_type% --target all
cmake .. -G %CMAKE_GENERATOR% -DORCA_TOOLS=ON %SIG_FLAG% -DBUILD_TESTS=%BUILD_TESTS% -DCMAKE_BUILD_TYPE=%build_type%
cmake --build . --config %build_type% --target ALL_BUILD
) else (
cmake .. -G %CMAKE_GENERATOR% -A %arch% %TOOLSET_ARG% -DORCA_TOOLS=ON %SIG_FLAG% -DBUILD_TESTS=%BUILD_TESTS% -DCMAKE_BUILD_TYPE=%build_type%
cmake .. -G %CMAKE_GENERATOR% -A %arch% -DORCA_TOOLS=ON %SIG_FLAG% -DBUILD_TESTS=%BUILD_TESTS% -DCMAKE_BUILD_TYPE=%build_type%
cmake --build . --config %build_type% --target ALL_BUILD -- -m
)
@echo off
-1396
View File
File diff suppressed because it is too large Load Diff
-7
View File
@@ -256,13 +256,6 @@ function(add_precompiled_header _target _input)
message(STATUS "Adding precompiled header ${_input} to target ${_target}.")
target_precompile_headers(${_target} PRIVATE ${_input})
# Clang records the modification time of every input in the precompiled
# header, which makes it differ between two checkouts of the same source
# and defeats a compiler cache. The build system already rebuilds the
# header when an input changes.
target_compile_options(${_target} PRIVATE
"$<$<CXX_COMPILER_ID:Clang,AppleClang>:SHELL:-Xclang -fno-pch-timestamp>")
get_target_property(_sources ${_target} SOURCES)
list(FILTER _sources INCLUDE REGEX ".*\\.mm?")
-43
View File
@@ -1,43 +0,0 @@
if(CMAKE_VERSION VERSION_LESS 3.22)
set(_assimp_url "https://github.com/assimp/assimp/archive/refs/tags/v5.3.1.tar.gz")
set(_assimp_hash "SHA256=a07666be71afe1ad4bc008c2336b7c688aca391271188eb9108d0c6db1be53f1")
else()
set(_assimp_url "https://github.com/assimp/assimp/archive/refs/tags/v5.4.3.tar.gz")
set(_assimp_hash "SHA256=66dfbaee288f2bc43172440a55d0235dfc7bf885dda6435c038e8000e79582cb")
endif()
# Assimp's bundled zlib (contrib/zlib) is too old to compile against the modern
# macOS SDK: its zutil.h takes the classic-Mac branch under TARGET_OS_MAC and
# does `#define fdopen(fd,mode) NULL`, which then clobbers the SDK's real
# `fdopen` prototype in <stdio.h> and breaks the build. On macOS use the system
# zlib (already found by find_package(ZLIB) in deps-unix-common) instead.
if(APPLE)
set(_assimp_build_zlib "-DASSIMP_BUILD_ZLIB=OFF")
else()
set(_assimp_build_zlib "-DASSIMP_BUILD_ZLIB=ON")
endif()
orcaslicer_add_cmake_project(Assimp
URL ${_assimp_url}
URL_HASH ${_assimp_hash}
CMAKE_ARGS
# Assimp's ccache support sets the global RULE_LAUNCH_COMPILE, which breaks
# the Ninja RC rule. The superbuild forwards CMAKE_<LANG>_COMPILER_LAUNCHER.
-DASSIMP_BUILD_USE_CCACHE=OFF
-DASSIMP_BUILD_TESTS=OFF
-DASSIMP_BUILD_SAMPLES=OFF
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-DASSIMP_INSTALL_PDB=OFF
-DASSIMP_NO_EXPORT=ON
-DASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT=OFF
-DASSIMP_BUILD_GLTF_IMPORTER=ON
-DASSIMP_BUILD_OBJ_IMPORTER=ON
-DASSIMP_BUILD_FBX_IMPORTER=ON
${_assimp_build_zlib}
-DASSIMP_WARNINGS_AS_ERRORS=OFF
-DBUILD_WITH_STATIC_CRT=OFF
)
if (MSVC)
add_debug_dep(dep_Assimp)
endif ()
+1 -9
View File
@@ -24,13 +24,6 @@ if (MSVC AND DEP_DEBUG)
set(_options "FORWARD_CONFIG")
endif ()
# Boost.Container's bundled dlmalloc passes int* where the Win32 Interlocked API
# takes volatile long*; cl compiles that with a warning, clang errors out.
set(_boost_c_flags_line "")
if (MSVC AND CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(_boost_c_flags_line "-DCMAKE_C_FLAGS:STRING=-Wno-incompatible-pointer-types")
endif ()
orcaslicer_add_cmake_project(Boost
${_options}
URL "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz"
@@ -45,7 +38,6 @@ orcaslicer_add_cmake_project(Boost
"${_context_abi_line}"
"${_context_arch_line}"
"${_context_impl_line}"
"${_boost_c_flags_line}"
)
set(DEP_Boost_DEPENDS ZLIB)
set(DEP_Boost_DEPENDS ZLIB)
+3 -16
View File
@@ -157,16 +157,8 @@ endif ()
function(orcaslicer_add_cmake_project projectname)
cmake_parse_arguments(P_ARGS "FORWARD_CONFIG" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
# MSVC is true for clang-cl as well, so the sub-build toolchain has to key on the
# generator. A non-Visual-Studio superbuild passes its own generator down, and with
# it the CMAKE_C_COMPILER / CMAKE_CXX_COMPILER forwarded below.
set(_dep_msvc_gen FALSE)
if (MSVC AND CMAKE_GENERATOR MATCHES "Visual Studio")
set(_dep_msvc_gen TRUE)
endif ()
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
if (_is_multi OR _dep_msvc_gen)
if (_is_multi OR MSVC)
if (P_ARGS_FORWARD_CONFIG)
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
elseif (ORCA_INCLUDE_DEBUG_INFO AND NOT DEP_DEBUG)
@@ -182,7 +174,7 @@ function(orcaslicer_add_cmake_project projectname)
set(_target_config "Release")
endif()
if (_dep_msvc_gen)
if (MSVC)
set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}")
else()
set(_gen "")
@@ -190,7 +182,7 @@ function(orcaslicer_add_cmake_project projectname)
if ($ENV{CMAKE_BUILD_PARALLEL_LEVEL})
set(_build_j "") # assume environment will control --build parallel setting
elseif(_dep_msvc_gen)
elseif(MSVC)
set(_build_j "/m")
else()
set(_build_j "-j${NPROC}")
@@ -375,9 +367,6 @@ include(libnoise/libnoise.cmake)
include(Draco/Draco.cmake)
include(FFMPEG/FFMPEG.cmake)
include(Assimp/Assimp.cmake)
# I *think* 1.1 is used for *just* md5 hashing?
# 3.1 has everything in the right place, but the md5 funcs used are deprecated
@@ -459,8 +448,6 @@ set(_dep_list
dep_libnoise
dep_python3
dep_wxInspector
dep_FFMPEG
dep_Assimp
)
if (MSVC)
-14
View File
@@ -56,18 +56,6 @@ else()
set(_curl_static ON)
endif()
# curl 7.75's configure probes and code rely on C laxness cl allows but clang
# errors on (implicit function declarations, int* vs u_long* in ioctlsocket),
# which flips probe results and misconfigures nonblock.c into the AmigaOS
# IoctlSocket branch. Relax both diagnostics so the probes behave like cl, and
# pin the camel-case probes off since they only "pass" by implicit declaration.
set(_curl_c_flags_line "")
set(_curl_probe_overrides "")
if (MSVC AND CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(_curl_c_flags_line "-DCMAKE_C_FLAGS:STRING=-Wno-implicit-function-declaration -Wno-incompatible-pointer-types")
set(_curl_probe_overrides -DHAVE_IOCTLSOCKET_CAMEL=0 -DHAVE_IOCTLSOCKET_CAMEL_FIONBIO=0)
endif ()
orcaslicer_add_cmake_project(CURL
# GIT_REPOSITORY https://github.com/curl/curl.git
# GIT_TAG curl-7_75_0
@@ -81,8 +69,6 @@ orcaslicer_add_cmake_project(CURL
-DBUILD_CURL_EXE:BOOL=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCURL_STATICLIB=${_curl_static}
"${_curl_c_flags_line}"
${_curl_probe_overrides}
${_curl_platform_flags}
)
-15
View File
@@ -7,20 +7,5 @@ orcaslicer_add_cmake_project(Eigen
URL https://gitlab.com/libeigen/eigen/-/archive/5.0.1/eigen-5.0.1.zip
URL_HASH SHA256=0dbb1f9e3aaad66f352c03227d8c983f6f0b49e0b07e71a7300f4abcc01aee12
CMAKE_ARGS "${_eigen_extra_flags}"
# Only the headers are consumed here. Everything below builds nothing we
# use, and all three enable_language(Fortran): test/CMakeLists.txt:9,
# lapack/CMakeLists.txt:6 and blas/testing/CMakeLists.txt:2. They default
# to ON because the dependency configures as its own top-level project.
#
# Whether that probe is harmless depends on what CMake finds. The Visual
# Studio generator supports no Fortran, so it finds nothing; clang-cl sits
# next to the LLVM toolset's flang, which works. MSVC with Ninja finds
# Strawberry Perl's MinGW gfortran instead, which the deps build already
# requires for OpenSSL, and hands it the MSVC-style /machine:x64 that
# MinGW's ld reads as a missing input file. The configure dies there and
# takes the rest of the superbuild with it.
-DEIGEN_BUILD_TESTING=OFF
-DEIGEN_BUILD_BLAS=OFF
-DEIGEN_BUILD_LAPACK=OFF
DEPENDS dep_Boost dep_GMP dep_MPFR
)
-87
View File
@@ -1,87 +0,0 @@
set(_conf_cmd ./configure)
if (MSVC)
set(_source_dir "${CMAKE_BINARY_DIR}/dep_FFMPEG-prefix/src/dep_FFMPEG")
set(PREBUILD_URL_arm64 "https://github.com/Noisyfox/FFmpeg-Builds-Orca/releases/download/autobuild-2026-07-17-14-28/ffmpeg-n7.0.3-31-g9b6ffd74b5-winarm64-orca-shared-7.0.zip")
set(PREBUILD_HASH_arm64 "12f4140279f2f8469885e1b5b2e8be9d788882914c21523cacd56989f3548054")
set(PREBUILD_URL_x64 "https://github.com/Noisyfox/FFmpeg-Builds-Orca/releases/download/autobuild-2026-07-17-14-28/ffmpeg-n7.0.3-31-g9b6ffd74b5-win64-orca-shared-7.0.zip")
set(PREBUILD_HASH_x64 "e65916020ddb9ef84b2666dfbcbfc9b1d67f69d15b4a66db53754637bf2d498c")
ExternalProject_Add(dep_FFMPEG
URL ${PREBUILD_URL_${DEPS_ARCH}}
URL_HASH SHA256=${PREBUILD_HASH_${DEPS_ARCH}}
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/FFMPEG
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND
COMMAND ${CMAKE_COMMAND} -E copy_directory "${_source_dir}/bin" "${DESTDIR}/bin"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${_source_dir}/lib" "${DESTDIR}/lib"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${_source_dir}/include" "${DESTDIR}/include"
)
else ()
if (APPLE)
set(_minos_cmd
"--extra-cflags=-mmacosx-version-min=${DEP_OSX_TARGET}"
"--extra-ldflags=-mmacosx-version-min=${DEP_OSX_TARGET}"
)
# Static FFmpeg: nothing to bundle into the .app, no rpath handling.
# Disable the VideoToolbox/AudioToolbox HW-accel paths: the player decodes
# in software (swscale), and the auto-detected HW objects would drag in
# system frameworks that the static libs would then depend on.
set(_link_cmd --enable-static --disable-shared --disable-videotoolbox --disable-audiotoolbox)
if (IS_CROSS_COMPILE)
set(_cross_cmd --enable-cross-compile)
set(_pic_cmd --enable-pic)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
set(_arch_cmd --arch=arm64)
set(_cc_cmd "--cc=clang -arch arm64")
else()
set(_arch_cmd --arch=x86_64)
set(_cc_cmd "--cc=clang -arch x86_64")
endif()
endif()
else ()
set(_link_cmd --enable-shared)
endif ()
set(_build_j -j)
if(DEFINED ENV{CMAKE_BUILD_PARALLEL_LEVEL})
set(_build_j "-j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}")
endif()
ExternalProject_Add(dep_FFMPEG
URL https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n7.0.3.tar.gz
URL_HASH SHA256=DEEDCABE339165214A3637DF4C86A507AEF0D793CF8774FF68735F4737E8DDBC
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/FFMPEG
CONFIGURE_COMMAND ${_conf_cmd}
${_cross_cmd}
${_pic_cmd}
${_arch_cmd}
${_cc_cmd}
"--prefix=${DESTDIR}"
${_link_cmd}
${_minos_cmd}
--disable-doc
--enable-small
--disable-outdevs
--disable-filters
--enable-filter=*null*,afade,*fifo,*format,*resample,aeval,allrgb,allyuv,atempo,pan,*bars,color,*key,crop,draw*,eq*,framerate,*_qsv,*_vaapi,*v4l2*,hw*,scale,volume,test*
--disable-protocols
--enable-protocol=file,fd,pipe,rtp,udp
--disable-muxers
--enable-muxer=rtp
--disable-encoders
--disable-decoders
--enable-decoder=*aac*,h264*,mp3*,mjpeg,rv*
--disable-demuxers
--enable-demuxer=h264,mp3,mov
--disable-zlib
--disable-avdevice
BUILD_IN_SOURCE ON
BUILD_COMMAND make ${_build_j}
INSTALL_COMMAND make install
)
endif()
-43
View File
@@ -1,20 +1,3 @@
diff --git a/adm/cmake/occt_defs_flags.cmake b/adm/cmake/occt_defs_flags.cmake
index 00000000..00000001 100644
--- a/adm/cmake/occt_defs_flags.cmake
+++ b/adm/cmake/occt_defs_flags.cmake
@@ -134,7 +134,11 @@
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
# Optimize size of binaries
- set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
+ # clang-cl reports the Clang compiler ID, and OCCT builds shared on Windows,
+ # where the MSVC-style linker gets this flag as an argument it does not know.
+ if (NOT WIN32)
+ set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
+ endif()
elseif(MINGW)
add_definitions(-D_WIN32_WINNT=0x0601)
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d98acc0f..28eb8eb4 100644
--- a/CMakeLists.txt
@@ -185,32 +168,6 @@ index d98acc0f..28eb8eb4 100644
endforeach()
if (BUILD_SAMPLES_QT)
diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake
index 224c96b1..8c94a1c5 100644
--- a/adm/cmake/occt_macros.cmake
+++ b/adm/cmake/occt_macros.cmake
@@ -608,7 +608,7 @@ macro (OCCT_INSERT_CODE_FOR_TARGET)
install(CODE "if (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$\")
set (OCCT_INSTALL_BIN_LETTER \"\")
elseif (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Rr][Ee][Ll][Ww][Ii][Tt][Hh][Dd][Ee][Bb][Ii][Nn][Ff][Oo])$\")
- set (OCCT_INSTALL_BIN_LETTER \"i\")
+ set (OCCT_INSTALL_BIN_LETTER \"\")
elseif (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\")
set (OCCT_INSTALL_BIN_LETTER \"d\")
endif()")
diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake
index 550e0e2f..7ac1a3b8 100644
--- a/adm/cmake/occt_toolkit.cmake
+++ b/adm/cmake/occt_toolkit.cmake
@@ -241,7 +241,7 @@
else()
set (aReleasePdbConf)
endif()
- install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
+ install (FILES $<TARGET_PDB_FILE:${PROJECT_NAME}>
CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
endif()
diff --git a/src/Font/Font_FTFont.cxx b/src/Font/Font_FTFont.cxx
index 5ae9899f..0a17372b 100644
--- a/src/Font/Font_FTFont.cxx
-8
View File
@@ -1,10 +1,3 @@
# clang-cl cannot emit IGESAppli_GeneralModule.cxx on ARM64
# (llvm/llvm-project#62081). cl and clang-cl share an ABI.
set(_occt_compiler_args "")
if ("${DEPS_ARCH}" STREQUAL "arm64" AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(_occt_compiler_args -DCMAKE_C_COMPILER:STRING=cl -DCMAKE_CXX_COMPILER:STRING=cl)
endif ()
if(WIN32)
set(library_build_type "Shared")
else()
@@ -38,7 +31,6 @@ orcaslicer_add_cmake_project(OCCT
-DBUILD_MODULE_ModelingAlgorithms=OFF
-DBUILD_MODULE_ModelingData=OFF
-DBUILD_MODULE_Visualization=OFF
${_occt_compiler_args}
)
# add_dependencies(dep_OCCT ${FREETYPE_PKG})
-8
View File
@@ -10,13 +10,6 @@ else ()
set(_options "")
endif ()
# carotene is OpenCV's ARM NEON HAL. It uses M_PI without _USE_MATH_DEFINES
# and does not compile with clang-cl.
set(_disable_carotene "")
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)
endif ()
@@ -90,6 +83,5 @@ orcaslicer_add_cmake_project(OpenCV
-DWITH_PROTOBUF=OFF
-DWITH_WIN32UI=OFF
-DHAVE_WIN32UI=FALSE
${_disable_carotene}
)
+4 -22
View File
@@ -6,7 +6,7 @@ if(DEFINED OPENSSL_ARCH)
set(_cross_arch ${OPENSSL_ARCH})
else()
if(WIN32)
if("${DEPS_ARCH}" STREQUAL "arm64")
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "ARM64")
set(_cross_arch "VC-WIN64-ARM")
else()
set(_cross_arch "VC-WIN64A")
@@ -17,20 +17,10 @@ else()
endif()
if(WIN32)
set(_openssl_msvc_env CC=cl CXX=cl RC=rc CL=/FS)
# OpenSSL's perl Configure honors the CC environment variable, but the
# VC-WIN64A makefile only works with cl (an unquoted clang-cl path with
# spaces, e.g. exported by CLion, silently produces no .obj files and the
# lib step fails with LNK1181). Pin the upstream toolchain.
# Keep rc.exe resolved from the MSVC developer environment as well. The
# absolute Windows SDK path contains spaces and OpenSSL 1.1.1 writes it to
# the generated nmake file without quoting, which skips .res generation.
# /FS serializes access to OpenSSL's shared generated PDB when cl is
# driven through nmake from a Ninja configure step.
set(_conf_cmd ${CMAKE_COMMAND} -E env ${_openssl_msvc_env} perl Configure )
set(_conf_cmd perl Configure )
set(_cross_comp_prefix_line "")
set(_make_cmd ${CMAKE_COMMAND} -E env ${_openssl_msvc_env} nmake)
set(_install_cmd ${CMAKE_COMMAND} -E env ${_openssl_msvc_env} nmake install_sw )
set(_make_cmd nmake)
set(_install_cmd nmake install_sw )
else()
if(APPLE)
set(_conf_cmd export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} && ./Configure -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
@@ -62,14 +52,6 @@ ExternalProject_Add(dep_OpenSSL
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
"--openssldir=${DESTDIR}"
"--prefix=${DESTDIR}"
# OpenSSL's linux-x86_64 target sets multilib=64, so it installs to
# <prefix>/lib64 while every other dep uses <prefix>/lib. CPython's
# --with-openssl only ever emits -L<dir>/lib, so it misses the bundled
# static libs and silently links the system OpenSSL instead -- which,
# against 1.1.1w headers, leaves _ssl.so with an undefined
# SSL_get_peer_certificate (removed in OpenSSL 3.x). Pin libdir so the
# prefix stays single-layout.
"--libdir=lib"
${_cross_comp_prefix_line}
no-shared
no-asm
-4
View File
@@ -1,10 +1,6 @@
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 ()
-98
View File
@@ -1,98 +0,0 @@
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set(TBB_LINK_DEF_FILE_FLAG ${CMAKE_LINK_DEF_FILE_FLAG})
set(TBB_DEF_FILE_PREFIX win${TBB_ARCH})
# Workaround for CMake issue https://gitlab.kitware.com/cmake/cmake/issues/18317.
# TODO: consider use of CMP0092 CMake policy.
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(TBB_WARNING_LEVEL $<$<BOOL:${TBB_STRICT}>:/W4> $<$<BOOL:${TBB_STRICT}>:/WX>)
# Warning suppression C4324: structure was padded due to alignment specifier
set(TBB_WARNING_SUPPRESS /wd4324)
set(TBB_TEST_COMPILE_FLAGS /bigobj)
if (MSVC_VERSION LESS_EQUAL 1900)
# Warning suppression C4503 for VS2015 and earlier:
# decorated name length exceeded, name was truncated.
# More info can be found at
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4503
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} /wd4503)
endif()
set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS)
set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS /EHsc)
# Ignore /WX set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
tbb_remove_compile_flag(/WX)
endif()
if (WINDOWS_STORE OR TBB_WINDOWS_DRIVER)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D_WIN32_WINNT=0x0A00)
set(TBB_COMMON_LINK_FLAGS -NODEFAULTLIB:kernel32.lib -INCREMENTAL:NO)
set(TBB_COMMON_LINK_LIBS OneCore.lib)
endif()
if (WINDOWS_STORE)
if (NOT CMAKE_SYSTEM_VERSION EQUAL 10.0)
message(FATAL_ERROR "CMAKE_SYSTEM_VERSION must be equal to 10.0")
endif()
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /ZW /ZW:nostdlib)
# CMake define this extra lib, remove it for this build type
string(REGEX REPLACE "WindowsApp.lib" "" CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES}")
if (TBB_NO_APPCONTAINER)
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -APPCONTAINER:NO)
endif()
endif()
if (TBB_WINDOWS_DRIVER)
# Since this is universal driver disable this variable
set(CMAKE_SYSTEM_PROCESSOR "")
# CMake define list additional libs, remove it for this build type
set(CMAKE_CXX_STANDARD_LIBRARIES "")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D _UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__)
endif()
if (NOT DEFINED TBB_ENABLE_IPO)
if (DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
set(TBB_ENABLE_IPO ${CMAKE_INTERPROCEDURAL_OPTIMIZATION})
else()
set(TBB_ENABLE_IPO ON)
endif()
endif()
if (TBB_ENABLE_IPO)
if (CMAKE_CXX_COMPILER_ID MATCHES "(Clang|IntelLLVM)")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg)
endif()
set(TBB_OPENMP_NO_LINK_FLAG TRUE)
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
else()
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:/GL>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-LTCG> $<$<NOT:$<CONFIG:Debug>>:-INCREMENTAL:NO>)
endif()
else()
if (CMAKE_CXX_COMPILER_ID MATCHES "(Clang|IntelLLVM)" AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg)
endif()
set(TBB_IPO_COMPILE_FLAGS "")
set(TBB_IPO_LINK_FLAGS "")
endif()
set(TBB_OPENMP_FLAG /openmp)
+1 -5
View File
@@ -1,6 +1,4 @@
if (MSVC)
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/MSVC.cmake ./cmake/compilers/MSVC.cmake)
elseif (FLATPAK AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (FLATPAK AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake ./cmake/compilers/GNU.cmake)
else()
set(_patch_command "")
@@ -15,8 +13,6 @@ orcaslicer_add_cmake_project(
-DTBB_BUILD_SHARED=OFF
-DTBB_BUILD_TESTS=OFF
-DTBB_TEST=OFF
-DTBB_ENABLE_IPO=OFF
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_DEBUG_POSTFIX=_debug
)
+7 -9
View File
@@ -15,13 +15,7 @@ if(WIN32)
# See https://github.com/python/cpython/issues/153438
# Patch from https://github.com/python/cpython/pull/153608
# This patch has not been merged to 3.12 yet so we need to apply it manually
#
# Without core.autocrlf=false the patched find_python.bat comes out LF and
# cmd.exe cannot find its goto labels.
set(_patch_cmd git init
&& ${GIT_EXECUTABLE} -c core.autocrlf=false apply --verbose
--ignore-space-change --whitespace=fix
${CMAKE_CURRENT_LIST_DIR}/01-windows-nuget.patch)
set(_patch_cmd git init && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/01-windows-nuget.patch)
if(MSVC_VERSION EQUAL 1800)
set(_python_platform_toolset v120)
@@ -59,9 +53,12 @@ if(WIN32)
set(_python_pcbuild_output_dir win32)
endif()
# pybind11 undefines _DEBUG around Python.h so a debug build links the
# release python3xx.lib; Py_DEBUG could not load release plugin modules.
set(_python_pcbuild_config Release)
set(_python_layout_debug OFF)
if(DEFINED DEP_DEBUG AND DEP_DEBUG)
set(_python_pcbuild_config Debug)
set(_python_layout_debug ON)
endif()
# CPython's PCbuild needs a 64-bit-hosted toolchain: find_msbuild.bat picks the
# 32-bit Bin\MSBuild.exe, whose x86 cl.exe/link.exe run out of address space
@@ -104,6 +101,7 @@ if(WIN32)
-DPYTHON_BUILD_DIR=<SOURCE_DIR>/PCbuild/${_python_pcbuild_output_dir}
-DPYTHON_DEST_DIR=${DESTDIR}/libpython
-DPYTHON_LAYOUT_ARCH=${_python_layout_arch}
-DPYTHON_DEBUG=${_python_layout_debug}
-P ${CMAKE_CURRENT_LIST_DIR}/stage_windows.cmake
)
elseif(APPLE)
+17 -3
View File
@@ -9,6 +9,9 @@ foreach(_var PYTHON_SOURCE_DIR PYTHON_BUILD_DIR PYTHON_DEST_DIR PYTHON_LAYOUT_AR
endforeach()
set(_python_exe "${PYTHON_BUILD_DIR}/python.exe")
if(PYTHON_DEBUG)
set(_python_exe "${PYTHON_BUILD_DIR}/python_d.exe")
endif()
if(NOT EXISTS "${_python_exe}")
message(FATAL_ERROR "Built Python executable not found: ${_python_exe}")
@@ -46,11 +49,22 @@ endif()
set(_required_files
"${PYTHON_DEST_DIR}/Lib/encodings/__init__.py"
"${PYTHON_DEST_DIR}/include/Python.h"
"${PYTHON_DEST_DIR}/python.exe"
"${PYTHON_DEST_DIR}/python${_python_abi}.dll"
"${PYTHON_DEST_DIR}/libs/python${_python_abi}.lib"
)
if(PYTHON_DEBUG)
list(APPEND _required_files
"${PYTHON_DEST_DIR}/python_d.exe"
"${PYTHON_DEST_DIR}/python${_python_abi}_d.dll"
"${PYTHON_DEST_DIR}/libs/python${_python_abi}_d.lib"
)
else()
list(APPEND _required_files
"${PYTHON_DEST_DIR}/python.exe"
"${PYTHON_DEST_DIR}/python${_python_abi}.dll"
"${PYTHON_DEST_DIR}/libs/python${_python_abi}.lib"
)
endif()
foreach(_required_file IN LISTS _required_files)
if(NOT EXISTS "${_required_file}")
message(FATAL_ERROR "Staged Python file missing: ${_required_file}")
-24
View File
@@ -1,26 +1,3 @@
# wxInspector finds wxWidgets through CMake's FindwxWidgets module, which only
# searches lib/vc*_lib because _WX_TOOL is hardcoded to "vc". A superbuild driven
# by clang-cl installs wxWidgets into lib/clang_x64_lib, so hand the module the
# directory wxWidgets actually used, derived the same way wxWidgetsConfig.cmake
# derives it.
set(_wxinspector_wx_hints "")
if (MSVC)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(_wx_compiler_prefix "clang")
else ()
set(_wx_compiler_prefix "vc")
endif ()
set(_wx_arch_suffix "")
if (CMAKE_GENERATOR_PLATFORM AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
string(TOLOWER "_${CMAKE_GENERATOR_PLATFORM}" _wx_arch_suffix)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_wx_arch_suffix "_x64")
endif ()
set(_wxinspector_wx_hints
"-DwxWidgets_ROOT_DIR=${DESTDIR}"
"-DwxWidgets_LIB_DIR=${DESTDIR}/lib/${_wx_compiler_prefix}${_wx_arch_suffix}_lib")
endif ()
orcaslicer_add_cmake_project(
wxInspector
URL https://github.com/Noisyfox/wxInspector/archive/refs/tags/v1.0.0.zip
@@ -29,7 +6,6 @@ orcaslicer_add_cmake_project(
CMAKE_ARGS
-DCMAKE_CXX_FLAGS="-DwxDEBUG_LEVEL=0"
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
${_wxinspector_wx_hints}
)
if (MSVC)
@@ -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;
}
-10
View File
@@ -21,22 +21,12 @@ else ()
set(_wx_edge "-DwxUSE_WEBVIEW_EDGE=OFF")
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_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=ON
+2 -2
View File
@@ -162,7 +162,7 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first, Impor
rewind(fp);
try{
char solid_name[256];
int res_solid = fscanf(fp, " solid %255[^\n]", solid_name);
int res_solid = fscanf(fp, " solid %[^\n]", solid_name);
if (res_solid == 1) {
char* mw_position = strstr(solid_name, "MW");
if (mw_position != NULL) {
@@ -170,7 +170,7 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first, Impor
char version_str[16];
char model_id_str[128];
char country_code_str[16];
int num_values = sscanf(mw_position + 3, "%15s %127s %15s", version_str, model_id_str, country_code_str);
int num_values = sscanf(mw_position + 3, "%s %s %s", version_str, model_id_str, country_code_str);
if (num_values == 3) {
if (strcmp(version_str, "1.0") == 0) {
model_id = model_id_str;
+1 -5
View File
@@ -37,11 +37,7 @@ target_include_directories(Clipper2
)
if (WIN32)
if (MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(Clipper2 PRIVATE /W4 /WX)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
target_compile_options(Clipper2 PRIVATE /W4)
endif()
target_compile_options(Clipper2 PRIVATE /W4 /WX)
else()
target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic -Werror)
target_link_libraries(Clipper2 PUBLIC -lm)
-1
View File
@@ -2856,7 +2856,6 @@ const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
{
0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x2000, 0x206F, // General Punctuation
0x2103, 0x2103, // ℃ Celsius symbol
0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana
0x31F0, 0x31FF, // Katakana Phonetic Extensions
0xFF00, 0xFFEF, // Half-width characters
-95
View File
@@ -465,57 +465,6 @@ static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditState *stat
STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
y = r.ymin;
}
else
{
// In multi-line mode, clamp y to stay within the text vertical bounds.
// This lets the click still land at a valid location if the mouse is slightly
// above or below the text.
StbTexteditRow r;
int n = STB_TEXTEDIT_STRINGLEN(str);
int i = 0;
float base_y = 0, y_min, y_max;
// Get the first row to establish y_min and start the iteration
STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
if (r.num_chars <= 0)
{
state->cursor = 0;
state->select_start = state->cursor;
state->select_end = state->cursor;
state->has_preferred_x = 0;
return;
}
y_min = r.ymin;
y_max = base_y + r.ymax;
i = r.num_chars;
base_y += r.baseline_y_delta;
// Walk the remaining rows to find the bottom of the last row
while (i < n)
{
STB_TEXTEDIT_LAYOUTROW(&r, str, i);
if (r.num_chars <= 0)
break;
y_max = base_y + r.ymax;
i += r.num_chars;
base_y += r.baseline_y_delta;
}
// If the text ends with a newline, account for the empty trailing line
// so the cursor can be placed on it
if (n > 0 && STB_TEXTEDIT_GETCHAR(str, n - 1) == STB_TEXTEDIT_NEWLINE)
{
STB_TEXTEDIT_LAYOUTROW(&r, str, n);
y_max = base_y + r.ymax;
}
// Subtract half the last line height to avoid rounding issues when the mouse
// is just barely below the last line (keep cursor on the last line, not after the text)
y_max -= (r.ymax - r.ymin) * 0.5f;
if (y < y_min) y = y_min;
if (y > y_max) y = y_max;
}
state->cursor = stb_text_locate_coord(str, x, y);
state->select_start = state->cursor;
@@ -536,50 +485,6 @@ static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditState *state
STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
y = r.ymin;
}
else
{
// In multi-line mode, clamp y to stay within the text vertical bounds.
// This lets the drag keep working if the mouse goes off the top or bottom of the text.
StbTexteditRow r;
int n = STB_TEXTEDIT_STRINGLEN(str);
int i = 0;
float base_y = 0, y_min, y_max;
// Get the first row to establish y_min and start the iteration
STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
if (r.num_chars <= 0)
return;
y_min = r.ymin;
y_max = base_y + r.ymax;
i = r.num_chars;
base_y += r.baseline_y_delta;
// Walk the remaining rows to find the bottom of the last row
while (i < n)
{
STB_TEXTEDIT_LAYOUTROW(&r, str, i);
if (r.num_chars <= 0)
break;
y_max = base_y + r.ymax;
i += r.num_chars;
base_y += r.baseline_y_delta;
}
// If the text ends with a newline, account for the empty trailing line
// so the cursor can be placed on it
if (n > 0 && STB_TEXTEDIT_GETCHAR(str, n - 1) == STB_TEXTEDIT_NEWLINE)
{
STB_TEXTEDIT_LAYOUTROW(&r, str, n);
y_max = base_y + r.ymax;
}
// Subtract half the last line height to avoid rounding issues when the mouse
// is just barely below the last line (keep cursor on the last line, not after the text)
y_max -= (r.ymax - r.ymin) * 0.5f;
if (y < y_min) y = y_min;
if (y > y_max) y = y_max;
}
if (state->select_start == state->select_end)
state->select_start = state->cursor;
-2
View File
@@ -11,8 +11,6 @@ add_library(miniz_static STATIC
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
target_compile_definitions(miniz_static PRIVATE _GNU_SOURCE)
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
target_compile_options(miniz_static PRIVATE /clang:-Wno-error=incompatible-pointer-types)
endif()
target_link_libraries(miniz INTERFACE miniz_static)
-508
View File
@@ -1,508 +0,0 @@
# Filament IDs (`filament_id`)
`filament_id` identifies one **filament product**: one named spool product = one id, shared by
all of that product's per-printer / per-nozzle variants, in every profile bundle that ships it.
Devices use it to match a physical spool or tray to a filament preset. It is never per-color,
per-printer, per-nozzle, or per-preset (per-preset identity is `setting_id`), and it is never
per-bundle either — PolyLite PLA carries the same id whether the preset lives in the
OrcaFilamentLibrary (OFL), Qidi, or Snapmaker bundle. The granularity is the name on the spool,
not the brand behind it: `AAA PLA Lite` and `AAA PLA Pro` are two filaments with two ids, not
variants of one.
**How it is generated:** an id is computed, never invented. `scripts/orca_id_tool.py`
mints it as a deterministic hash of the product's identity — the triple
`(filament_vendor, filament_type, filament name)`, where the filament name is the preset name
with its `@...` variant suffix stripped — producing an 8-character `OF*` code that is the
same for that product in every bundle, in every PR, on every machine. For example, Polymaker's
PolyLite PLA presets (`PolyLite PLA @base`, `PolyLite PLA@Q2-Series`, …) resolve
`filament_vendor` `Polymaker`, `filament_type` `PLA`, and filament name `PolyLite PLA`; hashing
`filament_product/Polymaker/PLA/PolyLite PLA` yields `OF5CgdDq`, and that is the id the
OrcaFilamentLibrary, OrcaArena, Qidi, and Snapmaker bundles all arrive at independently
(derivation details in the Minting section).
**How it is used:** at runtime the id is the join key between hardware and profiles.
When a printer reports what a tray holds (Bambu AMS, Qidi box, Creality CFS,
Klipper, Snapmaker), OrcaSlicer matches the reported id against the filament presets
compatible with that printer to select the right profile; other features — tray display
names, support-material detection, vitrification warnings, multi-nozzle filament grouping —
look up material properties by id alone. An id that changes is not forwarded anywhere: a
tray or record still holding the old value falls back to matching by material type until the
user re-selects the filament, so identity changes are made deliberately and rarely.
This page is the rule for authoring `filament_id` in system profiles
(`resources/profiles/**`). CI enforces everything below; the short version is:
> [!IMPORTANT]
> **Never write a `filament_id` value by hand.** A new filament gets its id from
> `python scripts/orca_id_tool.py --generate`; one already in the tree has one — inherit it.
## The design, in two pieces
Because several consumers match **globally by id alone, first hit wins** (see the next
section), any two materials sharing one id feed wrong data somewhere — a wrong tray name, a
wrong support-material flag, a wrong nozzle grouping — and inside one printer a duplicated id
makes AMS spool matching a coin toss. Hand-written ids produce such collisions constantly, so
the system is built to make them impossible:
1. **Deterministic minting.** An id is a pure hash of the product's identity — no registry to
maintain, no next-free-number ceremony, no way for two concurrent PRs to race for the same
number, and no way to get it wrong by hand, because you never write it by hand.
2. **A sanctioned snapshot.** The complete id landscape derived from the tree must equal
`scripts/filament_id_snapshot.json` exactly, so every change to ids, claims (which bundles
ship which id, and for which filament), or product identity surfaces as a reviewable diff to
one file — the maintainer gate.
## Who consumes the id
The canonical consumer is tray-to-preset matching: a device reports a tray material id
(`tray_info_idx`), and the shared matching pipeline (`PresetBundle::sync_ams_list` and
friends) resolves it to a preset. The matcher is printer-scoped and first-match-wins:
scanning only compatible root presets — system roots plus user-made custom filaments, which
are user roots carrying their own `P*` ids; a preset derived from another resolves through
its root and never matches directly — it picks the first one whose `filament_id` equals the
tray's. On a miss it falls back by filament type: a system `Generic <type>` preset
(matched by name, then by type similarity), else the slot's previous selection, else any compatible system generic or,
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
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.
| 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 |
| Snapmaker | runtime color/vendor/type match |
Tray-to-preset matching is printer-scoped, but **several consumers match globally by id alone,
first hit wins**: tray display names, `filament_is_support`, vitrification warnings, and
multi-nozzle filament grouping in the slicing pipeline (`FilamentGroup::try_merge_filaments`
merges plate slots sharing one `(filament_id, color)` pair, with matching
extruder-printability, onto one nozzle group; the engine is implemented but no grouping path
calls it yet).
Two *different* materials sharing one id
feed wrong data to those consumers even when the presets live in different vendors — so
cross-material id sharing is never safe. Within one printer, duplicate ids break AMS matching:
the matcher picks whichever preset loads first (it now logs an "Ambiguous AMS filament match"
warning, but the pick is still arbitrary) and the tray-edit dialog, which lists one entry per
id, hides the second preset entirely. The profile validator's `-f` check
(`check_filament_subtypes``PresetBundle::check_duplicate_filament_subtypes`) rejects this
per printer, and CI runs it tree-wide.
Two more consumer-side facts worth knowing:
- The machine-facing dialogs (AMS tray edit, AMS dry control, calibration history, extrusion
calibration) offer the filaments a connected printer can use by the same compatibility rule
the plater uses (an empty `compatible_printers` means *every* printer). Alias shadowing
still applies: a vendor's same-name profile supersedes the library generic. That is what
puts Orca Filament Library materials in those lists — deduplicated to one entry per
`filament_id` in the AMS and calibration-history dialogs, while extrusion calibration
deliberately lists every matching preset by full name.
- The id is load-bearing at startup: an instantiated system filament (one marked
`"instantiation": "true"` — see the structure rules) that resolves **no**
`filament_id` anywhere in its `inherits` chain is a hard load error in the C++ loader
(`Can not find filament_id for <name>`) that discards the entire vendor bundle (for the
OrcaFilamentLibrary itself the failure is messier: library presets loaded before the
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.
## 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?**
Different polymer, different sub-brand (Basic / Matte / Silk / HF), fiber-filled sibling, or a
second selectable diameter → **new filament, new id**. The same spool tuned for another printer
or nozzle → **join the existing filament** (keep its base name and inherit it; no id
key needed). Tuning a generic material → **join the OrcaFilamentLibrary filament** (inherit
`Generic X @System` and keep the `Generic X` base name; no id key needed).
| Situation | id |
| --- | --- |
| Per-printer / per-nozzle variant of an existing material | same id (inherit it) |
| Sub-brand or product line (PLA vs PLA Matte vs PLA Silk vs PLA HF) | new id each |
| Color | never a new id |
| Second diameter of the same product (1.75 + 2.85) | sibling filament, new id |
| "High-speed" tuned for a *different printer model* | same id (it is a printer variant) |
| "High-speed" selectable *alongside* the normal preset on one printer | new name, so a new id (it is a product line) |
## Structure rules
1. **Every preset carries the id of its own product, wherever it gets it from.** The id is a
function of the preset's own triple (rule 5), and `inherits` carries settings, never
identity. So a preset may declare the key itself or inherit it from any ancestor — a
`<Filament> @base` root, a real (instantiated) preset of the same filament, an
OrcaFilamentLibrary preset — and CI checks one thing: the id it ends up with equals the
mint of *its* triple. The usual shape is one `@base` root (`"instantiation": "false"`)
declaring the key and the per-printer variants inheriting it; a filament may have several
roots — Qidi's PolyLite PLA has four per-series roots (`PolyLite PLA@Q2-Series`,
`@Q2C-Series`, `@X-Max 4-Series`, `@X-Plus 5-Series`) — which then all declare the identical
id. A branded filament that borrows a generic's settings (`Flashforge ABS Basic @FF C5`
inherits `Generic ABS @System`) declares its own id, because its triple is its own.
2. **The filament name is the base name**: the preset name with everything from the first
(optionally space-preceded) `@` stripped. `MyBrand PLA @Orca 3D Fuse1` and `MyBrand PLA@HS`
are both the filament `MyBrand PLA`.
3. **Within one filament, variants' `compatible_printers` are pairwise disjoint** — per printer,
at most one compatible instantiated preset per id, or AMS matching turns ambiguous. The
C++ validator's `-f` check enforces this, tree-wide in CI. Since one product carries one id
and cannot be split onto two, this rule is the *only* remedy for such an ambiguity: narrow
the `compatible_printers`, or retire the preset that duplicates another.
4. **Generics belong to OrcaFilamentLibrary.** A vendor tuning a generic material inherits
`Generic X @System`, keeps the `Generic X` base name (that alias is what hides the library
preset on your printers, and it is what makes its triple — and so its id — the library's)
and sets a non-empty `compatible_printers` — e.g. `Generic PLA @Sovol SV08 MAX` inherits
`Generic PLA @System` and lists three Sovol nozzles. Renaming such a preset makes it a
different product by rule 5, so it then needs its own id.
5. **Ids follow the product identity.** The id is a pure function of the product triple
`(filament_vendor, filament_type, filament name)`, so correcting any of them re-mints the id
**by design**, applied by `--generate` (preview with `--dry-run`, confine with `--vendor`) and
gated by the `--update-snapshot` diff; the exact sequence is in the FAQ. Nothing forwards
the old value, so anything outside the tree that stored it — a device tray, a calibration
record, a saved project — falls back to matching by filament type until the user re-selects
the filament. Re-mint deliberately, and only to fix a genuinely wrong identity.
(`renamed_from` still gates preset-*name* compatibility, as before.)
## Minting — nobody invents ids
New ids are deterministic, computed exactly like the `setting_id` precedent
(the `setting_id` half of `scripts/orca_id_tool.py`):
```text
FILAMENT_ID_NAMESPACE = uuid5(setting-id NAMESPACE, "filament_id")
= c4d3ff49-4c32-5534-a3e3-00894157ab97
filament_id = "OF" + base62_6( uuid5(FILAMENT_ID_NAMESPACE,
"filament_product/<filament_vendor>/<filament_type>/<filament_name>") )
```
`base62_6` is the low 6 base62 digits (alphabet `0-9A-Za-z`) of the UUID taken as a big-endian
integer, most-significant digit first; with the `OF` prefix the full id is 8 chars, within the
AMS length limit. The triple comes from the root preset's *flattened* config:
`<filament_vendor>` is the filament
**manufacturer** (`"Polymaker"`, or `"Generic"` for generics — never the printer brand),
`<filament_type>` the material type, `<filament_name>` the root's base name; the two config
values are inheritable list options and the first element counts.
Content-addressing on that triple is what makes the whole system converge. The key contains no
bundle name, so the same product mints the same id in every bundle — moving a filament into
OrcaFilamentLibrary never changes its id, and two vendors independently shipping the same
product arrive at the same id without coordinating. `Polymaker/PLA/PolyLite PLA` mints
`OF5CgdDq`, and that one id is declared by the OrcaFilamentLibrary, OrcaArena, Qidi, and
Snapmaker bundles alike; the OFL generic `Generic/PLA/Generic PLA` mints `OFDSrzZ8`, claimed
by 35 bundles — most by independent declarations converging on the same mint, the rest
purely through inheritance from the OFL preset.
Nothing but the triple feeds the mint — not the rest of the tree, not the snapshot, not what
another preset of the product happens to carry. Determined triple, determined id: one product
carries one id and there is no second acceptable value for it, so any other value on a preset
is a mismatch `--check` reports and `--generate` pulls back. Two *different* products whose
triples mint the same base62 value would be a collision (a roughly 36-bit id space against a
few thousand products); nothing salts past it: `--check` reports it naming both products,
`--generate` refuses to write it, and the remedy is a rename so their triples differ. Where
two presets of one product would be AMS-ambiguous on a printer, the fix is likewise in the
profiles — make their `compatible_printers` disjoint (structure rule 3), retire the redundant
preset, or, if they really are different products, give them different names so their triples
differ. Never a second id for one triple.
Workflow for a new filament:
```bash
# 1. Author the filament with NO filament_id key anywhere.
python scripts/orca_id_tool.py --dry-run # 2. preview the ids — writes nothing
python scripts/orca_id_tool.py --generate # 3. apply them to the profile file(s)
python scripts/orca_id_tool.py --update-snapshot # 4. record the new claims in the snapshot
python scripts/orca_id_tool.py --check # 5. validate the filament_id state
python scripts/orca_extra_profile_check.py # 6. ...and everything else CI checks
# 7. Commit the profile edits together with scripts/filament_id_snapshot.json, for review.
```
`--generate` makes every filament's id equal the mint of its own
`(filament_vendor, filament_type, filament name)` triple: it inserts one where an instantiated
filament resolves none, and re-derives one that does not match. A preset that *inherits* a
mismatching id is the one case left to the author — check 3b names it, and the fix is to inherit
a preset of the same filament or to give the preset its own key. A declaration is left alone
exactly when it already equals the one id its triple mints, and a collision (check 3d) is
reported and left unwritten. The same run assigns
`generate_preset_setting_id(vendor, type, name)` to every instantiated filament, process
and machine preset of every vendor except BBL, which keeps its authoritative `G*` ids, strips
`setting_id` from base profiles, and fixes the misspelled `settings_id` key — dropped, or, for
BBL, whose ids have no formula to fall back on, restored under the correct name. It is idempotent and
byte-preserving (indentation, BOM, and line endings intact, every edited file re-parsed to fail
loudly), and a no-op on a tree that already passes `scripts/orca_extra_profile_check.py` — the
check CI runs over both id kinds, of which `--check` is the `filament_id` half.
- `--filament-id` limits the run to `filament_id`.
- `--setting-id` limits the run to `setting_id`. The two exclude each other; pass neither to
write both.
- `--vendor VENDOR` confines the run to that bundle; repeatable. The id is a function of the
triple alone, so a narrowed run writes exactly what a full one would; `--check` reports
whatever it left outside.
- `--dry-run` reports what `--generate` would do and writes nothing; with no mode of its own it
implies `--generate`, so `--dry-run --vendor <Vendor>` previews just that bundle.
- `--profiles DIR` points the tooling at a different profile tree (default
`resources/profiles`). `--check` and `--update-snapshot` read and write the sanctioned state of
the tree they are given, so pointing them elsewhere needs `--snapshot PATH` for that tree too —
`scripts/filament_id_snapshot.json` describes `resources/profiles` and no other tree.
**Identity fixes need no separate mode.** `--generate` re-derives an id that no longer matches its
triple exactly the way it fills in a missing one, so a rename or a `filament_vendor` /
`filament_type` correction is just: fix the config, run `--generate` (confine it with `--vendor`,
preview it with `--dry-run`), then `--update-snapshot` and review the diff.
If you skip the tooling, CI fails and prints the remedy: the expected id for your filament and
the instruction to run `python scripts/orca_id_tool.py --generate`; once the id is minted, the
snapshot checks likewise point at `--update-snapshot` and tell you to commit the resulting
diff.
## Reserved namespaces — never mint or hand-write into
A **reserved namespace** is an id space no system profile may declare, because an external
catalog or a device protocol owns the values. None of them has an owning vendor: there is no
bundle — not even the one whose printers use the catalog — that may write one into a profile.
| Space | Status | Rule |
| --- | --- | --- |
| `GF*` | Bambu AMS/RFID catalog | declarable by **nobody**, BBL included: Bambu's own ids live in the generated catalog map, never in a profile |
| `QD_*` | Qidi device protocol | declarable by **nobody**, Qidi included: the box composes these ids at runtime and they are not preset ids |
| `P` + 7 hex chars (case-insensitive), `"null"` | user-created custom filaments (`CreatePresetsDialog.cpp`) | never appears in system profiles |
The two device namespaces, in detail:
- **Bambu (`GF*`).** Bambu's device/RFID/cloud catalog is external and opaque, which is a
reason to keep it out of the profiles rather than to let one bundle own it. Every BBL filament
mints an `OF` id from its triple like every other vendor's, and the correspondence to Bambu's
catalog ids lives in one generated file the app applies at the printer boundary — the next
section. Nothing under `resources/profiles/**` carries a `GF*` id today and nothing can be
exempted, so a `GF*` id appearing anywhere in the tree is a mistake, whoever wrote it.
- **Qidi (`QD_*`).** `QD_*` is a device-*protocol* namespace, not a preset id space: the
Qidi box path composes `QD_<series>_<vendor>_<typeidx>` ids at runtime (slot vendor and
type indices reported by the device, the series digit inferred client-side from the printer
model/name). Qidi presets carry ordinary minted `OF*` ids (generics share the OFL ids), so
a composed id matches no preset and the slot falls back to filament type; translating it to
the filament's id belongs in `QidiPrinterAgent`. The alternative — treating per-series
protocol ids as preset ids — would put one product under five ids (`QIDI PLA Rapido` would
be `QD_0_1_1` through `QD_4_1_1`), exactly the fragmentation the mint rule removes.
## The Bambu catalog map
Bambu's printers, its AMS and its cloud know only Bambu's own catalog ids. Our profiles carry
minted `OF` ids like every other vendor's, so one generated file records the correspondence and
the app applies it **only where an id crosses to or from a Bambu printer**.
**The file** is `resources/printers/bambu_filament_ids.json` — a header plus one row per
catalogued product, keyed by our id:
```json
{
"source": "https://github.com/bambulab/BambuStudio",
"bambustudio_commit": "66e405477",
"generated": "2026-09-04",
"filaments": {
"OFhuaUQB": { "bambu_id": "GFB00", "vendor": "Bambu Lab", "type": "ABS", "name": "Bambu ABS" }
}
}
```
It ships in `resources/printers/`, next to `filaments_blacklist.json` — deliberately not in
`resources/profiles/`, where the loader reads every top-level `.json` as a vendor index. It
holds 100 rows today, one per product BambuStudio ships, and the correspondence is
one-to-one in both directions.
**It is generated, never hand-edited.** `python scripts/update_bambu_filament_ids.py` rebuilds
it from **BambuStudio's own shipped BBL bundle** — a sparse shallow clone of upstream `master`,
or `--bambustudio-dir <a BambuStudio resources/profiles checkout>`. Our BBL bundle is a fork of
Bambu's, tuned and extended independently, so it is not the source of truth for Bambu's ids.
A row's key is the id the product's `(filament_vendor, filament_type, filament name)` triple
mints — the same id any bundle of ours carries for it, since the id is a function of the triple
alone; the row of a product we do not ship sits inert until some bundle claims that triple —
`OFdyfQvU` / `GFG03`, "Bambu PETG Matte", is such a row today.
**Regenerate it in the same commit as every BBL profile sync**, and read the drift report it
prints. Two lines, both informational, neither blocking the write:
```text
upstream ships 'Bambu PETG Matte' (Bambu Lab/PETG), we ship nothing with that identity
Orca BBL filaments with no row: 135 Orca-only product(s)
```
The first names each upstream product our BBL bundle has no same-identity filament for —
sometimes a genuinely missing product, sometimes a name drift a follow-up rename would
converge. The second counts our own BBL filaments that matched no row: 135 of 234 today, of
which 109 send an `OF` id on the wire and 26 already rode `OF` ids inherited from the
OrcaFilamentLibrary. **135 is the number to expect at every regeneration** — 109 was the
one-off size of the transition and stopped being computable from the tree once the BBL bundle
was re-minted, so do not "fix" the report to print it.
**Check 6** lives in `check_filament_ids`, so profile CI runs it alongside the other five. It
holds the file to its contract: it parses, carries `source` / `bambustudio_commit` /
`generated`, keys only `OF`-format ids, maps each Bambu id at most once, and — for every row
whose key the tree actually claims — agrees with the tree on that id's `(vendor, type, name)`
triple. A row for a product we do not ship is skipped, not an error. The remedy it prints is
always the same: regenerate the map and commit the diff for review.
### The runtime rule: swap on hit
Outbound, our id with a row becomes Bambu's; inbound, Bambu's id with a row becomes ours.
Everything else is forwarded untouched — an `OF` id with no row, a Bambu id for a product we do
not ship, a `P`-hex user id, `"null"`, an empty string. Translation is confined to the
boundary: nothing between the boundaries ever holds a Bambu id.
Translating one value is a capability of the printer agent: `IPrinterAgent` declares
`to_orca_filament_id` and `from_orca_filament_id` returning their argument, and `BBLPrinterAgent`
overrides them with Bambu's map, so an agent whose printers already speak our ids inherits the
identity default and translates nothing. `NetworkAgent` forwards both to the live agent, so the
comparison sites below reach them through `wxGetApp().getAgent()` and leave an id untranslated
while no agent is live. Whole documents are Bambu's business alone:
`BBLPrinterAgent::to_orca_payload` and `from_orca_payload` rewrite every string under
`tray_info_idx`, `filament_id` or `filamentId` at any depth; text that does not parse, or carries
none of those keys, comes back unchanged. The map is loaded once, lazily; a missing or malformed
file degrades to identity with a log line rather than failing.
| Boundary | Where it translates |
| --- | --- |
| Everything the agent sends | `BBLPrinterAgent::send_message` and `send_message_to_printer`, plus `PrintParams::ams_mapping_info` in `dispatch_start` — the funnel all five `start_*` calls share |
| Everything the agent receives | `set_on_message_fn` and `set_on_local_message_fn` wrap their callback, so `MachineObject::parse_json` and everything downstream see our ids only |
| 3mf export | `Plater::export_3mf` writes Bambu's ids into `slice_info.config`, gated on `preset_bundle.is_bbl_vendor()` — the printer reads that file and knows only its own catalog, and no other vendor's export is affected. The CLI has its own writer in `OrcaSlicer.cpp`; it does the same, gated on the `printer_model` prefix that already decides `Print::is_BBL_printer()` for that run |
| Project ingest | `Plater::priv::load_files` reverse-maps the project's `filament_ids` before the bundle ingests them, so a project saved by an older Orca or by BambuStudio still resolves the same presets |
| Prints from the printer's SD card | `SelectMachineDialog::update_print_required_data` reverse-maps each plate's slice-info ids as it adopts the plates, so the AMS mapping dialog pairs them with trays |
| Bambu-specific comparisons | `CalibUtils.cpp`, `DeviceManager.cpp`, `DeviceCore/DevFilaSystem.cpp`, `DeviceCore/DevFilaBlackList.cpp`, `SelectMachine.cpp`, `AMSDryControl.cpp`, `AMSMaterialsSetting.cpp`, `PresetComboBoxes.cpp`, `ColorDecomposeSupport.cpp` |
That last row is the rule to follow when a new Bambu-specific behaviour is added: **translate
the value you are about to compare, never the table you compare it against.** The shipped data
those sites read is Bambu's and stays verbatim — `white_fila_ids` in
`resources/printers/filaments_blacklist.json`, the calibration id lists in
`resources/printers/<model>.json`, `fila_id` in
`resources/profiles/BBL/filament/filaments_color_codes.json`.
`tests/slic3rutils/test_bambu_filament_ids.cpp` covers the lookups, the payload rewrite and the
Bambu-specific rules. `orcaslicer_discover_tests` registers a Catch2 tag as a CTest **label**,
not as part of the test name, so `-R` matches nothing here and the filter is `-L`:
```bash
ctest --test-dir <build dir>/tests/slic3rutils -L BambuFilamentIds
```
### Three places the map deliberately does not reach
The map and its lookups live in the GUI library, which libslic3r cannot link against and which a
GUI-less build does not link at all. Three consequences are known and documented; none is worth
pulling the map down into libslic3r for.
- **The support display type in `PrintConfig.cpp`.** `DynamicPrintConfig::get_filament_type`
picks `PLA-S` / `Sup.PLA` and `PA-S` / `Sup.PA` for a support filament by testing
`filament_id` against `GFS00` and `GFS01`, and otherwise falls back on `filament_type` — a
fallback that returns those same two pairs for `"PLA"` and `"PA"`. Bambu Support W inherits
`fdm_filament_pla` and Bambu Support G inherits `fdm_filament_pa`, so with their `OF` ids the
fallback produces exactly what the id branches produced. (The only config that ever carries a
singular `filament_id` key is the AMS tray config built in `Plater.cpp`, and that one never
reaches this function.) These two lines are the only mention of a Bambu id anywhere in
libslic3r, and they need no change.
- **Config imports.** `PresetBundle::import_presets` (File ▸ Import ▸ Import Configs, for
`.json` / `.zip` / `.orca_filament` / `.orca_printer` / `.orca_bundle`) and
`PresetBundle::load_config_file` (the CLI's `--load-settings` of a G-code file with an
embedded config) both parse inside libslic3r, out of the GUI's reach, so a Bambu id carried
in such a file lands on the imported preset untranslated. The effect is bounded: that preset
does not auto-match an AMS tray while the stale id is live, and the id does not survive
being saved — `Preset::save` writes a `filament_id` key only for a preset whose `inherits` is
empty, and on the next load an inheriting preset takes its parent's id. A known gap, and not
a regression: nothing forwarded a stale id before either.
- **A build configured without the GUI.** `target_link_libraries(OrcaSlicer libslic3r_gui)` sits
inside `if (SLIC3R_GUI)` in `src/CMakeLists.txt`, so the lookups are not linkable when the GUI
is off. The CLI's 3mf writer in `src/OrcaSlicer.cpp` therefore guards its translation with
`#ifdef SLIC3R_GUI`, and a 3mf that such a build slices for a Bambu printer carries our `OF`
ids in `slice_info.config` rather than Bambu's. Every shipped build enables the GUI, so this
reaches only a purpose-built GUI-less binary.
One more thing worth recording before it is rediscovered:
`SyncAmsInfoDialog::update_print_required_data` is a structural twin of the SD-card function
above and carries no translation. It has no callers today and its plate list is only ever read
for `printer_model_id`, so it is not a live gap — but wiring it up without adding the reverse
map would silently reproduce the bug.
## How CI enforces this
Profile CI (`check_profiles.yml`) runs `check_filament_ids()` tree-wide via
`scripts/orca_extra_profile_check.py`. Its ground truth is
**`scripts/filament_id_snapshot.json` — the sanctioned state**: the id state derived from the
tree must equal the snapshot exactly, in both directions. Any change to the id landscape
therefore surfaces as a diff to that file, and **that snapshot diff is what maintainers review
and gate in a PR**. Never edit the snapshot by hand — `--update-snapshot` regenerates it
deterministically (running it twice changes nothing). The snapshot holds one map, `ids`: each
entry is the product the id is minted from (`filament_vendor`, `filament_type`, `name`) and the
`filaments` claiming it (`Vendor/Filament`), and it sanctions *state*, never exceptions: no check
consults it to excuse a preset from a rule, and there is no grandfather list of any kind.
The checks, in brief:
- **Format** — every id occurring in the tree is `OF` + 6 base62 chars. No exceptions: not a
snapshot entry, not BBL.
- **Snapshot equality** — tree claims == snapshot claims **and** each id's declared triple ==
its snapshot entry, both directions: any `filament_vendor`/`filament_type`/name change
surfaces as a snapshot diff.
- **Identity** — the id is a function of the triple alone. A declared `OF*` id must equal the
one id its declarer's own triple mints, with no second acceptable value; the id an
instantiated preset *inherits* must equal the mint of *its* own triple, however it inherits
it (a root, a real filament, a library preset — structure rule 1); and every instantiated
system filament must resolve an effective id at all (recall: an id-less one is a hard load
error in C++ that discards the whole vendor bundle); and no two products mint one id (a
base62 collision, resolved by renaming one of them). The errors print the expected id.
- **Reserved namespaces**`GF*`, `QD_*`, `P<7-hex>` or `"null"` claimed by any vendor,
BBL and Qidi included.
- **Triple integrity** — every declarer must resolve a non-empty `filament_vendor` and
`filament_type` (generics use `"Generic"`), and all declarers of one filament within a
bundle must agree on the triple.
- **Bambu catalog map**`resources/printers/bambu_filament_ids.json` parses, carries its
`source` / `bambustudio_commit` / `generated` header, keys only `OF`-format ids, maps each
Bambu id at most once, and agrees with the tree on the triple of every row whose key the
tree claims. See [The Bambu catalog map](#the-bambu-catalog-map); the remedy is always to
regenerate, never to hand-edit.
A profile that declares a **reserved-namespace** id — `GF*`, `QD_*` or `P<7-hex>`, whatever
its vendor — cannot pass the format check, so `--update-snapshot` refuses to sanction it
rather than hide the mistake until CI. For a Bambu-cataloged product, the catalog map is where
the correspondence belongs. Any other new sharing via a *declared* id is caught by the identity
check; sharing through inheritance carries no declaration to check and surfaces only as a new
claim in the snapshot diff — which is exactly why that diff is the gate.
`orca_extra_profile_check.py` separately holds every declared id to the AMS 8-character limit,
tree-wide and for every vendor alike, scoped to the presets a vendor's index actually
references (a file the index never loads cannot break AMS matching).
Complementing the Python checks, CI also runs the C++ profile validator with `-f`
(`check_filament_subtypes`): it loads the bundle exactly as the app does and flags any printer
for which two or more compatible filament presets share one `filament_id` — the runtime-shaped
ambiguity check behind structure rule 3.
## FAQ
- **A new color of an existing product?** Never a new id — colors are not filaments.
- **A second diameter (1.75 mm and 2.85 mm) of the same product?** A sibling filament with its
own id: two diameters are separately selectable spool products.
- **A high-speed tune of an existing material for another printer model?** Same filament:
keep the base name and inherit its root; no id key needed.
- **A tuned generic ("our profile for Generic PLA")?** Inherit `Generic PLA @System`, keep the
`Generic PLA` base name, set `compatible_printers`; no id key needed.
- **A branded filament that borrows a generic's settings?** Fine — inherit `Generic X @System`
(or any real filament) for the settings and declare the id of your own filament; run
`python scripts/orca_id_tool.py --generate` to mint it. Inheritance never changes the id.
- **I need to fix a filament's `filament_vendor` or `filament_type`.** Fix the config, run
`--generate --vendor <Vendor>` (preview with `--dry-run`), then `--update-snapshot`, and commit
the profile and snapshot diffs together. The id re-derives from the corrected identity, and
nothing forwards the old value, so a tray or record still holding it falls back to matching by
filament type.
- **I need to rename a filament.** Rename the presets (adding `renamed_from`, which keeps the
preset *name* resolving), then `--generate --vendor <Vendor>` (preview with `--dry-run`), then
`--update-snapshot`. The id follows the new filament name; as with any identity fix, the old id
is not forwarded.
- **Can I reuse a `QD_*` id for a Qidi profile?** No — nobody can. It is the device protocol's
own id space: the box composes those values at runtime and no preset carries one. Author
Qidi filaments like any other vendor's.
- **CI says my filament needs an id.** Run `python scripts/orca_id_tool.py --generate`, then
`--update-snapshot`, and commit both diffs. Do not type an id by hand.
For general profile authoring, see the profile development guide on the
[OrcaSlicer wiki](https://www.orcaslicer.com/wiki).
-402
View File
@@ -1,402 +0,0 @@
# System Preset Cache — High Level Design
## Why it exists
OrcaSlicer ships tens of thousands of system preset JSON files. Every launch used to
parse all of them: read each vendor profile, walk its machine, process and filament
sub-files, resolve inheritance, and build the preset collections from scratch. That
parse dominated startup, and it produced the same result every time, because system
presets only change when the app is updated or a profile update is installed.
The preset cache replaces that parse with a read. Each vendor's presets are serialized
once — at build time, in CI — into a single binary file the app reads in one pass. The
read replaces the file walk and the JSON parsing, which is where the time went;
resolving inheritance and registering the presets still runs at load, through the same
code the JSON path uses, so the result is the parse's result without the parse.
The cache is **only ever an optimization**. Every rule below exists to guarantee that a
cache is either provably equivalent to parsing the JSONs, or rejected. There is no
"mostly right" cache.
## The unit is one vendor
A cache covers exactly one vendor. `BBL.opc` sits beside `BBL.json` and holds
everything `BBL.json` and the `BBL/` sub-file tree would have produced.
Per-vendor granularity is what makes the system practical:
- A vendor whose profile is bumped invalidates only its own cache. The other 60-odd
vendors keep theirs — even when the bumped vendor is the shared Orca filament
library everyone else inherits from.
- The setup wizard, which loads vendors one at a time, gets the same speedup as
startup without a second code path.
- A vendor with no cache, or a broken one, costs only that vendor a parse.
A cache holds *system* presets only. User presets, project settings and modified
presets are never serialized — they have their own storage and their own lifecycle.
## Where the files live
| Location | Contents on a shipped build | Role |
|---|---|---|
| `resources/profiles/` | `<vendor>.opc` alone — the profile and its preset JSONs both pruned | What the app ships with; what installing copies from, and the only thing it is read for |
| `<data_dir>/system/` | `<vendor>.opc` alone, or `<vendor>.json` + `<vendor>/` after an update | What the user has installed |
| `<data_dir>/system/` (dev build) | `<vendor>.json` + `<vendor>/` + `<vendor>.opc` written at runtime | A developer tree caches as it parses |
| `<data_dir>/cache/wizard_profile_data.json` | The wizard's derived vendor catalog plus the stamps it was built from | Written and read by the setup wizard only; never shipped (see "The wizard's profile-data cache") |
Two forms of the same vendor therefore exist, and the system's central rule is that
**a vendor's cache is the whole of it**. Where a cache ships or is installed, no profile
and no preset JSONs sit beside it: the cache carries the presets, the vendor profile,
and the version stamp that says which release it came from. A vendor is "installed" if
either form is present *and usable*, and its installed version is read from whichever
form a load would serve.
What stays beside the caches in `resources/profiles/` is everything that is not a
preset: each vendor's directory of printer thumbnails, cover images, bed models and
hotend meshes, which are read from disk by path and were never part of the cache. Files
that are not vendors at all, `blacklist.json` chief among them, are untouched.
The alternative — shipping both and treating the cache as a sidecar — was rejected. It
doubles the installed size, and it creates a class of bug where the two disagree and
the app's behavior depends on which one a given code path happened to read.
## What a cache file is
A fixed-size header followed by one binary stream.
The header carries a magic number, the cache format version, the payload size and a
CRC32 of the payload. It exists so that a truncated download, a half-written file or a
file from an entirely different program is rejected in microseconds, before anything
tries to interpret it.
The payload opens with the stamps that decide whether the cache may be used at all —
format version, vendor name, vendor version — then a dictionary, and then the vendor's
data: its vendor profile, three lists of preset entries (process, filament, machine),
and the count of errors the original parse hit.
Each entry is one preset **in source form**: what its JSON sub-file states and nothing
that resolving it derives — the preset's own config diff, the name of the preset it
inherits, and the parse metadata (name, sub-path, description, instantiation, setting
and filament ids, renames). Non-instantiated base presets are stored too; the children
that inherit from them cannot resolve without them.
**The payload names its own keys.** The dictionary holds the distinct `opt_key`s the
file uses, the `ConfigOptionType` each was written as, and the distinct enum *value
names*; an option in an entry's config is then a `uint16` index into that dictionary
plus its value. Names are written once per file rather than once per occurrence, and a
reader resolves the dictionary against this build's `print_config_def` once, after
which reading an option is a vector index.
This is what makes the cache survive config-schema drift. The alternative — keying an
option by its `serialization_key_ordinal`, the position `ConfigDef::add` assigns by
declaration order at static init — cannot: inserting one option into the middle of
`PrintConfig.cpp` shifts every later ordinal, and the lookup on the way back in then
*succeeds on the wrong option*, silently, wherever the two share a type. Because a
name-keyed payload instead drops the individual options this build cannot place, the
file as a whole stays readable, and there is no schema fingerprint — no checksum over
the option schema that would reject every cache on every release. An option this build
no longer defines, or now defines with a different type, gets exactly what it gets from
a JSON profile: read, dropped, and the rest of the preset loads.
The ordinal-keyed cereal hooks in `PrintConfig.hpp` are untouched — they are also the
undo/redo wire format, where the process cannot change underneath them. The cache has
its own serialization in `PresetCacheFormat.{hpp,cpp}`.
Three deliberate choices in the layout:
- **Stamps come first**, so the question "what version is this vendor installed at?"
can be answered by reading the first kilobyte. The updater asks that question for
every vendor on every launch; reading tens of megabytes to answer it would give back
the startup time the cache saved. The dictionary sits behind them, ahead of the
entries, so a reader that does go on resolves it once and then indexes.
- **Nothing inherited is baked in.** A filament preset that inherits from the shared
library is stored as its own diff plus its parent's name, and the parent is looked up
when the entry is installed, against whatever library is loaded then. A cache
therefore carries no other vendor's values, and no other vendor's update — the
library's included — can make it stale.
- **Nothing derived is stored.** Default presets, flattened configs, aliases and
lookup maps are all reconstructed at load by the same code the JSON path runs, and
state that path never fills (obsolete-preset lists) is not stored either. This keeps
the cache a record of the vendor's data, not a memory image of the program's state.
## When a cache may be used
A cache is accepted only if every gate below passes. Any failure means "parse the
JSONs instead" — never a hard error, never a partial load.
**1. Integrity.** Magic number, a declared body size that is exactly the rest of the
file, CRC32 over the payload. The size is checked against the file's real length before
anything is allocated on the strength of it, so an eight-byte field in an unauthenticated
file cannot ask for a gigabyte.
**2. Cache format version.** A single integer bumped by hand whenever the binary layout
changes in a way nothing else would catch: reordering or retyping a hand-written
serialized field, or changing what the cache's own stamps mean. Config-schema drift is
explicitly *not* such a change — the dictionary handles it — so this no longer moves
every release.
**3. Vendor identity and version.** The cache names the vendor it holds and the profile
version it was built from. It is accepted only if that version is at least as new as
the profile now on disk. Where no profile sits beside the cache — the shipped,
cache-only form — the comparison is skipped, because nothing on disk can be newer than
a cache that is the installation.
**4. Every entry installs.** Entries are installed as they are read, and an entry that
cannot be — typically one that inherits a parent the currently loaded filament library
no longer provides — rejects the whole cache, never just the entry. A partial vendor is
not a vendor.
There is deliberately no stamp for the shared filament library. A cache stores its
filaments' inheritance by name and resolves it at load, so a library update changes
what a cache load *produces*, never whether the cache is *valid* — the same file yields
the updated result. This matters most on a shipped build, where a vendor is its cache
and nothing else: a profile update that delivered only the library would otherwise have
stranded every other vendor with a cache it invalidated and no JSONs to fall back on.
A vendor profile with no parsable version is never cached and never served from a
cache. There would be no way to tell later whether the cache had gone stale, and a
cache nothing can invalidate is worse than no cache.
## How a vendor is loaded
Vendors load in a fixed order, because filament inheritance crosses exactly one
boundary: any vendor's filament may inherit from the shared Orca filament library,
and nothing else reaches across vendors. The library therefore goes first, alone;
every other vendor follows in parallel, resolving against it; and the results are
merged in a stable order:
```mermaid
flowchart LR
lib["1 · OrcaFilamentLibrary<br/>loaded first, synchronously"] --> par["2 · every other vendor in parallel,<br/>each into its own bundle, filaments<br/>resolving against the loaded library"] --> merge["3 · bundles merged into one,<br/>sequentially, in stable vendor order"]
```
Whether a vendor comes from its cache or from a parse changes nothing in that
order — both produce the same bundle, so cached and parsed vendors mix freely in
one startup.
**A vendor is loaded from where it is installed and nowhere else.** For startup that
is `<data_dir>/system/`; resources reaches the app by being *installed* into that
directory first, never by being loaded from. (The setup wizard is the one caller with
a different notion of "where": it also shows vendors the user has not installed, and
loads those from `resources/profiles` — see "The wizard's profile-data cache".) There
is one lookup tier and one parse source:
```
load vendor V from <data_dir>/system:
system/V.opc passes CACHE_VERSION + size + CRC + vendor name + version gate?
yes -> serve from it
no -> parse system/V.json, then write system/V.opc back
```
The same decision drawn out — "the gates" are the four acceptance checks above:
```mermaid
flowchart TB
start["load vendor V from a directory dir<br/>— normally &lt;data_dir&gt;/system/"]
start --> stamp["installed version = version of dir/V.json<br/>— or ∞ with no profile there,<br/>the cache then being the installation"]
stamp --> g1{"dir/V.opc<br/>passes all four gates?"}
g1 -- "yes" --> hit(["served from the<br/>installed cache"])
g1 -- "no" --> pd["parse the JSONs in dir"]
pd --> ver{"profile version<br/>parsable?"}
ver -- "yes" --> save(["loaded; dir/V.opc written back —<br/>the next load takes the top path"])
ver -- "no" --> raw(["loaded, never cached"])
```
A second tier into `resources/profiles/` used to sit between those two, and a parse
fallback to the same place behind them. Both existed only because an installed cache
died on every app upgrade, when the schema fingerprint rejected it; with the fingerprint
gone there is nothing for them to rescue. They also had a cost: on a developer tree the
shipped cache answered first, so the profile in `<data_dir>/system/` was never parsed
and its cache was never written back.
Serving from a cache is not a memory-image restore. The entries are deserialized and
then installed one by one — inheritance resolved against the presets installed before
them and the currently loaded filament library, configs flattened onto the collection
defaults, validated and registered — by the same function the JSON path calls straight
after parsing a sub-file. The two paths share everything below the parse, which is what
makes a cache-loaded bundle indistinguishable from a JSON-loaded one by construction
rather than by test coverage. Installation also rebuilds each preset's file path from
the local data directory, so a shipped cache never carries the generating machine's
paths.
App upgrades work because a cache normally survives one. Only a deliberate
`CACHE_VERSION` bump makes an installed cache unreadable, and that is handled at
install time rather than at load: a vendor whose cache this build cannot read counts
as **not installed**, so the updater lays down a working copy on the next launch (see
below). A vendor that still has its profile JSONs beside the cache is simply parsed
and re-cached.
If a parse does happen and the vendor's profile carries a version, the app writes the
cache back beside where it looked for the vendor. That is how a developer build warms
itself up on second launch, and how a vendor delivered by a profile update becomes
cached without waiting for the next release.
## The wizard's profile-data cache
The setup wizard's printer and filament pages want every vendor in one bundle — the
installed ones *and* the shipped ones the user has not installed yet, because the
wizard is where installing is chosen. Its set therefore spans two directories:
`<data_dir>/system/` for installed vendors (shadowing resources on a name collision),
`resources/profiles` for the rest, each vendor loaded from its own directory.
What the wizard actually consumes from that bundle is one derived JSON — the model /
machine / filament / process catalog its web pages render — and that JSON is a pure
function of the vendor set: each vendor's name and version, in load order. A profile
change requires a version bump, so name and version determine a vendor's content
wherever its copy sits; which directory served it is deliberately **not** stamped,
and installing or removing a copy at an unchanged version leaves the cache valid. So
the wizard caches the *derived JSON*, not another form of the inputs:
`<data_dir>/cache/wizard_profile_data.json` holds the stamp list and the catalog. On
open, the wizard computes the current stamps (one version peek per vendor) and, when
they match, serves the catalog from the file — no bundle built, no preset installed.
Caching bundle inputs instead was tried and measured: rebuilding the bundle from
per-vendor caches costs ~2 s of preset installation whatever feeds it, so only
skipping the rebuild entirely wins.
Any change to the set — a vendor added, removed or updated, or its cache-only
`.opc` replaced by a newer one — changes the stamps and retires the whole file;
the wizard then rebuilds the bundle vendor by vendor (per-vendor caches serving where
they cover) and writes the catalog back. Selections, region and per-open decorations
are applied downstream of the cache either way, so a served catalog is
indistinguishable from a rebuilt one. Nothing ships this file and the updater never
touches it; it is a locally written artifact, re-derived whenever stale, written
through a temp file and rename so half a cache is never readable.
The cache lives under `<data_dir>/cache/`, not beside the vendors: everything that
scans `<data_dir>/system/` treats any `.opc` there as a vendor, so a non-vendor
cache file must not sit in that directory. Relatedly, the stamp reader is hardened:
`read_cache_stamps` validates the cache version before reading anything
variable-length and bounds the stamp strings' lengths, so a reader pointed at a
foreign or damaged `.opc` rejects it cleanly instead of aborting on a garbage
64-bit allocation.
## How a vendor is installed
Installing copies from `resources/profiles/` into `<data_dir>/system/`. A shipped build
offers only a cache and a source tree only JSONs, but a partially-generated tree can
have both, at different versions, so the installer picks the form that ships at the
**newer version** and installs only that one:
- Cache newer or equal, and readable → copy the `.opc`, verify the *copy* is one this
build can read, and only then delete any profile and vendor directory a previous
install left behind, so nothing can shadow it.
- Profile newer, or the cache unreadable or absent → copy the profile and the vendor's
preset JSONs exactly as the app did before caches existed, and delete any stale `.opc`
once the profile is safely in place.
One vendor that cannot be installed is one vendor missing, not a reason to leave the
rest uninstalled: the installer skips it, records the failure, and carries on with the
batch. A vendor whose cache arrives unreadable falls back to installing its profile,
which is decided by reading the copy rather than by the kilobyte peek that chose the
form.
**"Installed" means present and usable.** Where the cache is the whole of a vendor's
installation, a `.opc` this build cannot read is not an installation — counted as one,
the vendor would be stranded with nothing to load and the updater would never repair
it. The installed version is likewise whichever form a load would actually serve: the
cache's stamp while it covers the profile beside it, the profile's own version once it
does not.
The result is that only one form of a vendor is ever present, and it is the newest one
the build has. This matters most for the update check, which compares what is installed
against what installing *would* lay down: if those two disagreed about which form
counts, a vendor could reinstall on every launch forever, or silently never update.
Profile updates delivered over the air always arrive as JSONs, and they win — an
updated vendor's real profile lands in the data directory, the installed cache beside it
is older and gets rejected, and the vendor is parsed and re-cached. An update that touches only
the filament library needs nothing more: every other vendor's cache stays valid and
simply resolves against the new library on its next load.
## How the caches are produced
Cache generation is a build step, not something a user ever runs.
One script per platform does the whole job, and CI calls it once on each. It builds a
small dev-utility that loads a profiles directory exactly as the app would, with cache
writing enabled, dropping a `<vendor>.opc` beside every vendor profile it parses; then
it copies those caches into each packaged application it was pointed at and deletes
every preset JSON they replace — the vendor's own profile included. Only a vendor that
actually has a cache is pruned, so a vendor the generator skipped keeps its JSONs and is
simply parsed at startup.
Caches are generated into the checkout's own `resources/profiles`, because that is what
cpack re-installs from when it builds the NSIS installer — so that directory is also a
prune target in CI. Pruning it deletes the checkout's preset JSONs, which is a packaging
step, not something a build should do to a working tree by surprise: the Windows script
refuses that target unless given `--prune-source`, and CI passes it.
Generation runs after the build, in the same job, so the caches ship with a build that
can read them.
The flatpak differs only in where the script is called from. Nothing outside
flatpak-builder ever builds it, so there is no packaged tree for the workflow to point
the script at afterwards: the manifest runs it as a build step instead, against the
profiles the install has already copied into `/app`.
## Behavior when things go wrong
The system is designed so that no cache problem is fatal:
- **Corrupt, truncated or foreign file** — rejected at the header, vendor parsed. A
cache is written to a temp file beside its target and moved into place, so a write
that dies partway leaves the previous cache intact rather than a truncated one.
- **An option this build no longer has, or now types differently** — that option alone
is dropped, exactly as a JSON profile's would be. The preset and the file load.
- **Cache from a build with a different cache layout** — rejected on `CACHE_VERSION`.
A vendor with JSONs beside it is parsed and re-cached; a cache-only vendor reads as
not installed and the updater reinstalls it.
- **Stale cache** — rejected on the vendor version stamp, vendor parsed and re-cached.
- **Failure part-way through loading** — a deserialization error, or any entry that
fails to install — rejects the whole cache, and the bundle is reset to a clean state
before falling back, so a half-loaded cache can never leak into the parsed result.
- **A vendor that can be neither read nor parsed** — logged, and left out. The setup
wizard drops that vendor from its list and opens with the rest; startup records the
error alongside the vendors that did load. One broken vendor never takes the app down.
The one genuine limit: on a shipped build a vendor is its cache and nothing else, so a
rejected cache has nothing to fall back to for that vendor. This is by design — the
alternative is shipping every preset twice — and it is why the acceptance gates are
conservative and why CI generates the caches with the same build that ships them. The
recovery path is a profile update, which delivers real JSONs.
It also means nothing may quietly assume a `<vendor>.json` exists. Discovery, version
checks and the update decision all read whichever form is present, and a code path that
enumerates only `*.json` will find no vendors at all in a packaged build.
## Maintenance rules
- **Adding, removing, retyping or reordering a config option** needs nothing. The
payload names its keys and its enum values, so an option a cache carries and this
build does not is dropped; one this build has and the cache does not is simply
absent, as it would be from a JSON that predates it.
- **Changing a hand-written `serialize()`**`VendorProfile` or its nested types — or
the `CachedPreset` field list — written and read by `visit_entry` in
`PresetCacheFormat.cpp`, one list for the save, the load and the name peek alike — or
the cache's own layout or stamps, requires bumping `CACHE_VERSION` by hand.
- **The dictionary indexes with a `uint16`**, so `print_config_def` may hold at most
65535 options and one cache at most 65535 distinct enum value names.
`CacheDictionary::save` throws past that, which surfaces when CI generates the
caches rather than on a user's machine.
- **Bumping `CACHE_VERSION` is safe without a resources fallback** because
`is_vendor_installed` means *present and usable*: cache-only vendors read as not
installed after a bump, and the updater reinstalls them from resources.
- **Bumping a vendor profile's version** invalidates that vendor's cache and nothing
else — the filament library's included. Other vendors' caches resolve against the
new library the next time they load.
- **Caches are never committed.** They are build artifacts, generated per build,
ignored by git.
## Where this lives in the tree
| Area | Files |
|---|---|
| Everything about the bytes on disk — the dictionary, one config's wire format, the file framing and stamps, entry serialization, `VendorCacheFile` save/load/peeks | `src/libslic3r/PresetCacheFormat.{hpp,cpp}` |
| Serve-or-parse decision, installing cache entries into a bundle, cache write-back | `src/libslic3r/PresetBundle.{hpp,cpp}` |
| Vendor profile serialization | `src/libslic3r/Preset.hpp` |
| Vendor discovery, installed/shipped versions, installation | `src/libslic3r/utils.cpp` (declared in `Utils.hpp`) |
| Update and reinstall decisions | `src/slic3r/Utils/PresetUpdater.cpp` |
| Setup wizard and printer-selection dialog | `src/slic3r/GUI/ConfigWizard.cpp`, `src/slic3r/GUI/WebGuideDialog.cpp` |
| Generator tool | `src/dev-utils/generate_system_cache.cpp` |
| Build and packaging script | `scripts/build_preset_cache.{sh,bat}` |
| Tests | `tests/libslic3r/test_vendor_cache.cpp` |
@@ -0,0 +1,111 @@
# Move `wxInspectable` into `DPIAware` — Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Move `wxInspector::wxInspectable` from individual leaf classes into the common `DPIAware<P>` template so every DPIAware widget is automatically inspectable and gets the inspector keyboard shortcut.
**Architecture:** `DPIAware<P>` gains `wxInspector::wxInspectable` as a second base class and calls `SetupInspectorAccelerator(this)` in its constructor. `DPIDialog` and `MainFrame` drop their now-redundant `wxInspectable` inheritance and `SetupInspectorAccelerator` calls.
**Tech Stack:** C++17, wxWidgets, wxInspector
## Global Constraints
- Build with `D:\VisualStudio\2026\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe`
- Use `--config RelWithDebInfo` for all builds
- Cross-platform: must compile on Windows, macOS, and Linux
- Match existing code style: PascalCase classes, `#pragma once`
- Do NOT commit files under `.superpowers/`
- Do NOT commit `task.md`
---
### Task 1: Move `wxInspectable` and `SetupInspectorAccelerator` into `DPIAware<P>`
**Files:**
- Modify: `src/slic3r/GUI/GUI_Utils.hpp:92` (DPIAware template — add wxInspectable base + SetupInspectorAccelerator call)
- Modify: `src/slic3r/GUI/GUI_Utils.hpp:276` (DPIDialog — drop wxInspectable + SetupInspectorAccelerator)
- Modify: `src/slic3r/GUI/MainFrame.hpp:96` (MainFrame — drop wxInspectable)
- Modify: `src/slic3r/GUI/MainFrame.cpp:304` (MainFrame constructor — drop SetupInspectorAccelerator)
**Interfaces:**
- Consumes: Nothing (standalone refactor)
- Produces: All DPIAware widgets automatically inherit `wxInspector::wxInspectable` and get Ctrl+Shift+I accelerator
- [ ] **Step 1: Add `wxInspectable` to `DPIAware<P>` and call `SetupInspectorAccelerator`**
In `src/slic3r/GUI/GUI_Utils.hpp`, line 92, change the base class:
```cpp
// Before:
template<class P> class DPIAware : public P
// After:
template<class P> class DPIAware : public P, public wxInspector::wxInspectable
```
In the constructor body of `DPIAware<P>`, after `this->CenterOnParent();` (currently line 110), add:
```cpp
SetupInspectorAccelerator(this);
```
(`<wx/inspector/inspector.h>` is already included at line 23.)
- [ ] **Step 2: Remove redundant `wxInspectable` and `SetupInspectorAccelerator` from `DPIDialog`**
In `src/slic3r/GUI/GUI_Utils.hpp`, line 276, change:
```cpp
// Before:
class DPIDialog : public DPIAware<wxDialog>, public wxInspector::wxInspectable
// After:
class DPIDialog : public DPIAware<wxDialog>
```
In the `DPIDialog` constructor body, remove the `SetupInspectorAccelerator(this);` line (currently line 286). The rest of the constructor stays.
- [ ] **Step 3: Remove redundant `wxInspectable` from `MainFrame`**
In `src/slic3r/GUI/MainFrame.hpp`, line 96, change:
```cpp
// Before:
class MainFrame : public DPIFrame, public wxInspector::wxInspectable
// After:
class MainFrame : public DPIFrame
```
`MainFrame` now gets `wxInspectable` through `DPIFrame``DPIAware<wxFrame>`.
- [ ] **Step 4: Remove redundant `SetupInspectorAccelerator` from `MainFrame` constructor**
In `src/slic3r/GUI/MainFrame.cpp`, line 304, remove the line:
```cpp
SetupInspectorAccelerator(this);
```
It is now called automatically by the `DPIAware<wxFrame>` constructor.
- [ ] **Step 5: Build to verify compilation**
```powershell
$cmakePath = "D:\VisualStudio\2026\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
& $cmakePath --build . --config RelWithDebInfo --target ALL_BUILD -- -m
```
Expected: Build succeeds with zero new errors or warnings.
- [ ] **Step 6: Commit**
```bash
git add src/slic3r/GUI/GUI_Utils.hpp src/slic3r/GUI/MainFrame.hpp src/slic3r/GUI/MainFrame.cpp
git commit -m "refactor: move wxInspectable and SetupInspectorAccelerator into DPIAware
DPIAware<P> now inherits wxInspector::wxInspectable and calls
SetupInspectorAccelerator in its constructor, making all DPIAware
widgets automatically appear in the inspector tree with the
Ctrl+Shift+I shortcut. Remove redundant wxInspectable inheritance
and SetupInspectorAccelerator calls from DPIDialog and MainFrame.
Co-Authored-By: Claude <noreply@anthropic.com>"
```
@@ -0,0 +1,753 @@
# wxInspector Plugins for OrcaSlicer — Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Build two wxInspector plugins (DPIAware + CustomWidgets) that expose OrcaSlicer custom control properties in the inspector's property grid.
**Architecture:** Two plugins in a shared folder under `src/slic3r/Utils/wxInspectorPlugins/`. DPIAwarePlugin uses `dynamic_cast<DPIFrame*>/<DPIDialog*>` for detection; CustomWidgetsPlugin uses per-type `dynamic_cast`. Both registered as static singletons via a single inline function in `Registration.hpp`, called from `MainFrame` constructor.
**Tech Stack:** C++17, wxWidgets, wxInspector plugin API (`wx/inspector/plugin.h`, `wx/inspector/inspector.h`), OrcaSlicer custom widget headers
## Global Constraints
- Plugins placed under `src/slic3r/Utils/wxInspectorPlugins/`
- Build with `D:\VisualStudio\2026\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe`
- Minimal source changes: only trivial (one-line) getters/setters added to existing classes
- Cross-platform: must compile on Windows, macOS, and Linux
- Match existing code style: PascalCase classes, snake_case functions, `#pragma once`
---
### Task 1: Add getters/setters to existing Orca widget headers
**Files:**
- Modify: `src/slic3r/GUI/GUI_Utils.hpp` (DPIAware template — add 4 methods)
- Modify: `src/slic3r/GUI/Widgets/Button.hpp` (add 3 getters)
- Modify: `src/slic3r/GUI/Widgets/CheckBox.hpp` (add 1 getter)
- Modify: `src/slic3r/GUI/Widgets/TextInput.hpp` (add 1 getter)
- Modify: `src/slic3r/GUI/Widgets/LabeledStaticBox.hpp` (add 4 getter declarations)
- Modify: `src/slic3r/GUI/Widgets/LabeledStaticBox.cpp` (add 4 getter implementations)
**Interfaces:**
- Consumes: Nothing (prerequisite for all other tasks)
- Produces:
- `DPIAware<P>::set_scale_factor(float)`, `DPIAware<P>::set_prev_scale_factor(float)`, `DPIAware<P>::set_em_unit(int)`, `DPIAware<P>::force_rescale() const`
- `Button::GetStyle()`, `Button::GetType()`, `Button::IsSelected()`
- `CheckBox::IsHalfChecked()`
- `TextInput::GetCornerRadius()`
- `LabeledStaticBox::GetCornerRadius()`, `LabeledStaticBox::GetBorderWidth()`, `LabeledStaticBox::GetBorderColor()`, `LabeledStaticBox::GetScale()`
- [ ] **Step 1: Add DPIAware setters/getter in GUI_Utils.hpp**
After line 184 (`float prev_scale_factor() const { return m_prev_scale_factor; }`), add:
```cpp
void set_scale_factor(float v) { m_scale_factor = v; }
void set_prev_scale_factor(float v) { m_prev_scale_factor = v; }
void set_em_unit(int v) { m_em_unit = v; }
bool force_rescale() const { return m_force_rescale; }
```
- [ ] **Step 2: Add Button getters in Button.hpp**
After line 79 (`void SetSelected(bool selected = true) { m_selected = selected; }`), add:
```cpp
ButtonStyle GetStyle() const { return m_style; }
ButtonType GetType() const { return m_type; }
bool IsSelected() const { return m_selected; }
```
- [ ] **Step 3: Add CheckBox getter in CheckBox.hpp**
After line 16 (`void SetHalfChecked(bool value = true);`), add:
```cpp
bool IsHalfChecked() const { return m_half_checked; }
```
- [ ] **Step 4: Add TextInput getter in TextInput.hpp**
After line 44 (`void SetCornerRadius(double radius);`), add:
```cpp
int GetCornerRadius() const { return static_cast<int>(radius); }
```
(Note: `radius` is inherited from `StaticBox` which has it as a protected `double` member.)
- [ ] **Step 5: Add LabeledStaticBox getter declarations in LabeledStaticBox.hpp**
After line 46 (`bool Enable(bool enable) override;`), add:
```cpp
int GetCornerRadius() const { return m_radius; }
int GetBorderWidth() const { return m_border_width; }
StateColor GetBorderColor() const { return border_color; }
float GetScale() const { return m_scale; }
```
(Note: all of `m_radius`, `m_border_width`, `border_color`, `m_scale` are protected members, accessible to inline methods.)
- [ ] **Step 6: Commit**
```bash
git add src/slic3r/GUI/GUI_Utils.hpp src/slic3r/GUI/Widgets/Button.hpp src/slic3r/GUI/Widgets/CheckBox.hpp src/slic3r/GUI/Widgets/TextInput.hpp src/slic3r/GUI/Widgets/LabeledStaticBox.hpp
git commit -m "feat: add getters/setters for wxInspector plugin access
Add minimal public accessors to DPIAware (set_scale_factor,
set_prev_scale_factor, set_em_unit, force_rescale), Button
(GetStyle, GetType, IsSelected), CheckBox (IsHalfChecked),
TextInput (GetCornerRadius), and LabeledStaticBox
(GetCornerRadius, GetBorderWidth, GetBorderColor, GetScale)."
```
---
### Task 2: Create Registration helper header
**Files:**
- Create: `src/slic3r/Utils/wxInspectorPlugins/Registration.hpp`
**Interfaces:**
- Consumes: Nothing (forward-declares plugin classes)
- Produces: `RegisterOrcaInspectorPlugins()`
- [ ] **Step 1: Create directory**
```bash
mkdir -p src/slic3r/Utils/wxInspectorPlugins
```
- [ ] **Step 2: Write Registration.hpp**
```cpp
#pragma once
namespace wxInspector {
class wxInspectorPlugin;
void RegisterPlugin(wxInspectorPlugin* plugin);
}
// Forward declare our plugins
class DPIAwarePlugin;
class CustomWidgetsPlugin;
inline void RegisterOrcaInspectorPlugins()
{
static DPIAwarePlugin dpiaware;
static CustomWidgetsPlugin customWidgets;
wxInspector::RegisterPlugin(&dpiaware);
wxInspector::RegisterPlugin(&customWidgets);
}
```
- [ ] **Step 3: Commit**
```bash
git add src/slic3r/Utils/wxInspectorPlugins/Registration.hpp
git commit -m "feat: add wxInspector plugin registration helper
Add RegisterOrcaInspectorPlugins() inline function that creates
and registers the DPIAwarePlugin and CustomWidgetsPlugin as
static instances (matching wxInspector's built-in pattern)."
```
---
### Task 3: Create DPIAwarePlugin
**Files:**
- Create: `src/slic3r/Utils/wxInspectorPlugins/DPIAwarePlugin.hpp`
- Create: `src/slic3r/Utils/wxInspectorPlugins/DPIAwarePlugin.cpp`
**Interfaces:**
- Consumes: Task 1 (DPIAware getters/setters), Task 2 (registration pattern)
- Produces: `class DPIAwarePlugin : public wxInspector::wxInspectorPlugin`
- [ ] **Step 1: Write DPIAwarePlugin.hpp**
```cpp
#pragma once
#include <wx/inspector/plugin.h>
class DPIAwarePlugin : public wxInspector::wxInspectorPlugin
{
public:
wxString GetName() const override;
bool CanProvideProperties(wxClassInfo* info) override;
wxVector<wxInspector::PropertyDef> GetProperties(
wxInspector::InspectableObject& obj) override;
};
```
- [ ] **Step 2: Write DPIAwarePlugin.cpp**
```cpp
#include "DPIAwarePlugin.hpp"
#include "slic3r/GUI/GUI_Utils.hpp" // DPIFrame, DPIDialog, DPIAware<P>
#include <wx/window.h>
namespace {
template<typename T>
void addDPIProps(T* dpi, wxVector<wxInspector::PropertyDef>& props)
{
using namespace wxInspector;
props.push_back({"Scale Factor", "DPI Scaling", PropertyType::String,
wxString::Format("%.2f", dpi->scale_factor()), false, {},
[dpi]() { return wxString::Format("%.2f", dpi->scale_factor()); },
[dpi](const wxString& v) {
double val;
if (wxSscanf(v, "%lf", &val) != 1) return false;
dpi->set_scale_factor((float) val);
return true;
}});
props.push_back({"Prev Scale Factor", "DPI Scaling", PropertyType::String,
wxString::Format("%.2f", dpi->prev_scale_factor()), false, {},
[dpi]() { return wxString::Format("%.2f", dpi->prev_scale_factor()); },
[dpi](const wxString& v) {
double val;
if (wxSscanf(v, "%lf", &val) != 1) return false;
dpi->set_prev_scale_factor((float) val);
return true;
}});
props.push_back({"EM Unit", "DPI Scaling", PropertyType::Integer,
wxString::Format("%d", dpi->em_unit()), false, {},
[dpi]() { return wxString::Format("%d", dpi->em_unit()); },
[dpi](const wxString& v) {
long val;
if (!v.ToLong(&val)) return false;
dpi->set_em_unit((int) val);
return true;
}});
props.push_back({"Normal Font", "DPI Scaling", PropertyType::ReadOnly,
dpi->normal_font().GetNativeFontInfoDesc(), true, {},
[dpi]() { return dpi->normal_font().GetNativeFontInfoDesc(); },
nullptr});
props.push_back({"Force Rescale", "DPI Scaling", PropertyType::Boolean,
dpi->force_rescale() ? "true" : "false", true, {},
[dpi]() { return dpi->force_rescale() ? "true" : "false"; },
nullptr});
}
} // anonymous namespace
wxString DPIAwarePlugin::GetName() const
{
return "OrcaDPIAware";
}
bool DPIAwarePlugin::CanProvideProperties(wxClassInfo* info)
{
return info->IsKindOf(CLASSINFO(wxWindow));
}
wxVector<wxInspector::PropertyDef> DPIAwarePlugin::GetProperties(
wxInspector::InspectableObject& obj)
{
wxVector<wxInspector::PropertyDef> props;
wxWindow* win = obj.AsWindow();
if (!win) return props;
if (auto* frame = dynamic_cast<DPIFrame*>(win)) {
addDPIProps(frame, props);
} else if (auto* dlg = dynamic_cast<DPIDialog*>(win)) {
addDPIProps(dlg, props);
}
return props;
}
```
- [ ] **Step 3: Commit**
```bash
git add src/slic3r/Utils/wxInspectorPlugins/DPIAwarePlugin.hpp src/slic3r/Utils/wxInspectorPlugins/DPIAwarePlugin.cpp
git commit -m "feat: add DPIAware wxInspector plugin
Exposes DPI scaling properties (scale_factor, prev_scale_factor,
em_unit, normal_font, force_rescale) on DPIFrame and DPIDialog
widgets. Uses dynamic_cast for detection and a template helper
to capture the correct static type for lambda accessors."
```
---
### Task 4: Create CustomWidgetsPlugin
**Files:**
- Create: `src/slic3r/Utils/wxInspectorPlugins/CustomWidgetsPlugin.hpp`
- Create: `src/slic3r/Utils/wxInspectorPlugins/CustomWidgetsPlugin.cpp`
**Interfaces:**
- Consumes: Task 1 (all widget getters), Task 2 (registration pattern)
- Produces: `class CustomWidgetsPlugin : public wxInspector::wxInspectorPlugin`
- [ ] **Step 1: Write CustomWidgetsPlugin.hpp**
```cpp
#pragma once
#include <wx/inspector/plugin.h>
class CustomWidgetsPlugin : public wxInspector::wxInspectorPlugin
{
public:
wxString GetName() const override;
bool CanProvideProperties(wxClassInfo* info) override;
wxVector<wxInspector::PropertyDef> GetProperties(
wxInspector::InspectableObject& obj) override;
private:
void addButtonProps(class Button* btn,
wxVector<wxInspector::PropertyDef>& props);
void addCheckBoxProps(class CheckBox* cb,
wxVector<wxInspector::PropertyDef>& props);
void addTextInputProps(class TextInput* ti,
wxVector<wxInspector::PropertyDef>& props);
void addSwitchButtonProps(class SwitchButton* sb,
wxVector<wxInspector::PropertyDef>& props);
void addProgressBarProps(class ProgressBar* pb,
wxVector<wxInspector::PropertyDef>& props);
void addLabelProps(class Label* lbl,
wxVector<wxInspector::PropertyDef>& props);
void addLabeledStaticBoxProps(class LabeledStaticBox* lsb,
wxVector<wxInspector::PropertyDef>& props);
};
```
- [ ] **Step 2: Write CustomWidgetsPlugin.cpp — includes and GetName/CanProvideProperties**
```cpp
#include "CustomWidgetsPlugin.hpp"
#include "slic3r/GUI/Widgets/Button.hpp"
#include "slic3r/GUI/Widgets/CheckBox.hpp"
#include "slic3r/GUI/Widgets/TextInput.hpp"
#include "slic3r/GUI/Widgets/SwitchButton.hpp"
#include "slic3r/GUI/Widgets/ProgressBar.hpp"
#include "slic3r/GUI/Widgets/Label.hpp"
#include "slic3r/GUI/Widgets/LabeledStaticBox.hpp"
#include <wx/window.h>
#include <wx/tglbtn.h>
wxString CustomWidgetsPlugin::GetName() const
{
return "OrcaCustomWidgets";
}
bool CustomWidgetsPlugin::CanProvideProperties(wxClassInfo* info)
{
return info->IsKindOf(CLASSINFO(wxWindow));
}
wxVector<wxInspector::PropertyDef> CustomWidgetsPlugin::GetProperties(
wxInspector::InspectableObject& obj)
{
wxVector<wxInspector::PropertyDef> props;
wxWindow* win = obj.AsWindow();
if (!win) return props;
if (auto* btn = dynamic_cast<Button*>(win))
addButtonProps(btn, props);
if (auto* cb = dynamic_cast<CheckBox*>(win))
addCheckBoxProps(cb, props);
if (auto* ti = dynamic_cast<TextInput*>(win))
addTextInputProps(ti, props);
if (auto* sb = dynamic_cast<SwitchButton*>(win))
addSwitchButtonProps(sb, props);
if (auto* pb = dynamic_cast<ProgressBar*>(win))
addProgressBarProps(pb, props);
if (auto* lbl = dynamic_cast<Label*>(win))
addLabelProps(lbl, props);
if (auto* lsb = dynamic_cast<LabeledStaticBox*>(win))
addLabeledStaticBoxProps(lsb, props);
return props;
}
```
- [ ] **Step 3: Write CustomWidgetsPlugin.cpp — addButtonProps**
```cpp
void CustomWidgetsPlugin::addButtonProps(Button* btn,
wxVector<wxInspector::PropertyDef>& props)
{
using namespace wxInspector;
wxVector<wxString> styleChoices;
styleChoices.push_back("Regular");
styleChoices.push_back("Confirm");
styleChoices.push_back("Alert");
styleChoices.push_back("Disabled");
auto styleToStr = [](ButtonStyle s) -> wxString {
switch (s) {
case ButtonStyle::Regular: return "Regular";
case ButtonStyle::Confirm: return "Confirm";
case ButtonStyle::Alert: return "Alert";
case ButtonStyle::Disabled: return "Disabled";
}
return "Regular";
};
props.push_back({"Button Style", "Orca Button", PropertyType::Choice,
styleToStr(btn->GetStyle()), false, styleChoices,
[btn, styleToStr]() { return styleToStr(btn->GetStyle()); },
[btn](const wxString& v) {
ButtonStyle s = ButtonStyle::Regular;
if (v == "Confirm") s = ButtonStyle::Confirm;
else if (v == "Alert") s = ButtonStyle::Alert;
else if (v == "Disabled") s = ButtonStyle::Disabled;
btn->SetStyle(s, btn->GetType());
return true;
}});
wxVector<wxString> typeChoices;
typeChoices.push_back("Compact");
typeChoices.push_back("Window");
typeChoices.push_back("Choice");
typeChoices.push_back("Parameter");
typeChoices.push_back("Icon");
typeChoices.push_back("Expanded");
auto typeToStr = [](ButtonType t) -> wxString {
switch (t) {
case ButtonType::Compact: return "Compact";
case ButtonType::Window: return "Window";
case ButtonType::Choice: return "Choice";
case ButtonType::Parameter: return "Parameter";
case ButtonType::Icon: return "Icon";
case ButtonType::Expanded: return "Expanded";
}
return "Compact";
};
props.push_back({"Button Type", "Orca Button", PropertyType::Choice,
typeToStr(btn->GetType()), false, typeChoices,
[btn, typeToStr]() { return typeToStr(btn->GetType()); },
[btn](const wxString& v) {
ButtonType t = ButtonType::Compact;
if (v == "Window") t = ButtonType::Window;
else if (v == "Choice") t = ButtonType::Choice;
else if (v == "Parameter") t = ButtonType::Parameter;
else if (v == "Icon") t = ButtonType::Icon;
else if (v == "Expanded") t = ButtonType::Expanded;
btn->SetStyle(btn->GetStyle(), t);
return true;
}});
props.push_back({"Selected", "Orca Button", PropertyType::Boolean,
btn->IsSelected() ? "true" : "false", false, {},
[btn]() { return btn->IsSelected() ? "true" : "false"; },
[btn](const wxString& v) {
btn->SetSelected(v == "true");
btn->Refresh();
return true;
}});
}
```
- [ ] **Step 4: Write CustomWidgetsPlugin.cpp — addCheckBoxProps**
```cpp
void CustomWidgetsPlugin::addCheckBoxProps(CheckBox* cb,
wxVector<wxInspector::PropertyDef>& props)
{
using namespace wxInspector;
props.push_back({"Half Checked", "Orca CheckBox", PropertyType::Boolean,
cb->IsHalfChecked() ? "true" : "false", false, {},
[cb]() { return cb->IsHalfChecked() ? "true" : "false"; },
[cb](const wxString& v) {
cb->SetHalfChecked(v == "true");
return true;
}});
}
```
- [ ] **Step 5: Write CustomWidgetsPlugin.cpp — addTextInputProps**
```cpp
void CustomWidgetsPlugin::addTextInputProps(TextInput* ti,
wxVector<wxInspector::PropertyDef>& props)
{
using namespace wxInspector;
props.push_back({"Label", "Orca TextInput", PropertyType::String,
ti->GetLabel(), false, {},
[ti]() { return ti->GetLabel(); },
[ti](const wxString& v) { ti->SetLabel(v); return true; }});
props.push_back({"Text Value", "Orca TextInput", PropertyType::String,
ti->GetTextCtrl()->GetValue(), false, {},
[ti]() { return ti->GetTextCtrl()->GetValue(); },
[ti](const wxString& v) { ti->GetTextCtrl()->SetValue(v); return true; }});
props.push_back({"Corner Radius", "Orca TextInput", PropertyType::Integer,
wxString::Format("%d", ti->GetCornerRadius()), false, {},
[ti]() { return wxString::Format("%d", ti->GetCornerRadius()); },
[ti](const wxString& v) {
long val;
if (!v.ToLong(&val)) return false;
ti->SetCornerRadius((double) val);
ti->Refresh();
return true;
}});
}
```
- [ ] **Step 6: Write CustomWidgetsPlugin.cpp — addSwitchButtonProps**
```cpp
void CustomWidgetsPlugin::addSwitchButtonProps(SwitchButton* sb,
wxVector<wxInspector::PropertyDef>& props)
{
using namespace wxInspector;
props.push_back({"Value", "Orca SwitchButton", PropertyType::Boolean,
sb->GetValue() ? "true" : "false", false, {},
[sb]() { return sb->GetValue() ? "true" : "false"; },
[sb](const wxString& v) {
sb->SetValue(v == "true");
return true;
}});
}
```
(Note: `GetValue()` and `SetValue()` are inherited from `wxBitmapToggleButton``wxToggleButton`.)
- [ ] **Step 7: Write CustomWidgetsPlugin.cpp — addProgressBarProps**
```cpp
void CustomWidgetsPlugin::addProgressBarProps(ProgressBar* pb,
wxVector<wxInspector::PropertyDef>& props)
{
using namespace wxInspector;
props.push_back({"Proportion", "Orca ProgressBar", PropertyType::String,
wxString::Format("%.2f", pb->m_proportion), false, {},
[pb]() { return wxString::Format("%.2f", pb->m_proportion); },
[pb](const wxString& v) {
double val;
if (wxSscanf(v, "%lf", &val) != 1) return false;
pb->m_proportion = val;
pb->Refresh();
return true;
}});
props.push_back({"Show Number", "Orca ProgressBar", PropertyType::Boolean,
pb->m_shownumber ? "true" : "false", false, {},
[pb]() { return pb->m_shownumber ? "true" : "false"; },
[pb](const wxString& v) {
pb->m_shownumber = (v == "true");
pb->Refresh();
return true;
}});
}
```
(Note: `m_proportion` and `m_shownumber` are public members on `ProgressBar`.)
- [ ] **Step 8: Write CustomWidgetsPlugin.cpp — addLabelProps**
```cpp
void CustomWidgetsPlugin::addLabelProps(Label* lbl,
wxVector<wxInspector::PropertyDef>& props)
{
using namespace wxInspector;
bool isHyperlink = (lbl->GetWindowStyleFlag() & 0x0020) != 0; // LB_HYPERLINK
props.push_back({"Is Hyperlink", "Orca Label", PropertyType::Boolean,
isHyperlink ? "true" : "false", true, {},
[lbl]() {
return (lbl->GetWindowStyleFlag() & 0x0020) ? "true" : "false";
},
nullptr});
props.push_back({"Font Point Size", "Orca Label", PropertyType::ReadOnly,
wxString::Format("%d", lbl->GetFont().GetPointSize()), true, {},
[lbl]() {
return wxString::Format("%d", lbl->GetFont().GetPointSize());
},
nullptr});
}
```
- [ ] **Step 9: Write CustomWidgetsPlugin.cpp — addLabeledStaticBoxProps**
```cpp
void CustomWidgetsPlugin::addLabeledStaticBoxProps(LabeledStaticBox* lsb,
wxVector<wxInspector::PropertyDef>& props)
{
using namespace wxInspector;
props.push_back({"Corner Radius", "LabeledStaticBox", PropertyType::Integer,
wxString::Format("%d", lsb->GetCornerRadius()), false, {},
[lsb]() { return wxString::Format("%d", lsb->GetCornerRadius()); },
[lsb](const wxString& v) {
long val;
if (!v.ToLong(&val)) return false;
lsb->SetCornerRadius((int) val);
return true;
}});
props.push_back({"Border Width", "LabeledStaticBox", PropertyType::Integer,
wxString::Format("%d", lsb->GetBorderWidth()), false, {},
[lsb]() { return wxString::Format("%d", lsb->GetBorderWidth()); },
[lsb](const wxString& v) {
long val;
if (!v.ToLong(&val)) return false;
lsb->SetBorderWidth((int) val);
return true;
}});
// Border Color: display as hex string
wxColour bc = lsb->GetBorderColor().colorForStates(0);
props.push_back({"Border Color", "LabeledStaticBox", PropertyType::String,
bc.GetAsString(wxC2S_HTML_SYNTAX), false, {},
[lsb]() {
return lsb->GetBorderColor()
.colorForStates(0)
.GetAsString(wxC2S_HTML_SYNTAX);
},
[lsb](const wxString& v) {
wxColour c(v);
if (!c.IsOk()) return false;
lsb->SetBorderColor(StateColor(c));
return true;
}});
props.push_back({"Scale", "LabeledStaticBox", PropertyType::ReadOnly,
wxString::Format("%.2f", lsb->GetScale()), true, {},
[lsb]() { return wxString::Format("%.2f", lsb->GetScale()); },
nullptr});
}
```
- [ ] **Step 10: Commit**
```bash
git add src/slic3r/Utils/wxInspectorPlugins/CustomWidgetsPlugin.hpp src/slic3r/Utils/wxInspectorPlugins/CustomWidgetsPlugin.cpp
git commit -m "feat: add OrcaCustomWidgets wxInspector plugin
Exposes Orca-specific properties on 7 widget types:
- Button: Style, Type, Selected
- CheckBox: Half Checked
- TextInput: Label, Text Value, Corner Radius
- SwitchButton: Value
- ProgressBar: Proportion, Show Number
- Label: Is Hyperlink, Font Point Size
- LabeledStaticBox: Corner Radius, Border Width, Border Color, Scale
Each widget type uses dynamic_cast for safe detection."
```
---
### Task 5: Wire plugins into MainFrame and CMakeLists
**Files:**
- Modify: `src/slic3r/GUI/MainFrame.cpp` (add include + registration call)
- Modify: `src/slic3r/CMakeLists.txt` (add 4 source files)
**Interfaces:**
- Consumes: Tasks 1-4 (all plugins and registration helper)
- Produces: Registered plugins available at runtime, buildable project
- [ ] **Step 1: Add include in MainFrame.cpp**
After the existing includes (around line 30, near the other Utils includes), add:
```cpp
#include "slic3r/Utils/wxInspectorPlugins/Registration.hpp"
```
- [ ] **Step 2: Add registration call in MainFrame constructor**
After `SetupInspectorAccelerator(this);` (currently line ~303), add:
```cpp
RegisterOrcaInspectorPlugins();
```
- [ ] **Step 3: Add source files to CMakeLists.txt**
Find the `SLIC3R_GUI_SOURCES` list in `src/slic3r/CMakeLists.txt`. After the existing `Utils/*.cpp` entries (around line 650-754), add:
```cmake
Utils/wxInspectorPlugins/DPIAwarePlugin.hpp
Utils/wxInspectorPlugins/DPIAwarePlugin.cpp
Utils/wxInspectorPlugins/CustomWidgetsPlugin.hpp
Utils/wxInspectorPlugins/CustomWidgetsPlugin.cpp
Utils/wxInspectorPlugins/Registration.hpp
```
(Note: Add all 5 files — 2 .hpp + 2 .cpp + 1 Registration.hpp. wxWidgets cmake needs headers listed too for the resource system.)
- [ ] **Step 4: Commit**
```bash
git add src/slic3r/GUI/MainFrame.cpp src/slic3r/CMakeLists.txt
git commit -m "feat: wire wxInspector plugins into MainFrame and build
- Call RegisterOrcaInspectorPlugins() after SetupInspectorAccelerator
- Add all plugin source files to SLIC3R_GUI_SOURCES"
```
---
### Task 6: Build and verify
**Files:**
- None modified (verification only)
- [ ] **Step 1: Configure the build**
```powershell
$cmakePath = "D:\VisualStudio\2026\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
& $cmakePath --build . --config Debug --target ALL_BUILD -- -m
```
Expected: Build succeeds with zero errors and zero warnings from our new files.
- [ ] **Step 2: Fix any compilation errors**
If the build fails:
- Check that `#include` paths resolve (the `slic3r/GUI/…` relative paths use `src/` as the include root — verify this is set up in CMake via `include_directories`)
- Check that `ButtonStyle` and `ButtonType` enums are visible (they're defined in `Button.hpp`)
- Check that `StateColor` constructor from `wxColour` is valid (it has `StateColor(wxColour const&)`)
- Check that `LabeledStaticBox::GetBorderColor()` returns by value (StateColor copy is fine)
- On macOS: static box margin removal call needs `#ifdef __WXOSX__` guard
- [ ] **Step 3: Launch OrcaSlicer and verify inspector**
Launch the built OrcaSlicer, press Ctrl+Shift+I to open the inspector:
1. Select the MainFrame in the tree — verify "DPI Scaling" category appears with Scale Factor, Prev Scale Factor, EM Unit, Normal Font, Force Rescale
2. Select an Orca Button — verify "Orca Button" category appears
3. Select an Orca CheckBox — verify "Orca CheckBox" category appears
4. Edit a property value (e.g., Scale Factor) — verify the setter applies correctly
5. Select a LabeledStaticBox — verify corner radius, border width, border color, scale appear
- [ ] **Step 5: Commit (if fixes were needed) or mark complete**
```bash
git status
```
If clean: verification complete. If changes were made: `git add` and commit with fix message.
@@ -0,0 +1,102 @@
# Move `wxInspectable` into `DPIAware` — Design Spec
Date: 2026-07-23
Branch: `dev/layout-inspector`
## Overview
Move the `wxInspector::wxInspectable` base class from individual leaf classes (`DPIDialog`, `MainFrame`) into the common `DPIAware<P>` template. This makes every DPIAware widget automatically visible in the inspector tree without requiring each subclass to opt in.
## Motivation
Currently, only `DPIDialog` and `MainFrame` explicitly inherit `wxInspectable`. `DPIFrame` (which `MainFrame` inherits from) does not — `MainFrame` adds it manually. This means:
- Any `DPIAware<T>` widget that isn't `DPIDialog` or `MainFrame` is invisible in the inspector tree
- `DPIFrame` subclasses (`BaseTransparentDPIFrame`, `ImageDPIFrame`, `ModelMallDialog`, `MediaFileFrame`, `SecondaryCheckDialog`, `PrintErrorDialog`, etc.) don't appear
- Adding a new DPIAware widget type requires remembering to also inherit `wxInspectable`
Moving `wxInspectable` to `DPIAware` fixes this for all current and future DPIAware widgets at once.
## Design
### Change 1: `GUI_Utils.hpp``DPIAware<P>`
Add `wxInspector::wxInspectable` as a second base class, and call `SetupInspectorAccelerator(this)` in the constructor (after `this->CenterOnParent()`):
```cpp
// Before:
template<class P> class DPIAware : public P
// After:
template<class P> class DPIAware : public P, public wxInspector::wxInspectable
```
Add in the constructor body (after `this->CenterOnParent()` at line 110):
```cpp
SetupInspectorAccelerator(this);
```
This gives every `DPIAware<T>` widget both inspectability and the Ctrl+Shift+I keyboard shortcut automatically. `#include <wx/inspector/inspector.h>` is already present in the file.
### Change 2: `GUI_Utils.hpp``DPIDialog`
Remove the now-redundant `wxInspector::wxInspectable` and the `SetupInspectorAccelerator(this)` call:
```cpp
// Before:
class DPIDialog : public DPIAware<wxDialog>, public wxInspector::wxInspectable
// ...
SetupInspectorAccelerator(this);
// After:
class DPIDialog : public DPIAware<wxDialog>
// (SetupInspectorAccelerator call removed — now done in DPIAware constructor)
```
`DPIDialog` gets `wxInspectable` and the accelerator through `DPIAware<wxDialog>` now.
### Change 3: `MainFrame.hpp``MainFrame`
Remove the now-redundant `wxInspector::wxInspectable`:
```cpp
// Before:
class MainFrame : public DPIFrame, public wxInspector::wxInspectable
// After:
class MainFrame : public DPIFrame
```
`MainFrame` gets `wxInspectable` through `DPIFrame``DPIAware<wxFrame>`.
### Change 4: `MainFrame.cpp``MainFrame` constructor
Remove the now-redundant `SetupInspectorAccelerator(this)` call (line 304). It will be called automatically by the `DPIAware` constructor.
## Impact
| Widget | Before | After |
|--------|--------|-------|
| `DPIDialog` subclasses (~80) | ✓ inspectable | ✓ inspectable (transitive) |
| `MainFrame` | ✓ inspectable | ✓ inspectable (transitive) |
| `DPIFrame` subclasses (8 others) | ✗ invisible | ✓ inspectable |
| Future `DPIAware<T>` | ✗ invisible | ✓ inspectable |
## Files Modified
| File | Change |
|------|--------|
| `src/slic3r/GUI/GUI_Utils.hpp` | `DPIAware<P>` gains `wxInspector::wxInspectable` + `SetupInspectorAccelerator(this)` call; `DPIDialog` drops redundant `wxInspector::wxInspectable` and `SetupInspectorAccelerator(this)` |
| `src/slic3r/GUI/MainFrame.hpp` | `MainFrame` drops redundant `wxInspector::wxInspectable` |
| `src/slic3r/GUI/MainFrame.cpp` | Remove redundant `SetupInspectorAccelerator(this)` from MainFrame constructor |
## Non-Goals
- The `DPIAwarePlugin` detection logic (`dynamic_cast<DPIFrame*>` / `dynamic_cast<DPIDialog*>`) is unchanged
- No new DPI properties — this is purely about tree visibility and accelerator setup
## Risk Assessment
- **Multiple inheritance**: `DPIAware<P>` already has a vtable (virtual destructor). Adding `wxInspectable` adds a second base but no additional data members. The `wxInspector::wxInspectable` class is expected to be a lightweight marker interface.
- **Build**: No new includes needed; `<wx/inspector/inspector.h>` is already included in `GUI_Utils.hpp`.
- **Cross-platform**: The change is standard C++ multiple inheritance — no platform-specific concerns.
@@ -0,0 +1,244 @@
# wxInspector Plugins for OrcaSlicer Custom Controls — Design Spec
Date: 2026-07-23
Branch: `dev/layout-inspector`
## Overview
Create wxInspector plugins that expose OrcaSlicer's custom widget properties in the inspector's property grid. Without these plugins, the inspector shows only generic wxWidgets properties — missing all DPI-awareness data, custom styling, and Orca-specific control state.
## Goals
1. **DPIAware properties** — Inspect and update `scale_factor`, `prev_scale_factor`, `em_unit`, and `normal_font` on any DPIAware-derived widget
2. **Custom widget properties** — Surface Orca-specific properties on `Button`, `CheckBox`, `TextInput`, `SwitchButton`, `ProgressBar`, `Label`, and `LabeledStaticBox`
3. **Minimal source changes** — Only add trivial (one-line) getters/setters to existing classes; no architectural refactoring of Orca's widget hierarchy
## Non-Goals
- Custom inspector panels or AUI tabs (use the existing property grid and method invoker)
- Python-plugin integration (this is C++ wxInspector, not Orca's Python plugin system)
- Event logging customization (the built-in event logger already works)
## Architecture
### Two Plugins
| Plugin | Class | Files |
|--------|-------|-------|
| DPIAware plugin | `DPIAwarePlugin` | `DPIAwarePlugin.hpp`, `DPIAwarePlugin.cpp` |
| Custom widgets plugin | `CustomWidgetsPlugin` | `CustomWidgetsPlugin.hpp`, `CustomWidgetsPlugin.cpp` |
| Registration helper | inline function | `Registration.hpp` |
All files live under `src/slic3r/Utils/wxInspectorPlugins/`.
### Plugin Detection Strategy
**DPIAware plugin**: Uses `dynamic_cast<DPIFrame*>` and `dynamic_cast<DPIDialog*>` as detection gates. `DPIFrame` = `DPIAware<wxFrame>`, `DPIDialog` = `DPIAware<wxDialog>`. Since these are concrete typedefs, `dynamic_cast` works at runtime. This covers `MainFrame`, `SettingsDialog`, and all 8 calibration dialogs (which inherit `DPIDialog`).
**Custom widgets plugin**: Gates broadly on `CLASSINFO(wxWindow)`, then uses per-type `dynamic_cast` inside `GetProperties` to check each Orca-specific type. Only matching types append properties.
### Registration
A single `RegisterOrcaInspectorPlugins()` inline function in `Registration.hpp` creates both plugins as function-local statics (matching the wxInspector built-in provider pattern) and registers them via `wxInspector::RegisterPlugin()`.
Called once from `MainFrame::MainFrame()` after `SetupInspectorAccelerator(this)`.
### Why Separate Plugins?
- DPIAware is a C++ template concept (not a wxClassInfo-isKindOf check), so it needs its own detection logic
- Custom widgets use standard wxClassInfo-based detection, matching the built-in provider pattern
- Two focused files are easier to review and maintain than one monolithic plugin
- Compile-time failure isolation: if a widget header changes, only one plugin breaks
## DPIAware Plugin — Property Specification
### Source Changes (GUI_Utils.hpp)
Four one-liner methods added to the `DPIAware<P>` template class (public section):
```cpp
float scale_factor() const { return m_scale_factor; } // already exists
float prev_scale_factor() const { return m_prev_scale_factor; } // already exists
int em_unit() const { return m_em_unit; } // already exists
void set_scale_factor(float v) { m_scale_factor = v; } // NEW
void set_prev_scale_factor(float v) { m_prev_scale_factor = v; } // NEW
void set_em_unit(int v) { m_em_unit = v; } // NEW
bool force_rescale() const { return m_force_rescale; } // NEW
// m_normal_font getter already exists: normal_font()
```
### Detection
```cpp
bool CanProvideProperties(wxClassInfo* info) override {
// Gated in GetProperties via dynamic_cast on the window itself
return info->IsKindOf(CLASSINFO(wxWindow));
}
```
In `GetProperties`:
```cpp
auto* win = obj.AsWindow();
bool isDPI = dynamic_cast<DPIFrame*>(win) || dynamic_cast<DPIDialog*>(win);
if (!isDPI) return props;
```
### Property Table (category: "DPI Scaling")
| Name | Type | Editable | Getter | Setter |
|------|------|----------|--------|--------|
| Scale Factor | String (float) | Yes | `dpi->scale_factor()` | `dpi->set_scale_factor(v)` |
| Prev Scale Factor | String (float) | Yes | `dpi->prev_scale_factor()` | `dpi->set_prev_scale_factor(v)` |
| EM Unit | Integer | Yes | `dpi->em_unit()` | `dpi->set_em_unit(v)` |
| Normal Font | ReadOnly | No | `dpi->normal_font().GetNativeFontInfoDesc()` | — |
| Force Rescale | Boolean (ReadOnly) | No | `dpi->force_rescale()` | — |
**Note on setters**: The setters simply store values. They do NOT trigger a widget rescale/layout. To see the effect of a changed scale factor, use the inspector's Methods panel to call `Layout()` or resize the window — which triggers the DPI_CHANGED event path naturally.
## Custom Widgets Plugin — Property Specification
All properties are appended to the built-in wxWindow properties. Each widget type is independently detected via `dynamic_cast`.
### Detection gates (in `GetProperties`)
```cpp
auto* win = obj.AsWindow();
if (auto* btn = dynamic_cast<Button*>(win)) { addButtonProperties(btn, props); }
if (auto* cb = dynamic_cast<CheckBox*>(win)) { addCheckBoxProperties(cb, props); }
if (auto* ti = dynamic_cast<TextInput*>(win)) { addTextInputProperties(ti, props); }
if (auto* sb = dynamic_cast<SwitchButton*>(win)) { addSwitchButtonProperties(sb, props); }
if (auto* pb = dynamic_cast<ProgressBar*>(win)) { addProgressBarProperties(pb, props); }
if (auto* lbl = dynamic_cast<Label*>(win)) { addLabelProperties(lbl, props); }
if (auto* lsb = dynamic_cast<LabeledStaticBox*>(win)) { addLabeledStaticBoxProperties(lsb, props); }
```
### Orca Button (`Button`) — category: "Orca Button"
| Name | Type | Editable | Getter | Setter |
|------|------|----------|--------|--------|
| Button Style | Choice | Yes | enum→string | string→enum |
| Button Type | Choice | Yes | enum→string | string→enum |
| Selected | Boolean | Yes | `m_selected` (needs getter) | `SetSelected(v)` |
| Active Icon | ReadOnly | No | icon name string | — |
| Inactive Icon | ReadOnly | No | icon name string | — |
Choices for Button Style: `Regular`, `Confirm`, `Alert`, `Disabled`
Choices for Button Type: `Compact`, `Window`, `Choice`, `Parameter`, `Icon`, `Expanded`
**Source changes needed**: Button's `m_selected` is private. Add one-liner getter:
```cpp
bool IsSelected() const { return m_selected; }
```
### Orca CheckBox (`CheckBox`) — category: "Orca CheckBox"
| Name | Type | Editable | Getter | Setter |
|------|------|----------|--------|--------|
| Half Checked | Boolean | Yes | `m_half_checked` (needs getter) | `SetHalfChecked(v)` |
**Source changes needed**: `m_half_checked` is private. Add one-liner getter:
```cpp
bool IsHalfChecked() const { return m_half_checked; }
```
### Orca TextInput (`TextInput`) — category: "Orca TextInput"
| Name | Type | Editable | Getter | Setter |
|------|------|----------|--------|--------|
| Label | String | Yes | `GetLabel()` (inherited from wxWindow) | `SetLabel(v)` (exists) |
| Text Value | String | Yes | `GetTextCtrl()->GetValue()` (GetTextCtrl is public) | `GetTextCtrl()->SetValue(v)` |
| Corner Radius | Integer | Yes | `GetCornerRadius()` (NEW) | `SetCornerRadius(v)` (exists) |
**Source changes needed**: Add one getter to `TextInput`:
```cpp
int GetCornerRadius() const { return static_cast<int>(radius); }
```
(`radius` is inherited from StaticBox. `SetCornerRadius(double)` already exists. `GetTextCtrl()` is already public.)
### Orca SwitchButton (`SwitchButton`) — category: "Orca SwitchButton"
| Name | Type | Editable | Getter | Setter |
|------|------|----------|--------|--------|
| Value | Boolean | Yes | existing getter | existing setter |
### Orca ProgressBar (`ProgressBar`) — category: "Orca ProgressBar"
| Name | Type | Editable | Getter | Setter |
|------|------|----------|--------|--------|
| Proportion | Float (0-1) | Yes | `pb->m_proportion` (public member) | `pb->m_proportion = v` |
| Show Number | Boolean | Yes | `pb->m_shownumber` (public member) | `pb->m_shownumber = v` |
**No source changes needed**: `m_proportion` and `m_shownumber` are already public members. `SetValue(int)` and `SetProgress(int)` already exist as public methods.
### Orca Label (`Label`) — category: "Orca Label"
| Name | Type | Editable | Getter | Setter |
|------|------|----------|--------|--------|
| Is Hyperlink | Boolean | No | existing flag check | — |
| Font Size | ReadOnly | No | `GetFont().GetPointSize()` | — |
### LabeledStaticBox — category: "LabeledStaticBox"
| Name | Type | Editable | Getter | Setter |
|------|------|----------|--------|--------|
| Corner Radius | Integer | Yes | `GetCornerRadius()` (NEW) | `SetCornerRadius(v)` (exists) |
| Border Width | Integer | Yes | `GetBorderWidth()` (NEW) | `SetBorderWidth(v)` (exists) |
| Border Color | String (hex) | Yes | `GetBorderColor()` (NEW) | `SetBorderColor(v)` (exists) |
| Scale | Float (ReadOnly) | No | `m_scale` (protected, needs getter) | — |
**Source changes needed**: Four one-liner getters added to `LabeledStaticBox`:
```cpp
int GetCornerRadius() const { return m_radius; }
int GetBorderWidth() const { return m_border_width; }
StateColor GetBorderColor() const { return border_color; }
float GetScale() const { return m_scale; }
```
## Files Modified (Existing Code)
| File | Changes |
|------|---------|
| `src/slic3r/GUI/GUI_Utils.hpp` | +4 methods in `DPIAware<P>`: `set_scale_factor()`, `set_prev_scale_factor()`, `set_em_unit()`, `force_rescale()` |
| `src/slic3r/GUI/Widgets/LabeledStaticBox.hpp` | +4 getter declarations: `GetCornerRadius()`, `GetBorderWidth()`, `GetBorderColor()`, `GetScale()` |
| `src/slic3r/GUI/Widgets/LabeledStaticBox.cpp` | +4 getter implementations |
| `src/slic3r/GUI/Widgets/Button.hpp` | +1 getter: `IsSelected()` |
| `src/slic3r/GUI/Widgets/CheckBox.hpp` | +1 getter: `IsHalfChecked()` |
| `src/slic3r/GUI/Widgets/TextInput.hpp` | +1 getter: `GetCornerRadius()` |
| `src/slic3r/GUI/Widgets/ProgressBar.hpp` | None (public members are used directly) |
| `src/slic3r/GUI/MainFrame.cpp` | +1 `#include`, +1 call to `RegisterOrcaInspectorPlugins()` |
| `src/slic3r/CMakeLists.txt` | +4 entries in `SLIC3R_GUI_SOURCES` (the .cpp plugin files) |
## Files Created
```
src/slic3r/Utils/wxInspectorPlugins/
├── DPIAwarePlugin.hpp
├── DPIAwarePlugin.cpp
├── CustomWidgetsPlugin.hpp
├── CustomWidgetsPlugin.cpp
└── Registration.hpp
```
## Build & Linking
The `wxInspector` dependency is already wired:
- `deps/wxInspector/wxInspector.cmake` fetches and builds wxInspector
- `src/CMakeLists.txt` lines 92-93 link `wxInspector::wxInspector` into `wxWidgets_LIBRARIES`
- The plugin files only need `#include <wx/inspector/plugin.h>` and `#include <wx/inspector/inspector.h>` — both available from the installed dependency
No new CMake dependencies needed. Only the new source files need listing in `SLIC3R_GUI_SOURCES`.
## Error Handling & Edge Cases
- **Stale pointers**: Plugin lambdas capture raw pointers, regenerated on every `GetProperties` call (matching wxInspector's built-in provider pattern). Pointers live only until the next tree selection.
- **Widget destruction**: If a widget is destroyed while the inspector is showing its properties, `InspectableObject::IsValid()` returns false and properties are not displayed. The inspector won't show stale data.
- **Invalid property values**: Setters use `sscanf` / `ToLong` with validation (matching built-in patterns). Bogus input is rejected — setter returns `false`, property grid shows error state.
- **DPI drift**: Setting `scale_factor` without triggering rescale means displayed sizes don't match the new factor. This is acceptable — the inspector is a developer tool; operators know to call `Layout()` after making changes.
- **Missing widget type**: If a `dynamic_cast` fails for all types, only built-in wxWindow properties are shown. No crash, no error — just reduced info.
## Future Work (Out of Scope)
- **StateColor visualization**: `StateColor` is a multi-value type (maps bitmask states to colors). A full solution would need a custom property editor (e.g., a table showing each state→color pair). Keep it simple for now.
- **ScalableBitmap display**: Could show the bitmap as an inline thumbnail. Complex property editor work — deferred.
- **More widget types**: `SwitchBoard`, `MultiSwitchButton`, `StepCtrl`, `FanControl`, `DropDown`, `ComboBox`, `AMS*` widgets could all benefit. Add as needed.
- **Property refresh on tree selection**: Currently properties are static snapshots. A "refresh" button or auto-poll could keep values current for rapidly-changing widgets (progress bars, etc.). The built-in wxInspector already provides a tree-refresh button.
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 -2
View File
@@ -136,7 +136,6 @@ src/slic3r/GUI/BackgroundSlicingProcess.cpp
src/slic3r/GUI/BedShapeDialog.cpp
src/slic3r/GUI/BedShapeDialog.hpp
src/slic3r/GUI/ConfigManipulation.cpp
src/slic3r/GUI/ConfigValueFormatter.cpp
src/slic3r/GUI/DeviceManager.cpp
src/slic3r/GUI/DeviceErrorDialog.cpp
src/slic3r/GUI/ExtraRenderers.cpp
@@ -176,7 +175,6 @@ src/slic3r/GUI/ProgressStatusBar.cpp
src/slic3r/GUI/PlateSettingsDialog.cpp
src/slic3r/GUI/PrivacyUpdateDialog.cpp
src/slic3r/GUI/PublishDialog.cpp
src/slic3r/GUI/PublishSettingsDialog.cpp
src/slic3r/GUI/SavePresetDialog.cpp
src/slic3r/GUI/Search.cpp
src/slic3r/GUI/Selection.cpp
@@ -195,6 +193,7 @@ src/slic3r/GUI/ObjColorDialog.cpp
src/slic3r/GUI/SyncAmsInfoDialog.cpp
src/slic3r/GUI/WipeTowerDialog.cpp
src/slic3r/GUI/wxExtensions.cpp
src/slic3r/GUI/wxMediaCtrl2.cpp
src/slic3r/GUI/WebUserLoginDialog.cpp
src/slic3r/GUI/WebGuideDialog.cpp
src/slic3r/GUI/KBShortcutsDialog.hpp
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
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 579 KiB

After

Width:  |  Height:  |  Size: 171 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M1.5,8 14.5,1.5 7.5,14.5 6.3,9.7 Z" style="fill:none;stroke:gray;stroke-linecap:round;stroke-linejoin:round"/></svg>

Before

Width:  |  Height:  |  Size: 209 B

+8 -4
View File
@@ -1,4 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<line x1="0.5" y1="7.5" x2="14.5" y2="7.5" style="fill:none;stroke:#949494;stroke-linecap:round;stroke-linejoin:round"/>
<line x1="7.5" y1="0.5" x2="7.5" y2="14.5" style="fill:none;stroke:#949494;stroke-linecap:round;stroke-linejoin:round"/>
</svg>
<svg width="25" height="25" xmlns="http://www.w3.org/2000/svg" fill="none">
<g>
<title>Layer 1</title>
<path id="svg_1" stroke-linecap="round" stroke-width="2" stroke="#262E30" d="m1,12.5l23,0"/>
<path id="svg_2" stroke-linecap="round" stroke-width="2" stroke="#262E30" d="m12.5,24l0,-23"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 312 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12.00,12.00 L12.00,11.96 L12.01,11.92 L12.03,11.89 L12.05,11.85 L12.08,11.82 L12.12,11.80 L12.16,11.78 L12.20,11.76 L12.25,11.75 L12.30,11.75 L12.35,11.75 L12.40,11.77 L12.46,11.79 L12.51,11.81 L12.56,11.85 L12.61,11.89 L12.66,11.94 L12.70,12.00 L12.74,12.06 L12.77,12.14 L12.79,12.21 L12.80,12.29 L12.81,12.38 L12.81,12.47 L12.80,12.56 L12.77,12.65 L12.74,12.74 L12.70,12.83 L12.65,12.92 L12.58,13.01 L12.51,13.09 L12.43,13.17 L12.33,13.24 L12.23,13.30 L12.12,13.36 L12.00,13.40 L11.87,13.43 L11.74,13.46 L11.61,13.46 L11.47,13.46 L11.33,13.45 L11.18,13.41 L11.04,13.37 L10.90,13.31 L10.76,13.24 L10.63,13.15 L10.50,13.05 L10.38,12.93 L10.27,12.81 L10.17,12.67 L10.08,12.51 L10.01,12.35 L9.95,12.18 L9.90,12.00 L9.87,11.81 L9.86,11.62 L9.86,11.43 L9.88,11.23 L9.92,11.03 L9.98,10.83 L10.06,10.64 L10.15,10.45 L10.27,10.27 L10.40,10.09 L10.55,9.93 L10.72,9.78 L10.90,9.64 L11.10,9.52 L11.31,9.41 L11.53,9.32 L11.76,9.25 L12.00,9.20 L12.25,9.17 L12.50,9.17 L12.75,9.18 L13.01,9.22 L13.27,9.29 L13.52,9.37 L13.76,9.48 L14.00,9.62 L14.23,9.77 L14.44,9.95 L14.64,10.15 L14.83,10.37 L15.00,10.60 L15.14,10.86 L15.27,11.12 L15.37,11.41 L15.45,11.70 L15.50,12.00 L15.53,12.31 L15.52,12.62 L15.49,12.94 L15.44,13.25 L15.35,13.56 L15.23,13.87 L15.09,14.16 L14.92,14.45 L14.72,14.72 L14.50,14.98 L14.25,15.22 L13.98,15.44 L13.69,15.63 L13.38,15.80 L13.06,15.94 L12.72,16.06 L12.36,16.15 L12.00,16.20 L11.63,16.22 L11.26,16.21 L10.88,16.17 L10.51,16.09 L10.14,15.98 L9.78,15.84 L9.43,15.66 L9.10,15.46 L8.78,15.22 L8.48,14.95 L8.21,14.65 L7.96,14.33 L7.74,13.99 L7.54,13.62 L7.38,13.24 L7.25,12.84 L7.16,12.42 L7.10,12.00 L7.08,11.57 L7.10,11.14 L7.15,10.70 L7.25,10.27 L7.38,9.85 L7.55,9.43 L7.76,9.03 L8.01,8.65 L8.29,8.29 L8.60,7.95 L8.94,7.64 L9.32,7.35 L9.72,7.10 L10.14,6.88 L10.58,6.70 L11.04,6.56 L11.52,6.46 L12.00,6.40 L12.49,6.38 L12.99,6.41 L13.48,6.48 L13.97,6.59 L14.45,6.75 L14.92,6.95 L15.37,7.19 L15.80,7.47 L16.21,7.79 L16.59,8.15 L16.94,8.54 L17.25,8.97 L17.53,9.42 L17.77,9.90 L17.97,10.40 L18.13,10.92 L18.24,11.45 L18.30,12.00 L18.31,12.55 L18.28,13.11 L18.20,13.66 L18.07,14.21 L17.89,14.74 L17.66,15.27 L17.38,15.77 L17.06,16.25 L16.70,16.70 L16.30,17.12 L15.86,17.51 L15.38,17.86 L14.88,18.17 L14.34,18.43 L13.78,18.65 L13.20,18.82 L12.61,18.93 L12.00,19.00 L11.39,19.01 L10.77,18.97 L10.16,18.87 L9.55,18.72 L8.96,18.52 L8.38,18.26 L7.83,17.96 L7.30,17.60 L6.80,17.20 L6.34,16.75 L5.92,16.26 L5.53,15.73 L5.20,15.17 L4.91,14.58 L4.68,13.96 L4.49,13.32 L4.37,12.67 L4.30,12.00 L4.29,11.33 L4.34,10.65 L4.45,9.98 L4.62,9.31 L4.85,8.66 L5.13,8.03 L5.47,7.43 L5.86,6.85 L6.31,6.31 L6.80,5.80 L7.34,5.34 L7.92,4.93 L8.53,4.56 L9.18,4.25 L9.86,4.00 L10.55,3.80 L11.27,3.67 L12.00,3.60" style="fill:none;stroke:#009688;stroke-linecap:round;stroke-linejoin:round"/><rect x="1.5" y="1.5" width="21" height="21" rx="2" style="fill:none;stroke:#949494;stroke-linecap:round;stroke-linejoin:round"/></svg>

Before

Width:  |  Height:  |  Size: 2.9 KiB

-607
View File
@@ -1,607 +0,0 @@
{
"bambustudio_commit": "66e405477",
"filaments": {
"OF0UJcb6": {
"bambu_id": "GFG60",
"name": "PolyLite PETG",
"type": "PETG",
"vendor": "Polymaker"
},
"OF0wBGNx": {
"bambu_id": "GFB51",
"name": "Bambu ASA-CF",
"type": "ASA-CF",
"vendor": "Bambu Lab"
},
"OF1UNk9P": {
"bambu_id": "GFP97",
"name": "Generic PP",
"type": "PP",
"vendor": "Generic"
},
"OF2GCW1l": {
"bambu_id": "GFSNL08",
"name": "SUNLU PETG",
"type": "PETG",
"vendor": "SUNLU"
},
"OF2VFe4J": {
"bambu_id": "GFN04",
"name": "Bambu PAHT-CF",
"type": "PA-CF",
"vendor": "Bambu Lab"
},
"OF342jVN": {
"bambu_id": "GFA10",
"name": "Bambu PLA Tough+",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OF4RvVuU": {
"bambu_id": "GFT02",
"name": "Bambu PPS-CF",
"type": "PPS-CF",
"vendor": "Bambu Lab"
},
"OF54B0S0": {
"bambu_id": "GFN06",
"name": "Bambu PPA-CF",
"type": "PPA-CF",
"vendor": "Bambu Lab"
},
"OF5CgdDq": {
"bambu_id": "GFL00",
"name": "PolyLite PLA",
"type": "PLA",
"vendor": "Polymaker"
},
"OF6rdQ6M": {
"bambu_id": "GFT98",
"name": "Generic PPS-CF",
"type": "PPS-CF",
"vendor": "Generic"
},
"OF74KeQR": {
"bambu_id": "GFR98",
"name": "Generic PHA",
"type": "PHA",
"vendor": "Generic"
},
"OF7lOgYF": {
"bambu_id": "GFG96",
"name": "Generic PETG HF",
"type": "PETG",
"vendor": "Generic"
},
"OF8Tlg47": {
"bambu_id": "GFN96",
"name": "Generic PPA-GF",
"type": "PPA-GF",
"vendor": "Generic"
},
"OF8tPByX": {
"bambu_id": "GFN97",
"name": "Generic PPA-CF",
"type": "PPA-CF",
"vendor": "Generic"
},
"OF9OlTWH": {
"bambu_id": "GFA07",
"name": "Bambu PLA Marble",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFAnyRUI": {
"bambu_id": "GFS02",
"name": "Bambu Support For PLA",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFBSW57R": {
"bambu_id": "GFA11",
"name": "Bambu PLA Aero",
"type": "PLA-AERO",
"vendor": "Bambu Lab"
},
"OFBw6eEG": {
"bambu_id": "GFL05",
"name": "Overture Matte PLA",
"type": "PLA",
"vendor": "Overture"
},
"OFCD8qiU": {
"bambu_id": "GFR99",
"name": "Generic EVA",
"type": "EVA",
"vendor": "Generic"
},
"OFDGigEI": {
"bambu_id": "GFA13",
"name": "Bambu PLA Dynamic",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFDSrzZ8": {
"bambu_id": "GFL99",
"name": "Generic PLA",
"type": "PLA",
"vendor": "Generic"
},
"OFDvXujf": {
"bambu_id": "GFS99",
"name": "Generic PVA",
"type": "PVA",
"vendor": "Generic"
},
"OFDxfPgH": {
"bambu_id": "GFA08",
"name": "Bambu PLA Sparkle",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFEGNJD4": {
"bambu_id": "GFA05",
"name": "Bambu PLA Silk",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFEkPBwx": {
"bambu_id": "GFA12",
"name": "Bambu PLA Glow",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFEswT5W": {
"bambu_id": "GFA50",
"name": "Bambu PLA-CF",
"type": "PLA-CF",
"vendor": "Bambu Lab"
},
"OFFNYwWR": {
"bambu_id": "GFN03",
"name": "Bambu PA-CF",
"type": "PA-CF",
"vendor": "Bambu Lab"
},
"OFFbSnCD": {
"bambu_id": "GFA17",
"name": "Bambu PLA Translucent",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFFvzqcd": {
"bambu_id": "GFG00",
"name": "Bambu PETG Basic",
"type": "PETG",
"vendor": "Bambu Lab"
},
"OFHWSM21": {
"bambu_id": "GFL54",
"name": "Fiberon PET-CF",
"type": "PET-CF",
"vendor": "Polymaker"
},
"OFHa48An": {
"bambu_id": "GFT01",
"name": "Bambu PET-CF",
"type": "PET-CF",
"vendor": "Bambu Lab"
},
"OFHmPYRy": {
"bambu_id": "GFSNL04",
"name": "SUNLU PLA+ 2.0",
"type": "PLA",
"vendor": "SUNLU"
},
"OFIBbYO5": {
"bambu_id": "GFU02",
"name": "Bambu TPU for AMS",
"type": "TPU-AMS",
"vendor": "Bambu Lab"
},
"OFIfnzxC": {
"bambu_id": "GFS05",
"name": "Bambu Support For PLA/PETG",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFKhMPeX": {
"bambu_id": "GFC00",
"name": "Bambu PC",
"type": "PC",
"vendor": "Bambu Lab"
},
"OFLJ8S6I": {
"bambu_id": "GFSNL07",
"name": "SUNLU Wood PLA",
"type": "PLA",
"vendor": "SUNLU"
},
"OFLPAxz3": {
"bambu_id": "GFB98",
"name": "Generic ASA",
"type": "ASA",
"vendor": "Generic"
},
"OFLakOUI": {
"bambu_id": "GFC99",
"name": "Generic PC",
"type": "PC",
"vendor": "Generic"
},
"OFMTK0UC": {
"bambu_id": "GFS03",
"name": "Bambu Support For PA/PET",
"type": "PA",
"vendor": "Bambu Lab"
},
"OFMUWNkp": {
"bambu_id": "GFSNL03",
"name": "SUNLU PLA+",
"type": "PLA",
"vendor": "SUNLU"
},
"OFMjtqTC": {
"bambu_id": "GFA16",
"name": "Bambu PLA Wood",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFNk8bxk": {
"bambu_id": "GFN08",
"name": "Bambu PA6-GF",
"type": "PA-GF",
"vendor": "Bambu Lab"
},
"OFOvv91M": {
"bambu_id": "GFB60",
"name": "PolyLite ABS",
"type": "ABS",
"vendor": "Polymaker"
},
"OFPklMI1": {
"bambu_id": "GFP99",
"name": "Generic PE",
"type": "PE",
"vendor": "Generic"
},
"OFQ3e56w": {
"bambu_id": "GFA15",
"name": "Bambu PLA Galaxy",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFQHiNJs": {
"bambu_id": "GFS01",
"name": "Bambu Support G",
"type": "PA",
"vendor": "Bambu Lab"
},
"OFQLcbps": {
"bambu_id": "GFN98",
"name": "Generic PA-CF",
"type": "PA-CF",
"vendor": "Generic"
},
"OFS2tn6G": {
"bambu_id": "GFL53",
"name": "Fiberon PA612-CF",
"type": "PA",
"vendor": "Polymaker"
},
"OFTHDCqA": {
"bambu_id": "GFA19",
"name": "Bambu PLA Pure",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFTRZ8Y4": {
"bambu_id": "GFG50",
"name": "Bambu PETG-CF",
"type": "PETG-CF",
"vendor": "Bambu Lab"
},
"OFUanySo": {
"bambu_id": "GFA06",
"name": "Bambu PLA Silk+",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFVCkX5w": {
"bambu_id": "GFU01",
"name": "Bambu TPU 95A",
"type": "TPU",
"vendor": "Bambu Lab"
},
"OFW29a9R": {
"bambu_id": "GFL01",
"name": "PolyTerra PLA",
"type": "PLA",
"vendor": "Polymaker"
},
"OFWbdGsC": {
"bambu_id": "GFL98",
"name": "Generic PLA-CF",
"type": "PLA-CF",
"vendor": "Generic"
},
"OFX0ycRQ": {
"bambu_id": "GFL52",
"name": "Fiberon PA12-CF",
"type": "PA-CF",
"vendor": "Polymaker"
},
"OFXIbw5D": {
"bambu_id": "GFA01",
"name": "Bambu PLA Matte",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFXkm8q1": {
"bambu_id": "GFP96",
"name": "Generic PP-CF",
"type": "PP-CF",
"vendor": "Generic"
},
"OFXzQ4yL": {
"bambu_id": "GFB02",
"name": "Bambu ASA-Aero",
"type": "ASA-AERO",
"vendor": "Bambu Lab"
},
"OFY9muEs": {
"bambu_id": "GFB99",
"name": "Generic ABS",
"type": "ABS",
"vendor": "Generic"
},
"OFYPdQJh": {
"bambu_id": "GFG99",
"name": "Generic PETG",
"type": "PETG",
"vendor": "Generic"
},
"OFaQMgRH": {
"bambu_id": "GFA09",
"name": "Bambu PLA Tough",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFc3xdm9": {
"bambu_id": "GFL04",
"name": "Overture PLA",
"type": "PLA",
"vendor": "Overture"
},
"OFcytyoA": {
"bambu_id": "GFL06",
"name": "Fiberon PETG-ESD",
"type": "PETG",
"vendor": "Polymaker"
},
"OFd0Fv0k": {
"bambu_id": "GFP98",
"name": "Generic PE-CF",
"type": "PE-CF",
"vendor": "Generic"
},
"OFdyfQvU": {
"bambu_id": "GFG03",
"name": "Bambu PETG Matte",
"type": "PETG",
"vendor": "Bambu Lab"
},
"OFesA6rF": {
"bambu_id": "GFL96",
"name": "Generic PLA Silk",
"type": "PLA",
"vendor": "Generic"
},
"OFf6mfQO": {
"bambu_id": "GFS06",
"name": "Bambu Support for ABS",
"type": "ABS",
"vendor": "Bambu Lab"
},
"OFfBpSRI": {
"bambu_id": "GFB01",
"name": "Bambu ASA",
"type": "ASA",
"vendor": "Bambu Lab"
},
"OFg57Nmc": {
"bambu_id": "GFC01",
"name": "Bambu PC FR",
"type": "PC",
"vendor": "Bambu Lab"
},
"OFg8ndtj": {
"bambu_id": "GFN99",
"name": "Generic PA",
"type": "PA",
"vendor": "Generic"
},
"OFgbpcy9": {
"bambu_id": "GFU99",
"name": "Generic TPU",
"type": "TPU",
"vendor": "Generic"
},
"OFhuaUQB": {
"bambu_id": "GFB00",
"name": "Bambu ABS",
"type": "ABS",
"vendor": "Bambu Lab"
},
"OFk8t9mz": {
"bambu_id": "GFL55",
"name": "Fiberon PETG-rCF",
"type": "PETG-CF",
"vendor": "Polymaker"
},
"OFkOviHk": {
"bambu_id": "GFL50",
"name": "Fiberon PA6-CF",
"type": "PA6-CF",
"vendor": "Polymaker"
},
"OFknl9Iz": {
"bambu_id": "GFB50",
"name": "Bambu ABS-GF",
"type": "ABS-GF",
"vendor": "Bambu Lab"
},
"OFlfuj2k": {
"bambu_id": "GFU04",
"name": "Bambu TPU 85A",
"type": "TPU",
"vendor": "Bambu Lab"
},
"OFmN2lvw": {
"bambu_id": "GFU98",
"name": "Generic TPU for AMS",
"type": "TPU-AMS",
"vendor": "Generic"
},
"OFmpMwxS": {
"bambu_id": "GFL95",
"name": "Generic PLA High Speed",
"type": "PLA",
"vendor": "Generic"
},
"OFnfxTvi": {
"bambu_id": "GFA18",
"name": "Bambu PLA Lite",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFniMuTN": {
"bambu_id": "GFN05",
"name": "Bambu PA6-CF",
"type": "PA6-CF",
"vendor": "Bambu Lab"
},
"OFo2UF2C": {
"bambu_id": "GFS97",
"name": "Generic BVOH",
"type": "BVOH",
"vendor": "Generic"
},
"OFoYSJKi": {
"bambu_id": "GFG98",
"name": "Generic PETG-CF",
"type": "PETG-CF",
"vendor": "Generic"
},
"OFoiVqVM": {
"bambu_id": "GFA00",
"name": "Bambu PLA Basic",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFovEIbw": {
"bambu_id": "GFG02",
"name": "Bambu PETG HF",
"type": "PETG",
"vendor": "Bambu Lab"
},
"OFpPGSKG": {
"bambu_id": "GFSNL05",
"name": "SUNLU Silk PLA+",
"type": "PLA",
"vendor": "SUNLU"
},
"OFpW4gdi": {
"bambu_id": "GFSNL02",
"name": "SUNLU PLA Matte",
"type": "PLA",
"vendor": "SUNLU"
},
"OFq9svOz": {
"bambu_id": "GFT97",
"name": "Generic PPS",
"type": "PPS",
"vendor": "Generic"
},
"OFqINlYj": {
"bambu_id": "GFL03",
"name": "eSUN PLA+",
"type": "PLA",
"vendor": "eSUN"
},
"OFrKLeE3": {
"bambu_id": "GFA02",
"name": "Bambu PLA Metal",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFsFon5l": {
"bambu_id": "GFS98",
"name": "Generic HIPS",
"type": "HIPS",
"vendor": "Generic"
},
"OFsHSVZc": {
"bambu_id": "GFS00",
"name": "Bambu Support W",
"type": "PLA",
"vendor": "Bambu Lab"
},
"OFsijjtH": {
"bambu_id": "GFP95",
"name": "Generic PP-GF",
"type": "PP-GF",
"vendor": "Generic"
},
"OFtkLO6q": {
"bambu_id": "GFU03",
"name": "Bambu TPU 90A",
"type": "TPU",
"vendor": "Bambu Lab"
},
"OFu1evlr": {
"bambu_id": "GFG97",
"name": "Generic PCTG",
"type": "PCTG",
"vendor": "Generic"
},
"OFvKUnLh": {
"bambu_id": "GFU00",
"name": "Bambu TPU 95A HF",
"type": "TPU",
"vendor": "Bambu Lab"
},
"OFvrXuV7": {
"bambu_id": "GFB61",
"name": "PolyLite ASA",
"type": "ASA",
"vendor": "Polymaker"
},
"OFwPrlCM": {
"bambu_id": "GFG01",
"name": "Bambu PETG Translucent",
"type": "PETG",
"vendor": "Bambu Lab"
},
"OFwaYjL6": {
"bambu_id": "GFL51",
"name": "Fiberon PA6-GF",
"type": "PA-GF",
"vendor": "Polymaker"
},
"OFxUwUeW": {
"bambu_id": "GFSNL06",
"name": "SUNLU PLA Marble",
"type": "PLA",
"vendor": "SUNLU"
},
"OFzyIxba": {
"bambu_id": "GFS04",
"name": "Bambu PVA",
"type": "PVA",
"vendor": "Bambu Lab"
}
},
"generated": "2026-09-04",
"source": "https://github.com/bambulab/BambuStudio"
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Afinia",
"version": "02.04.00.03",
"version": "02.04.00.02",
"force_update": "0",
"description": "Afinia configurations",
"machine_model_list": [
@@ -1,6 +1,6 @@
{
"type": "filament",
"filament_id": "OFLfywkp",
"filament_id": "GFB00_01",
"setting_id": "wAJTMxtCY7EoavRi",
"name": "Afinia ABS+@HS",
"from": "system",
@@ -1,6 +1,6 @@
{
"type": "filament",
"filament_id": "OFV5wEMe",
"filament_id": "GFB00_01",
"setting_id": "qCDnb2iBaz4hd4vX",
"name": "Afinia ABS@HS",
"from": "system",
@@ -1,6 +1,6 @@
{
"type": "filament",
"filament_id": "OF9HCdyQ",
"filament_id": "GFA00_01",
"setting_id": "N3sCgjdjvp6FTtw9",
"name": "Afinia PLA@HS",
"from": "system",
@@ -4,7 +4,7 @@
"inherits": "fdm_filament_tpu",
"from": "system",
"setting_id": "zUqTgAEbqTN1EdRl",
"filament_id": "OFDJU6R3",
"filament_id": "GFU01_01",
"instantiation": "true",
"filament_vendor": [
"Afinia"
@@ -1,6 +1,6 @@
{
"type": "filament",
"filament_id": "OFXi59OX",
"filament_id": "GFB00_01",
"setting_id": "OxIiEYjbhEvSykaQ",
"name": "Afinia Value ABS@HS",
"from": "system",
@@ -1,6 +1,6 @@
{
"type": "filament",
"filament_id": "OFgHh8ly",
"filament_id": "GFA00_01",
"setting_id": "BASsUdyvElEVJ9AA",
"name": "Afinia Value PLA@HS",
"from": "system",
+85 -85
View File
@@ -1,6 +1,6 @@
{
"name": "Anker",
"version": "02.04.00.02",
"version": "02.04.00.01",
"force_update": "0",
"description": "Anker configurations",
"machine_model_list": [
@@ -161,172 +161,172 @@
"sub_path": "filament/fdm_filament_tpu.json"
},
{
"name": "Generic ABS @Anker base",
"sub_path": "filament/Generic ABS @Anker base.json"
"name": "Anker Generic ABS @base",
"sub_path": "filament/Anker Generic ABS @base.json"
},
{
"name": "Generic ASA @Anker base",
"sub_path": "filament/Generic ASA @Anker base.json"
"name": "Anker Generic ASA @base",
"sub_path": "filament/Anker Generic ASA @base.json"
},
{
"name": "Generic PA @Anker base",
"sub_path": "filament/Generic PA @Anker base.json"
"name": "Anker Generic PA @base",
"sub_path": "filament/Anker Generic PA @base.json"
},
{
"name": "Generic PA-CF @Anker base",
"sub_path": "filament/Generic PA-CF @Anker base.json"
"name": "Anker Generic PA-CF @base",
"sub_path": "filament/Anker Generic PA-CF @base.json"
},
{
"name": "Generic PC @Anker base",
"sub_path": "filament/Generic PC @Anker base.json"
"name": "Anker Generic PC @base",
"sub_path": "filament/Anker Generic PC @base.json"
},
{
"name": "Generic PETG @Anker base",
"sub_path": "filament/Generic PETG @Anker base.json"
"name": "Anker Generic PETG @base",
"sub_path": "filament/Anker Generic PETG @base.json"
},
{
"name": "Generic PETG-CF @Anker base",
"sub_path": "filament/Generic PETG-CF @Anker base.json"
"name": "Anker Generic PETG-CF @base",
"sub_path": "filament/Anker Generic PETG-CF @base.json"
},
{
"name": "Generic PLA @Anker base",
"sub_path": "filament/Generic PLA @Anker base.json"
"name": "Anker Generic PLA @base",
"sub_path": "filament/Anker Generic PLA @base.json"
},
{
"name": "Generic PLA Silk @Anker base",
"sub_path": "filament/Generic PLA Silk @Anker base.json"
"name": "Anker Generic PLA Silk @base",
"sub_path": "filament/Anker Generic PLA Silk @base.json"
},
{
"name": "Generic PLA+ @Anker base",
"sub_path": "filament/Generic PLA+ @Anker base.json"
"name": "Anker Generic PLA+ @base",
"sub_path": "filament/Anker Generic PLA+ @base.json"
},
{
"name": "Generic PLA-CF @Anker base",
"sub_path": "filament/Generic PLA-CF @Anker base.json"
"name": "Anker Generic PLA-CF @base",
"sub_path": "filament/Anker Generic PLA-CF @base.json"
},
{
"name": "Generic PVA @Anker base",
"sub_path": "filament/Generic PVA @Anker base.json"
"name": "Anker Generic PVA @base",
"sub_path": "filament/Anker Generic PVA @base.json"
},
{
"name": "Generic TPU @Anker base",
"sub_path": "filament/Generic TPU @Anker base.json"
"name": "Anker Generic TPU @base",
"sub_path": "filament/Anker Generic TPU @base.json"
},
{
"name": "Generic ABS @Anker",
"sub_path": "filament/Generic ABS @Anker.json"
"name": "Anker Generic ABS",
"sub_path": "filament/Anker Generic ABS.json"
},
{
"name": "Generic ABS @Anker 0.2 nozzle",
"sub_path": "filament/Generic ABS @Anker 0.2 nozzle.json"
"name": "Anker Generic ABS 0.2 nozzle",
"sub_path": "filament/Anker Generic ABS 0.2 nozzle.json"
},
{
"name": "Generic ABS @Anker 0.25 nozzle",
"sub_path": "filament/Generic ABS @Anker 0.25 nozzle.json"
"name": "Anker Generic ABS 0.25 nozzle",
"sub_path": "filament/Anker Generic ABS 0.25 nozzle.json"
},
{
"name": "Generic ASA @Anker",
"sub_path": "filament/Generic ASA @Anker.json"
"name": "Anker Generic ASA",
"sub_path": "filament/Anker Generic ASA.json"
},
{
"name": "Generic ASA @Anker 0.2 nozzle",
"sub_path": "filament/Generic ASA @Anker 0.2 nozzle.json"
"name": "Anker Generic ASA 0.2 nozzle",
"sub_path": "filament/Anker Generic ASA 0.2 nozzle.json"
},
{
"name": "Generic ASA @Anker 0.25 nozzle",
"sub_path": "filament/Generic ASA @Anker 0.25 nozzle.json"
"name": "Anker Generic ASA 0.25 nozzle",
"sub_path": "filament/Anker Generic ASA 0.25 nozzle.json"
},
{
"name": "Generic PA @Anker",
"sub_path": "filament/Generic PA @Anker.json"
"name": "Anker Generic PA",
"sub_path": "filament/Anker Generic PA.json"
},
{
"name": "Generic PA @Anker 0.2 nozzle",
"sub_path": "filament/Generic PA @Anker 0.2 nozzle.json"
"name": "Anker Generic PA 0.2 nozzle",
"sub_path": "filament/Anker Generic PA 0.2 nozzle.json"
},
{
"name": "Generic PA @Anker 0.25 nozzle",
"sub_path": "filament/Generic PA @Anker 0.25 nozzle.json"
"name": "Anker Generic PA 0.25 nozzle",
"sub_path": "filament/Anker Generic PA 0.25 nozzle.json"
},
{
"name": "Generic PA-CF @Anker",
"sub_path": "filament/Generic PA-CF @Anker.json"
"name": "Anker Generic PA-CF",
"sub_path": "filament/Anker Generic PA-CF.json"
},
{
"name": "Generic PC @Anker",
"sub_path": "filament/Generic PC @Anker.json"
"name": "Anker Generic PC",
"sub_path": "filament/Anker Generic PC.json"
},
{
"name": "Generic PC @Anker 0.2 nozzle",
"sub_path": "filament/Generic PC @Anker 0.2 nozzle.json"
"name": "Anker Generic PC 0.2 nozzle",
"sub_path": "filament/Anker Generic PC 0.2 nozzle.json"
},
{
"name": "Generic PC @Anker 0.25 nozzle",
"sub_path": "filament/Generic PC @Anker 0.25 nozzle.json"
"name": "Anker Generic PC 0.25 nozzle",
"sub_path": "filament/Anker Generic PC 0.25 nozzle.json"
},
{
"name": "Generic PETG @Anker",
"sub_path": "filament/Generic PETG @Anker.json"
"name": "Anker Generic PETG",
"sub_path": "filament/Anker Generic PETG.json"
},
{
"name": "Generic PETG @Anker 0.2 nozzle",
"sub_path": "filament/Generic PETG @Anker 0.2 nozzle.json"
"name": "Anker Generic PETG 0.2 nozzle",
"sub_path": "filament/Anker Generic PETG 0.2 nozzle.json"
},
{
"name": "Generic PETG @Anker 0.25 nozzle",
"sub_path": "filament/Generic PETG @Anker 0.25 nozzle.json"
"name": "Anker Generic PETG 0.25 nozzle",
"sub_path": "filament/Anker Generic PETG 0.25 nozzle.json"
},
{
"name": "Generic PETG-CF @Anker",
"sub_path": "filament/Generic PETG-CF @Anker.json"
"name": "Anker Generic PETG-CF",
"sub_path": "filament/Anker Generic PETG-CF.json"
},
{
"name": "Generic PLA @Anker",
"sub_path": "filament/Generic PLA @Anker.json"
"name": "Anker Generic PLA",
"sub_path": "filament/Anker Generic PLA.json"
},
{
"name": "Generic PLA @Anker 0.2 nozzle",
"sub_path": "filament/Generic PLA @Anker 0.2 nozzle.json"
"name": "Anker Generic PLA 0.2 nozzle",
"sub_path": "filament/Anker Generic PLA 0.2 nozzle.json"
},
{
"name": "Generic PLA @Anker 0.25 nozzle",
"sub_path": "filament/Generic PLA @Anker 0.25 nozzle.json"
"name": "Anker Generic PLA 0.25 nozzle",
"sub_path": "filament/Anker Generic PLA 0.25 nozzle.json"
},
{
"name": "Generic PLA Silk @Anker",
"sub_path": "filament/Generic PLA Silk @Anker.json"
"name": "Anker Generic PLA Silk",
"sub_path": "filament/Anker Generic PLA Silk.json"
},
{
"name": "Generic PLA Silk @Anker 0.2 nozzle",
"sub_path": "filament/Generic PLA Silk @Anker 0.2 nozzle.json"
"name": "Anker Generic PLA Silk 0.2 nozzle",
"sub_path": "filament/Anker Generic PLA Silk 0.2 nozzle.json"
},
{
"name": "Generic PLA Silk @Anker 0.25 nozzle",
"sub_path": "filament/Generic PLA Silk @Anker 0.25 nozzle.json"
"name": "Anker Generic PLA Silk 0.25 nozzle",
"sub_path": "filament/Anker Generic PLA Silk 0.25 nozzle.json"
},
{
"name": "Generic PLA+ @Anker",
"sub_path": "filament/Generic PLA+ @Anker.json"
"name": "Anker Generic PLA+",
"sub_path": "filament/Anker Generic PLA+.json"
},
{
"name": "Generic PLA+ @Anker 0.2 nozzle",
"sub_path": "filament/Generic PLA+ @Anker 0.2 nozzle.json"
"name": "Anker Generic PLA+ 0.2 nozzle",
"sub_path": "filament/Anker Generic PLA+ 0.2 nozzle.json"
},
{
"name": "Generic PLA+ @Anker 0.25 nozzle",
"sub_path": "filament/Generic PLA+ @Anker 0.25 nozzle.json"
"name": "Anker Generic PLA+ 0.25 nozzle",
"sub_path": "filament/Anker Generic PLA+ 0.25 nozzle.json"
},
{
"name": "Generic PLA-CF @Anker",
"sub_path": "filament/Generic PLA-CF @Anker.json"
"name": "Anker Generic PLA-CF",
"sub_path": "filament/Anker Generic PLA-CF.json"
},
{
"name": "Generic PVA @Anker",
"sub_path": "filament/Generic PVA @Anker.json"
"name": "Anker Generic PVA",
"sub_path": "filament/Anker Generic PVA.json"
},
{
"name": "Generic TPU @Anker",
"sub_path": "filament/Generic TPU @Anker.json"
"name": "Anker Generic TPU",
"sub_path": "filament/Anker Generic TPU.json"
}
],
"machine_list": [
@@ -1,10 +1,9 @@
{
"type": "filament",
"name": "Generic ABS @Anker 0.2 nozzle",
"inherits": "Generic ABS @Anker base",
"renamed_from": "Anker Generic ABS 0.2 nozzle",
"name": "Anker Generic ABS 0.2 nozzle",
"inherits": "Anker Generic ABS @base",
"from": "system",
"setting_id": "iOCt7x95XbWYMe5q",
"setting_id": "BD5ODYVM90Ig44C5",
"instantiation": "true",
"filament_max_volumetric_speed": [
"2"
@@ -1,10 +1,9 @@
{
"type": "filament",
"name": "Generic ABS @Anker 0.25 nozzle",
"inherits": "Generic ABS @Anker base",
"renamed_from": "Anker Generic ABS 0.25 nozzle",
"name": "Anker Generic ABS 0.25 nozzle",
"inherits": "Anker Generic ABS @base",
"from": "system",
"setting_id": "7Q2pr70SpSjK7v7Y",
"setting_id": "WS5wXckNuiQqSVwO",
"instantiation": "true",
"filament_max_volumetric_speed": [
"3"
@@ -1,8 +1,8 @@
{
"type": "filament",
"name": "Generic ABS @Anker base",
"name": "Anker Generic ABS @base",
"inherits": "fdm_filament_abs",
"from": "system",
"filament_id": "OFY9muEs",
"filament_id": "GFB99",
"instantiation": "false"
}
@@ -1,10 +1,9 @@
{
"type": "filament",
"name": "Generic PVA @Anker",
"inherits": "Generic PVA @Anker base",
"renamed_from": "Anker Generic PVA",
"name": "Anker Generic ABS",
"inherits": "Anker Generic ABS @base",
"from": "system",
"setting_id": "HXERDaP3AgzWtmiu",
"setting_id": "axEspGzFJnrnidm4",
"instantiation": "true",
"compatible_printers": [
"Anker M5 0.4 nozzle",
@@ -1,10 +1,9 @@
{
"type": "filament",
"name": "Generic PLA @Anker 0.2 nozzle",
"inherits": "Generic PLA @Anker base",
"renamed_from": "Anker Generic PLA 0.2 nozzle",
"name": "Anker Generic ASA 0.2 nozzle",
"inherits": "Anker Generic ASA @base",
"from": "system",
"setting_id": "rCvmCzPgi4KA6nmI",
"setting_id": "G7pzEyyhPFDnae3R",
"instantiation": "true",
"filament_max_volumetric_speed": [
"2"
@@ -1,10 +1,9 @@
{
"type": "filament",
"name": "Generic ASA @Anker 0.25 nozzle",
"inherits": "Generic ASA @Anker base",
"renamed_from": "Anker Generic ASA 0.25 nozzle",
"name": "Anker Generic ASA 0.25 nozzle",
"inherits": "Anker Generic ASA @base",
"from": "system",
"setting_id": "FU4BiMydEyo7zxq5",
"setting_id": "ErUUDTQ7h1wNHAKT",
"instantiation": "true",
"filament_max_volumetric_speed": [
"3"
@@ -1,8 +1,8 @@
{
"type": "filament",
"name": "Generic ASA @Anker base",
"name": "Anker Generic ASA @base",
"inherits": "fdm_filament_asa",
"from": "system",
"filament_id": "OFLPAxz3",
"filament_id": "GFB98",
"instantiation": "false"
}
@@ -1,10 +1,9 @@
{
"type": "filament",
"name": "Generic ASA @Anker",
"inherits": "Generic ASA @Anker base",
"renamed_from": "Anker Generic ASA",
"name": "Anker Generic ASA",
"inherits": "Anker Generic ASA @base",
"from": "system",
"setting_id": "aDADuxiEKt2dVKOJ",
"setting_id": "QiFoBW5WuDUJGmFZ",
"instantiation": "true",
"compatible_printers": [
"Anker M5 0.4 nozzle",
@@ -1,10 +1,9 @@
{
"type": "filament",
"name": "Generic PA @Anker 0.2 nozzle",
"inherits": "Generic PA @Anker base",
"renamed_from": "Anker Generic PA 0.2 nozzle",
"name": "Anker Generic PA 0.2 nozzle",
"inherits": "Anker Generic PA @base",
"from": "system",
"setting_id": "tYAT7xnNFD6gY84A",
"setting_id": "NZB26MSD9WbOeY2S",
"instantiation": "true",
"filament_max_volumetric_speed": [
"2"
@@ -1,10 +1,9 @@
{
"type": "filament",
"name": "Generic PC @Anker 0.25 nozzle",
"inherits": "Generic PC @Anker base",
"renamed_from": "Anker Generic PC 0.25 nozzle",
"name": "Anker Generic PA 0.25 nozzle",
"inherits": "Anker Generic PA @base",
"from": "system",
"setting_id": "h7IRuq5uekjNw4vg",
"setting_id": "Wj7oXTGUxo8lie1B",
"instantiation": "true",
"filament_max_volumetric_speed": [
"3"

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