Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add built-in support for Prusa layer counting, no gcode mods needed. #238

Merged
merged 2 commits into from
Oct 14, 2021

Conversation

scyto
Copy link
Contributor

@scyto scyto commented Sep 20, 2021

Add support for Prusa without need for asking folks to have script in prusa to add layers.
This works with lastest Prusa (i don't know how far back Prusa was adding ;[LAYER_CHANGE] as I am relatively new to 3D printing.

My only concern would be what happens to folks who have already configured some other approach?

here is it working:
image

By default Prusa (at least today, don't know about past as i am new to 3D printing) adds a Layer Change comment to the gcode by default, no need to turn on verbose commenting in prusa or add post processing as i jave seen in a bunch of old issues.

This change will work really well for new users of prusa / octprint.
Not sure what happens if folks have added custom gcode processing in prusa / custom filters.
fix line 1612 and 1613 to add new return and new line correctly
@scyto scyto changed the title Add support for Prusa layer counting. Add built-in support for Prusa layer counting, no gcode mods needed. Sep 20, 2021
@OllisGit OllisGit added the status: inNextRelease Will be implemented/fixed in next release label Oct 14, 2021
@OllisGit
Copy link
Owner

Hi @scyto , thank a lot for the PR. It will be in the next release.

@OllisGit OllisGit merged commit 135d472 into OllisGit:master Oct 14, 2021
OllisGit added a commit that referenced this pull request Oct 14, 2021
- E #230 fire event when m600 occurs
- E #224, #182 adjustable current time format
- E #222 Option to disable "Layer indicator not found" popup
- E #221 Option to change "look ahead" line count
- B #213 filter empty lines from layer-expressions
- PR #234 typo, credit goes to @2231puppy
- PR #238 Added built-in support for Prusa layer counting, credit goes to @scyto

- reducing size of master.zip
@OllisGit
Copy link
Owner

fyi: new release 1.27.0 is out now

@OllisGit OllisGit added type: enhancement New feature or request and removed status: inNextRelease Will be implemented/fixed in next release labels Oct 14, 2021
@scyto scyto deleted the patch-1 branch October 14, 2021 21:45
@scyto
Copy link
Contributor Author

scyto commented Oct 14, 2021

Thanks, glad i could help!

@kcdr
Copy link

kcdr commented Nov 8, 2021

I Think this collides with Slic3r expression.
At least my PrusaSlicer (v2.3.3) emits both (;LAYER_CHANGE and ;BEFORE_LAYER_CHANGE)

@scyto
Copy link
Contributor Author

scyto commented Nov 8, 2021

@kcdr My 2.3.3 prusaslicer doesn't

Are you sure you don't have custom gcode added to prusa scripts or maybe some option turned on that is not default?

@scyto
Copy link
Contributor Author

scyto commented Nov 8, 2021

This is the default on a clean prusa slicer printer settings, its possible it set as custom for some printers?

image
what printer profile do you have?

@scyto
Copy link
Contributor Author

scyto commented Nov 8, 2021

yup seems it is set on some profiles, this screenshot is a creality profile.
i am unclear what % of printer profiles have this set, the community one i used for Snapmaker A350 did not have it set, if the vast majority have this set then this change should be reverted. Though to be clear give prusaslicer code has a LAYER_CHANGE in, i am unclear that the creality profiles should have this at all, but it does ¯(°_o)/¯`

image

@kcdr what symptom or issue are you seeing, double layer counts?

@kcdr
Copy link

kcdr commented Nov 9, 2021

@kcdr My 2.3.3 prusaslicer doesn't

Are you sure you don't have custom gcode added to prusa scripts or maybe some option turned on that is not default?

@scyto You are right, I had custom Before layer change G-code. Content was

;BEFORE_LAYER_CHANGE
;[layer_num]

I don't know if it was in the initial profile, which profile I chose initially or if I added it by myself (maybe to get it working with DisplayLayerProgress-plugin).
Anyway, sorry for my wrong assumption.
But as it seems I am not the only one with this problem: #240

@scyto
Copy link
Contributor Author

scyto commented Nov 9, 2021

@kcdr I checked a few profiles and it seems many (all?) have that gcode in it by default.
did it actually cause problems?

My printer is a community create profile and the person made it didn't have that added, so its likely i am the outlier.

I suspect prusa in older versions didn't have the "LAYER_CHANGE" so all printer profiles were updated to include the BEFORE_LAYER_CHANGE but then at somepoint between then and now prusa added LAYER_CHANGE.

@OllisGit i think there are two options:

  1. revert this pull and back out, and update docs to tell people to add BEFORE_LAYER_CHANGE to their printer profile

  2. if plugin matches more than one filter use only first match (i am unclear if it does this already?)

@AJErazzor
Copy link

Is there a workaround for this until merged?

@scyto
Copy link
Contributor Author

scyto commented Nov 10, 2021 via email

@AJErazzor
Copy link

AJErazzor commented Nov 12, 2021

My symptoms are the same - double layer count coming from PrusaSlicer 2.4.0B1 to Octoprint

@scyto
Copy link
Contributor Author

scyto commented Nov 12, 2021

My symptoms are the same - double layer count coming from PrusaSlicer 2.4.0B1 to Octoprint

do you mean you deleted onw of the two lines and see double counting?
If so you did re-upload your gcode files - the analysis is done at time of upload to octoprint, not at print time

@OllisGit
Copy link
Owner

Continue discussion in issue #240 ... because I don't want to revert this merged PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants