[ue4] Call computeWorldVertices before fetching renderer object. See #2154.

This commit is contained in:
Mario Zechner 2022-09-15 08:36:00 +02:00
parent d890eed2dc
commit 25719370c7
2 changed files with 8 additions and 8 deletions

View File

@ -273,18 +273,18 @@ void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList &OutDrawEle
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
RegionAttachment *regionAttachment = (RegionAttachment *) attachment;
attachmentColor.set(regionAttachment->getColor());
attachmentAtlasRegion = (AtlasRegion *) regionAttachment->getRendererObject();
attachmentColor.set(regionAttachment->getColor());
regionAttachment->computeWorldVertices(*slot, *attachmentVertices, 0, 2);
attachmentAtlasRegion = (AtlasRegion *) regionAttachment->getRendererObject();
attachmentIndices = quadIndices;
attachmentUvs = regionAttachment->getUVs().buffer();
numVertices = 4;
numIndices = 6;
} else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
MeshAttachment *mesh = (MeshAttachment *) attachment;
attachmentColor.set(mesh->getColor());
attachmentAtlasRegion = (AtlasRegion *) mesh->getRendererObject();
attachmentColor.set(mesh->getColor());
mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), attachmentVertices->buffer(), 0, 2);
attachmentAtlasRegion = (AtlasRegion *) mesh->getRendererObject();
attachmentIndices = mesh->getTriangles().buffer();
attachmentUvs = mesh->getUVs().buffer();
numVertices = mesh->getWorldVerticesLength() >> 1;

View File

@ -235,9 +235,9 @@ void USpineSkeletonRendererComponent::UpdateMesh(Skeleton *Skeleton) {
continue;
}
attachmentColor.set(regionAttachment->getColor());
attachmentAtlasRegion = (AtlasRegion *) regionAttachment->getRendererObject();
attachmentColor.set(regionAttachment->getColor());
regionAttachment->computeWorldVertices(*slot, *attachmentVertices, 0, 2);
attachmentAtlasRegion = (AtlasRegion *) regionAttachment->getRendererObject();
attachmentIndices = quadIndices;
attachmentUvs = regionAttachment->getUVs().buffer();
numVertices = 4;
@ -251,9 +251,9 @@ void USpineSkeletonRendererComponent::UpdateMesh(Skeleton *Skeleton) {
continue;
}
attachmentColor.set(mesh->getColor());
attachmentAtlasRegion = (AtlasRegion *) mesh->getRendererObject();
attachmentColor.set(mesh->getColor());
mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), attachmentVertices->buffer(), 0, 2);
attachmentAtlasRegion = (AtlasRegion *) mesh->getRendererObject();
attachmentIndices = mesh->getTriangles().buffer();
attachmentUvs = mesh->getUVs().buffer();
numVertices = mesh->getWorldVerticesLength() >> 1;