PrusaSlicer Placeholder/Variable evaluation
I am using PrusaSlicer Version: 2.3.3+win64-202107161027
My custom G-code is set up as:
Start G-code
; * Start of TJW code **************************
; Reset speed, extrusion rates, and temperatures
M140 S{first_layer_bed_temperature[0]} ; set bed temp
M104 S{temperature[0]}
M117 {temperature[0]}
Template Custom G-code
; Template Custom G-code
M140 S{first_layer_bed_temperature[0]} ; set bed temp
M104 S{temperature[0]}
M117 {temperature[0]}
After slicing the exported G-code appears as:
...
;TYPE:Custom
; * Start of TJW code ********************************
; Reset speed, extrusion rates, and temperatures
M140 S85; set bed temp
M104 S250
M117 250
...
;AFTER_LAYER_CHANGE
;4
;CUSTOM_GCODE
; Template Custom G-code
M140 S{first_layer_bed_temperature[0]} ; set bed temp
M104 S{temperature[0]}
M117 {temperature[0]}
...
In the first instance the Placeholders are evaluated correctly but in the second instance no evaluation occurs. Is this behaviour correct? What do I need to do for placeholder/variable evaluation to be performed?
Thanks
@timw-3
Save, zip, and upload project file
Prusa i3 MK3S+ FW 3.11.0 (kit dec -20), PrusaSlicer 2.6.1+win64, Fusion 360, Windows 10
2¢ worth
Try enclosing the placeholders in square brackets. Curly braces are needed to evaluate expressions, but square brackets are used otherwise. No idea why it does it differently for layer change versus start gcode, but this is worth a shot.
FWIW - Your layer change example shows setting all layers to the 1st layer bed temp. Is that what you want? The reverse is true for the filament temp in the start gcode.
and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan
PrusaSlicer Placeholder/Variable evaluation
Thanks for the [] suggestion. Unfortunately the placeholders are still not evaluated:
;AFTER_LAYER_CHANGE
;4
;CUSTOM_GCODE
; Template Custom G-code
M140 S[first_layer_bed_temperature] ; set bed temp
M104 S[temperature]
M117 [temperature]
The example that I am using illustrates the problem but is not what I actually use.
Thanks again.
PrusaSlicer Placeholder/Variable evaluation
Simple project which illustrates the problem is attached.
Thanks
PrusaSlicer Placeholder/Variable evaluation
I have created a very simple model and modified the default Printer Settings/Custom G-codes. It seems that evaluation of Placeholders occurs correctly for:
Start G-code
End G-code
Before layer change G-code
After layer change G-code
But there is no evaluation of Placeholders for:
Color Change G-code
Pause Print G-code
Template Custom G-code
The model I am using to illustrate the problem is: Placeholder_eval
Thanks for any help with this.
2¢
I'm seeing the same. I'd open up a bug report ticket on Prusa's GitHub pages to get developer attention. This is only a user-user forum and the devs only pop in occasionally.
and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan
PrusaSlicer Placeholder/Variable evaluation
bobstro, thanks for making the effort to reproduce the problem. I have opened an issue on GitHub, https://github.com/prusa3d/PrusaSlicer/issues/6760 , and will post any response back here.
PrusaSlicer Placeholder/Variable evaluation
This issue has been confirmed.
"I think this a duplicate of #5782 which was fixed on master in 224f3e5. But there have been several duplicate reports already so perhaps the fix could be considered for cherry-picking into stable."
Hopefully we will see a released fix in the near future.