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

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:

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

3 Likes

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!

1 Like

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)

Same!

Should we add something to the unity issue tracker?

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.

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?

1 Like

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.

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.

Oh, ok.
Just tried reseting mesh filter - it does nothing.

If you click on the target next to the mesh filter name and choose the correct mesh does that fix it?

1 Like

Just tried your fix and it works for that one model, the rest still are combined. :confused: 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.

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.

Send_A_Bug_Report_With_Your_Scene

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)

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

Not sure if the OP wants to add my thread to the original post as im having the exact same issues. Bloated Scene File - Unity Engine - Unity Discussions

I dont want to spend two days going through the project re-assigning meshes, but not sure of any other options.

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.

#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;

public class EditorFixes : MonoBehaviour {
    public int meshFilterIndex;
    public List<MeshFilter> meshFilterlist;

    public void combinedMeshFixStart() {
        meshFilterIndex = 0;
        meshFilterlist = new List<MeshFilter>( FindObjectsOfType<MeshFilter>() );
        for(int i = meshFilterlist.Count - 1; i >= 0; --i) {
            if(!meshFilterlist[i].sharedMesh.name.Contains( "Combined" )) {
                meshFilterlist.RemoveAt( i );
            }
        }
        print( meshFilterlist.Count );
    }

    public void combinedMeshFixNext() {
        focus( meshFilterlist[meshFilterIndex].gameObject );
        string s = meshFilterlist[meshFilterIndex].gameObject.name.Replace( "(Clone)", "" ).Trim();
        string[] ss = AssetDatabase.FindAssets( s );
        Mesh mm = AssetDatabase.LoadAssetAtPath<Mesh>( AssetDatabase.GUIDToAssetPath( ss[0] ) );
        Debug.Log( "changed " + s + " " + mm.name, mm );
        meshFilterlist[meshFilterIndex].sharedMesh = mm;

        meshFilterIndex = ( meshFilterIndex + 1 ) % meshFilterlist.Count;
        if(meshFilterIndex == 0) {
            print( "Looped" );
        }
    }

    void focus(GameObject go) {
        EditorGUIUtility.PingObject( go );
        Selection.activeGameObject = go;
        SceneView.lastActiveSceneView.FrameSelected();
    }
}

[CustomEditor( typeof( EditorFixes ), true )]
public class LODFixEditor : Editor {
    public override void OnInspectorGUI() {
        DrawDefaultInspector();

        GUILayout.Space( 10 );

        if(GUILayout.Button( "Combined Mesh Fix Start" )) {
            var myScript = (EditorFixes)target;
            myScript.combinedMeshFixStart();
        }

        if(GUILayout.Button( "Combined Mesh Fix Next" )) {
            var myScript = (EditorFixes)target;
            myScript.combinedMeshFixNext();
        }
    }
}
#endif

guys:
close unity
delete library folder

not sure if that what worked for me, but is worth a try.

Im afraid that didn’t work for myself meganuke. Worth a shot though.

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.