Search Unity

Unity generated combined meshes permanetly saved in scene if build is cancelled?

Discussion in 'Editor & General Support' started by ArachnidAnimal, Jan 31, 2017.

  1. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,650
    I have come across numerous threads recently were users were encountering an issue. It appears for static game objects, Unity generates the combined mesh. But if aborting a build the source mesh is overridden with the combined mesh and saved in scene, not reverting back to the original mesh.

    Here are some threads created recently:
    https://forum.unity3d.com/threads/combined-mesh-root-scene-issue.453490/
    https://forum.unity3d.com/threads/combined-mesh-cataclism.453432/
    https://forum.unity3d.com/threads/bloated-scene-file.458004/#post-2971652
    https://forum.unity3d.com/threads/r...denly-not-working-in-one-scene-solved.470633/
    https://forum.unity3d.com/threads/i...in-every-mesh-in-my-scene.92494/#post-3040604

    Does anyone have any additional information regarding this new functionality?
    This doesn't sound right to me, and would be hesitant to download the new versions of Unity.

    Edit:
    A bug report for this issue was elevated to "Active".

    https://issuetracker.unity3d.com/is...process?_ga=1.227536926.2050027250.1489787241
     
    Last edited: Jun 2, 2017
    guneyozsan and shamsfk like this.
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,440
    There was another thread recently where this popped up, so you're right in that it's not an isolated thing!

    Somebody that has it happen needs to report a bug!
     
  3. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    277
    It happened to me, but there is not much to report, it just was that way when I tried to modify some walls (I don't know when and how it happened)
     
  4. Brainversation01

    Brainversation01

    Joined:
    May 25, 2015
    Posts:
    15
    Same!

    Should we add something to the unity issue tracker?
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,440
    What needs to happen is that somebody that experiences this bug sends a bug report containing a scene with the combined mesh problem in it, and a good description of the problem. The Unity devs are pretty good at fixing bugs they get to know about. They don't read all of the threads.
     
  6. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,650
    So this is not expected behavior in Unity 5.5? Usually a Unity employee will pop in a thread and encourage people to submit a bug report if they highly suspect something is a bug.

    Is the combined mesh being permanently saved in the scene?
    What happens if you go to the mesh filter and choose "revert". Is the combined mesh replaced with the original source mesh?
     
    shamsfk likes this.
  7. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    277
    It was saved in my case.
    Reverting indeed helps but it comes with the cost of loosing all specific data in attached behaviours.
    Some more horror occurs when you try to undo reverting: it undones into blank plane with default uvs etc. Clearly broken.
     
  8. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,650
    What I mean is just revert the Mesh Filter portion, by hitting the gear icon and choosing Revert. This should just restore the mesh inside the Mesh Filter. I think you're hitting the revert button which is causing the loss of the serialized data in the attached MonoBehaviours.
    AFAIK, Unity never was able to reliably handle undoing the "Revert" operation. I think I submitted a bug report a couple of years ago, with no response.
     
    Last edited: Feb 2, 2017
  9. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    277
    Oh, ok.
    Just tried reseting mesh filter - it does nothing.
     
  10. richardlord

    richardlord

    Joined:
    Jan 5, 2015
    Posts:
    1
    If you click on the target next to the mesh filter name and choose the correct mesh does that fix it?
     
    Xalior likes this.
  11. Brainversation01

    Brainversation01

    Joined:
    May 25, 2015
    Posts:
    15
    Just tried your fix and it works for that one model, the rest still are combined. :/ I guess that is a temp fix for now. The only problem is, I am not sure how that will effect the combined mesh during runtime and optimizations such as that.
     
  12. veinstix

    veinstix

    Joined:
    May 1, 2015
    Posts:
    11
    Having the same problem.. Reverting allows me to move the objects once again, but it doesn't clear from the combined mesh. Which is a problem for me because I'm baking navigation in my project.
     
  13. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,440
    Send_A_Bug_Report_With_Your_Scene
     
  14. meganuke

    meganuke

    Joined:
    Aug 23, 2013
    Posts:
    14
    i have this!
    i remebered to have seen something like that so iwent to my scene and it is right there!
    mesh is combined


    i already submitted this scene to unity but for a different bug (im currently looking if there is a thread aboutt that one)
     
  15. meganuke

    meganuke

    Joined:
    Aug 23, 2013
    Posts:
    14
    er... sorry
    no, is not in the project i uploaded for the bug reported
    i guess its because i deleted the "library" folder....

    there is no way i would upload a 6gb folder.
    sorry
     
  16. Mark-Paul

    Mark-Paul

    Joined:
    Feb 8, 2013
    Posts:
    46
  17. Brainversation01

    Brainversation01

    Joined:
    May 25, 2015
    Posts:
    15
    Hello I am still having this problem, but I couldn't wait any longer so I tried making a script that could help automate a fix. Below is what I have so far I think it needs a little more work.

    This only works if the Model file is the same as your prefab or gameobject in the game that has the combined mesh.

    Hope this helps and if you have any questions do not hesitate to ask.

    Code (CSharp):
    1. #if UNITY_EDITOR
    2. using UnityEngine;
    3. using UnityEditor;
    4. using System.Collections.Generic;
    5.  
    6. public class EditorFixes : MonoBehaviour {
    7.     public int meshFilterIndex;
    8.     public List<MeshFilter> meshFilterlist;
    9.  
    10.     public void combinedMeshFixStart() {
    11.         meshFilterIndex = 0;
    12.         meshFilterlist = new List<MeshFilter>( FindObjectsOfType<MeshFilter>() );
    13.         for(int i = meshFilterlist.Count - 1; i >= 0; --i) {
    14.             if(!meshFilterlist[i].sharedMesh.name.Contains( "Combined" )) {
    15.                 meshFilterlist.RemoveAt( i );
    16.             }
    17.         }
    18.         print( meshFilterlist.Count );
    19.     }
    20.  
    21.     public void combinedMeshFixNext() {
    22.         focus( meshFilterlist[meshFilterIndex].gameObject );
    23.         string s = meshFilterlist[meshFilterIndex].gameObject.name.Replace( "(Clone)", "" ).Trim();
    24.         string[] ss = AssetDatabase.FindAssets( s );
    25.         Mesh mm = AssetDatabase.LoadAssetAtPath<Mesh>( AssetDatabase.GUIDToAssetPath( ss[0] ) );
    26.         Debug.Log( "changed " + s + " " + mm.name, mm );
    27.         meshFilterlist[meshFilterIndex].sharedMesh = mm;
    28.  
    29.         meshFilterIndex = ( meshFilterIndex + 1 ) % meshFilterlist.Count;
    30.         if(meshFilterIndex == 0) {
    31.             print( "Looped" );
    32.         }
    33.     }
    34.  
    35.     void focus(GameObject go) {
    36.         EditorGUIUtility.PingObject( go );
    37.         Selection.activeGameObject = go;
    38.         SceneView.lastActiveSceneView.FrameSelected();
    39.     }
    40. }
    41.  
    42. [CustomEditor( typeof( EditorFixes ), true )]
    43. public class LODFixEditor : Editor {
    44.     public override void OnInspectorGUI() {
    45.         DrawDefaultInspector();
    46.  
    47.         GUILayout.Space( 10 );
    48.  
    49.         if(GUILayout.Button( "Combined Mesh Fix Start" )) {
    50.             var myScript = (EditorFixes)target;
    51.             myScript.combinedMeshFixStart();
    52.         }
    53.  
    54.         if(GUILayout.Button( "Combined Mesh Fix Next" )) {
    55.             var myScript = (EditorFixes)target;
    56.             myScript.combinedMeshFixNext();
    57.         }
    58.     }
    59. }
    60. #endif
    61.  
     
  18. meganuke

    meganuke

    Joined:
    Aug 23, 2013
    Posts:
    14
    guys:
    close unity
    delete library folder

    not sure if that what worked for me, but is worth a try.
     
  19. Mark-Paul

    Mark-Paul

    Joined:
    Feb 8, 2013
    Posts:
    46
    Im afraid that didn't work for myself meganuke. Worth a shot though.
     
  20. sidass18

    sidass18

    Joined:
    Feb 27, 2017
    Posts:
    1
    Has anyone found the way or noticed on how the issue is reproduced? Tried to import some basic combined mesh and play with various settings to get the issue, but sadly, to no results. Any ideas?

    (Working with one of these cases right now in QA).

    Thanks.
     
  21. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    277
    Wild guess is that my particular case could have happened when I canceled a build process in the middle of it. But thats just a guess, based on that I did nothing else unusual that day.
     
  22. Mark-Paul

    Mark-Paul

    Joined:
    Feb 8, 2013
    Posts:
    46
    I think it happened to ourselves when we tried to downgrade from 5.5.1 to 5.4.0. I spent a day replacing all the meshes in 5.5.1 and everything works as expected now. The bloated scene file has dropped from 120meg to 11meg as expected. It wasn't an ideal way to spend a day, but at least the issue is resolved... for now!
     
  23. Leetchi

    Leetchi

    Joined:
    Aug 7, 2014
    Posts:
    1
    Same thing happened to me today, and as shamsfk said, it happened right after I cancelled a build process before it ends. Can't see anything else unusual... Currently trying to delete the Library folder, hope it'll work, I don't even want to think of the time I'll spend if I have to replace all the meshes in my scene...
     
  24. Brainversation01

    Brainversation01

    Joined:
    May 25, 2015
    Posts:
    15
    Did not work.
     
  25. meganuke

    meganuke

    Joined:
    Aug 23, 2013
    Posts:
    14
    A bug report with this will be worthless, because it will only contain an scene with meshes combined, the guys at unity can make one of those in seconds (i think).
    what they need is to understand how, when and why this has happened, and a scene with combined meshes will not hold that information, and even less if you have done anything else on it (like trying to fix the issue for yourself).

    for a bug to be fixed it needs to be "reproduced" which wont be possible until somebody actually understand this issue.

    i solved my issue by using the "revert" button on the instance manager on *every* static object in the scene, fortunately for me, i had all the static objects grouped, and everything was created from prefabs, so it only took 30 minutes. Best Practices FTW!!!.

    ill start making more periodical backups on everything because this is a bug that will live for a loooong time.
     
  26. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Just found this thread and have flagged it to the team. We do have bug reports but it seems the issue was not reproducible from the projects sent in. Hoping I can escalate this and have ETA for a fix.


    Edit: the team needs a 100% recreate, so if everyone in here can help out by sending in your affected projects where it reproduces we can get this moving along.
     
    Last edited: Mar 14, 2017
    shamsfk, Baste and ArachnidAnimal like this.
  27. vicator

    vicator

    Joined:
    Oct 12, 2014
    Posts:
    26

    Hi, Unity 5.5.0f3 here, seeing this issue.
    I had a working light bake in the process. Then deselected Auto in the lightning window. Then I started a build - which I aborted quite quickly. Tried to move some objects in the editor without result. Only colliders will follow. Now the project is stuck with a big combined mesh.

    After i try to bake the light it consumes all RAM and stops at 5/11 clustering 80. Then after a few hours the computer crashes.

    ill report with the current failed project for you to investigate. Case: 891971
    I have a couple of days old backups of the project before this thing happened. Hope to file it later.
     
    iLyxa3D likes this.
  28. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Thank you! Getting the earlier version would help us with the investigation.
     
  29. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    277
    The only same thing with what I did when this bug happened to me.
     
  30. vicator

    vicator

    Joined:
    Oct 12, 2014
    Posts:
    26
    Ive supplied the earlier verrsion and according to unity devs they were able to reproduce the error. it is now in their hands for actual bug fixing. Hope we wont see this too often in the future anymore.

    my suggestion to you guys is that you should never abort a build.
     
  31. iLyxa3D

    iLyxa3D

    Joined:
    Sep 25, 2013
    Posts:
    15
    Same problem in 5.6.0f3 :(
    Huge scene, a lot of static objects combined((
    Cancel android build (or backing light), close unity and get "surprise" on next day..
    Will try to Revert prefabs, but a lot of them has custom changes in scene (985 objects combined)..

    This bug is SuperCritical! I think..
     
    Last edited: Apr 6, 2017
  32. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,650
  33. vicator

    vicator

    Joined:
    Oct 12, 2014
    Posts:
    26
    You should now have been able to check the bug. It was reproducable by the devs after my last report. Hope it gets fixed in the future.

    To all devs: Never cancel a build in progress.
     
    Last edited: Apr 22, 2017
  34. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,111
    Hope they fix this issue soon, seems to be widespread. Im on 5.6.0f3, and its totally mucked up my project to the point that I can't do anything with the objects. Not sure if its just child objects that are an issue.
     
  35. SeriouSerg

    SeriouSerg

    Joined:
    Jan 27, 2013
    Posts:
    49
    Same here.
    >1500 objects combined.

    This is our last project on your engine, you scoff at us, bugs are more fatal in every new build, you do not progress, you regress. Your QA team must be fired completely.
     
  36. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,111
    I reverted back to 5.5.2f1, seems to be ok on this version - but really need 5.6!
     
  37. chassets

    chassets

    Joined:
    Nov 27, 2013
    Posts:
    256
    Having the same issues with 5.6.0f3 & 5.6.0p4. Basically destroyed my project -.-
     
    Last edited: May 9, 2017
  38. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,111
    I tried Unity 5.6.0f3 again, imported my project after reverting to a backup, seemed fine the second time round. But didn't cancel any build.
     
  39. raincoil

    raincoil

    Joined:
    Nov 5, 2016
    Posts:
    4
  40. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,650
    You just needed to revert the scene file (.unity file) right? That is where the combined mesh is stored, unless something changed with Unity.
     
    julianr likes this.
  41. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,111
    Can you revert the whole scene? Strange thing was it only seemed to do it to ProBuilder created meshes.
     
  42. guneyozsan

    guneyozsan

    Joined:
    Feb 1, 2012
    Posts:
    69
    I can confirm the bug is there in 5.6.0f3. Really frustrating and almost kills the scene. I get it like every two days.
     
  43. guneyozsan

    guneyozsan

    Joined:
    Feb 1, 2012
    Posts:
    69
    Usually I notice the bug it by noticing a missing GameObject with a mesh. Then I understand that it happened again.

    If you are not actively working on that part of the scene, you can discover the bug days or weeks later, which means too late to roll back and redo the scene almost from scratch.
     
  44. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,650
    It's strange that Unity has not fixed this yet. This seems to be a critical bug, probably the most severe bug I've ever seen, yet it's still active since Mar 16.
     
  45. eastes

    eastes

    Joined:
    Sep 1, 2012
    Posts:
    49
    Ouch. I just lost 3 days of work to this. Need to revert to a 3 day old backup :-( Ooops.
     
  46. HummerBumble

    HummerBumble

    Joined:
    Apr 13, 2013
    Posts:
    20
    Lost so much work to this, still happening on 5.6.1
     
  47. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    294
    i encountered this bug as well on unity 5.6.2 i was trying some builds (tried canceling building once or twice) in the past two days and found my scene littered with combined mesh issue.

    sadly some meshes created in probuilder in scene are lost.. and if you are lucky enough.. if these gameobjects have mesh collider, you can find original mesh referenced in mesh collider..

    i think unity should bullet proof all scenes in unity.. no matter what project goes through (upgrades/downgrades/building/etc).. scenes should be protected from such issues..
     
    Last edited: Jun 29, 2017
    shamsfk likes this.
  48. entropicjoey1

    entropicjoey1

    Joined:
    Jun 1, 2014
    Posts:
    21
    Got this bug in unity2017, canceled while building :(
     

    Attached Files:

  49. sadrag

    sadrag

    Joined:
    Nov 11, 2015
    Posts:
    3
    for Pro Builder;
    Turn off Static Batching at Player Settings. Sb.png
     
    mohojing likes this.
unityunity