- Editado
[Unity] Baking and opacity
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 ?
Doesn't support color keys sorry.
Ok, I was wondering what I got wrong. Is this something that will happen someday, or shouldn't I wait for it ?
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.
@Pharan > indeed, this seems much cleaner. Thanks a lot.
I'm still having trouble with it though. Here's my process :
Image removed due to the lack of support for HTTPS. | Show Anyway
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).
Image removed due to the lack of support for HTTPS. | Show Anyway
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.
Image removed due to the lack of support for HTTPS. | Show Anyway
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.
Image removed due to the lack of support for HTTPS. | Show Anyway
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 ?
Now this is a question for 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
I hadn't noticed the blank png.
@[borrado]
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
@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 : Image removed due to the lack of support for HTTPS. | Show Anyway
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).
Unity's animations definitely supports hiding images (which in Unity is equivalent to disabling GameObjects).
It must be a bug in the Baking process.
Pharan escribióI hadn't noticed the blank png.
@[borrado]
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
@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.
@[borrado]
BUG
That Pharan is such a bugger!
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].
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