Skip to content

MeshEffect doesn't work with Layout system #6

@markv12

Description

@markv12

I am using this library for the Outline 8 shadow effect on a TextMesh Pro Text object. The resulting shadow is sharper and looks better on pixel fonts than the default TextMesh Pro outline.

But I'm finding that it doesn't work well with the Unity layout system.
If TextMesh Pro text objects are part of a layout or have a ContentSizeFitter on them, At certain times, especially if you call:
LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent<RectTransform>());
You get an error like this:

Mesh.vertices is too small. The supplied vertex array has less vertices than are referenced by the triangles array. UnityEngine.Mesh:set_vertices(Vector3[]) TMPro.TextMeshPro:GenerateTextMesh() (at Library/PackageCache/[email protected]/Scripts/Runtime/TMPro_Private.cs:3796) TMPro.TextMeshPro:CalculateLayoutInputVertical() (at Library/PackageCache/[email protected]/Scripts/Runtime/TextMeshPro.cs:534) UnityEngine.Canvas:SendWillRenderCanvases()

Any idea what might be causing this?

Thank you!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions