Mesh '': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due

Anyone know how to identify which mesh is the problem here, there is no name? It stops me making a build with:

Mesh ‘’: abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
Mesh bounds min=(-0.00, -0.00, 0.00), max=(0.00, 0.00, 1381150977987604581328295047462912.00). Please make sure the mesh is exported without any errors.
0x00007FF724F2848C (Unity) StackWalker::GetCurrentCallstack
0x00007FF724F2B991 (Unity) StackWalker::ShowCallstack
0x00007FF723640FC5 (Unity) GetStacktrace
0x00007FF725C1C1BE (Unity) DebugStringToFile
0x00007FF7247246FF (Unity) Mesh::CreateMesh
0x00007FF72472106A (Unity) Mesh::AwakeFromLoad
0x00007FF7235D0B37 (Unity) AwakeFromLoadQueue::InvokePersistentManagerAwake
0x00007FF7235D1630 (Unity) AwakeFromLoadQueue::persistentManagerAwakeFromLoad
0x00007FF72356C975 (Unity) PersistentManager::IntegrateAllThreadedObjects
0x00007FF72356D1A0 (Unity) PersistentManager::LoadAndIntegrateAllPreallocatedObjects
0x00007FF723570354 (Unity) PersistentManager::ReadObject
0x00007FF72250A4C5 (Unity) PPtr::hushed:perator Mesh * __ptr64
0x00007FF7246F3AFE (Unity) MeshRenderer::UpdateCachedMesh
0x00007FF72474CDD9 (Unity) MeshFilter::AssignMeshToRenderer
0x00007FF7235D0B37 (Unity) AwakeFromLoadQueue::InvokePersistentManagerAwake
0x00007FF7235D1630 (Unity) AwakeFromLoadQueue::persistentManagerAwakeFromLoad
0x00007FF72356C975 (Unity) PersistentManager::IntegrateAllThreadedObjects
0x00007FF72356D1A0 (Unity) PersistentManager::LoadAndIntegrateAllPreallocatedObjects
0x00007FF723570354 (Unity) PersistentManager::ReadObject
0x00007FF722A61CF5 (Unity) PPtr::hushed:perator EditorExtension * ptr64
0x00007FF72324E874 (Unity) IsPrefabInstanceWithValidParent
0x00007FF72321378C (Unity) MergeAllPrefabInstancesDuringLoad
0x00007FF724951BA5 (Unity) LoadSceneOperation::CompleteAwakeSequence
0x00007FF724952AA5 (Unity) LoadSceneOperation::IntegrateMainThread
0x00007FF72495639C (Unity) PreloadManager::UpdatePreloadingSingleStep
0x00007FF724956C61 (Unity) PreloadManager::WaitForAllAsyncOperationsToComplete
0x00007FF723290EBF (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF722EAD644 (Unity) EndPlayerBuilding
0x00007FF722E9721F (Unity) BuildPlayer
0x00007FF723DC5625 (Unity) BuildPipeline::BuildPlayerInternalNoCheck
0x00007FF723DAAE46 (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
0x0000026DC2F0280A (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[ ],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,string[ ],bool)
0x0000026DC2F022DB (Mono JIT Code) UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
0x0000026DC2EFE83B (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x0000026DC2EFE343 (Mono JIT Code) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun (bool)
0x000002793348CCFB (Mono JIT Code) UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform)
0x00000279334838A3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
0x0000027933474CA3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:OnGUI ()
0x0000026DC2F8C954 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this
(object,intptr,intptr,intptr)
0x00007FFA056ECE80 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
0x00007FFA05672142 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
0x00007FFA0567B312 (mono-2.0-bdwgc) [object.c:3073] mono_runtime_invoke_checked
0x00007FFA0567BAA9 (mono-2.0-bdwgc) [object.c:5264] mono_runtime_try_invoke_array
0x00007FFA0567B2A6 (mono-2.0-bdwgc) [object.c:5142] mono_runtime_invoke_array_checked
0x00007FFA056202D4 (mono-2.0-bdwgc) [icall.c:3358] ves_icall_InternalInvoke
0x0000026DC2CD8DCD (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[ ],System.Exception&)
0x0000026DC2CD7CDB (Mono JIT Code) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[ ],System.Globalization.CultureInfo)
0x0000026DC2CD7BFE (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[ ])
0x0000026DC2C773CB (Mono JIT Code) UnityEditor.HostView:Invoke (string,object)
0x0000026DC2C77353 (Mono JIT Code) UnityEditor.HostView:Invoke (string)
0x000002793341F6D3 (Mono JIT Code) UnityEditor.HostView:OldOnGUI ()
0x0000026DC2E3C9F2 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:smile:oOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect,bool)
0x0000026DC2DC86BB (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool)
0x0000026DC2DC7083 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,bool)
0x0000026DC2DC6E23 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIPrivate (UnityEngine.UIElements.EventBase,bool)
0x0000026DC2DC6D53 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI (UnityEngine.UIElements.EventBase,bool)
0x0000026DC2C6EA93 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleEvent (UnityEngine.UIElements.EventBase)
0x0000026DC2C6959F (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase)
0x0000026DC2DAB0C3 (Mono JIT Code) UnityEngine.UIElements.MouseCaptureDispatchingStrategy:smile:ispatchEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000026DC2C6774D (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:processEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000026DC2C6723B (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:processEventQueue ()
0x0000026DC2C670B3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:OpenGate ()
0x0000026DC2C6701B (Mono JIT Code) UnityEngine.UIElements.EventDispatcherGate:smile:ispose ()
0x0000026DC2C67BD3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:processEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000026DC2C658D3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:smile:ispatch (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,UnityEngine.UIElements.DispatchMode)
0x0000026DC2C6576B (Mono JIT Code) UnityEngine.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.DispatchMode)
0x0000026DC2D6E40B (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:smile:oDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000026DC2D6DEFB (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:processEvent (int,intptr)
0x0000026DC2D6DC57 (Mono JIT Code) UnityEngine.GUIUtility:processEvent (int,intptr)
0x0000026DC2D6DD1A (Mono JIT Code) (wrapper runtime-invoke) :runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr)
0x00007FFA056ECE80 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
0x00007FFA05672142 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
0x00007FFA0567B13F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
0x00007FF724EA8D6E (Unity) scripting_method_invoke
0x00007FF724EA28DD (Unity) ScriptingInvocation::Invoke
0x00007FF724E9CACA (Unity) ScriptingInvocation::Invoke
0x00007FF7222D5315 (Unity) Scripting::UnityEngine::GUIUtilityProxy::processEvent
0x00007FF722C418FC (Unity) GUIView::processRetainedMode
0x00007FF72366680D (Unity) GUIView::OnInputEvent
0x00007FF722C4180C (Unity) GUIView::processInputEvent
0x00007FF7236682E5 (Unity) GUIView::processEventMessages
0x00007FF723661049 (Unity) GUIView::GUIViewWndProc
0x00007FFA46A763ED (USER32) CallWindowProcW
0x00007FFA46A75DE2 (USER32) DispatchMessageW
0x00007FF7236657F0 (Unity) MainMessageLoop
0x00007FF72366F419 (Unity) WinMain
0x00007FF7266BAD92 (Unity) __scrt_common_main_seh
0x00007FFA47A07BD4 (KERNEL32) BaseThreadInitThunk
0x00007FFA47EACED1 (ntdll) RtlUserThreadStart

Still struggling with this over a year later, I seem to have 4 meshes with this issue but there is no way at all to identify which ones they are! Any ideas? My scene is absolutely huge…

Would it be crazy to just walk through the mesh data and make sure all x, y, z components of all vertices are finite?

public static bool IsMeshOk(Mesh m) {
  foreach (Vector3 v in m.vertices) {
    if (!float.IsFinite(v.x) || !float.IsFinite(v.y) || !float.IsFinite(v.z)) {
    return false;
  }

  return true;
}
1 Like

oh yeh smart thinking! thanks!!!

Unity doesn’t seem to have IsFinite for some reason so you can probably just use something like

public static bool IsFinite(this float f) {
  return !float.IsInfinite(f) && !float.IsNan(f)
}
1 Like

Cheers man!!..

I tried this but it just uses up over 200 gig then reboots pc :slight_smile:

MeshFilter[] filters = FindObjectsOfType<MeshFilter>();
                Debug.Log("checking mesh filters for IsInfinity, IsNegativeInfinity, IsNaN ->" + filters.Length);
                for (int i = 0; i < filters.Length; i++)
                {
                    Mesh filter = filters[i].mesh;
                    Vector3[] v = filter.vertices;

                    for (int j = 0; j < v.Length; j++)
                    {
                        if (float.IsInfinity(v[j].x) || float.IsInfinity(v[j].y) || float.IsInfinity(v[j].z))
                        {
                            Debug.Log("Mesh with issue (IsInfinity) " + filter.name);//
                        }
                        if (float.IsNegativeInfinity(v[j].x) || float.IsNegativeInfinity(v[j].y) || float.IsNegativeInfinity(v[j].z))
                        {
                            Debug.Log("Mesh with issue (IsNegativeInfinity) " + filter.name);//
                        }
                        if (float.IsNaN(v[j].x) || float.IsNaN(v[j].y) || float.IsNaN(v[j].z))
                        {
                            Debug.Log("Mesh with issue (IsNan) " + filter.name + filter.name);//
                        }
                    }                                   
                }

Will try in smaller increments on various parts of the city, it didnt crash out there with 4000 meshes, but it does with 19000, lol.

Scripting it now to try reduce memory etc, but honestly with 19000 x 19000 checks, and a timer to allow gc, I will be dead for 10k years before this is done… SURELY there is a better way.

Further hampered by this - does this mean I may not even find what I am looking for? this is PURE PURE HELL, one line of code to unity could output what the problematic mesh is… oh if only it was open src.):
Not allowed to access vertices on mesh ‘Combined Mesh (root: scene) 151 Instance’ (isReadable is false; Read/Write must be enabled in import settings)

@karl_jones Any ideas on this? Why cant unity tell me which mesh is the issue? Seems beyond belief that it fails without saying which mesh is the issue! Shall I file a bug report for this? Im sorry to drag you into this but you seem to be the best employee unity has lol. I already recommended to David Helgason that you should be paid 10x more like 2 years ago :slight_smile: Any help would be greatly appreciated, in mean time I will plough on.

Yeah its borderline IMPOSSIBLE to hunt out the broken meshes. Unity once again dances on my grave, because no one can be arsed to output real error messages. It really does feel like Unity WANT you to fail at every hurdle.

Can’t report bug either, classic unity bug reporter “something went wrong”… good lord unity sort yourselves out will you!!!

Yes I would say a bug report is the best approach. I’ll bringit up internally and see why we can’t report the mesh.

Edit: looks like the area where the error occurs is not aware of the asset, it’s raw mesh data. We have some ideas to fix this which we will look into.

1 Like

Thanks mate I will try report, but ot be honest my current 3 game breaking bugs dont even get glanced at. Unity really try hard not to help their devs in need. I know you do but no others do, my bugs have all been outstanding for years, not been able to a a build since 2013 due to unity bugs. If I had to rate unity on bugfixing out of 100, it would be 1% - complete mess of people hiding from the issues and trying not to fix. I will report it if the bug reporter works which is about 2% of the time. I think faith in Unity is dwindling every single day, I have many people offering to pay me to move to unreal for example, but honestly I think leasrning an engine is to hard and im stuck with unity, even though it is like an engine thrown together by a 12 year old version of myself sometimes.

edit: I do want to say that I have seen you personally solve issues that changed our lives, but not all unity employees are like you. I wanted to become one myself to be like you, saving the peons from destruction, but they turned me down. I want to intewrface with people facing hell and sort it for them, and be that guy who arranges fixes or possibly implements himself, or does digging… but theyre not clued up enough to realise that is a viable position.#

edit2: youre saying there is NO WAY to report a name here? unity s more of a joke than I thought, it will take me a LIFE TIME, to hunt it. Every single day of my life I curse choosing unity, I really do, what a joke piece of software it has turned out to be. Childish crap. I train people in unity but im too embarassed to tell them a game like mine will flaw it without fail, it will be impossible to even make an earlry GTA game in unity (and most including me have this dream).

Plus 99…9999999% of the time i try submit a bug it crashes, if it does get through unity close the bug immediately with no explanation or fix (I have examples f you message me), unity has become a joke in the game dev community for such issues. It is considered a childrens tool for tiny games, and I dont teach above that level… but I feel if they actually fixed the bugs it could be AAA.

Apologies for the frustrations and comments but unity was meant to democratise game dev, to me it is always on my mind how absolutely awful it is in the exact ways that stop me living my dreams, and I feel it was designed to be the opposite.

I’m sorry to hear that. We do fix bugs, just look at the release notes of a release, its full of bug fixes. Do you have any bug numbers I can look at? See why they have not been fixed.

Thats great to hear. I myself was also inspired by another Unity employee on the forums :slight_smile:
Don’t give up hope, I interviewed with Unity twice :wink:
There are many people at Unity who go above and beyond in helping people with their issue, I am by no means unique. For every person, you see on the forum there’s a dozen more working in the background just as hard.

No, I’m not saying there is no way. Just that the information is not currently available in that part of code, so it’s not simply a case of just updating the error message but that we also need to rearchitect some of the code so that we can report the asset.

See: [quote=“karl_jones, post:12, topic: 764968, username:karl_jones”]
We have some ideas to fix this which we will look into.
[/quote]

Did you manage to get your script working to find the errant mesh?

Thanks, and for sure the unity guys fix something lol, im too angry and personal with unity sometimes, but it effects my real life directly, and in turn hapiness, so you know :slight_smile:

I have not yet found the meshes to ruin my dreams, still working on it. Now I also see :

An asset is marked with HideFlags.DontSave but is included in the build:

Again it does not mention what asset is to blame, again I cannot fathom how games have been made without this sort of error reporting but I will try and include on my error report when I do one, which probably wont submit which is a shame.The list of issues is mounting up which stops me making a demo, so frustrating. And bug report tool does not work.

As for bug numbers yes, show stoppers:

AI/Navagent bugs:
1281611 (closed without explanation, not fixed by any means, though recently I was in touch with a unity employee who was looking into it),

Editor bugs:
1244521, the classic 2020 bug that kills entire app when you click on anything. Once in a blue moon I get an email along the lines of hey we moved your proj to an external HD!.. looking into it, but cant really be true…

And current bug:
abnormal mesh does not report name when build fails and same for HideFlags.DontSave assets.

This is still happening… :frowning: I wrote a script to identify bad meshes but it reports many that dont seem to be bad… I wish unity could “ignore” any mesh problems like it does in editor.

    private void getMeshes()
    {
        //string[] allMeshes = AssetDatabase.FindAssets("t:MeshFilter");
        MeshFilter[] allMeshes = (MeshFilter[])Resources.FindObjectsOfTypeAll(typeof(MeshFilter));
        for (int i=0; i< allMeshes.Length; i++)
        {

            //_(i+" MESH ->"+ allMeshes[i].name);
            Mesh m = allMeshes[i].sharedMesh;//.mesh;
            if (m == null)
            {
                _("shared mesh was ll null bail on  this one "+ allMeshes[i].name);

            }
            else
            {
                Bounds bounds = m.bounds;
                if (bounds.size.x < bounds.min.x)
                {
                    _("" + allMeshes[i].name + " HAS X PROBLEMS below min bounds.size.x is "+ bounds.size.x);
                }
                if (bounds.size.x > bounds.max.x)
                {
                    _("" + allMeshes[i].name + " HAS X PROBLEMS above max bounds.  bounds.size.x is "+ bounds.size.x);
                }
                if (bounds.size.y < bounds.min.y)
                {
                    _("" + allMeshes[i].name + " HAS Y PROBLEMS below min bounds.size.y is " + bounds.size.y);
                }
                if (bounds.size.y > bounds.max.y)
                {
                    _("" + allMeshes[i].name + " HAS Y PROBLEMS above max bounds.size.y is " + bounds.size.y);
                }
            }
           

        }
    }