- Home /
How to turn off m_Modification for prefabs?
Starting with Unity 5.1 I'm seeing two modifications to the prefab file whenever changing a single field in a prefab. One is the change itself, the other one is something like an undo history of changes being made, I suppose.
Example. I changed frameTimeMean30 from 0 to 10. This is the field:
MonoBehaviour:
m_GameObject: {fileID: 100000}
frameTimeMean30: 10
And later in the same file this is the list of modifications to the prefab:
Prefab:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 0}
propertyPath: frameTimeMean30
value: 10
objectReference: {fileID: 0}
m_RemovedComponents: []
As you can see it specifically lists a modification to frameTimeMean30 with a new value of 10.
Needless to say I don't need the list of modifications saved to file. It adds zero value, makes diffs harder to read, and merging virtually impossible. How do I turn it off?
I suppose it's a bug introduced with scene saving in Unity 5. http://blogs.unity3d.com/2015/02/17/production-workflow-improvements/ . My best guess is it supposed to save scene specific modifications of prefab instances. Perhaps even prefab specific changes of child prefabs. But it's doing the same thing for the root prefab too.
Yes, I wish you could turn these off. They also cause Unity to think that a prefab will have dependencies on things you removed/changed, since they still show up in the m_$$anonymous$$odifications section. You have to actually go into the prefab and delete that section manually. It's awful.
Your answer
Follow this Question
Related Questions
Can I safely put a prefab asset into version control with Unity Free? 3 Answers
Can I change a prefab without changing the scene? 3 Answers
Why do prefabbed meshes go missing whenever I pull an update from Unity Collab? 0 Answers
Change angle of camera in prefab preview 1 Answer
How Mark Prefab Dirty? 1 Answer