• Bugs
  • [Starling] Clipping doesn't work

Hello,

I need two masks for an animation. As I know Spine supports only one clipping per skeleton. So I made two skeletons each has one clipping area. In the starling runtime, only one clipping plays as expected. I checked the asset in SkeletonViewer and it plays the animation correctly.

I sent the starling project and the spine project to esoteric email.

Animation assets: dewPart1, dewPart2

Thanks

Related Discussions
...

Cheers, I got the repro files. I'll post here once I found the issue.

9 días más tarde

I've found the issue, but no way to properly fix it. It seems the SWC compiler does something terrible when compiling the source files, specifically Triangulator.as and SkeletonClipping.as. These are contained in spine-as3.swc, which we compile with default compiler options in release mode. For whatever reason, the clipping starts failing when referencing these classes through spine-as3.swc.

The only working solution at the moment is to take these two files and put them in your project's src/spine/ directory, while still linking to the spine-as3.swc file.

Thanks for the investigation. I'll check the solution later.


I added spine as3/starling src to the project instead of swc and it works correctly. Magic 🙂

hello,

how can i animate the end slot in clipping in spine..

Thanks.,

Hello tenjarlaKC, I recommend modifying the draw order, as long as the starting slot and the end slot are the same what's in the middle can change. Otherwise, you could also just create a copy of the clipping and switch to that when you want to have a different clipping end.

Thanks Erikari,
modifying the draw order between starting slot and ending slot helped and it saves lots of time for me...

Thanks..

2 meses más tarde

Hi Mario,

I have found another issue with that example.
The asset "dewPart1" contains several animations: "initial.idel", "ant.walk".

If I change "ant.walk" to "initial.idel" with "skeleton.state.setAnimationByName(0, "initial.idel", true);" then the issue appears.

Any ideas?)

Could you open an issue for this? IIRC, you send the assets by email?

I opened an issue on git: [Starling] Clipping doesn't work · #1125

You are right: the as3 project and the spine project were sent on March 31. A couple of days ago I sent modified src file to reproduce the bug.

Thanks, I'll investigate!

Many thanks to Mario! He found and fixed very annoying bug with clipping. Now the animation works correctly.

Whoops, forgot to also update the forum post. The fix is in the latest 3.6, 3.7-beta branches! Thanks for reminding me!

Whoops, forgot to also update the forum post. The fix is in the latest 3.6, 3.7-beta branches! Thanks for reminding me!

un año más tarde

Something happened with those animations again)

They stopped to play correctly in the Starling runtime.
In the Spine editor dewPart1 and dewPart2 work correctly.

I downloaded the latest skeletonViewer.jar to check animations. And they also don't play.

The animation dewPart1 can't load with an exception:

com.badlogic.gdx.utils.SerializationException: Error reading animation: initial.idle
        at com.esotericsoftware.spine.SkeletonJson.readSkeletonData(SkeletonJson.java:348)
        at com.esotericsoftware.spine.SkeletonViewer.loadSkeleton(SkeletonViewer.java:207)
        at com.esotericsoftware.spine.SkeletonViewer$UI$2.changed(SkeletonViewer.java:705)
        at com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.handle(ChangeListener.java:28)
        at com.badlogic.gdx.scenes.scene2d.Actor.notify(Actor.java:188)
        at com.badlogic.gdx.scenes.scene2d.Actor.fire(Actor.java:152)
        at com.badlogic.gdx.scenes.scene2d.ui.Button.setChecked(Button.java:131)
        at com.badlogic.gdx.scenes.scene2d.ui.Button$1.clicked(Button.java:94)
        at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:88)
        at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:59)
        at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:351)
        at com.badlogic.gdx.InputMultiplexer.touchUp(InputMultiplexer.java:124)
        at com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:360)
        at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:221)
        at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:128)
Caused by: java.lang.NullPointerException
        at com.esotericsoftware.spine.SkeletonJson.readCurve(SkeletonJson.java:901)
        at com.esotericsoftware.spine.SkeletonJson.readTimeline(SkeletonJson.java:883)
        at com.esotericsoftware.spine.SkeletonJson.readAnimation(SkeletonJson.java:630)
        at com.esotericsoftware.spine.SkeletonJson.readSkeletonData(SkeletonJson.java:346)
        ... 14 more

The animation dewPart2 loads but an ant stays on an initial position and doesn't go by a curve.
I'll send animations to the Esoteric Software email.

Thanks.

@ilusha likely the version of Spine you used to export you data doesn't match the runtimes you are using. Eg, if you use the 3.8 runtimes, you must export with Spine 3.8.xx.

un mes más tarde

@ilusha I've looked into your two files. dewPart1 plays in SkeletonViewer 3.8.80 from Skeleton Viewer. I've looked at the initial.idle animation in dewPart1 in both SkeletonViewer and the editor, and they are identical. The ant doesn't move and is not visible.

dewPart2 and the ant.magnification animation also play correctly in the 3.8.80 SkeletonViewer as well as the editor. The ant is being clipped against the rain drop, and walks from left to right.

Both animations also work correctly in my Starling setup. Could you please make sure you use the latest spine-startling.swc from our spine-runtimes repository from the 3.8 branch? Note that spine-startling.swc now also includes spine-as3.swc, so you do not have to add the spine-as3.swc separately to your project! If you still have spine-as3.swc in your project, just delete it.