x


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..

more ▼

asked May 07 '11 at 08:06 AM

brad_ict gravatar image

brad_ict
64 2 2 6

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered May 12 '11 at 04:50 AM

brad_ict gravatar image

brad_ict
64 2 2 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x274
x229
x50
x39

asked: May 07 '11 at 08:06 AM

Seen: 829 times

Last Updated: May 07 '11 at 08:06 AM