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.74k stars 1.93k forks source link

Output format dont match with discribe #5845

Open JCD95-lab opened 3 years ago

JCD95-lab commented 3 years ago

Version

Version of PrusaSlicer used goes here PrusaSlicer_Win_standalone_2.3.0

Use About->About PrusaSlicer for release versions 2.3.0

For -dev versions, use git describe --tag or get the hash value for the version you downloaded or git rev-parse HEAD PrusaSlicer_Win_standalone_2.3.0

Operating system type + version

What OS are you using, and state any version #s Windows 7 In case of 3D rendering issues, please attach the content of menu Help -> System Info dialog

3D printer brand / version + firmware version (if known)

What 3D printer brand / version are you printing on, is it a stock model or did you modify the printer, what firmware is running on your printer, version of the firmware #s Artillery Genius marlin 1.5

Behavior

option must be "{input_filenamebase}{layerheight}mm{filamenttype[0]}[fillpattern]{print_time}.gcode" instead of "{input_filenamebase}{layerheight}mm{filamenttype[0]}{fillpattern}{print_time}.gcode" result expected "PEGASUS_0.16mm_PLA_gyroid_5h5m.gcode"

Thimoran commented 3 years ago

Always nice after a certain amount of time elapsed you can conclude it is not just you that is crazy. Cause something that simple drives you crazy until you get a mental throwback "what if I use the old syntax with brackets we used back in Slic3r?". I encountered the same thing while I was playing with adding the infill pattern to my output filename.

And guess what, actually the brackets could/should be around every placeholder in the default value of the field. As the hover-tooltip also shows, placeholders can be used with brackets, the accolades are intended for running macros and applying all kinds of logic and math to the values.

In short, it's the difference between using the pure placeholder, or using the placeholder that gets evaluated within the macro. eg {fill_density} > 20 , clean integer value that can be used in macros. [fill_density] > 20%, pure textual representation of the value.

Functional example, I prefer my layer heights in microns instead of mm with a decimal point: {layerheight*1000}um , resulting in 200um instead of 0.2mm (and yes I accept that it costs more characters) ( And I wished I could have used a μ there, but that get's mangled into μ everytime you leave the Output options)_

One might guess that the macro language can not handle strings and strings evaluation, which fill_pattern obviously returns, But this is not the case, since [notes] & {notes} both do evaluate.

For now the correct definition of the issue probably comes down to: placeholder fill_pattern can't be used in macros. Fortunately, you don't need macro's for your desired outcome.


Issue Details Location: Print Settings> Output filename format: The default value of the field is using accolades around placeholders, while pure placeholders can be evaluated using brackets according to the tooltip. Not all placeholders can be evaluated within macro's, resulting when these are tried within the given suggested syntax in the following parsing error .

Failed processing of the output_filename_format template. Parsing error at line 1: Unknown scalar variable type

Affected placeholders:

Not affected placeholder