Skip to content

Commit f16630a

Browse files
committed
[c][cpp][flutter][godot][ios] Port d463f34 and 71999c2 from libgdx
Also ports libgdx doc updates f5dea9f and 7d8c983.
1 parent 4c74097 commit f16630a

24 files changed

Lines changed: 143 additions & 22 deletions

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## C
44

55
- **Additions**
6+
- Added generated slider data `max` APIs.
67
- Added generated physics constraint `ScaleYMode` APIs.
78
- Added generated `Interpolation` and `TrackEntry` mix interpolation APIs for non-linear animation mixing.
89
- Added `spine_slider` and `spine_slider_data` types for slider constraints
@@ -13,6 +14,7 @@
1314
- Added generated animation color and bone icon size/rotation APIs.
1415

1516
- **Bug fixes**
17+
- Fixed draw order timelines not mixing out to the setup pose.
1618
- Fixed slider sorting crashes when slider animations key slot or constraint timelines.
1719
- Fixed bones that don't inherit rotation when parent scale is near zero.
1820
- Fixed `BonePose::updateLocalTransform()` for `noScale` and `noScaleOrReflection` inheritance.
@@ -98,6 +100,7 @@
98100
## C++
99101

100102
- **Additions**
103+
- Added `SliderData::getMax()` / `setMax()` for nonessential bone-driven slider metadata.
101104
- Added `PhysicsConstraintData::getScaleYMode()` / `setScaleYMode()` to control how physics scaleX affects scaleY.
102105
- Added `Interpolation` and `TrackEntry::getMixInterpolation()` / `setMixInterpolation()` for non-linear animation mixing.
103106
- Added `Slider` and `SliderData` classes for slider constraints
@@ -124,6 +127,7 @@
124127
- Added `Animation::getColor()` and `BoneData` icon size/rotation accessors for nonessential editor data.
125128

126129
- **Bug fixes**
130+
- Fixed draw order timelines not mixing out to the setup pose.
127131
- Fixed slider sorting crashes when slider animations key slot or constraint timelines.
128132
- Fixed bones that don't inherit rotation when parent scale is near zero.
129133
- Fixed `BonePose::updateLocalTransform()` for `noScale` and `noScaleOrReflection` inheritance, plus related IK epsilon handling.
@@ -293,13 +297,15 @@
293297
### Godot
294298

295299
- **Additions**
300+
- Added `SpineSliderData.get_max()` / `set_max()` for nonessential bone-driven slider metadata.
296301
- Added `SpinePhysicsConstraintData.get_scale_y_mode()` / `set_scale_y_mode()`.
297302
- Added `SpineTrackEntry` mix interpolation APIs and `SpineConstant.MixInterpolation`.
298303
- Added convex and inverse clipping support through the updated spine-cpp clipping runtime.
299304
- Added `SpineSlider` and `SpineSliderData` classes for slider constraints
300305
- Added `SpineTrackEntry.get_additive()` / `set_additive()` for additive blending per track entry.
301306

302307
- **Bug fixes**
308+
- Fixed draw order timelines not mixing out to the setup pose.
303309
- Fixed editor crashes when assigning skeleton data with slider animations that key slots or constraints.
304310
- Fixed attachment timelines so hidden setup-pose attachments remain hidden while mixing out, preserving deform behavior.
305311
- Fixed `SpineAnimationTrack` editor preview paths for nested `AnimationPlayer` roots, and prevented inactive tracks from clearing `SpineSprite` preview animations.
@@ -549,11 +555,13 @@
549555
## iOS
550556

551557
- **Additions**
558+
- Added generated slider data `max` APIs.
552559
- Added generated physics constraint `scaleYMode` APIs.
553560
- Added generated `Interpolation` and `TrackEntry` mix interpolation APIs.
554561
- Added convex and inverse clipping support through the updated spine-cpp clipping runtime.
555562

556563
- **Bug fixes**
564+
- Fixed draw order timelines not mixing out to the setup pose.
557565
- Fixed bones that don't inherit rotation when parent scale is near zero.
558566
- Fixed `BonePose.updateLocalTransform(_:)` for `noScale` and `noScaleOrReflection` inheritance.
559567
- Fixed attachment timelines so hidden setup-pose attachments remain hidden while mixing out, preserving deform behavior.
@@ -570,6 +578,7 @@
570578
## Dart
571579

572580
- **Additions**
581+
- Added generated slider data `max` APIs.
573582
- Added generated physics constraint `scaleYMode` APIs.
574583
- Added generated `Interpolation` and `TrackEntry` mix interpolation APIs.
575584
- Added `Slider` and `SliderData` classes for slider constraints
@@ -578,6 +587,7 @@
578587
- Added `Pose`, `Posed`, and `PosedActive` base classes for unified pose management
579588

580589
- **Bug fixes**
590+
- Fixed draw order timelines not mixing out to the setup pose.
581591
- Fixed bones that don't inherit rotation when parent scale is near zero.
582592
- Fixed `BonePose.updateLocalTransform()` for `noScale` and `noScaleOrReflection` inheritance.
583593
- Fixed attachment timelines so hidden setup-pose attachments remain hidden while mixing out, preserving deform behavior.
@@ -606,13 +616,15 @@
606616
### Flutter
607617

608618
- **Additions**
619+
- Added generated slider data `max` APIs.
609620
- Added generated physics constraint `scaleYMode` APIs.
610621
- Added generated `Interpolation` and `TrackEntry` mix interpolation APIs.
611622
- Added convex and inverse clipping support through the updated spine-cpp clipping runtime.
612623
- Added `fromMemory` methods to `AtlasFlutter`, `SkeletonDataFlutter`, `SkeletonDrawableFlutter`, and `SpineWidget` for loading Spine data from custom sources (memory, encrypted storage, databases, custom caching, etc.)
613624
- Added example `load_from_memory.dart` demonstrating how to load all assets into memory and use the `fromMemory` API
614625

615626
- **Bug fixes**
627+
- Fixed draw order timelines not mixing out to the setup pose.
616628
- Fixed bones that don't inherit rotation when parent scale is near zero.
617629
- Fixed `BonePose.updateLocalTransform()` for `noScale` and `noScaleOrReflection` inheritance.
618630
- Fixed attachment timelines so hidden setup-pose attachments remain hidden while mixing out, preserving deform behavior.

