Skip to content

Commit 187018c

Browse files
authoredMar 10, 2025··
[Spine] Fix "Animation finished" condition (#7464)
1 parent e9c625a commit 187018c

File tree

2 files changed

+16
-31
lines changed

2 files changed

+16
-31
lines changed
 

‎Extensions/Spine/spineruntimeobject-pixi-renderer.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,14 @@ namespace gdjs {
193193
}
194194

195195
isAnimationComplete(): boolean {
196-
return this._isAnimationComplete;
196+
if (!isSpine(this._rendererObject)) {
197+
return true;
198+
}
199+
const track = this._rendererObject.state.tracks[0];
200+
if (!track) {
201+
return true;
202+
}
203+
return this._isAnimationComplete && !track.loop;
197204
}
198205

199206
getPointAttachmentPosition(

‎GDJS/tests/games/capabilities/capabilities.json

+8-30
Original file line numberDiff line numberDiff line change
@@ -5767,7 +5767,7 @@
57675767
"parameters": [
57685768
"PausedLabel",
57695769
"=",
5770-
"\"Paused: \" + RedHero.AnimationTest::AnimationPaused() + \", \" + FemalWitch.AnimationTest::AnimationPaused() + \", \" + Spine.AnimationTest::AnimationPaused()"
5770+
"\"Paused: \" + RedHero.AnimationTest::AnimationPaused() + \", \" + Spine.AnimationTest::AnimationPaused() + \", \" + FemalWitch.AnimationTest::AnimationPaused()"
57715771
]
57725772
},
57735773
{
@@ -5777,7 +5777,7 @@
57775777
"parameters": [
57785778
"EndedLabel",
57795779
"=",
5780-
"\"Ended: \" + RedHero.AnimationTest::AnimationFinished() + \", \" + FemalWitch.AnimationTest::AnimationFinished() + \", \" + Spine.AnimationTest::AnimationFinished()"
5780+
"\"Ended: \" + RedHero.AnimationTest::AnimationFinished() + \", \" + Spine.AnimationTest::AnimationFinished() + \", \" + FemalWitch.AnimationTest::AnimationFinished()"
57815781
]
57825782
}
57835783
]
@@ -18770,24 +18770,14 @@
1877018770
"events": [
1877118771
{
1877218772
"type": "BuiltinCommonInstructions::Standard",
18773-
"conditions": [
18774-
{
18775-
"type": {
18776-
"value": "AnimatableCapability::AnimatableBehavior::HasAnimationEnded"
18777-
},
18778-
"parameters": [
18779-
"Object",
18780-
"Animatable"
18781-
]
18782-
}
18783-
],
18773+
"conditions": [],
1878418774
"actions": [
1878518775
{
1878618776
"type": {
1878718777
"value": "SetReturnString"
1878818778
},
1878918779
"parameters": [
18790-
"\"true\""
18780+
"\"false\""
1879118781
]
1879218782
}
1879318783
]
@@ -18797,7 +18787,6 @@
1879718787
"conditions": [
1879818788
{
1879918789
"type": {
18800-
"inverted": true,
1880118790
"value": "AnimatableCapability::AnimatableBehavior::HasAnimationEnded"
1880218791
},
1880318792
"parameters": [
@@ -18812,7 +18801,7 @@
1881218801
"value": "SetReturnString"
1881318802
},
1881418803
"parameters": [
18815-
"\"false\""
18804+
"\"true\""
1881618805
]
1881718806
}
1881818807
]
@@ -18844,24 +18833,14 @@
1884418833
"events": [
1884518834
{
1884618835
"type": "BuiltinCommonInstructions::Standard",
18847-
"conditions": [
18848-
{
18849-
"type": {
18850-
"value": "AnimatableCapability::AnimatableBehavior::IsAnimationPaused"
18851-
},
18852-
"parameters": [
18853-
"Object",
18854-
"Animatable"
18855-
]
18856-
}
18857-
],
18836+
"conditions": [],
1885818837
"actions": [
1885918838
{
1886018839
"type": {
1886118840
"value": "SetReturnString"
1886218841
},
1886318842
"parameters": [
18864-
"\"true\""
18843+
"\"false\""
1886518844
]
1886618845
}
1886718846
]
@@ -18871,7 +18850,6 @@
1887118850
"conditions": [
1887218851
{
1887318852
"type": {
18874-
"inverted": true,
1887518853
"value": "AnimatableCapability::AnimatableBehavior::IsAnimationPaused"
1887618854
},
1887718855
"parameters": [
@@ -18886,7 +18864,7 @@
1888618864
"value": "SetReturnString"
1888718865
},
1888818866
"parameters": [
18889-
"\"false\""
18867+
"\"true\""
1889018868
]
1889118869
}
1889218870
]

0 commit comments

Comments
 (0)
Please sign in to comment.