playcanvas-spine
playcanvas-spine copied to clipboard
Plugin for version 4.2 is not working
Description
As title says, the plugin for spine 4.2 is not working, it throws an error "physics is undefined".
Any updates on this? I would really like to use the spine integration in my upcoming workflows. I've also created an forum post including a test project, see: https://forum.playcanvas.com/t/spine-js-integration-current-workflow-and-example-needed/39374
Thanks for flagging. I can't see a physics issue in that repro. Is it missing a branch?
related forum thread: https://forum.playcanvas.com/t/spine-js-integration-current-workflow-and-example-needed/39374
I tried running 4.2 (fork of the project: https://playcanvas.com/editor/scene/2200037)
and get the physics is undefined error as well.
Looking here - it seems spine 4.2 adds support for the physics, and that is something that needs to be added here to the wrapper. A quick look on where to get this physics from didn't get me any insights, so I'm not sure what needs to be done.
In the meantime, please use spine 4.1. I've also seemed some note somewhere that spine editor 4.2 can be used as well, and expose 4.1 compatible json files, as long as no new features (physics, maybe others) are not used.
I'm currently struggling with this. I tried exporting 4.1 compatible JSON from editor 4.2, but there seems to be an issue with the way the skeleton is evaluated. When exported as 4.1, the skeleton version listed will be 4.1.0, which will then fail this check:
this._spine_3_6_0 = semver.satisfies(this.skeletonVersion, '<=3.6.0');
this._spine_3_7_99 = semver.satisfies(this.skeletonVersion, '<=3.7.99');
this._spine_4_0_X = semver.satisfies(this.skeletonVersion, '~4.0.0');
this._spine_4_1_X = semver.satisfies(this.skeletonVersion, '~4.1.23'); // <------
Then reverting to the 3.7.99 system, well cause bones to be accessed incorrectly. ~~Manually changing the check back down to 4.1.0 will get the spine animation showing, but I'm noticing a weird behavior when the sprite appears to be rotated about 45 degrees:~~
~~and moving the image on the x + y axes makes it seem like the coordinate system might not match perfectly:~~
~~I'm going to go back and try version 4.0, but I take it, the current advice is still to use 4.1 instead of 4.2? Unfortunately, these were purchased assets, so I can't really go back in time with the project version, only the export version.~~
Nevermind the warping That was my own fault. 4.1 will work if the check for the version is updated to 4.1.0 instead of requiring 4.1.23. This will allow for exports from later editor versions.
Hi @eproasim - @mvaligursky is currently on vacation, but he should be able to respond later this week when he's back in the office.