spine-c/src/generated/physics_constraint_data.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ SPINE_C_API void spine_physics_constraint_data_set_shear_x(spine_physics_constra
5757
SPINE_C_API float spine_physics_constraint_data_get_limit(spine_physics_constraint_data self);
5858
SPINE_C_API void spine_physics_constraint_data_set_limit(spine_physics_constraint_data self, float limit);
5959
/**
60-
* Determines how BonePose::getScaleY() changes when
61-
* PhysicsConstraintData::getScaleX() sets BonePose::getScaleX().
60+
* Determines how BonePose::getScaleY() changes when getScaleX() sets
61+
* BonePose::getScaleX().
6262
*/
6363
SPINE_C_API spine_scale_y_mode spine_physics_constraint_data_get_scale_y_mode(spine_physics_constraint_data self);
6464
SPINE_C_API void spine_physics_constraint_data_set_scale_y_mode(spine_physics_constraint_data self, spine_scale_y_mode scaleYMode);

spine-c/src/generated/slider_data.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ void spine_slider_data_set_offset(spine_slider_data self, float offset) {
9191
_self->setOffset(offset);
9292
}
9393

94+
float spine_slider_data_get_max(spine_slider_data self) {
95+
SliderData *_self = (SliderData *) self;
96+
return _self->getMax();
97+
}
98+
99+
void spine_slider_data_set_max(spine_slider_data self, float max) {
100+
SliderData *_self = (SliderData *) self;
101+
_self->setMax(max);
102+
}
103+
94104
bool spine_slider_data_get_local(spine_slider_data self) {
95105
SliderData *_self = (SliderData *) self;
96106
return _self->getLocal();

spine-c/src/generated/slider_data.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ SPINE_C_API void spine_slider_data_set_scale(spine_slider_data self, float scale
5858
*/
5959
SPINE_C_API float spine_slider_data_get_offset(spine_slider_data self);
6060
SPINE_C_API void spine_slider_data_set_offset(spine_slider_data self, float offset);
61+
/**
62+
* When a bone is set, the maximum slider time for the bone property range, or 0
63+
* if nonessential data was not exported.
64+
*/
65+
SPINE_C_API float spine_slider_data_get_max(spine_slider_data self);
66+
SPINE_C_API void spine_slider_data_set_max(spine_slider_data self, float max);
6167
/**
6268
* When true and a bone is set, the bone's local transform property is read
6369
* instead of its world transform.

spine-c/src/generated/track_entry.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ SPINE_C_API void spine_track_entry_set_track_time(spine_track_entry self, float
8181
* animation are set to the setup pose and the track is cleared.
8282
*
8383
* It may be desired to use AnimationState::addEmptyAnimation(int, float, float)
84-
* rather than have the animation abruptly cease being applied.
84+
* rather than have the animation abruptly cease being applied, leaving the
85+
* current pose.
8586
*/
8687
SPINE_C_API float spine_track_entry_get_track_end(spine_track_entry self);
8788
SPINE_C_API void spine_track_entry_set_track_end(spine_track_entry self, float inValue);

spine-cpp/include/spine/AnimationState.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ namespace spine {
159159
/// properties keyed by the animation are set to the setup pose and the track is cleared.
160160
///
161161
/// It may be desired to use AnimationState::addEmptyAnimation(int, float, float) rather than have the animation
162-
/// abruptly cease being applied.
162+
/// abruptly cease being applied, leaving the current pose.
163163
float getTrackEnd();
164164

165165
void setTrackEnd(float inValue);

spine-cpp/include/spine/PhysicsConstraintData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace spine {
8585
float getLimit();
8686
void setLimit(float limit);
8787

88-
/// Determines how BonePose::getScaleY() changes when PhysicsConstraintData::getScaleX() sets BonePose::getScaleX().
88+
/// Determines how BonePose::getScaleY() changes when getScaleX() sets BonePose::getScaleX().
8989
ScaleYMode getScaleYMode();
9090
void setScaleYMode(ScaleYMode scaleYMode);
9191

spine-cpp/include/spine/SliderData.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ namespace spine {
8787
float getOffset();
8888
void setOffset(float offset);
8989

90+
/// When a bone is set, the maximum slider time for the bone property range, or 0 if nonessential data was not exported.
91+
float getMax();
92+
void setMax(float max);
93+
9094
/// When true and a bone is set, the bone's local transform property is read instead of its world transform.
9195
bool getLocal();
9296
void setLocal(bool local);
@@ -99,6 +103,7 @@ namespace spine {
99103
FromProperty *_property;
100104
float _offset;
101105
float _scale;
106+
float _max;
102107
bool _local;
103108
};
104109
}

spine-cpp/src/spine/AnimationState.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,16 +981,16 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton) {
981981
for (size_t i = 0; i < timelineCount; i++) {
982982
Timeline *timeline = timelines[i];
983983
int mode = timelineMode[i];
984+
bool fromSetup = (mode & First) != 0;
984985
float alpha;
985986
if ((mode & Hold) != 0) {
986987
TrackEntry *holdMix = timelineHoldMix[i];
987988
alpha = holdMix == NULL ? alphaHold : alphaHold * (1 - holdMix->mix());
988989
} else {
989-
if (!drawOrder && timeline->getRTTI().isExactly(DrawOrderTimeline::rtti)) continue;
990+
if (!drawOrder && timeline->getRTTI().isExactly(DrawOrderTimeline::rtti) && !fromSetup) continue;
990991
alpha = alphaMix;
991992
}
992993
from->_totalAlpha += alpha;
993-
bool fromSetup = (mode & First) != 0;
994994
if (!shortestRotation && timeline->getRTTI().isExactly(RotateTimeline::rtti)) {
995995
applyRotateTimeline((RotateTimeline *) timeline, skeleton, applyTime, alpha, fromSetup, timelinesRotation, i << 1, firstFrame);
996996
} else if (timeline->getRTTI().isExactly(AttachmentTimeline::rtti)) {

spine-cpp/src/spine/SkeletonBinary.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,13 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons
406406
data->_loop = (flags & 2) != 0;
407407
data->_additive = (flags & 4) != 0;
408408
SliderPose &setup = data->_setupPose;
409-
if ((flags & 8) != 0) setup._time = input.readFloat();
409+
if ((flags & 8) != 0) {
410+
float value = input.readFloat();
411+
if (nonessential && (flags & 64) != 0)
412+
data->_max = value;
413+
else
414+
setup._time = value;
415+
}
410416
if ((flags & 16) != 0) setup._mix = (flags & 32) != 0 ? input.readFloat() : 1;
411417
if ((flags & 64) != 0) {
412418
data->_local = (flags & 128) != 0;

0 commit comments

Comments
 (0)