pixijs / spine

Pixi.js plugin that enables Spine support.
Other
564 stars 217 forks source link

skinned attachments switched during animation get transforms too late causing flashes on screen #421

Open Friksel opened 2 years ago

Friksel commented 2 years ago

After hours of trying to debug this unfortunately I can only come to the conclusion there is an issue in pixi-spine that is causing the following:

Having an animation, created in Spine editor, which switches a skinned mouth slot's placeholders to lip sync. There are multiple skins which are using the same mouth images, but have different transforms (translate, rotate, scale) to fit the mouth on the chosen character.

When running the animation with pixi-spine everything is okay.

The issue happens when switching to another skin:

I tried everything. And I mean EVERYTHING. But it seems to be impossible to get this behaviour straight, meaning the same as in the Spine editor.

I tried setting the positions one by one after loading a new skin, I've tried setting to setuppose after switching skin etc. etc. But it all doesn't seem to have ANY effect in pixi-spine as it seems pixi-spine only allows us to set or update transforms on attachments only if they are currently selected and shown on screen. But that's exactly the problem; when they are on screen it's too late.

If somebody has a workaround for this I'm open to suggestions, but after hours and hours of trying to get this to work, to work around this issue, I have to give up. Unfortunately it looks impossible to do with pixi-spine at the moment without a change in the lib itself :(

Solution

IMO the solution is in pixi-spine; when switching a skin it should make sure all (skinned) attachments have the right transform, also the ones that aren't currently selected and so not visible. Another solution would be to apply transforms to an attachment/placeholder BEFORE making them visible when switching to another placeholder/attachment.

ivanpopelyshev commented 2 years ago

Make minimal reproduction and ask at https://github.com/pixijs/pixijs/discussions to investigate it? Also if its transform issue, it should be easily fixable.

Btw did you try official runtime spine-ts, it works there, right?

Friksel commented 2 years ago

Btw did you try official runtime spine-ts, it works there, right?

"My car has a shortcut in the circuit board" "Did you ask other car brands if they too have a shortcut in their circuit boards?"