Reduce the size of current and new JSONs by standardising them with 1 tab indentation instead of 4 spaces.
This effectively reduces the size by almost 20 MB.
| Current | New |
|---|---|
| 85.2 Mib | 67 Mib |
Used [JQ](https://jqlang.org/) `--tab` to automatically format every current JSON.
> [!NOTE]
> Some profiles had the arrays on the same line, but those created by Orca were in the standard format (each object below the previous one). In some cases, this increases the number of tabs due to the new lines, but the increase is negligible, and this way both the base profiles and those created by Orca maintain the same style.
## Problem
Some Creality printers (e.g. Ender-3 V3 SE) rely on metadata comments in the first lines of G-code files to display print info on the screen (estimated time, filament usage, layer height). This follows a format originally used by Cura/Creality Print:
```
;FLAVOR:Marlin
;TIME:3708.97
;Filament used:6.21m
;Layer height:0.2
```
OrcaSlicer currently has no way to write content before the `HEADER_BLOCK` in the G-code output, and does not expose `print_time_sec` or `filament_length_m` as usable placeholders. As a result, these printers show zeroed-out print info on screen.
## Changes
### 1. New placeholders (post-processing)
Added two new G-code placeholders resolved during post-processing:
- `{print_time_sec}` — total estimated print time in seconds (double)
- `{filament_length_m}` — total filament length in meters (double)
These values are only available after G-code generation, so they use inline marker replacement (`@PRINT_TIME_SEC@`, `@FILAMENT_LENGTH_M@`) that `GCodeProcessor::run_post_process()` substitutes with actual computed values — the same pattern used by existing M73 and layer count placeholders.
### 2. New "File header G-code" option (`machine_top_gcode`)
Added a new G-code field in **Printer Settings > Machine G-code** that writes content at the very top of the output file, before `HEADER_BLOCK_START`. This allows users to add firmware-specific metadata that must appear in the first lines.
### 3. Creality Ender-3 V3 SE profile update
Pre-configured the Ender-3 V3 SE profiles (all 4 nozzle variants) with a default `machine_top_gcode` value matching the Cura-compatible header format, so print info displays correctly out of the box.
# Screenshots
| Before (current OrcaSlicer) | After (this PR) |
|---|---|
|  |  |
## Tests
- Sliced test model with Ender-3 V3 SE profile
- Verified G-code output contains correct values in first lines:
- `;TIME:` with actual print time in seconds
- `;Filament used:` with filament length in meters
- `;Layer height:` with correct layer height
- Verified `{print_time_sec}` and `{filament_length_m}` work in both Machine Start G-code and File header G-code fields
- Verified empty `machine_top_gcode` produces no extra output
- Built and tested on macOS (arm64)
Using my Ender 3 V3 SE I noticed weird printing behaviour. Searching for
the cause, I found that the default layer height for a 0.2mm nozzle for
the printer was set to 0.08mm min and 0.32mm max, which are the default
20%/80% values for a 0.4mm nozzle. This commit changes the values for
all Creality printer which had not a reasonable default value for 0.2mm,
0.6mm and 0.8mm nozzles to 20% min and 80% max.
Co-authored-by: SoftFever <softfeverever@gmail.com>
* e3v3se: remove jerk settings from processes
Remove jerk settings from Ender3 V3 SE processes to prevent emission of M205 into gcode.
This is due to E3 V3 SE does not use jerk, but has junction deviation
enabled instead. Those two modes are mutually exclusive according to
marlin configuration page:
https://marlinfw.org/docs/configuration/configuration.html#default-acceleration-https://marlinfw.org/docs/configuration/configuration.html#junction-deviation-
Based on M503 output, E3V3SE hase junction deviation enabled:
echo:; Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>
echo: M205 B20000.00 S0.00 T0.00 J0.10
"M205" emitted into gcode is useless since setting jerk settings via
"M205 Xn Yn Zn" does not have any effect on the stock V3 SE firmware.
* e3v3se: update machine retraction settings
Set retraction speed to 40 mm/s as recommended by Creality
Source: https://wiki.creality.com/en/ender-series/ender-3-v3-se/quick-start-guide/user-manual
Set retraction acceleration to 500 mm/s2 to prevent extruder clicking on retraction.
* e3v3se: update start gcode
* Set and wait for bed temperature to stabilize prior to homing.
Bed mesh calibration is done with the bed temp set to 60C.
Performing G28 with bed at room temperature will not compensate
for thermal deformation introduced by heated bed if there are any.
* Remove explicit mesh levelling enable (M420).
Creality FW auto enables M420 once homing (G28) is complete:
"M420 S1 Z10.00"
* e3v3se: disable m73 as not supported in FW
* e3v3se: remove thumbnails
Remove thumbnails generation to not confuse users.
Currently event CrealityPrint does not generate thumbnails for the E3 V3 SE.
* e3v3se: update motion capabilities
Update motion parameters for the Ender 3 V3 SE profiles:
- max acceleration on all axis to 2500 as per product spec
- max X and Y speeds to 250 as per product spec
- max Z speed to 5 as set in factory defaults (M502, M503)
- max E speed to 40 as presented in recommended print parameters on the
product page
Product spec sheet:
https://wiki.creality.com/en/ender-series/ender-3-v3-se/quick-start-guide/user-manual
* Add Ender-3 V3 SE .2, .6, .8 and fix small Ender-3 Pro bug
* Forgot to remove these
* Fix error
* Remove these...
* Why did I delete this?
* Revert deletion
* Add missing profiles
* Create 0.24mm Draft @Creality Ender3V3KE.json
* Apply new nozzle sizes to generic filament
* Maybe this will do it
* Revert 0.4 renames & add to Generic ABS
* Add M420 S1; Enable mesh leveling
* Fix wring nozzle_diameter
* Potentially fix the issue of printer not being added after selected