0
$\begingroup$

I have encountered a problem when exporting an animation of the scale of planes to Unity.

I have an animation made in Blender and exported into .fbx. Each plane (leaf texture) changes its location and scale independently of others (each plane is an object, I do not animate individual vertices). If I import this animation back into Blender it works as intended, however, when importing it into Unity, some of the planes become distorted and behave strangely. I tried changing the import settings in Unity and nothing helps. I have applied all of the transforms (so they have scale of 1.0 on all axes) before animating it, so this should not be a problem. The animation keyframes all capture location, rotation, and scale, so no data should get lost. I tried to drag and drop the .blend file directly into Unity without exporting it into .fbx, or exporting the leaves separately from the trunk, nothing helped.

Below are the animations in Blender and Unity - as you can see, the tree should have leaves on the bottom, but those seem to have the scale of 0 on the vertical axis at the beginning and in the end, the other two axes are squished.

Does anybody have any suggestions on what I should try to solve this problem?

Unity animation at the beginning, after a few frames, in the middle of the animation and at the end:

Unity animation at the beginning
Unity animation in the middle of the animation [![Unity animation at the end of the animation][3]][3]

Blender animation at the beginning (the leaves just get smaller progressively, the trunk is rigged):

Blender animation at the beginning

View of the planes in Blender (close up):

View of the planes in Blender (close up)

My export settings:

Export settings

EDIT: I also tried exporting the leaves separately from the rest of the tree, but now I get an error in the console: " ImportFBX Errors: Take/AnimStack 'Scene' contains animation curves with invalid numbers (NANs) on these nodes (R - rotation): 'Leaves' (R), 'Leaves.001' (R), ... "

When I googled the error, I found information (at https://issuetracker.unity3d.com/is...ue-when-fbx-assets-are-imported-to-the-editor) that "This error indicates corrupt FBX file. In some case this error can be caused by having 0 scales in animation. 0 scales are not supported in FBXSDK. Use very small scales (like 1e-5) instead."

When I changed the final scale from 0 to a value close to it, it fixed the animation partially, but not completely, see below. There are not that many distorted fragments, but there still are some.

After fix to not scale to zero

$\endgroup$

1 Answer 1

1
$\begingroup$

Okay, so for anyone who might have the same problem. I have no idea why this worked (if Unity or .fbx have some size limitation) but this is what helped me:

I simply exported the animation in two parts - leaves on top and bottom. This fixed all the distortions and everything works as intended.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .