From a5b67629c898787a923fd88b0c6e0b4324df1556 Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Wed, 26 Jan 2022 09:39:15 -0400 Subject: [PATCH 1/3] [libgdx] Fixed additive scaling mixing. Fixes: http://esotericsoftware.com/forum/Mixing-two-animations-on-additive-track-problem-16953 Problem was introduced by f4021177f9bc71af93509763232b2401589f7acf which tried to fix: http://esotericsoftware.com/forum/About-negative-bone-scale-Web-Player-16410 --- .../src/com/esotericsoftware/spine/Animation.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java index d14a13823..3079b3f67 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java @@ -739,8 +739,8 @@ public class Animation { bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha; break; case add: - bone.scaleX = (x - bone.data.scaleX) * alpha; - bone.scaleY = (y - bone.data.scaleY) * alpha; + bone.scaleX += (x - bone.data.scaleX) * alpha; + bone.scaleY += (y - bone.data.scaleY) * alpha; } } else { switch (blend) { @@ -818,7 +818,7 @@ public class Animation { bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bx) * alpha; break; case add: - bone.scaleX = (x - bone.data.scaleX) * alpha; + bone.scaleX += (x - bone.data.scaleX) * alpha; } } else { switch (blend) { @@ -891,7 +891,7 @@ public class Animation { bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha; break; case add: - bone.scaleY = (y - bone.data.scaleY) * alpha; + bone.scaleY += (y - bone.data.scaleY) * alpha; } } else { switch (blend) { From 4cbae2411a17bcb3a7c7bfb1fc833783de49030d Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 20 Jan 2022 13:50:01 +0100 Subject: [PATCH 2/3] [unity] Minor: removed a commented-out leftover line of code. --- spine-csharp/src/Skeleton.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/spine-csharp/src/Skeleton.cs b/spine-csharp/src/Skeleton.cs index ca66eedc7..2274f75a7 100644 --- a/spine-csharp/src/Skeleton.cs +++ b/spine-csharp/src/Skeleton.cs @@ -28,7 +28,6 @@ *****************************************************************************/ using System; -using System.Collections.Generic; namespace Spine { public class Skeleton { @@ -122,7 +121,6 @@ namespace Spine { pathConstraints.Add(new PathConstraint(pathConstraintData, this)); UpdateCache(); - //UpdateWorldTransform(); } /// Caches information about bones and constraints. Must be called if the is modified or if bones, constraints, or From f5f91899f42651e24c2a94f95eec5cf4a08c1d29 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 26 Jan 2022 15:24:39 +0100 Subject: [PATCH 3/3] [csharp] Port fix of additive scale mixing. See #2028, see commit a5b6762. --- spine-csharp/src/Animation.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-csharp/src/Animation.cs b/spine-csharp/src/Animation.cs index c4dc2c5cf..7529888f4 100644 --- a/spine-csharp/src/Animation.cs +++ b/spine-csharp/src/Animation.cs @@ -773,8 +773,8 @@ namespace Spine { bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - by) * alpha; break; case MixBlend.Add: - bone.scaleX = (x - bone.data.scaleX) * alpha; - bone.scaleY = (y - bone.data.scaleY) * alpha; + bone.scaleX += (x - bone.data.scaleX) * alpha; + bone.scaleY += (y - bone.data.scaleY) * alpha; break; } } else { @@ -856,7 +856,7 @@ namespace Spine { bone.scaleX = bx + (Math.Abs(x) * Math.Sign(bx) - bx) * alpha; break; case MixBlend.Add: - bone.scaleX = (x - bone.data.scaleX) * alpha; + bone.scaleX += (x - bone.data.scaleX) * alpha; break; } } else { @@ -933,7 +933,7 @@ namespace Spine { bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - by) * alpha; break; case MixBlend.Add: - bone.scaleY = (y - bone.data.scaleY) * alpha; + bone.scaleY += (y - bone.data.scaleY) * alpha; break; } } else {