You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual results
The replacement token {retraction_speed, 2} was replaced with what looks like ALL possible settings, which makes this difficult to use and greatly expands the gcode size. I have tested this with various different numbers of extruders in the machine settings, and the error occurs any time the EXTRUDER_NUMBER part of the replacement token ({TOKEN_NAME, EXTRUDER_NUMBER}) is greater than or equal to machine_extruder_count.
Expected results
I would have expected the replacement token to be evaluated in one of the following ways:
Token not replaced at all if EXTRUDER_NUMBER >= machine_extruder_count like so:
; retraction_speed_2 = {retraction_speed, 2}
Token replaced with the default value (let's say that is 10mm/sec for example) like so:
; retraction_speed_2 = 10
Token replacement with empty string like so:
; retraction_speed_2 =
Of the 3 options above, I believe option 1 is more in line with what other tokens do, for example tokens that do not exist.
There are also a couple of other alternatives that would solve my particular problem (but not the reported issue). The first would be to implement another replacement token could be added called {retraction_speeds} that would be replaced like so (if there are 5 extruders for a printer):
; retraction_speeds = 10,20,30,25,10
That would be the most efficient way to report various per-extruder settings IMHO. Unfortunately that would require the addition of many other tokens capable of listing the settings as a CSV string, including {retraction_amount}, {retraction_hop}, and all other settings where "settable_per_extruder": true inside of the fdmprinter.def.json file.
,
The other idea I had would be to create a per-line conditional token (I don't think any conditional tokens exist at all, but perhaps I'm wrong??), something like the following:
or some other syntax. I understand that these last two items may already exist, and if they do not then they would be more suitable as a feature request. Please let me know your thoughts about this.
Additional information
I've not been able to debug this myself, but I believe the problem is in this file, probably in _expandGcodeTokens function perhaps on, near, or inside this line.
Several Octoprint plugins use these token replacements to extract settings for various purposes. My specific purpose is for supporting multi-extruder printers within Octolapse, a plugin I've been developing. I have been adding a new feature that allows automatic configuration of many plugin settings based on settings outputted to the user's gcode file. I've put in a lot of work trying improve the user experience for folks using Cura, so ANY help with this issue would be GREATLY appreciated!
Thank you so much for your time!
Edit: here is a snapshot of my machine settings, that shows more clearly what my example 'steps to reproduce' are:
The text was updated successfully, but these errors were encountered:
I try :) Thank YOU for this awesome open-source tool. You all are legends :)
Can I what happens if an extruder setting is requested, but is not available? I've only briefly looked at the commit, but it looks like if would leave the token alone like so:
Indeed it will not expand it then. In the code, you see that it'll use the value of default_value_str which is filled with the original replacement key {retraction_speed, 2} then.
Application version
4.3.0
Platform
Windows 10 64 bit
Printer
All printers/NA
Reproduction steps
Actual results
The replacement token
{retraction_speed, 2}
was replaced with what looks like ALL possible settings, which makes this difficult to use and greatly expands the gcode size. I have tested this with various different numbers of extruders in the machine settings, and the error occurs any time the EXTRUDER_NUMBER part of the replacement token ({TOKEN_NAME, EXTRUDER_NUMBER}
) is greater than or equal to machine_extruder_count.Expected results
I would have expected the replacement token to be evaluated in one of the following ways:
Of the 3 options above, I believe option 1 is more in line with what other tokens do, for example tokens that do not exist.
There are also a couple of other alternatives that would solve my particular problem (but not the reported issue). The first would be to implement another replacement token could be added called
{retraction_speeds}
that would be replaced like so (if there are 5 extruders for a printer):That would be the most efficient way to report various per-extruder settings IMHO. Unfortunately that would require the addition of many other tokens capable of listing the settings as a CSV string, including {retraction_amount}, {retraction_hop}, and all other settings where
"settable_per_extruder": true
inside of the fdmprinter.def.json file.,
The other idea I had would be to create a per-line conditional token (I don't think any conditional tokens exist at all, but perhaps I'm wrong??), something like the following:
or some other syntax. I understand that these last two items may already exist, and if they do not then they would be more suitable as a feature request. Please let me know your thoughts about this.
Additional information
I've not been able to debug this myself, but I believe the problem is in this file, probably in _expandGcodeTokens function perhaps on, near, or inside this line.
Several Octoprint plugins use these token replacements to extract settings for various purposes. My specific purpose is for supporting multi-extruder printers within Octolapse, a plugin I've been developing. I have been adding a new feature that allows automatic configuration of many plugin settings based on settings outputted to the user's gcode file. I've put in a lot of work trying improve the user experience for folks using Cura, so ANY help with this issue would be GREATLY appreciated!
Thank you so much for your time!
Edit: here is a snapshot of my machine settings, that shows more clearly what my example 'steps to reproduce' are:
The text was updated successfully, but these errors were encountered: