Skip to content

Commit a9f6c2a

Browse files
committed
[flutter][ios][haxe] Regenerate bindings for AnimationState/timeline API changes
1 parent 3322e6c commit a9f6c2a

103 files changed

Lines changed: 3341 additions & 1708 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎spine-flutter/lib/assets/libspine_flutter.js‎

Lines changed: 310 additions & 290 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
413 Bytes
Binary file not shown.

‎spine-flutter/lib/generated/animation.dart‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ import 'package:universal_ffi/ffi_utils.dart';
3434
import 'spine_dart_bindings_generated.dart';
3535
import '../spine_bindings.dart';
3636
import 'arrays.dart';
37-
import 'mix_blend.dart';
38-
import 'mix_direction.dart';
3937
import 'skeleton.dart';
4038

4139
/// Stores a list of timelines to animate a skeleton's pose over time.
@@ -91,18 +89,20 @@ class Animation {
9189
///
9290
/// See Timeline::apply().
9391
///
94-
/// [skeleton] The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton components the timelines may change.
95-
/// [lastTime] The last time in seconds this animation was applied. Some timelines trigger only at specific times rather than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered.
96-
/// [time] The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after this time and interpolate between the frame values. If beyond the getDuration() and loop is true then the animation will repeat, else the last frame will be applied.
97-
/// [loop] If true, the animation repeats after the getDuration().
98-
/// [events] If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines fire events.
99-
/// [alpha] 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between 0 and 1 applies values between the current or setup values and the timeline values. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layering).
100-
/// [blend] Controls how mixing is applied when alpha < 1.
101-
/// [direction] Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline.
92+
/// [skeleton] The skeleton the animation is applied to. This provides access to the bones, slots, and other skeleton components the timelines may change.
93+
/// [lastTime] The last time in seconds this animation was applied. Some timelines trigger only at discrete times, in which case all keys are triggered between lastTime (exclusive) and time (inclusive). Pass -1 the first time an animation is applied to ensure frame 0 is triggered.
94+
/// [time] The time in seconds the skeleton is being posed for. Timelines find the frame before and after this time and interpolate between the frame values.
95+
/// [loop] True if time beyond the getDuration() repeats the animation, else the last frame is used.
96+
/// [events] If any events are fired, they are added to this list. Can be NULL to ignore fired events or if no timelines fire events.
97+
/// [alpha] 0 applies setup or current values (depending on fromSetup), 1 uses timeline values, and intermediate values interpolate between them. Adjusting alpha over time can mix an animation in or out.
98+
/// [fromSetup] If true, alpha transitions between setup and timeline values, setup values are used before the first frame (current values are not used). If false, alpha transitions between current and timeline values, no change is made before the first frame.
99+
/// [add] If true, for timelines that support it, their values are added to the setup or current values (depending on fromSetup).
100+
/// [out] True when the animation is mixing out, else it is mixing in. Used by timelines that perform instant transitions.
101+
/// [appliedPose] True to modify the applied pose, else the pose is modified.
102102
void apply(Skeleton skeleton, double lastTime, double time, bool loop, ArrayEvent? events, double alpha,
103-
MixBlend blend, MixDirection direction, bool appliedPose) {
103+
bool fromSetup, bool add, bool out, bool appliedPose) {
104104
SpineBindings.bindings.spine_animation_apply(_ptr, skeleton.nativePtr.cast(), lastTime, time, loop,
105-
events?.nativePtr.cast() ?? Pointer.fromAddress(0), alpha, blend.value, direction.value, appliedPose);
105+
events?.nativePtr.cast() ?? Pointer.fromAddress(0), alpha, fromSetup, add, out, appliedPose);
106106
}
107107

108108
/// The animation's name, which is unique across all animations in the

‎spine-flutter/lib/generated/animation_state_data.dart‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import 'animation.dart';
3737
import 'skeleton_data.dart';
3838

