OrcaSlicer/resources/profiles
davyd 2f2f0df6af
Some checks are pending
Build all / Build Linux (push) Waiting to run
Build all / Build Non-Linux (push) Waiting to run
Build all / Unit Tests (push) Blocked by required conditions
Build all / Flatpak (push) Waiting to run
feat: Add File header G-code option and print_time_sec/filament_length_m placeholders (#12186)
## 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) |
|---|---|
| ![IMG_5285](https://github.com/user-attachments/assets/fdd2cc96-6593-4108-83f4-e272d5547467) | ![IMG_5286](https://github.com/user-attachments/assets/6cb4091a-4560-4596-93d9-49f2ff8f0a2b) |

## 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)
2026-02-08 23:56:28 +08:00
..
Afinia Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Anker Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Anycubic Fixed a typo 2026-01-06 12:43:42 -03:00
Artillery Update printer profiles for Artillery (#11284) 2025-11-25 13:27:35 +00:00
BBL Refactor Polymaker folder within Snapmaker profile directory and add more profiles (#11613) 2026-01-05 18:12:56 +08:00
BIQU Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Blocks Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Chuanying Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Co Print CoPrint Profiles Update (#11818) 2026-01-04 14:14:54 +08:00
CoLiDo Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Comgrow Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
CONSTRUCT3D Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Creality feat: Add File header G-code option and print_time_sec/filament_length_m placeholders (#12186) 2026-02-08 23:56:28 +08:00
Cubicon Add support for Cubicon xCeler-Plus printer and profiles. (#11771) 2026-01-06 10:56:00 +08:00
Custom Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
DeltaMaker Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Dremel Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Elegoo Add Elegoo CC 2 profiles (#11240) 2026-02-08 17:00:52 +08:00
Eryone Validate invalid fields for hidden system profiles (#11455) 2025-11-24 20:11:42 +08:00
Flashforge Flash forge ad5m gcode filename update (#11278) 2025-11-08 01:21:56 +08:00
FLSun Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
FlyingBear Update bed temp for Flyingbear Ghost7 machine (#12199) 2026-02-08 17:45:17 +08:00
Folgertech Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Geeetech Fixed wrong tool change at the starting G-Code for the multicolor Geeetech printers (#11926) 2026-01-13 20:23:32 +08:00
Ginger Additive Small Printer Thumbnail Orientation and Typo Fixes (#11807) 2026-01-02 17:26:27 +08:00
InfiMech Add new models named EX and EX+APS (#11776) 2026-02-08 17:24:24 +08:00
iQ Polymaker Polymax PETG updated - Grauts HPP4GF25 added (#11665) 2026-01-02 10:06:53 +08:00
Kingroon Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
LONGER [PROFILE] Add LONGER printer profiles (#11161) 2026-02-08 16:45:08 +08:00
Lulzbot Correct pressure advance syntax in startup GCODE for Taz Pro S (#11981) 2026-02-08 23:44:18 +08:00
M3D Small Printer Thumbnail Orientation and Typo Fixes (#11807) 2026-01-02 17:26:27 +08:00
MagicMaker Small Printer Thumbnail Orientation and Typo Fixes (#11807) 2026-01-02 17:26:27 +08:00
Mellow Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
OpenEYE Update machine profile for OpenEYE Peacock V2 (#11790) 2026-01-04 14:15:31 +08:00
OrcaArena Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
OrcaFilamentLibrary/filament Add Elas filament profiles (PLA, PLA Pro, PETG, ASA) (#11758) 2026-02-08 17:23:17 +08:00
Peopoly Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Phrozen Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Positron3D Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Prusa Prusa CORE One L (C1L) Profiles (#11447) 2026-01-22 15:34:43 +08:00
Qidi Misc profile fixes (#11944) 2026-01-13 21:06:48 +08:00
Raise3D Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Ratrig fix wrong inheritance for idex profiles (#12009) 2026-02-08 23:46:17 +08:00
RH3D Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
RolohaunDesign Fix RolohaunDesign Delta Flyer Refit process visible for every printer (#11594) 2025-12-09 01:06:57 +08:00
SecKit Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Snapmaker Snapmaker U1: switch wall_generator to arachne (#12121) 2026-02-01 00:10:09 +08:00
Sovol Update 0.18mm Optimal @Sovol SV08.json (#11291) 2025-11-07 09:29:26 +08:00
Tiertime Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Tronxy Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
TwoTrees Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
UltiMaker Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Vivedino Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Volumic Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Voron Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Voxelab Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Vzbot Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Wanhao Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Wanhao France Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
WEMAKE3D Add WEMAKE3D 3DPrinters Profiles (#11880) 2026-01-10 23:06:41 +08:00
WonderMaker Small Printer Thumbnail Orientation and Typo Fixes (#11807) 2026-01-02 17:26:27 +08:00
Z-Bolt Fixes / Improvements for Covers & Printer Selection dialog (#11151) 2025-11-04 10:16:06 +08:00
Afinia.json update profile version 2025-09-29 22:57:27 +08:00
Anker.json bump profile version 2025-10-24 17:23:26 +08:00
Anycubic.json Add profiles for Anycubic Kobra 2 Neo 2026-01-06 02:40:29 -03:00
Artillery.json Update printer profiles for Artillery (#11284) 2025-11-25 13:27:35 +00:00
BBL.json Refactor Polymaker folder within Snapmaker profile directory and add more profiles (#11613) 2026-01-05 18:12:56 +08:00
BIQU.json update profile version 2025-09-29 22:57:27 +08:00
blacklist.json Fixed many profile issues and cleaned up some messes. (#10686) 2025-09-11 17:50:53 +08:00
Blocks.json update profile version 2025-09-29 22:57:27 +08:00
check_unused_setting_id.py Feature/bs1.8beta (#2844) 2023-12-01 10:42:45 +00:00
Chuanying.json update profile version 2025-09-29 22:57:27 +08:00
Co Print.json update profile version 2025-09-29 22:57:27 +08:00
CoLiDo.json update profile version 2025-09-29 22:57:27 +08:00
Comgrow.json update profile version 2025-09-29 22:57:27 +08:00
CONSTRUCT3D.json update profile version 2025-09-29 22:57:27 +08:00
Creality.json Profiles for Creality K2 Pro printer (#11315) 2025-11-21 06:41:48 +00:00
Cubicon.json Add support for Cubicon xCeler-Plus printer and profiles. (#11771) 2026-01-06 10:56:00 +08:00
Custom.json update profile version 2025-09-29 22:57:27 +08:00
DeltaMaker.json Profile folder optimizations (Anycubic, Artillery, Bambu Lab, BIQU, Creality, Flashforge, Prusa, Ratrig, Sovol, Volumic, Voron, VzBot, Z-Bolt, Wanhao and more) (#10806) 2025-10-25 15:41:29 +08:00
Dremel.json update profile version 2025-09-29 22:57:27 +08:00
Elegoo.json Add Elegoo CC 2 profiles (#11240) 2026-02-08 17:00:52 +08:00
Eryone.json [Profiles] Add printer profiles for Eryone Er20 (Marlin and Klipper configuration) (#10607) 2025-11-19 22:20:16 +08:00
Flashforge.json update profile version 2025-09-29 22:57:27 +08:00
FLSun.json update profile version 2025-09-29 22:57:27 +08:00
FlyingBear.json Add new filaments and fix some params (#11042) 2025-10-25 22:52:48 +08:00
Folgertech.json update profile version 2025-09-29 22:57:27 +08:00
Geeetech.json Profile folder optimizations (Anycubic, Artillery, Bambu Lab, BIQU, Creality, Flashforge, Prusa, Ratrig, Sovol, Volumic, Voron, VzBot, Z-Bolt, Wanhao and more) (#10806) 2025-10-25 15:41:29 +08:00
Ginger Additive.json Profile folder optimizations (Anycubic, Artillery, Bambu Lab, BIQU, Creality, Flashforge, Prusa, Ratrig, Sovol, Volumic, Voron, VzBot, Z-Bolt, Wanhao and more) (#10806) 2025-10-25 15:41:29 +08:00
hotend.stl Profile folder optimizations (Anycubic, Artillery, Bambu Lab, BIQU, Creality, Flashforge, Prusa, Ratrig, Sovol, Volumic, Voron, VzBot, Z-Bolt, Wanhao and more) (#10806) 2025-10-25 15:41:29 +08:00
InfiMech.json Add new models named EX and EX+APS (#11776) 2026-02-08 17:24:24 +08:00
iQ.json Polymaker Polymax PETG updated - Grauts HPP4GF25 added (#11665) 2026-01-02 10:06:53 +08:00
Kingroon.json update profile version 2025-09-29 22:57:27 +08:00
LONGER.json [PROFILE] Add LONGER printer profiles (#11161) 2026-02-08 16:45:08 +08:00
Lulzbot.json update profile version 2025-09-29 22:57:27 +08:00
M3D.json Adds M3D D8500 Enabler Pro Profiles V1 (#11503) 2025-12-25 00:21:41 +08:00
MagicMaker.json update profile version 2025-09-29 22:57:27 +08:00
Mellow.json update profile version 2025-09-29 22:57:27 +08:00
OpenEYE.json Add OpenEYE Peacock V2 vendor, printer and process profiles (#11745) 2025-12-27 21:12:54 +08:00
OrcaArena.json update profile version 2025-09-29 22:57:27 +08:00
OrcaFilamentLibrary.json Add Elas filament profiles (PLA, PLA Pro, PETG, ASA) (#11758) 2026-02-08 17:23:17 +08:00
Peopoly.json update profile version 2025-09-29 22:57:27 +08:00
Phrozen.json Profile folder optimizations (Anycubic, Artillery, Bambu Lab, BIQU, Creality, Flashforge, Prusa, Ratrig, Sovol, Volumic, Voron, VzBot, Z-Bolt, Wanhao and more) (#10806) 2025-10-25 15:41:29 +08:00
Positron3D.json update profile version 2025-09-29 22:57:27 +08:00
Prusa.json Prusa CORE One L (C1L) Profiles (#11447) 2026-01-22 15:34:43 +08:00
Qidi.json Misc profile fixes (#11944) 2026-01-13 21:06:48 +08:00
Raise3D.json update profile version 2025-09-29 22:57:27 +08:00
Ratrig.json Profile folder optimizations (Anycubic, Artillery, Bambu Lab, BIQU, Creality, Flashforge, Prusa, Ratrig, Sovol, Volumic, Voron, VzBot, Z-Bolt, Wanhao and more) (#10806) 2025-10-25 15:41:29 +08:00
RH3D.json [PROFILE] Add E3NG printer profiles (#11067) 2025-10-25 23:24:22 +08:00
RolohaunDesign.json Fix RolohaunDesign Delta Flyer Refit process visible for every printer (#11594) 2025-12-09 01:06:57 +08:00
SecKit.json update profile version 2025-09-29 22:57:27 +08:00
Snapmaker.json Misc profile fixes (#11944) 2026-01-13 21:06:48 +08:00
Sovol.json update profile version 2025-09-29 22:57:27 +08:00
Tiertime.json update profile version 2025-09-29 22:57:27 +08:00
Tronxy.json update profile version 2025-09-29 22:57:27 +08:00
TwoTrees.json update profile version 2025-09-29 22:57:27 +08:00
UltiMaker.json update profile version 2025-09-29 22:57:27 +08:00
Vivedino.json update profile version 2025-09-29 22:57:27 +08:00
Volumic.json update profile version 2025-09-29 22:57:27 +08:00
Voron.json Profile folder optimizations (Anycubic, Artillery, Bambu Lab, BIQU, Creality, Flashforge, Prusa, Ratrig, Sovol, Volumic, Voron, VzBot, Z-Bolt, Wanhao and more) (#10806) 2025-10-25 15:41:29 +08:00
Voxelab.json update profile version 2025-09-29 22:57:27 +08:00
Vzbot.json update profile version 2025-09-29 22:57:27 +08:00
Wanhao France.json Profile folder optimizations (Anycubic, Artillery, Bambu Lab, BIQU, Creality, Flashforge, Prusa, Ratrig, Sovol, Volumic, Voron, VzBot, Z-Bolt, Wanhao and more) (#10806) 2025-10-25 15:41:29 +08:00
Wanhao.json update profile version 2025-09-29 22:57:27 +08:00
WEMAKE3D.json Add WEMAKE3D 3DPrinters Profiles (#11880) 2026-01-10 23:06:41 +08:00
WonderMaker.json update profile version 2025-09-29 22:57:27 +08:00
Z-Bolt.json update profile version 2025-09-29 22:57:27 +08:00