Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Scene Diff - Ease Your Suffering

Discussion in 'Assets and Asset Store' started by theylovegames, Nov 19, 2012.

  1. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
    Scene Merge 1.4

    Available in the Unity Asset Store:
    http://u3d.as/3EN

    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.
    http://www.youtube.com/watch?v=7Brg_aSjh2E&t=39m30s

    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.
    http://www.youtube.com/watch?v=QYOqRXV2qS8&t=18m38s

    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 https://developer.apple.com/xcode/.

    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.
     
    Last edited: Jan 16, 2013
  2. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
  3. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
    SceneMerge 1.3 adds support for comparing your scene/prefab with the previous version in (SVN) regardless of whether you sorted or not.

     

    Attached Files:

    Last edited: Nov 26, 2012
  4. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
    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)
     
  5. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
    I should add you want to install XCode free from the mac app store to get diff functionality on the mac.
     
  6. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    148
    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
     
  7. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
    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.
     
  8. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    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?
     
  9. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    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.
     
    Last edited: Jan 14, 2013
  10. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    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.
     
  11. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    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.
     
  12. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
    Update 1.4 will include a new post processor for auto sorting your scenes and prefabs:
     
  13. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    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.
     
  14. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    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.
     
  15. shaderop

    shaderop

    Joined:
    Nov 24, 2010
    Posts:
    942
    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?
     
  16. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Version 1.4 will be active in the store in the next few days. I'll PM you an update.
     
  17. shaderop

    shaderop

    Joined:
    Nov 24, 2010
    Posts:
    942
    Got it!

    Excellent product and fantastic support. Thank you!
     
  18. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
    Version 1.4 is now in the asset store.
     
  19. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    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.
     
  20. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397


    $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.
     
  21. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Okay so yes. I need to add custom code to find all scenes and prefab to reserialize. But it could be made automatic with an easy menu button. If there's a renderer problem, could you email a repro project with the problem to support@theylovegames.com and thanks. Always love to see people using the tools!
     
  22. privman

    privman

    Joined:
    Feb 21, 2013
    Posts:
    5
    First of all, many thanks for this plugin. I really can't believe the Unity developer community managed without something like this for so long.

    I just purchased SceneMerge, and it seems to be working very well with some of my scenes. However, in scenes which contain 2D Toolkit SpriteCollections, I get hundreds of diffs without making any real changes. It looks like some conflict between the plugins (maybe some parts of their code are triggering each other?).

    Have you had any experience with this? Are 2D projects supposed to be supported by SceneMerge?

    Thanks!
    Near
     
  23. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    I'll support anything you can provide me. If you find something not sorting good enough send me the original scene in force text mode.

    I had tons of merge conflicts when supporting 6 artists on the same project. Programmers work all day and check in code files which can be merged. Artists might work all day and check in a single scene file. And if another artist checked in, it clobbered their whole day of work.
     
  24. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    148
    I've also had issues with ragespline same as privman
     
  25. eelkenet

    eelkenet

    Joined:
    Jun 4, 2013
    Posts:
    3
    We're having the same problem here. Is there a fix available?

     
  26. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    The best way to fix things is sent me a link to a small project that reproduces the issue. And then I look at the diff and figure out how to automate merging that particular item. Be sure to reference what version of Unity that you are using.
     
  27. foo_mark

    foo_mark

    Joined:
    Sep 30, 2013
    Posts:
    3
    Hi,

    It seems I've ran into a problem where the objects in my scene seems to be visually placed correct, but the x position values in the inspector shows they've been all altered to incorrect values.

    That's when trying to save it and it tries to sort it out.
     
  28. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Hey foo mark. If you send me your scene from before and after sorting I can take a look.
     
  29. foo_mark

    foo_mark

    Joined:
    Sep 30, 2013
    Posts:
    3
    Here you go, you have the original and the altered one.

    Original
    After

    I didn't even merge a single scene, this is just scene merge doing its clean up work.

    Cheers,
     
  30. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Thanks I'll use to figure out what went.... foo_bar. :)
     
  31. foo_mark

    foo_mark

    Joined:
    Sep 30, 2013
    Posts:
    3
    Well, if its of any help, you can look at game objects that are named "CardWidgetPanel[n]", [n] being each one numbered starting from 1.
     
  32. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Gotcha it's probably sorting in string order versus numeric order...
     
  33. DirkBroenink

    DirkBroenink

    Joined:
    Oct 23, 2013
    Posts:
    1
    Does this tool work in Unity 4.x?
     
  34. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Yes but you need assets to be in 'Force Text' mode which puts them in YAML mode which can be better organized.
     
  35. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Pending version update.

    1.7 - Added GIT support for diffs. Made SVN/GIT client paths configurable. Save editor state for post processor and paths.

    This means if you are under GIT version control, you can click a button and quickly see what changed in your scene.

    Or if you use SVN/GIT you can browse to the path to your SVN.exe/GIIT.exe files on Windows.

    On Mac, you just need to install the command-line tools in Xcode->Preferences->Downloads.

    $SceneMerge.jpg
     
    Last edited: Jan 20, 2014
  36. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Version 1.7 is now available in the store.

    Change Log: Added GIT support for diffs. Made SVN/GIT client paths configurable on Windows. Save editor state for post processor and paths.
     
  37. nazgul

    nazgul

    Joined:
    Oct 24, 2011
    Posts:
    10
    Hi! Have you ever tested this plugin with NGUI? Did everything work fine?
     
  38. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    I specifically made this plugin because of NGUI. I was working with a team of 6 artists and they could lose a day of work if the merge clobbered their work. Without this plugin, it made manually merging impossible.
     
  39. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    We are considering getting Scene Merge for resolving some issues with, well, scene merges, but have a few questions.

    How does Scene Merge order objects that have the same name and components?
    Can it reliably and consistently sort these objects so as to avoid conflicts when performing version control updates?

    Since the ID reference is only unique per file, how can you guarantee the objects remain in the same order every time the file saves?
     
  40. tgraupmann

    tgraupmann

    Joined:
    Sep 14, 2007
    Posts:
    828
    Some items can be sorted by their file id and others have to maintain the original order. I'll send you a demo. What's your email?
     
  41. mmf9194

    mmf9194

    Joined:
    Sep 9, 2013
    Posts:
    1
    Just been giving this software a whirl and i was wondering if it doesn't work with hg/mercurial? Is it restricted soley to work with git/svn and winmerge?
     
  42. magicsquare15

    magicsquare15

    Joined:
    Sep 19, 2013
    Posts:
    1
    So I just purchased SceneMerge, and I'm getting some very strange behavior. (Btw, I'm running Unity 4.5 on Windows 7.) First of all, after importing it into my project, I could not find it under the Window tab. Finally, after restarting my computer, opening the Sample scene, and running it, the diffing options appeared under the menu->File menu. I can take a snapshot, however, comparing with the snapshot simply does nothing. At first this was because I don't have WinMerge installed. However, I set the script to run the "C:\Program Files (x86)\Beyond Compare 3\BCompare.exe" instead (since I'm a Beyond Compare guy) and after saving and compiling, even closing and reopening Unity, comparing with the snapshot still does nothing. I'm a seasoned programmer of 10 years, but I am new to Unity - so there could be some Unity bugs / gotchas that I'm not aware of. It's also very late at night, so maybe I'm missing something here... but so far all I'm dealing with is pure frustration. Another factor is the project I imported this into has other script errors, from some other programming bugs that got checked into the project... would those prevent SceneMerge from working? I also tried creating a new Unity Project (to take my project scene's script error bugs out of the picture), importing SceneMerge's sample scene, running that, saving, making a snapshot, making a cube invisible, resaving, and comparing with the snapshot, and once again it just did nothing. Please help!!! Let me know any other information you need to diagnose this problem - whether it's a bug or workaround with the program, or a bug or workaround with Unity - thanks!!! (So two questions - how do I consistently get SceneMerge's options to appear on the menu, and how do I get SceneMerge to actually launch my diffing program. Thanks!)
     
  43. theylovegames

    theylovegames

    Joined:
    Aug 18, 2012
    Posts:
    176
    Hi MagicSquare.

    Before you import any packages in Unity make sure all your compile issues are fixed. Otherwise when the package imports the menu options will not appear.

    For SVN/GIT clients I use TortoiseGIT and TortoiseSVN for the integration.

    For diffing I use WinMerge, but I also have access to BeyondCompare.

    Make sure you have all your compile errors fixed and then you will find Window->Open Scene Merge.

    Compile errors have to be fixed in order for editor scripts to compile. It would be a great feature if Unity could add compiling plugins before the current project.