Skip to content

ChangeAtZ - Fix #8574 and #8886#21316

Open
novamxd wants to merge 2 commits intoUltimaker:mainfrom
novamxd:master
Open

ChangeAtZ - Fix #8574 and #8886#21316
novamxd wants to merge 2 commits intoUltimaker:mainfrom
novamxd:master

Conversation

@novamxd
Copy link
Contributor

@novamxd novamxd commented Jan 20, 2026

Description

Type of change

  • [ X ] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I pulled the file given by GhostKeeper (here) and validated that it properly targets the expected heights. Also tested ranges with this file.

I also pulled the 25x25 Cube given by AbeFM (here) and that the fan speed is properly switched back to 30% after the desired layer.

Test Configuration:

  • Operating System: Windows 11. Cura 5.11.

Checklist:

  • [ Probably? ] My code follows the style guidelines of this project as described in UltiMaker Meta and Cura QML best practices
  • [ ✅ ] I have read the Contribution guide
  • [ ✅ ] I have commented my code, particularly in hard-to-understand areas
  • [ ✅ ] I have uploaded any files required to test this change

25x25Cube (1).zip
change_at_z_temperature (1).zip

…not properly apply (or change back) certain values. Z targeting now works by determining the target layer based on the minimum Z for a given layer. Added support for layer and Z ranges. Added support for reading layer height from project settings.

Kept backwards compatibility with older configs of ChangeAtZ.
@github-actions github-actions bot added the PR: Community Contribution 👑 Community Contribution PR's label Jan 20, 2026
@novamxd novamxd changed the title Fixed issues #8574 and #8886 where ChangeAtZ would not properly apply… ChangeAtZ - Fix #8574 and #8886 Jan 20, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

Test Results

24 592 tests  ±0   24 590 ✅ ±0   51s ⏱️ -1s
     1 suites ±0        2 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit fc208dd. ± Comparison against base commit 2e1a12c.

♻️ This comment has been updated with latest results.

@novamxd novamxd marked this pull request as ready for review January 20, 2026 04:42
@GregValiant
Copy link
Collaborator

@novamxd could you take a look at the current "TweakAtZ". The thought was to obsolete "Change At Z" in due time. It was left in Cura as project files might include it.
I have a PR in for a change to TweakAtZ that enables support for One-at-a-Time print sequence. See #21209 .

Tweak at Z currently has "Start/End layers" and "Start/End heights. If you could see if your changes can apply to Tweak At Z it would be helpful.

@novamxd
Copy link
Contributor Author

novamxd commented Jan 27, 2026

@novamxd could you take a look at the current "TweakAtZ". The thought was to obsolete "Change At Z" in due time. It was left in Cura as project files might include it. I have a PR in for a change to TweakAtZ that enables support for One-at-a-Time print sequence. See #21209 .

Tweak at Z currently has "Start/End layers" and "Start/End heights. If you could see if your changes can apply to Tweak At Z it would be helpful.

Hey @GregValiant

I already saw TweakAtZ. Personally I'm disappointed it exists and is the reason I decided to push my changes through.

There is and was nothing preventing you from updating the existing ChangeAtZ plugin to support the new features without breaking backwards compatibility, and yet you chose otherwise. Now customers of Cura are left with old projects that won't work right requiring a migration and any existing tutorials or documentation now invalid.

This was a terrible decision, in my opinion.

If anything I will slowly port the TweakAtZ functions missing from ChangeAtZ into ChangeAtZ, making TweakAtZ no longer required.

I hope this clarifies!

@GregValiant
Copy link
Collaborator

I started out updating Change at Z but when I got finished it was very different. Tweak at Z has the same (I think) functionality, but it is 700 lines of code shorter and it is WAY faster.

I thought one of the problems with Change At Z was the way speed changes were handled. Using M220 affects any speed. I went a different way and adjusted the individual speed "F" parameters in the Gcode. That allows Print, Travel, Retract/Prime, and Z-hop speeds to be handled separately. The fan commands were no longer needed as "Advanced Cooling Fan Control" covered that.
The addition of the "Start and End" Layer and Height (rather than "This Layer" or "All Layers") was also a large change.

The settings for Change At Z just didn't fit well anymore and a project that called Change at Z could well have had "unexpected consequences".

@novamxd
Copy link
Contributor Author

novamxd commented Feb 8, 2026

Hey @GregValiant,

I started out updating Change at Z but when I got finished it was very different.

So? I did a huge refactor when I first picked it up and after. So long as the existing functionality is undisturbed that's 100% fine. In fact so long as the customer experience is undisturbed, go ham.

but it is 700 lines of code shorter and it is WAY faster.

The speed increase is only useful if the functionality wasn't impaired. Function size at the end of the day doesn't matter much so long as it's easy to read.

I thought one of the problems with Change At Z was the way speed changes were handled. Using M220 affects any speed.

So? Make a toggle. As it is "speed" in ChangeAtZ highly depends on what you're modifying. Retract speed, for example, works differently depending on whether firmware retractions are enabled or not. If it's not firmware retractions it's a simple multiplication like your plugin. Also the current ChangeAtZ plugin solved a problem: overlapping multiplication. I don't see much of a means of memory in your current plugin, but I haven't reviewed it deeply. If your plugin has no memory component it means subsequent TweakAtZ will compound, causing unexpected changes.

That allows Print, Travel, Retract/Prime, and Z-hop speeds to be handled separately.

So? I can add that to the current ChangeAtZ plugin, and probably will.

The fan commands were no longer needed as "Advanced Cooling Fan Control" covered that.

I mean that only applies for new projects and those with newer versions of Cura. For new projects or folks who want to continue using ChangeAtZ it can remain, plus any existing documentation. For those who don't, they can use the baked in function.

The addition of the "Start and End" Layer and Height (rather than "This Layer" or "All Layers") was also a large change.

So? I added that pretty easily to ChangeAtZ.

The settings for Change At Z just didn't fit well anymore and a project that called Change at Z could well have had "unexpected consequences".

I mean you more or less ported them to your TweakAtZ.

Based on your responses there's nothing here that really convinces me that creating a new plugin was the right call, in fact I'd say it was a bad one. Like I said, I'll continue to support ChangeAtZ and I'll work to bring any missing functions to it.

Whether you want to keep yours is up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Community Contribution 👑 Community Contribution PR's

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants