spine icon indicating copy to clipboard operation
spine copied to clipboard

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

Open Friksel opened this issue 3 years ago • 2 comments

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:

  • The currently selected mouth placeholder gets the right transform values
  • When starting a lipsync animation (which only switches to another placeholder for the mouth on timed moments) every new mouth shape is first shown and only after that the transform is set. This is causing the mouth to flash from the old position (the one of the previously selected skin) to the new position (the one of the currently selected 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.

Friksel avatar Nov 28 '21 12:11 Friksel

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?

ivanpopelyshev avatar Nov 28 '21 12:11 ivanpopelyshev

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?"

Friksel avatar Nov 29 '21 13:11 Friksel