prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.72k stars 1.93k forks source link

G-code substitutions not replacing placeholders in v2.7 #11687

Open dmbaio opened 11 months ago

dmbaio commented 11 months ago

Description of the bug

In the 2.7 series of PrusaSlicer, machine jerk placeholders are not being properly replaced in the final g-code based on the substitution settings. Please see screenshots of my settings, which reduce the X and Y jerk only for external perimeters, and the resulting g-code which no longer sets them back to default. This worked as expected in 2.6.

image image

Project file & How to reproduce

Placeholder Issue.3mf.zip

Checklist of files included above

Version of PrusaSlicer

Version 2.7.0-rc1+MacOS-arm64

Operating system

macOS Sonoma 14.2

Printer model

AnkerMake M5

lukasmatena commented 11 months ago

This worked as expected in 2.6.

Did it? I have just tested in 2.6.0 and I see the same behavior as in 2.7.0-rc1. As far as I know, this was never supported, the substitutions were never processed by the placeholder parser.

dmbaio commented 11 months ago

Well this is embarrassing. I could have sworn it did but even looking back at files sliced with 2.6 I see what you mean. I don't really know how I thought it was working correctly the whole time...however, if not a bug, could this be an enhancement request?

Abasz commented 9 months ago

I was trying to use placeholders in the G-code substitution as well but I cant seem to make it work.

The docs says: "With regular expression disabled, n, r, t, and placeholders are supported in both "Find" and "Replace with" patterns similarly to Notepad++'s "extended" syntax."

But with find: M104 S210 and replace with M104 S{first_layer_temperature[0]} I get:

M104 S{first_layer_temperature[0]} instead of the actual first layer temp (lets say 205).

I understand that regex and placeholders are not supported but I understand from the docs that simple word replacement should work with placeholders.