From 11f261ba1f1200a0eb027267eebdda873745658a Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 14 Feb 2023 16:24:43 +0100 Subject: [PATCH] [ue4] Fix world vertices buffer allocation in widget. --- .../SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp index 90b9d29e2..879811e3c 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp @@ -274,6 +274,7 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList &OutDrawEle if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) { RegionAttachment *regionAttachment = (RegionAttachment *) attachment; attachmentColor.set(regionAttachment->getColor()); + attachmentVertices->setSize(8, 0); regionAttachment->computeWorldVertices(*slot, *attachmentVertices, 0, 2); attachmentAtlasRegion = (AtlasRegion *) regionAttachment->getRendererObject(); attachmentIndices = quadIndices; @@ -283,6 +284,7 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList &OutDrawEle } else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) { MeshAttachment *mesh = (MeshAttachment *) attachment; attachmentColor.set(mesh->getColor()); + attachmentVertices->setSize(mesh->getWorldVerticesLength(), 0); mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), attachmentVertices->buffer(), 0, 2); attachmentAtlasRegion = (AtlasRegion *) mesh->getRendererObject(); attachmentIndices = mesh->getTriangles().buffer();