LogText creates ArgumentException because of too high vertex count
Hello really like this console.
I found a Issue for too long Log-Texts, the long texts create too many vertices for the text mesh.
Error-Message:
ArgumentException: Mesh can not have more than 65000 vertices
UnityEngine.UI.VertexHelper.FillMesh (UnityEngine.Mesh mesh) (at Library/PackageCache/[email protected]/Runtime/UI/Core/Utility/VertexHelper.cs:226)
UnityEngine.UI.Graphic.DoMeshGeneration () (at Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:709)
UnityEngine.UI.Graphic.UpdateGeometry () (at Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:690)
UnityEngine.UI.Text.UpdateGeometry () (at Library/PackageCache/[email protected]/Runtime/UI/Core/Text.cs:580)
UnityEngine.UI.Graphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:648)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at Library/PackageCache/[email protected]/Runtime/UI/Core/CanvasUpdateRegistry.cs:215)
UnityEngine.Canvas:SendWillRenderCanvases()
The Error is thrown by the LogText Object multiple times
This also creates a Memory Problem. about 60MB is used for the UIVertex Meshes that the console creates. The Memory snapshot comes directly from a iOS Development Build.
Unity Version: Unity 2021.3.14f1
Hm, if I recall correctly it's supposed to split up into multiple text components if the logged string is large enough. Haven't worked on this for a while 😅 You may be able to manually lower that string length limit in the source code so that the vertex limit isn't reached.
One day I want to rewrite this whole asset... There's a lot of things I would do differently... One day... Glad you like it :) I use it in my projects too.
Yes, normally it's splitting then up, but in my case this error happened on loading a scene. At the beginning of the Scene, many async operations are executed, and it's really laggy in this loading time. Maybe that makes a problem for the Splitting.
However, I solved this Issue for me, I am now more carefully, enabling the console a little later and clearing it more often helped.