3939
/// Stores mix (crossfade) durations to be applied when AnimationState
40-
/// animations are changed.
40+
/// animations are changed on the same track.
4141
class AnimationStateData {
4242
final Pointer<spine_animation_state_data_wrapper> _ptr;
4343

@@ -72,8 +72,9 @@ class AnimationStateData {
7272
SpineBindings.bindings.spine_animation_state_data_set_default_mix(_ptr, value);
7373
}
7474

75-
/// The mix duration to use when changing from the specified animation to the
76-
/// other, or the DefaultMix if no mix duration has been set.
75+
/// Returns the mix duration to use when changing from the specified animation
76+
/// to the other on the same track, or the DefaultMix if no mix duration has
77+
/// been set.
7778
double getMix(Animation from, Animation to) {
7879
final result =
7980
SpineBindings.bindings.spine_animation_state_data_get_mix(_ptr, from.nativePtr.cast(), to.nativePtr.cast());

‎spine-flutter/lib/generated/api.dart‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ export 'blend_mode.dart';
3737
export 'event_type.dart';
3838
export 'format.dart';
3939
export 'inherit.dart';
40-
export 'mix_blend.dart';
41-
export 'mix_direction.dart';
4240
export 'physics.dart';
4341
export 'position_mode.dart';
4442
export 'property.dart';

‎spine-flutter/lib/generated/bone.dart‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ import 'posed_active.dart';
4343
import 'skeleton.dart';
4444
import 'update.dart';
4545

46-
/// The current pose for a bone, before constraints are applied.
47-
///
48-
/// A bone has a local transform which is used to compute its world transform. A
49-
/// bone also has an applied transform, which is a local transform that can be
50-
/// applied to compute the world transform. The local transform and applied
51-
/// transform may differ if a constraint or application code modifies the world
52-
/// transform after it was computed from the local transform.
46+
/// A bone has a number of poses: - BoneData::getSetupPose(): The setup pose. -
47+
/// getPose(): The local pose. Set by animations and app code. -
48+
/// getAppliedPose(): The applied local pose. This is the local pose modified by
49+
/// constraints and app code. - The world transform on the applied pose,
50+
/// computed by Skeleton::updateWorldTransform(Physics) and
51+
/// BonePose::updateWorldTransform(Skeleton).
5352
class Bone extends PosedActive implements Posed, Update {
5453
final Pointer<spine_bone_wrapper> _ptr;
5554

‎spine-flutter/lib/generated/bone_data.dart‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ class BoneData extends PosedData {
5858
SpineBindings.bindings.spine_bone_data_dispose(_ptr);
5959
}
6060

61-
/// The index of the bone in Skeleton.Bones
61+
/// The Skeleton::getBones() index.
6262
int get index {
6363
final result = SpineBindings.bindings.spine_bone_data_get_index(_ptr);
6464
return result;
6565
}
6666

67-
/// May be NULL.
67+
/// The parent bone, or NULL if this bone is the root.
6868
BoneData? get parent {
6969
final result = SpineBindings.bindings.spine_bone_data_get_parent(_ptr);
7070
return result.address == 0 ? null : BoneData.fromPointer(result);
@@ -84,6 +84,8 @@ class BoneData extends PosedData {
8484
return Color.fromPointer(result);
8585
}
8686

87+
/// The bone icon name as it was in Spine, or empty if nonessential data was
88+
/// not exported.
8789
String get icon {
8890
final result = SpineBindings.bindings.spine_bone_data_get_icon(_ptr);
8991
return result.cast<Utf8>().toDartString();

‎spine-flutter/lib/generated/bone_pose.dart‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,18 @@ import 'physics.dart';
3838
import 'skeleton.dart';
3939
import 'update.dart';
4040

41-
/// The applied pose for a bone. This is the Bone pose with constraints applied
42-
/// and the world transform computed by Skeleton::updateWorldTransform(Physics).
41+
/// The applied local pose and world transform for a bone. This is the
42+
/// Bone::getPose() with constraints applied and the world transform computed by
43+
/// Skeleton::updateWorldTransform(Physics) and updateWorldTransform(Skeleton).
44+
///
45+
/// If the world transform is changed, call updateLocalTransform(Skeleton)
46+
/// before using the local transform. The local transform may be needed by other
47+
/// code (eg to apply another constraint).
48+
///
49+
/// After changing the world transform, call updateWorldTransform(Skeleton) on
50+
/// every descendant bone. It may be more convenient to modify the local
51+
/// transform instead, then call Skeleton::updateWorldTransform(Physics) to
52+
/// update the world transforms for all bones and apply constraints.
4353
class BonePose extends BoneLocal implements Update {
4454
final Pointer<spine_bone_pose_wrapper> _ptr;
4555

@@ -72,8 +82,8 @@ class BonePose extends BoneLocal implements Update {
7282
SpineBindings.bindings.spine_bone_pose_update(_ptr, skeleton.nativePtr.cast(), physics.value);
7383
}
7484

75-
/// Computes the world transform using the parent bone's applied pose and this
76-
/// pose. Child bones are not updated.
85+
/// Computes the world transform using the parent bone's world transform and
86+
/// this applied local pose. Child bones are not updated.
7787
///
7888
/// See World transforms in the Spine Runtimes Guide.
7989
void updateWorldTransform(Skeleton skeleton) {
@@ -82,11 +92,6 @@ class BonePose extends BoneLocal implements Update {
8292

8393
/// Computes the local transform values from the world transform.
8494
///
85-
/// If the world transform is modified (by a constraint, rotateWorld(), etc)
86-
/// then this method should be called so the local transform matches the world
87-
/// transform. The local transform may be needed by other code (eg to apply
88-
/// another constraint).
89-
///
9095
/// Some information is ambiguous in the world transform, such as -1,-1 scale
9196
/// versus 180 rotation. The local transform after calling this method is
9297
/// equivalent to the local transform used to compute the world transform, but
@@ -95,8 +100,10 @@ class BonePose extends BoneLocal implements Update {
95100
SpineBindings.bindings.spine_bone_pose_update_local_transform(_ptr, skeleton.nativePtr.cast());
96101
}
97102

98-
/// If the world transform has been modified and the local transform no longer
99-
/// matches, updateLocalTransform() is called.
103+
/// If the world transform has been modified by constraints and the local
104+
/// transform no longer matches, updateLocalTransform() is called. Call this
105+
/// after Skeleton::updateWorldTransform(Physics) before using the applied
106+
/// local transform.
100107
void validateLocalTransform(Skeleton skeleton) {
101108
SpineBindings.bindings.spine_bone_pose_validate_local_transform(_ptr, skeleton.nativePtr.cast());
102109
}
@@ -113,8 +120,7 @@ class BonePose extends BoneLocal implements Update {
113120
SpineBindings.bindings.spine_bone_pose_reset_world(_ptr, update);
114121
}
115122

116-
/// Part of the world transform matrix for the X axis. If changed,
117-
/// updateLocalTransform() should be called.
123+
/// Part of the world transform matrix for the X axis.
118124
double get a {
119125
final result = SpineBindings.bindings.spine_bone_pose_get_a(_ptr);
120126
return result;
@@ -124,8 +130,7 @@ class BonePose extends BoneLocal implements Update {
124130
SpineBindings.bindings.spine_bone_pose_set_a(_ptr, value);
125131
}
126132

127-
/// Part of the world transform matrix for the Y axis. If changed,
128-
/// updateLocalTransform() should be called.
133+
/// Part of the world transform matrix for the Y axis.
129134
double get b {
130135
final result = SpineBindings.bindings.spine_bone_pose_get_b(_ptr);
131136
return result;
@@ -135,8 +140,7 @@ class BonePose extends BoneLocal implements Update {
135140
SpineBindings.bindings.spine_bone_pose_set_b(_ptr, value);
136141
}
137142

138-
/// Part of the world transform matrix for the X axis. If changed,
139-
/// updateLocalTransform() should be called.
143+
/// Part of the world transform matrix for the X axis.
140144
double get c {
141145
final result = SpineBindings.bindings.spine_bone_pose_get_c(_ptr);
142146
return result;
@@ -146,8 +150,7 @@ class BonePose extends BoneLocal implements Update {
146150
SpineBindings.bindings.spine_bone_pose_set_c(_ptr, value);
147151
}
148152

149-
/// Part of the world transform matrix for the Y axis. If changed,
150-
/// updateLocalTransform() should be called.
153+
/// Part of the world transform matrix for the Y axis.
151154
double get d {
152155
final result = SpineBindings.bindings.spine_bone_pose_get_d(_ptr);
153156
return result;
@@ -157,7 +160,7 @@ class BonePose extends BoneLocal implements Update {
157160
SpineBindings.bindings.spine_bone_pose_set_d(_ptr, value);
158161
}
159162

160-
/// The world X position. If changed, updateLocalTransform() should be called.
163+
/// The world X position.
161164
double get worldX {
162165
final result = SpineBindings.bindings.spine_bone_pose_get_world_x(_ptr);
163166
return result;
@@ -167,7 +170,7 @@ class BonePose extends BoneLocal implements Update {
167170
SpineBindings.bindings.spine_bone_pose_set_world_x(_ptr, value);
168171
}
169172

170-
/// The world Y position. If changed, updateLocalTransform() should be called.
173+
/// The world Y position.
171174
double get worldY {
172175
final result = SpineBindings.bindings.spine_bone_pose_get_world_y(_ptr);
173176
return result;
@@ -216,9 +219,6 @@ class BonePose extends BoneLocal implements Update {
216219
}
217220

218221
/// Rotates the world transform the specified amount.
219-
///
220-
/// After changes are made to the world transform, updateLocalTransform()
221-
/// should be called on this bone and any child bones, recursively.
222222
void rotateWorld(double degrees) {
223223
SpineBindings.bindings.spine_bone_pose_rotate_world(_ptr, degrees);
224224
}

‎spine-flutter/lib/generated/clipping_attachment.dart‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class ClippingAttachment extends VertexAttachment {
5757
SpineBindings.bindings.spine_clipping_attachment_dispose(_ptr);
5858
}
5959

60+
/// Clipping is performed between the clipping attachment's slot and the end
61+
/// slot. If NULL, clipping is done until the end of the skeleton's rendering.
6062
SlotData? get endSlot {
6163
final result = SpineBindings.bindings.spine_clipping_attachment_get_end_slot(_ptr);
6264
return result.address == 0 ? null : SlotData.fromPointer(result);

‎spine-flutter/lib/generated/constraint_timeline1.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import '../spine_bindings.dart';
3535
import 'constraint_timeline.dart';
3636
import 'curve_timeline1.dart';
3737

38-
/// Base class for single-value constraint timelines.
38+
/// The base class for timelines that change 1 constraint property with a curve.
3939
abstract class ConstraintTimeline1 extends CurveTimeline1 implements ConstraintTimeline {
4040
final Pointer<spine_constraint_timeline1_wrapper> _ptr;
4141

0 commit comments

Comments
 (0)