[ts] Port of 0e16ef9c, 409bf9d6.

Added DrawOrderFolderTimeline.
Fixed AnimationStateTests for discarding a never applied entry.
This commit is contained in:
Davide Tantillo 2026-03-16 11:19:27 +01:00
parent 7f24ed23af
commit 000a1882b9
2 changed files with 16 additions and 2 deletions

View File

@ -1139,9 +1139,9 @@ export class EventQueue {
this.drainDisabled = true; this.drainDisabled = true;
const listeners = this.animState.listeners; const listeners = this.animState.listeners;
const objects = this.objects;
for (let i = 0; i < objects.length; i += 2) { for (let i = 0; i < this.objects.length; i += 2) {
const objects = this.objects;
const type = objects[i] as EventType; const type = objects[i] as EventType;
const entry = objects[i + 1] as TrackEntry; const entry = objects[i + 1] as TrackEntry;
switch (type) { switch (type) {

View File

@ -32,6 +32,7 @@ import type { BoneData } from "./BoneData.js";
import type { ConstraintData } from "./ConstraintData.js"; import type { ConstraintData } from "./ConstraintData.js";
import type { EventData } from "./EventData.js"; import type { EventData } from "./EventData.js";
import type { Skin } from "./Skin.js"; import type { Skin } from "./Skin.js";
import { SliderData } from "./SliderData.js";
import type { SlotData } from "./SlotData.js"; import type { SlotData } from "./SlotData.js";
/** Stores the setup pose and all of the stateless data for a skeleton. /** Stores the setup pose and all of the stateless data for a skeleton.
@ -143,6 +144,19 @@ export class SkeletonData {
return null; return null;
} }
/** Collects animations used by {@link SliderData slider constraints}.
* <p>
* Slider animations are designed to be applied by slider constraints rather than on their own. Applications that have a user
* choose an animation may want to exclude them. */
findSliderAnimations (animations: Animation[]): Animation[] {
const constraints = this.constraints;
for (let i = 0, n = this.constraints.length; i < n; i++) {
const data = constraints[i];
if (data instanceof SliderData && data.animation != null) animations.push(data.animation);
}
return animations;
}
/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to /** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to
* call it multiple times. * call it multiple times.
* @returns May be null. */ * @returns May be null. */