FBX: Trouble exporting animation to Unity, looking like Blender's baking problem #51533

Open
opened 2017-05-17 14:10:38 +02:00 by KiJeon · 20 comments

Blender Version
Broken: 2.78

Short description of error
I'm having trouble with exporting a character animation from Blender to Unity.

Everything seems to export out fine except the eyelids animation.. it doesn't close correctly. I'm guessing this may be because of the shrinkwrap and/or action constraints I'm using, but I'm not entirely sure.

At first, when I saw the animation did not export correctly, I thought I could work around it by baking the animation in Blender first (Pose -> Animation -> Bake Action).. but the baked animation in Blender has the same problem.
Tried various methods of baking/exporting, but nothing works.

Strange thing to note though.. if I import in the .blend file itself into Unity, it seems to work.

Problem file is attached: AnimationBakeProblem.blend
Layer 2 has the geometry being used for shrinkwrap.

**Blender Version** Broken: 2.78 **Short description of error** I'm having trouble with exporting a character animation from Blender to Unity. Everything seems to export out fine except the eyelids animation.. it doesn't close correctly. I'm guessing this may be because of the shrinkwrap and/or action constraints I'm using, but I'm not entirely sure. At first, when I saw the animation did not export correctly, I thought I could work around it by baking the animation in Blender first (Pose -> Animation -> Bake Action).. but the baked animation in Blender has the same problem. Tried various methods of baking/exporting, but nothing works. Strange thing to note though.. if I import in the .blend file itself into Unity, it seems to work. Problem file is attached: [AnimationBakeProblem.blend](https://archive.blender.org/developer/F600922/AnimationBakeProblem.blend) Layer 2 has the geometry being used for shrinkwrap.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @0o00o0oo

Added subscriber: @0o00o0oo

#71668 was marked as duplicate of this issue

#71668 was marked as duplicate of this issue

Added subscriber: @fablefox

Added subscriber: @fablefox

Have you tested this in 2.78c?

Have you tested this in 2.78c?
Author

Yes, but neither exporting to .fbx to Unity nor baking the animation in Blender works corectly. Did it work for you in 2.78c?

Yes, but neither exporting to .fbx to Unity nor baking the animation in Blender works corectly. Did it work for you in 2.78c?
Author

Ah, actually, it looks like baking within Blender works if only "Only Selected" option is on. (While testing, I somehow came to the conclusion that all the options needed to be checked.)

..but when the baked animation is exported and brought into Unity, the problem comes back.
And it's not Unity's problem, because when this .fbx is brought into Blender, it has the same problem.

This is really strange because, again, when importing the .blend file directly to Unity, the animation seems to work just fine.

Ah, actually, it looks like baking within Blender works if only "Only Selected" option is on. (While testing, I somehow came to the conclusion that all the options needed to be checked.) ..but when the baked animation is exported and brought into Unity, the problem comes back. And it's not Unity's problem, because when this .fbx is brought into Blender, it has the same problem. This is really strange because, again, when importing the .blend file directly to Unity, the animation seems to work just fine.

In #51533#434647, @0o00o0oo wrote:
Yes, but neither exporting to .fbx to Unity nor baking the animation in Blender works corectly. Did it work for you in 2.78c?

I didn't test. It just a standard bug reporting to test with latest version first in case of the bug already have been fixed. A lot of bug has been fixed between 2.78a, 2.78b and 2.78c.

> In #51533#434647, @0o00o0oo wrote: > Yes, but neither exporting to .fbx to Unity nor baking the animation in Blender works corectly. Did it work for you in 2.78c? I didn't test. It just a standard bug reporting to test with latest version first in case of the bug already have been fixed. A lot of bug has been fixed between 2.78a, 2.78b and 2.78c.
Author

Right, but this doesn't look like one of them. Problem also replicated by co-worker. I'd appreciate it if somebody could look into this.

Right, but this doesn't look like one of them. Problem also replicated by co-worker. I'd appreciate it if somebody could look into this.

Added subscriber: @mont29

Added subscriber: @mont29

Blender FBX exporter does some simplification to exported animation (to reduce a bit huge size taken by animation when saving all frames as keyframe). While being OK most of the time, in some case it can be too aggressive, please try exporting while reducing Simplify value in Animation parameters of the exporter (you can put it to zero to completely disable simplification). Please report back if this does not solve your problem.

Note that baking in Blender won't change anything here, since FBX exporter already does that when exporting animation (precisely to take into account all possible combinations of fcurves/drivers/constraints/etc.).

