diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp index 4a845f1f1..2b0fb3381 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp @@ -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; diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp index 7b9eeedba..fbf2ad5cc 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp @@ -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;