- Home /
Why are merged materials modified when Unity opens?
We're merging materials from an SVN branch into the trunk. The materials in the trunk are modified by the merged branch materials and we commit this change to the trunk so all the files are up to date in the trunk and unmodified locally. We then open the trunk project and Unity modifies the merged materials. We aren't saving or modifying anything directly, we just open the project and the materials are changed on disk. We have version control configured correctly and have meta files committed, along with the Library files indicated in the Unity docs and nothing else. Here is the step by step workflow:
The material test.mat exists in both the branch and trunk.
Renamed test.mat in branch to test_renamed.mat
Merge trunk into branch. Tree Conflict between test.mat and test_renamed.mat
Right click tree conflict and choose Edit Conflicts. Choose Resolve (no choice for local or repo).
Updated branch.
Committed branch.
Updated trunk and branch.
Trunk > merge. Reintegrate branch -> trunk.
test_renamed.mat is added. test.mat is deleted.
Commit changes.
Open trunk project in Unity.
Material is correct. Dont modify or save anything.
Close Unity.
Check for modifications on trunk and test_renamed.mat file is changed.Why?????
Revert test_renamed.mat in trunk
Opened trunk project and get the same modification to the material again..
Answer by brad_ict · May 12, 2011 at 04:50 AM
After doing a binary diff on the material files we realized the name of the material is written inside the file when Unity imports the material. We simply SVN renamed the material in the branch with Unity closed to be safe, but this meant that when we re-integrated this material into the trunk and opened the trunk Unity imported the material and wrote the new name inside the file. Seems like the solution is to open and close your project before doing any commits.
Your answer
![](https://koobas.hobune.stream/wayback/20220613132336im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Where to find/How to make tree materials 1 Answer
Merging Textures 4 Answers
Trees' leaves showing up as squares? 0 Answers
How to deal with multiple users working on one scene? 1 Answer
SmartMerge with TortoiseSVN 1 Answer