Skip to content

G-Code Output

These settings control how G-code is generated and formatted. They impact readability, file size, print behavior, and compatibility with firmware and post-processing tools.

Reduce Infill Retraction

Mode: Advanced.
Variable: reduce_infill_retraction.
When enabled, the slicer will skip retractions for travel moves that occur entirely inside infill regions. This reduces the number of retractions and can speed up printing for complex models, but it may increase oozing or stringing inside infill. Slicing time may also increase slightly.

Recommended when internal cosmetic quality is not critical and you want fewer retractions.

Add line number

Mode: Developer.
Variable: gcode_add_line_number.
Prefix each G-code line with a sequential line number (N1, N2, ...). Useful for debugging or tools that expect numbered G-code.

Verbose G-code

Mode: Advanced.
Variable: gcode_comments.
Include descriptive comments for G-code lines and blocks to make the file human-readable and easier to debug.
Verbose mode produces much larger files and may slow down SD-card printing on some printers.

Label Objects

Mode: Advanced.
Variable: gcode_label_objects.
Insert comments that label moves with the object they belong to (object index or name). This is useful for integrations such as OctoPrint's Cancel Object plugin and for human inspection of the G-code.

Important

Object labelling is not compatible with Single-Extruder Multi-Material configurations or with "Wipe into Object" / "Wipe into Infill" strategies.
When those features are active, labels may be omitted.

Exclude Objects

Mode: Advanced.
Variable: exclude_object.
Add an EXCLUDE OBJECT marker or command in the exported G-code for objects flagged as excluded. This helps post-processors or custom scripts recognise excluded parts.

Filename Format

Define a filename template for exported G-code. Templates may include tokens like project name, date, or other metadata to produce consistent and informative filenames on export.

For example:

{input_filename_base}_{filament_type[initial_tool]}_{print_time}.gcode

Can be used to generate filenames like OrcaCube_PLA_1h15m.gcode.

Tip

Check Naming Built in placeholders variables for available tokens and their meanings.

Change extrusion role G-code

This G-code is inserted when the extrusion role is changed.
This is the process section of the feature "Change Extrusion Role G-code" that is also available in the Material settings and Printer settings.

Tip

Read the Printer settings for more details and examples.

Important

NEW FEATURE: Process Change Extrusion Role G-code
Available in: Nightly builds or Releases greater than 2.3.2.