Skip to content

Fix for uum-131151#1106

Open
arnaudparevogt-unity wants to merge 4 commits intomainfrom
uum-131151
Open

Fix for uum-131151#1106
arnaudparevogt-unity wants to merge 4 commits intomainfrom
uum-131151

Conversation

@arnaudparevogt-unity
Copy link
Contributor

Purpose of this PR

Fixed UUM-131151 (public issue)

Testing status

Tested the 3d samples + added an automated test

  • Added an automated test
  • Passed all automated tests
  • Manually tested

Documentation status

No doc needed, this is a bugfix

  • Updated CHANGELOG
  • Updated README (if applicable)
  • Commented all public classes, properties, and methods
  • Updated user documentation

Technical risk

Tech risk: low, halo effect: low

Comments to reviewers

Package version

[Justification for updating either the patch, minor, or major version according to the semantic versioning rules]

  • Updated package version

@u-pr
Copy link
Contributor

u-pr bot commented Feb 25, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

UUM-131151 - Fully compliant

Compliant requirements:

  • Fix the issue where the camera blend snaps to a cached position when switching back before a blend completes
  • Ensure that the camera blends smoothly from the current camera position instead of the old cached one
⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪

The PR provides a minimal, well-isolated bug fix that clears the snapshot state appropriately and includes a highly effective unit test that directly verifies the reported edge case.

🏅 Score: 100

The implementation directly and cleanly addresses the reported bug, handles state reset properly, and includes excellent automated test coverage to prevent future regressions.

🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected
  • Update review

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

@u-pr
Copy link
Contributor

u-pr bot commented Feb 25, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

Copy link
Collaborator

@glabute glabute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! And good fix.
I made a small comment, which is a suggestion for clarity.

if (cam == null || (cam.State.BlendHint & CameraState.BlendHints.FreezeWhenBlendingOut) == 0)
{
// No snapshot required - reset it
m_Snapshot.TakeSnapshot(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should call ClearSnapshot() here, for clarity

@codecov-github-com
Copy link

codecov-github-com bot commented Feb 25, 2026

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...unity.cinemachine/Runtime/Core/CameraBlendStack.cs 88.88% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1106      +/-   ##
==========================================
+ Coverage   17.07%   17.14%   +0.06%     
==========================================
  Files         209      209              
  Lines       23759    23768       +9     
==========================================
+ Hits         4058     4074      +16     
+ Misses      19701    19694       -7     
Flag Coverage Δ
cinemachine_MacOS_2022.3 ?
cinemachine_MacOS_6000.0 ?
cinemachine_MacOS_6000.3 ?
cinemachine_MacOS_6000.4 ?
cinemachine_MacOS_6000.5 ?
cinemachine_MacOS_6000.6 ?
cinemachine_Ubuntu_2022.3 ?
cinemachine_Ubuntu_6000.0 ?
cinemachine_Ubuntu_6000.3 ?
cinemachine_Ubuntu_6000.4 ?
cinemachine_Ubuntu_6000.5 ?
cinemachine_Ubuntu_6000.6 ?
cinemachine_Windows_2022.3 17.17% <88.88%> (+0.06%) ⬆️
cinemachine_Windows_6000.0 17.07% <88.88%> (+0.06%) ⬆️
cinemachine_Windows_6000.3 17.07% <88.88%> (+0.06%) ⬆️
cinemachine_Windows_6000.4 17.07% <88.88%> (+0.06%) ⬆️
cinemachine_Windows_6000.5 17.07% <88.88%> (+0.06%) ⬆️
cinemachine_Windows_6000.6 17.07% <88.88%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...unity.cinemachine/Runtime/Core/CameraBlendStack.cs 63.05% <88.88%> (+3.88%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants