reuno

Hi,

I'm still learning Spine these days, so this might be a stupid question, but here it is :
I have a character with a weapon. The weapon has a 0 opacity on most animations, and a 1 opacity when shooting.
This works great in Spine, I only see the weapon when playing the shoot animation.
When I import the data in Unity, and create my character using the "instanciate skeleton animation" method, everything's great, the weapon is only visible when needed.
If I bake that same skin however, the weapon is always visible. Now I could hide it in code, but is this the expected behavior ?
reuno
  • Posts: 8

Mitch

Doesn't support color keys :( sorry.
User avatar
Mitch
  • Posts: 978

reuno

Ok, I was wondering what I got wrong. Is this something that will happen someday, or shouldn't I wait for it ?
reuno
  • Posts: 8

Pharan

It will only happen if Unity supports it. And there hasn't been any word on that, I think. So I wouldn't count on it.

If you're only hiding and showing the weapon, you should be setting an attachment/slot key, not a slot color key: http://esotericsoftware.com/spine-key-f ... ttachments

That will work fine in baked-Unity.

It wasn't the best way to do it anyway. Even if the opacity is 0, it's still being rendered. If you do this to a lot of things, it'll slow down the game.
User avatar
Pharan
  • Posts: 5366

reuno

@Pharan > indeed, this seems much cleaner. Thanks a lot.
I'm still having trouble with it though. Here's my process :


I have this character that is usually sporting a shotgun in most animations. For one special animation, I need him to NOT have the shotgun. Following your advice, I've created two attachments : the usual gun skin attachment, and an empty one (I've also tried having a skin attachment on the empty slot, but this doesn't change a thing).


Then I switch to Animate, select the animation where I don't want the shotgun to appear, click on the visibility dot, the key turns yellow, I click on it, it adds a key in the timeline. Other animations are unchanged, this one looks great, all is well.


I export my data, import them into Unity, and if I select the skeleton data and preview this particular animation, again, everything's great, the shotgun is hidden. The other animations are fine too.


Now if I bake all the skins, and play that animation, the shotgun's still visible, and it shouldn't be.
Am I doing something wrong here ?
reuno
  • Posts: 8

Pharan

Now this is a question for Mitch. :D
User avatar
Pharan
  • Posts: 5366

Mitch

Err... is empty like... a blank PNG? because you could just set the key to "Off" instead of having an empty one. I actually dont know what woudl happen with an empty PNG O.o
User avatar
Mitch
  • Posts: 978

Pharan

I hadn't noticed the blank png.

@reuno
No, no. Don't use a blank png! (You didn't need one.)
You can turn the attachment off and then key the slot to be empty.
Just click on the visibility dot of the visible attachement so it becomes invisible. Then click the key.

@Nate, Shiu
See, this is why the editor needs the Image Picker GUI. XD
User avatar
Pharan
  • Posts: 5366

reuno

@Pharan, @Mitch, thanks for your answers.
I actually tried that at first, but as it didn't work, I went for that weird empty.png route.
I gave it another try just to be sure. In Spine it works great, but in Unity though, after baking, everything appears, for all animations, as it is in Setup mode.

I'm not ruling out the possibility that I'm completely stupid, and I'm sorry if I'm missing the obvious here, but as I really love Spine, and as it's the last thing I have that's not working as I'd like it to, I'd really like to understand :)

Here's what I do :


I'll add that I've tried other combinations (hiding gun and saber in setup and showing them in animate, hiding only the saber in setup, you get the idea).
reuno
  • Posts: 8

Pharan

Unity's animations definitely supports hiding images (which in Unity is equivalent to disabling GameObjects).
It must be a bug in the Baking process.
User avatar
Pharan
  • Posts: 5366

Søren

Pharan wrote:I hadn't noticed the blank png.

@reuno
No, no. Don't use a blank png! (You didn't need one.)
You can turn the attachment off and then key the slot to be empty.
Just click on the visibility dot of the visible attachement so it becomes invisible. Then click the key.

@Nate, Shiu
See, this is why the editor needs the Image Picker GUI. XD
Yeah we know, I miss it myself sometimes. We need more hours per day :(
User avatar
Søren

Shiu
  • Posts: 2453

Pharan

@Shiu
Haha! I feel you, man. Hope you two are doing fine.
I'm being pulled in all sorts of directions myself these days.
And some people have the nerve to complain about boredom. :D

@Mitch
BUG
User avatar
Pharan
  • Posts: 5366

Nate

That Pharan is such a bugger! ;)
User avatar
Nate

Nate
  • Posts: 12213

jbsunking

I'm having a similar issue.
I have animated a blend between two image assets.
I have an image of a dog's head (front-on) that fades to transparency. At the same time, I fade in the 2nd image of a dog's head (in profile), from transparency to opaque.
Looks great in Spine.

I export to Unity (4.6.2) and see in the Preview pane that the first run of the animation displays fine [fig 1], but the 2nd run (or looping display) is missing the profile head asset [fig 2].
Finally, when he reaches the top, the front-on head asset appears [fig 3].
You do not have the required permissions to view the files attached to this post.
jbsunking
  • Posts: 3

dirkmalta

Excuse my ignorance on Spine. I've been working with it for 2 months and loving it. However it there some sort of video tutorial of how best to bake animations. Also what sort of limitation and benefits is gained through baking?
Thanks
Creating a platform adventure game where time is manipulated when you move. Every step count!
And of course we using Spine ;-)
https://twitter.com/gloomvideogame
User avatar
dirkmalta
  • Posts: 5


Return to Unity