-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TrackEntry.animation is null on all events #394
Comments
Yeah, seems like new pixi-spine is not backward compatible, i.e ITrackEvent doesn't have 'listeners' field too. |
probably a bug |
those interfaces are common part of all spine runtimes. If you want to see some extra fields there and you are sure they are the same in all runtimes (37, 38, 40) please tell me their exact types. I guess i can make it for listeners, but not for |
Hi @ivanpopelyshev I had to put migration on hold because I found more issues with compatibility and had to switch to other tasks. But i'm on migration again so will try to go through differences this week and give you followup or even create pull requests. |
Please describe them? |
@ivanpopelyshev and @gprzybylowicz I've had a similar issue with things missing from the ITrackEntry interface that used to be accessible so thought I'd try and put this together for you. Looking at the runtimes for 3.7, 3.8 and 4.0 this seems to be all the shared items in TrackEntry. animation: Animation;
next: TrackEntry;
mixingFrom: TrackEntry;
mixingTo: TrackEntry;
listener: AnimationStateListener | AnimationStateListener2;
trackIndex: number;
loop: boolean;
holdPrevious: boolean;
eventThreshold: number;
attachmentThreshold: number;
drawOrderThreshold: number;
animationStart: number;
animationEnd: number;
animationLast: number;
nextAnimationLast: number;
delay: number;
trackTime: number;
trackLast: number;
nextTrackLast: number;
trackEnd: number;
timeScale: number;
alpha: number;
mixTime: number;
mixDuration: number;
interruptAlpha: number;
totalAlpha: number;
mixBlend: MixBlend;
timelineMode: Array<number>;
timelineHoldMix: Array<TrackEntry>;
timelinesRotation: Array<number>;
reset (): void;
getAnimationTime (): number;
setAnimationLast(animationLast: number): void;
isComplete (): boolean;
resetRotationDirections (): void; Is this what you were after? export declare interface ITrackEntry {
trackIndex: number;
loop: boolean;
delay: number;
trackTime: number;
trackLast: number;
nextTrackLast: number;
trackEnd: number;
timeScale: number;
alpha: number;
mixTime: number;
mixDuration: number;
interruptAlpha: number;
totalAlpha: number;
} |
Those are just quick findings based on transpilation errors right after installing newest version of pixi-spine:
All those properties/methods were there before, in ver 2.1.11. |
new version of pixi-spine supports all spine runtimes, 3.7 3.8 and 4.0 Its not possible to add 2,3,4 to it because those types are different across spine versions, and its too much to make generics out of it. If you want to work with 3.8, use as for 1. i can look |
Just focusing on 4 for a moment (ITrackEntry) how is it not possible to add at least In the post above I listed all the properties that are shared across 3.7, 3.8 and 4.0 and those 2 are included, they all have the same types as well. I got that list by comparing the 3 versions on github at these links (3.7, 3.8 and 4.0). Am I looking in the wrong place or is there something else I'm not taking into consideration? There are still examples in the pixi-spine docs here that show to use listener from the ITracksEntry interface, which may need updating if that's not possible. |
because there are three types: If you need only 4.0, just use |
I've personally not attempted to use So if you're saying that being able to use shared properties like |
It has full capacity, because runtimes are separated. The downside is that types of different runtimes are not compatble, so I added interfaces in full version so i can work on them slowly, your input about TrachEntry is really appreciated! Full version works with any model version. The first thing people encounter when they try spine is that the models from tutorials in internet all have different version. I'm just tired of all the newbies. Also, in case user doesnt know what types are - it works fine :) |
Using |
Actually i dont know . Maybe copying file https://github.com/pixijs/spine/blob/master/bundles/all-3.8/src/index.ts into your project and adding corresponding deps is enough? I'm not webpack master :( |
No problem. |
hm, in pixijs target is es5. Maybe i should use it too |
That would be awesome. However I wanted to change it on my own and push to my private npm as temp solution to proceed with migration but seems like my changes in tsconfig.json are not taken into consideration by build scripts and still see es6 code in output in /lib dir. @ivanpopelyshev any tips what else should be changed to build es5? I guess it's somehow connected with rollup here. |
Oh, right, its built with surcase: https://github.com/ShukantPal/pixi-build-tools/blob/df849b5625410d47fbe6fa6e0e579f0bddf84d0d/packages/rollup-configurator/main.js#L51 , i honestly dont know how to make different setting for it Here I have modified rollup config for pixi-picture, it uses |
Ok, i see. Never worked with surcase but seems like it's meant to be for developement builds only so I guess it has to be it :) |
Hi @ivanpopelyshev I managed to do it but I had to copy entire rollup config(did it as separate package). |
I have pixi-spine but it does not have the IAnimation interface on ITrackEntry? |
These functions work, but typescript says it's not ok Property 'animation' does not exist on type 'ITrackEntry'
|
I'd like to filter by the animation name, but I can't since when "end" event comes, there's no value for animation property.
Steps to reproduce:
Expected
entry.animation is not null
Actual
entry.animation is null
Versions
pixi-spine: ^3.0.1
pixi.js: ^6.0.4
The text was updated successfully, but these errors were encountered: