ryf9059

When making an animation sometimes one needs to have an animation fliped on x/y axis. For example walking left and riight requires that same animation but flipped. Does Spine support skeleton and image flipping?
ryf9059

Kickstarter Backer
  • 帖子: 91

Jap

Yes, you can flip the skeleton in code by using appropriate flipX or flipY functions on the skeleton object.
Jap
  • 帖子: 9

ryf9059

Jap 写道:Yes, you can flip the skeleton in code by using appropriate flipX or flipY functions on the skeleton object.
Can I flip it in the spine editor? I want to actually see it in the editor because I might do some image slot change based on the movement that is different from the origianal one.
ryf9059

Kickstarter Backer
  • 帖子: 91

Nate

No, you currently can't flip in the editor.
头像
Nate

Nate
  • 帖子: 12144

ryf9059

Nate 写道:No, you currently can't flip in the editor.
Will spine support this in the future?
ryf9059

Kickstarter Backer
  • 帖子: 91

Nate

Yes, eventually. :)
头像
Nate

Nate
  • 帖子: 12144

Litho

Sorry, but is there any more information about this feature? Does it have any priority currently, or whether it is planned to be released by christmas or sometime next year?

For game animation cycles this may not be a useful feature, but there's been many times when I needed it when animating characters on a fighting game, and currently (hence this post). Animating characters in general requires me to flip them from side to side and this feature would help greatly. :nod: Additionally the IK targest seem to work funky. :drunk:

Or otherwise does anybody have a suggestion on how to go about it currently? What's the best way to go about it? Thanks
Litho
  • 帖子: 24

Mitch

Err... what runtime are you using? The spine runtimes have a skeleton.FlipX and FlipY property that is very easy to use.
头像
Mitch

Mitch
  • 帖子: 978

Litho

I'm not doing that at runtime, I need to do it whilst animating a character in Spine. For example, making a character turn around in an animation sequence.

Usually what I do in such cases now, I create TSR keyframes for every bone and controller in a frame, and then create TSR keyframes for every bone and controller in the next, but with -1 scale. I change the former keyframes interpolation to stepped. And then there's loads of work of making it look like turning around :)
However, I did come up with an easier way to go about it! I duplicate the attached images, and set their local scale to -1. Then they have to be moved and rotated into place. When I need to flip the character's body parts, I just activate the duplicate image. Might be a good, practical solution.
Litho
  • 帖子: 24

Nate

I'd like to get to it very soon, especially since it isn't terribly hard to do. I already wrote the timelines for it, just need to add the JSON and parsing, port the timelines to all runtimes, and add the UI in Spine.
头像
Nate

Nate
  • 帖子: 12144

Pharan

A FlipX Timeline. Intriguing.
头像
Pharan
  • 帖子: 5366

Litho

Can someone explain why scaling the root bone from 1;1 to -1;1 messes up the positions and rotations of all the children bones? Why doesn't it just... "FlipX"?
Litho
  • 帖子: 24

Nate

The forum has a lot of information, please use the search.
viewtopic.php?p=7456#p7456

---

2.0.18 is now up, has keyable flip x/y. spine-libgdx, spine-csharp, and spine-c have been updated. spine-as3 will be updated today. Select the skeleton in the tree to flip it.
头像
Nate

Nate
  • 帖子: 12144

Pharan

Woo! I never thought I'd live to see this day.


There has to be a way to move these miscellaneous timelines (event, draworder, flip) to the top of the dopesheet from the bottom.
头像
Pharan
  • 帖子: 5366

Mitch

Pharan 写道:Woo! I never thought I'd live to see this day.
I updated the spine-unity.unitypackage too
头像
Mitch

Mitch
  • 帖子: 978

Pharan

I just read the code in the Animation class.
Wouldn't this break the code that's making your character logically face left or right? 'cause if the character was flipped to begin with, the values it would need to apply should be the opposite. I originally imagined a second flip value that would be XORed with skeleton.flipX
头像
Pharan
  • 帖子: 5366

Jaf

Nate 写道:2.0.18 is now up, has keyable flip x/y
Thank you so much :yes:
Jaf
  • 帖子: 39

Nate

Pharan 写道:Woo! I never thought I'd live to see this day.
That's what you get for not giving your input all this time!

---

2.0.19 changes flip timelines. The skeleton can no longer be flipped in the editor, but any bone can be flipped. This flipping uses the world axes, not the bone's local axes, because it simplifies the work/math that needs to be done to update the world transform for bones.
头像
Nate

Nate
  • 帖子: 12144

mfedorov

Nate, flip is awesome! runtime support this?
头像
mfedorov
  • 帖子: 287

Pharan

Just tried it. It works better than what I thought your description meant. yay!

(Is Spineboy spinning clockwise or counterclockwise?)
头像
Pharan
  • 帖子: 5366

Nate

Great!

spine-libgdx, spine-csharp, spine-c and the runtimes that use those support it so far.
头像
Nate

Nate
  • 帖子: 12144

MrHoot

Awesome ! Oh man this is gonna help so much for our character, since we often had to flip his weapon and arms depending on his orientation
MrHoot
  • 帖子: 25

Mitch

Sweet now I get to find some way to un**** Skeleton Utility for Unity :(
头像
Mitch

Mitch
  • 帖子: 978

Nate

Sorry Mitch! :(
头像
Nate

Nate
  • 帖子: 12144

Mitch

Nate 写道:Sorry Mitch! :(
Yea :( Bone FlipX is not possible with Unity hierarchy :( I have no problem leaving the bones in there, but they aren't ever going to line up correctly because hierarchy mirroring via a non-local axis isn't a thing....

---

https://github.com/EsotericSoftware/spi ... s/pull/308

Grumble grumble 5 hours of work grumble.

Works. Mostly. No Flip Y but I don't care. Unity package updated too.
头像
Mitch

Mitch
  • 帖子: 978


回到 Editor