From 81708ebb0d0133c4953b6025cdb46db35457ca26 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 15 Sep 2022 11:33:41 +0200 Subject: [PATCH 1/2] [unity] Call computeWorldVertices before accessing region uvs in SkeletonBaker. Fix only for cosmetic reasons, SkeletonBaker doesn't map sequence functionality to Unity skeletal animation. See #2154. --- .../Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs index 012c53a37..c1045d922 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs @@ -513,9 +513,9 @@ namespace Spine.Unity.Editor { bone.UpdateWorldTransform(); - Vector2[] uvs = ExtractUV(attachment.UVs); float[] floatVerts = new float[8]; attachment.ComputeWorldVertices(slot, floatVerts, 0); + Vector2[] uvs = ExtractUV(attachment.UVs); Vector3[] verts = ExtractVerts(floatVerts); //unrotate verts now that they're centered @@ -550,9 +550,9 @@ namespace Spine.Unity.Editor { slot.Bone.Y = 0; slot.Bone.UpdateWorldTransform(); - Vector2[] uvs = ExtractUV(attachment.UVs); float[] floatVerts = new float[attachment.WorldVerticesLength]; attachment.ComputeWorldVertices(slot, floatVerts); + Vector2[] uvs = ExtractUV(attachment.UVs); Vector3[] verts = ExtractVerts(floatVerts); int[] triangles = attachment.Triangles; @@ -617,7 +617,6 @@ namespace Spine.Unity.Editor { float[] floatVerts = new float[attachment.WorldVerticesLength]; attachment.ComputeWorldVertices(skeleton.Slots.Items[slotIndex], floatVerts); - Vector2[] uvs = ExtractUV(attachment.UVs); Vector3[] verts = ExtractVerts(floatVerts); From aeacf6e5028c25a2f34a9718f2d677cda6de6a70 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 21 Sep 2022 13:19:35 +0200 Subject: [PATCH 2/2] [c] Closes #2156, incorrect timeline type check. --- spine-c/spine-c/src/spine/AnimationState.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-c/spine-c/src/spine/AnimationState.c b/spine-c/spine-c/src/spine/AnimationState.c index 2ff7f484c..23375ac96 100644 --- a/spine-c/spine-c/src/spine/AnimationState.c +++ b/spine-c/spine-c/src/spine/AnimationState.c @@ -438,7 +438,7 @@ int spAnimationState_apply(spAnimationState *self, spSkeleton *skeleton) { if (!shortestRotation && timeline->type == SP_TIMELINE_ROTATE) _spAnimationState_applyRotateTimeline(self, timeline, skeleton, applyTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame); - else if (timeline->type == SP_TIMELINE_ROTATE) + else if (timeline->type == SP_TIMELINE_ATTACHMENT) _spAnimationState_applyAttachmentTimeline(self, timeline, skeleton, applyTime, timelineBlend, -1); else spTimeline_apply(timeline, skeleton, animationLast, applyTime, applyEvents, &internal->eventsCount,