ManInCool

Hi!

I have a few questions about mirroring movement.

If you have a look at these 2 examples:




You can see that the two characters are not symmetrical, because of lighting from the side, or the eye patch, etc.

So in cases like that, if I want to create a left and right view of an animation, flipping the animation would not work.


What tools does Spine currently have for mirroring (and possibly mirroring movement and keys without mirroring the image)?

After doing some research, the only option I found for complete mirroring is to place all bones of the character under a parent bone, and then scale the x value of that parent bone to -1.
Are there more options?

Also, regarding that option, when I do that in the "spineboy-pro" sample project that comes with spine, everything gets mirrored except the top part of the shoes. Why is that? If it's due to a restraint how would I avoid that problem?


(all bones are parented by the -1 x scaled bone "bone 25"):
Avatar
ManInCool
  • Postovi: 37

Erika

Hello ManInCool,

Your approach is generally correct!
ManInCool je napisao/la:when I do that in the "spineboy-pro" sample project that comes with spine, everything gets mirrored except the top part of the shoes.
That's because the shoe bones have inheritance of properties disabled, so they have to be mirrored too separately.

You can find a downloadable example of mirrored character with asymmetrical elements here:
https://www.youtube.com/watch?list=PLwGl7Ikd_6GTpd2PnWqqIZVsqotxtrtaE&v=WVLZCfitpdE
Spine: Twitch

(look for the t-shirt)

Basically, the options are to either flip the skeleton manually and unmirror the part that would be in reverse, or draw alternative parts just for the elements that don't mirror and activate the correct one in the required animations.
Avatar
Erika

Erikari
  • Postovi: 3082

ManInCool

Hello Erika,

thank you for the tips and information.

For the last part you said: yes, that made me think that I could first create all my image parts mirrored in an external graphics program (I'm dealing with shadow from the side in my graphics, which makes them assymetrical). After that I replace all the original image parts with the mirrored images. And after that, once I mirror the bones with the movement, the image is basically not mirrored anymore (because I double mirrored them), but the movement is.

I will come back here in some time with a suggestion I'd like to make about mirroring.
Avatar
ManInCool
  • Postovi: 37

Boscoe

I wouldn't actually mirror the images in the external program, I'd make a copy and keep them oriented the same, just move the lighting to the other side. Then I would have the game code handle the rig mirroring and swapping the images based on which direction the character is facing rather than doing it in Spine.
Boscoe
  • Postovi: 7

ManInCool

Hi Boscoe,
how are you suggesting to 'move the light to the other side' if not by mirroring the graphics externally?
Avatar
ManInCool
  • Postovi: 37

Boscoe

By drawing the shadow on the opposite side. Simply mirroring the art doesn't actually change anything, that's no different than if you didn't flip the art and just let it flip with the rig. If your character is asymmetrical, then the left view looks different than the right view. So instead of making art for the other view facing the opposite direction, just leave the art facing the SAME direction, but with the details changed to reflect how the other side would look. Then, in your game code, just change which version is visible depending on which direction the character is facing. Then everything flips together rather than trying to create pre-flipped art.

See what I'm saying? You have two matching sets of art assets, all facing the same direction, but in one version the shadow is on one side and in the other it's on the opposite side. And your code just toggles which version is visible, based on which direction the rig is currently facing.

Boscoe
  • Postovi: 7

ManInCool

Yeah that is what I suggested.
Avatar
ManInCool
  • Postovi: 37


Natrag na Editor