Blender FBX exporter does some simplification to exported animation (to reduce a bit huge size taken by animation when saving *all* frames as keyframe). While being OK most of the time, in some case it can be too aggressive, please try exporting while reducing `Simplify` value in Animation parameters of the exporter (you can put it to zero to completely disable simplification). Please report back if this does not solve your problem. Note that baking in Blender won't change anything here, since FBX exporter already does that when exporting animation (precisely to take into account all possible combinations of fcurves/drivers/constraints/etc.).
Author

Thanks for the suggestions, @mont29. I tried changing the Simplify value to different values (including 0), as well as the ##Sampling Rate## just in case, but nothing seems to help. =/

As far as I know, when importing the .blend directly to Unity, all it's doing is firing up Blender in the background and exporting a .fbx invisibly.. so I don't understand why that would work and exporting a .fbx out of Blender does not. Sadly, I don't think we can use the import-.blend-to-Unity method.

Thanks for the suggestions, @mont29. I tried changing the `Simplify` value to different values (including 0), as well as the ##Sampling Rate## just in case, but nothing seems to help. =/ As far as I know, when importing the .blend directly to Unity, all it's doing is firing up Blender in the background and exporting a .fbx invisibly.. so I don't understand why that would work and exporting a .fbx out of Blender does not. Sadly, I don't think we can use the import-.blend-to-Unity method.
Author

In case it helps, just wanted to add on that thing that seems apparent to me in my tests is that exporting .fbx out of Blender bakes the animation as if basically all the options for Bake Action are checked.
Whereas, when importing the .blend into Unity straight, the baked animation is as if only the "Only Selected" option is checked (which, in this case, seems to be the desired setting).

In case it helps, just wanted to add on that thing that seems apparent to me in my tests is that exporting .fbx out of Blender bakes the animation as if basically all the options for `Bake Action` are checked. Whereas, when importing the .blend into Unity straight, the baked animation is as if only the "Only Selected" option is checked (which, in this case, seems to be the desired setting).
Bastien Montagne self-assigned this 2017-05-19 21:37:08 +02:00

Hrmmmmf… checked your file, there is indeed something weird going on here, some bones just do not get any animation for some reason… Note that Blender also complains about some dependency cycles, could be the cause (though quite unlikely).

Will check that deeper when I have time :/

Hrmmmmf… checked your file, there is indeed something weird going on here, some bones just do not get any animation for some reason… Note that Blender also complains about some dependency cycles, could be the cause (though quite unlikely). Will check that deeper when I have time :/
Author

Thanks, Bastien.

For when you get around to it:

I found there is a baking problem with the Stretch To constraint, which I think could be contributing to the issue, if not the root of it.

Here's a file that exemplifies the problem: StretchToBakingProblem.blend

There are two Suzannes in the file (Suzanne, Suzanne.001). On the surface, they look identical, but if you turn the Stretch To constraints on and off, you'll see that they're constructed differently.
When you bake the animations with all the options checked, you'll find the animations are different (and, in fact, when exported to .fbx and sent to Unity, these are the animations that come in). Suzanne.001 will look right, but Suzanne will look off.

Furthermore, when importing the .blend into Unity, things are different still.. namely the result for Suzanne is different from how it looks baked in Blender, while the Suzanne.001 again looks right.

Thanks, Bastien. *For when you get around to it:* I found there is a baking problem with the Stretch To constraint, which I think could be contributing to the issue, if not the root of it. Here's a file that exemplifies the problem: [StretchToBakingProblem.blend](https://archive.blender.org/developer/F604357/StretchToBakingProblem.blend) There are two Suzannes in the file (Suzanne, Suzanne.001). On the surface, they look identical, but if you turn the Stretch To constraints on and off, you'll see that they're constructed differently. When you bake the animations with all the options checked, you'll find the animations are different (and, in fact, when exported to .fbx and sent to Unity, these are the animations that come in). Suzanne.001 will look right, but Suzanne will look off. Furthermore, when importing the .blend into Unity, things are different still.. namely the result for Suzanne is different from how it looks baked in Blender, while the Suzanne.001 again looks right.
Brendon Murphy changed title from Trouble exporting animation to Unity, looking like Blender's baking problem to FBX: Trouble exporting animation to Unity, looking like Blender's baking problem 2019-06-11 12:03:53 +02:00
Member

Added subscriber: @BrendonMurphy

Added subscriber: @BrendonMurphy
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

no activity 2017 archiving.

no activity 2017 archiving.

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'
Bastien Montagne removed their assignment 2019-08-12 16:05:22 +02:00

Added subscribers: @akjlleas, @EitanSomething

Added subscribers: @akjlleas, @EitanSomething
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#51533
No description provided.