Constantly have changes/overrides when nothing changed

Hi

I’m using Cinemachine in a project and I’m constantly getting changes in my version control about transforms of virtual cameras that have supposedly changed. Mostly the changes are in the >= 7th digit of a float value.

I’m not sure if it happens because I have the habit of pressing CMD-S even when editing prefabs. But even then, when I didn’t actively change anything I don’t really want these changes to show up in my version control. I’ll have to either manually discard them all or have a muddled change history.

This happens in nested prefabs, in prefabs that are only one level deep, as well as with virtual cameras that are not in a prefab in a scene. When testing the behaviour I managed to trigger it by just renaming an unrelated object and saving the scene.

Does anyone else experience this? Is this something that can this be fixed?

Cheers!

Hi,

What version of Cinemachine are you using?

Hi! Damn, sorry, forgot all the important info.

Cinemachine: Version 2.7.9
Unity: 2021.1.18f1
OS: macOS 11.6 & Windows 10 (happens on both)

I can’t seem to reproduce this in 2.7.9 or on master.

Could you give more details on the repro steps? Maybe a screenshot of the prefab. Do you change values in the prefab editor, or in the scene and then apply overrides?

I made you a quick repro project: https://drive.google.com/drive/folders/1oU39w242azs9Jr8w0nhjpqSOGXHhf6Xh?usp=sharing
The link to the GDrive contains a screenshot, a quick recording of it happening and a ZIP with the project.
Hope that helps.

The changes you see are like this? Do you see other changes?

-  m_LocalRotation: {x: 0.062324416, y: 0.0000000066581087, z: -3.8851208e-10, w: 0.998056}
+  m_LocalRotation: {x: 0.062324416, y: -0.0000000066581083, z: 3.8851197e-10, w: 0.998056}

If they are not in a prefab then they are usually quite similar to your example. If they are in a prefab in a scene, they usually take a shape closer to (some real example changes from a bigger project, some parts left with … out for shortness):

  PrefabInstance:
    ...
    m_Modification:
      m_TransformParent: {fileID: 0}
      m_Modifications:
      - target: {fileID: ..., guid: ..., type: 3}
        propertyPath: m_LocalPosition.x
-       value: -0.00000059604645
+       value: 0
        objectReference: {fileID: 0}
      - target: {fileID: ..., guid: ..., type: 3}
        propertyPath: m_LocalRotation.z
-       value: 0.82430995
+       value: 0.82431
        objectReference: {fileID: 0}

In prefab assets I have also seen:

  m_Lens:
-   m_SensorSize: {x: 1.7771429, y: 1}
+   m_SensorSize: {x: 1.778626, y: 1}

The members affected that I see most are: m_LocalRotation, m_LocalPosition and m_SensorSize. What I didn’t actively test yet is whether it happens on all types of virtual cameras.

I’m not too concerned about this behaviour messing with the values and breaking something. I understand that they probably stem from something to do with de-/serialisation and float imprecision. What I’m more annoyed by is that they show up at all when nothing related has changed and that I have to deal with them in my version control.

Was this ever fixed / is there a work around?

It’s not only annoying, in Plastic it makes version control a lot more complicated for artists (not to mention when it “checks out/locks” a file that is not being worked on). Plus it has a side effect of uploading unnecessary scene/prefab changes that can be quite large taking space from the repo.

Probuilder automatic creation/recreation of meshes and Cinemachine floating point weirdness have been making our Version Control management a lot more problematic than needed!

A fix for this is going to be available in our next releases (2.6.17, 2.8.8, 2.9.0).

Edit: edited version numbers.

Is there any estimate when those patches will arrive? Just asking because 2.9.0 has preview releases since October last year, with the latest version being from january.

the m_SensorSize having always a change is just annoying. We rely heavy on scene merges (using the YAMLMergeTool) which works quite nice, but having merge conflicts at this line every single time is just annoying.

It’s in the release queue. Barring unforeseen events, it should arrive within the week.

Shipped

Just wanted to let you know:
2.9.1. can currently be installed via manifest.json only. the package manager won’t show that there is an update - even if you’re on 2.9.1-preXYZ

also after it being installed the “Recommended” version is still 2.8.9

(tested with 2022.1.8f1)

Yeah, that’s baked into Unity. Quite irritating, imo. It will catch up eventually.

This issue is still occurring in 2.9.7. m_LocalRotation always changes.

Thanks for the heads-up. We will investigate and try to find a solution.