Scene Diff - Ease Your Suffering

Scene Merge 1.4

Available in the Unity Asset Store:

Requires Unity PRO for the “Force Text” option or until Unity free supports text serialization on assets.

Here’s a little preview of a new tool that is available in the Asset Store.

Basically it prepares your scene for easy comparison in your favorite diff tool.

If you have many people editing your scene, you may have felt pain. Or maybe you lost a whole day worth of changes in a merge conflict.

I have just the tool you need.

In the Unity Google Hangout #1 (39:30), someone asks “would it be possible to merge scenes in team server?” and this package would fit that need. Although they claim you may run into conflicts, which is what I see often, and by preparing scenes and prefabs in a certain way you can mitagate most of that trouble.

In the Unity Google Hangout #2 (18:38), Chuguleh asks “has a lot of scenes and objects where it’s difficult near impossible to diff and merge them together” plans to make this better are planned for 4.X, where SceneMerge gives you this functionality in 3.X and later.

Any feedback is welcome.

There are many features possible. Like potentially a scene graph viewer. For the time being, use your favorite diff tool. In the video, I’m using the free Winmerge tool from http://winmerge.org. Where xcode is a free download in the Mac App Store Xcode - Apple Developer.

This package requires Unity 3.5.0 or better since that’s when “Force Text” was added as a serialization option.

Future users, I need two pieces of info.

  1. What is your favorite diff program?

  2. If you have any scenes that are still hard to compare, please send me the snapshot and the sort file.

Change Log:

Version 1.1 - Initial project setup for comparing scenes

Version 1.2 - Support for comparing prefabs

Version 1.3 - Added support for comparing with SVN changes

Version 1.4 - Added post processors for automatic scene and prefab sorting

Requires Unity 3.5.0 or better with the Force Text option on for Asset serialization.

And yes! SceneMerge now available in the Unity Asset Store:

SceneMerge 1.3 adds support for comparing your scene/prefab with the previous version in (SVN) regardless of whether you sorted or not.

1096117--41177--$SceneMerge001.jpg

I’ll need a configure tab at this point so you can customize the external diff tool (winmerge/filemerge), and the svn tool (tortoise/mac)

I should add you want to install XCode free from the mac app store to get diff functionality on the mac.

Hey is this plugin compatible with Unity 4,

This is great work and I don’t understand how unity hasn’t implemented something similar already.

Thank you

Unity is working on something for Unity 4.X. But who wants to wait for that. SceneMerge works in both 3.5.X and 4.X.

This is like a god send, I can’t wait for Unity to get this fixed. God knows if it it will be like the UI.

Anyway a few questions

  1. I presume you are sorting by UID? Do you sort the internal children object/components as well?

  2. There is one annoying thing I found in unity. When I update a prefab, the scene file that uses the prefabs do not update until the next time the scene is opened in unity again. There is also another annoying “feature” is when I import a unitypackage that is saved in binary, it does not get converted to text on import (even on my project import). Currently I have to open the unitypackage in a separate project, change to force text, then bring the converted text scene in.

So your tool can add in support to touch all the items in the assets to convert them to text?

  1. In the next version SceneMerge has a post processor so you don’t need to manually sort prefabs and scenes.
    I sort as many children as I’ve seen in the files so far.

  2. The asset has to be in text in order to support sorting. Unity free does not have a Force Text option. File->Save Project will save prefab changes. Just saving the scene does not save your prefab. I always do save scene and save project to make sure. Importing will not auto serialize, you have to make a change for serialize to text to happen. This will be fixed in 4.1.

The tool won’t work on binary items.

Saving project does not work on previously untouched scene that has the prefab. I doubt that will be fixed in 4.1, so if you can provide a touch method to update, that would be much needed. Otherwise we might not merge properly because another user might open the scene with update prefab.

Either way I got the post processing working for scene and prefab files. And if you use svn when you update you’ll be getting properly formatted files. There’s a chance you just changed to FORCE_TEXT in which you still have binary files. Making a change to the prefab will reserialize them as text.

Update 1.4 will include a new post processor for auto sorting your scenes and prefabs:

That’s what I mean, there are a lot of prefabs, if you could add it to force the to change, it would be great.

If I mark the prefab as dirty and save the asset that should get it to reserialize. Otherwise the post processor will fix them as you save them.

I purchased this asset a few minutes ago, but it seems that it’s still at version 1.3 since I’m not seeing the auto sort feature. Either that or I’m doing something wrong. Any ideas?

Version 1.4 will be active in the store in the next few days. I’ll PM you an update.

Got it!

Excellent product and fantastic support. Thank you!

Version 1.4 is now in the asset store.

Hey I was wondering if there was a way to reimport all of my game using your file formatting so I don’t have to go into each prefab and scene and sort each file myself.

1200638--48034--$DFGT3FQ.png

Hey I’m having an issue when the prefab saves. I think it has to do with the skinned mesh renderer in the prefab.