- Изменено
Best practice for creating animation variants w/ Pixel Art
Hi,
I am working on a mix-and-match Pixel Art character, compiled in parts (head, chest, legs, right hand, left hand...etc) that is animated in 4 directions. I currently have 8 animations (walk and idle in each of the directions).
I'm trying to figure out the best way to add an alternative walking animation where the character is holding an item, with his hands, above his head.
Is it best practice to create 8 additional "duplicate" animations to achieve this? or is there some better way like creating an additional bone/slot/skin on the existing animations and simply hiding/showing the appropriate arms?
Creating an additional slot may work but I'm not sure if there is a way to hide a slot... and I wouldn't be able to hide an attachment because those same attachments are used for both arms/hands (walking and carrying).
I do plan on having other options like the character holding a Shield or Waving... so I'm not sure how scaleable creating additional animations would be since I want the animations to be playable while Walking and Idling.
Hoping someone can share some ideas!
Here's an example of the character holding something... I created an additional right_arm_holding and right_hand_holding slot and was planning to hide this some how but I've had no luck.
Thanks in advance,
Adrian
Hi, Adrian!
I am a pixel artist trying to solve this exact same situation. Hopefully you figured something out by now, but wanted to post my approach to help any other lost pixel artists who find this thread.
I don't know if this is "best practice", and requires you to be able to display multiple tracks of animation at once in your game, but here is what I did:
During setup you only need one slot for each arm. I was making the same mistake as you when I was first setting up my project, before realizing different slots' visibility cannot be toggled to switch between the arm positions... well it probably can, somehow, but I don't think it's the intended workflow.
If you have arm frames that you switch between but would never display at the same time, it makes most sense for all of them to be hooked into the same arm slot.Create your idle, walk, run, etc animations as normal. (in both of our cases, this involves a lot of switching between frames of animation for each body part.)
If the arms need to move up and down as the character moves, make sure this motion isn't baked into the image assets you're inputting into Spine, but instead that there is an arm bone actually controlling the up and down motion.Now, make your arms-only animations.
These are going to be animations that you can mix-and-match with the others.
Do not keyframe anything to do with the body, legs, or head, these animations should only be concerned with the arms themselves.
I also completely avoid keyframing any translation with these, because I haven't figured out any way to make that interact nicely with the positions set by the other, base animations.
here's the important part... the only thing I keyframed in the arms-only animations are frame changes.You should now be able to see how the arms-only animations combine with the others!
a) In setup mode, open up a Preview panel (Views -> Preview)
b) Track 0 is going to be your base animation (eg, walk), so set that to whatever you want to see.
c) oh and set the Mix slider to 0, we're making pixel perfect animations so we don't want to see any mixing between animations.
d) go to Track 1, set Mix to 0 there, too, and select your alternate arm animation!
e) when you don't want to have Track 1 active anymore, you can right click to disable it.
So when you do this, the arms' position should move up and down according to arm bone keyframes set in your walk animation, but instead of the walk animation arm frames you should be able to see whatever other arm frames you have set up in your arms-specific animation.
I hope this helps someone, somewhere, and isn't a totally illegal use of Spine.
You can add bones to skins, which will make any slots attached to that bone also part of the skin, so having a skin for "arms up" and another for "arms down" might work.
In my case I need to use skins for character customization, so I assume I can't do it this way unless I want to make arms-down and arms-up skins for every kind of player base and shirt, but this sounds like a super interesting solution!