I’ve successfully imported an animated mesh from 3dsMax using the latest FBX exporter, but the animations do not loop correctly. I know the animations loop correctly in 3dsMax and I know they play correctly in game because I have them working fine in my current game, which uses a different engine.
In Unity, however, they glitch right at the point where they should loop. In the property window, they’re set to loop, and I have set the WrapMode to loop in code as well.
I noticed when I was splitting animations that Unity wanted me to make frame 1 the first frame, but in 3dsMax my animations begin at frame 0. (EG: The first animation goes from Frame 0-20 inclusive. ) Also, this page (http://unity3d.com/support/documentation/Manual/Character-Animation.html) makes a similar assumption.
So I thought it might be a numbering convention in Unity to begin at 1, so I reimported the animated mesh and split the animations with all to and from frames increased by 1, but this doesn’t seem to have improved anything and might even have made it slightly worse. I can’t very well go the other way, can I? I don’t think -1 is going to be a valid keyframe somehow.
Anyone experienced anything like this or have any suggestions on what the problem might be and/or how to fix it? I would keep on trying various offsets but it takes Unity a very long time to import my mesh (245 split animations) and I don’t have another one to test with at the moment.
Unity does let you use zero as a frame number, or at least there is an example of that in the docs. Have you tried enabling the loop frame for this animation (checkbox next to wrap mode)?
Thanks for the reply, Andeeee. Yes, my import script automatically enables the loop wrapmode for all the animations which loop, and they are indeed shown with a check in the box in the property panel.
Right, well I tried importing the FBX back into 3dsMax to see if it was a problem with the exporter, and it is. What seems to be happening is that the FBX exporter is trying to blend between the end of one animation and the beginning of the next (which is logical) but it’s actually doing it AFTER the beginning of the next, so the first few frames of each animation are being affected by this attempt to blend between animations. [Perhaps the exporter has a minimum number of frames before it can interpolate, I don’t know.]
Anyway, the upshot is that all my animations get distorted by this and no longer loop correctly. Exporting in other formats works fine, and it plays fine in 3dsMax. So is there some way to prevent this happening? I’ve scoured the advanced options on the FBX export panel, but nothing there seems helpful. I’m not really able to just randomly test because it takes even longer to export the FBX than it takes to import it.
If it makes any difference, the animations all come in one single BIP file, and are applied to a biped. The mesh is rigged with Skin.
I have “Bake Animations” enabled in the exporter, and the step size is set to 1. (Which I assumed would set a keyframe for each frame, but this must not necessarily be the case.)
it’s very hard to answer when you have minor glitch in the animation. Submitting a bug report might be a good idea - then at least we can see what kind of glitch you have.
I have the same problem and i’m using a “lazy fix”. Just make sure you have a 10 frame buffer after every animation and add 10 extra frames in the frame splitting. For and example, if you got a loop between frame 20-50 (in max/maya), input 20-60 in Unity and it should loop correctly. This is not a very good way of solving it though, you don’t have control of what’s really happening, it just looks okay. I’d love to get a real solution for the issue!
i have same issue also ,with over 1120 animation in almost 29000 frames ,
this problem is still on even after i bake the animations , every thing is fine in other animation tools like motionbuilder , but in unity just like the OP stated right before the animation is about loop a notable glitch appears
some says make animation in separate file but i don’t see it as practical solution in my case.
i defiantly think of it as serious bug and it must be fixed very soon
for meanwhile let me share what was my trick to solve the issue
as i stated before i had above 1120 animations in about 29000 frames in 3ds max everything is smooth and bright inside of 3ds max,
but when i export it to fbx , the motion builder shows no glitches what so ever , but after i import it to the unity and split my animations with my editor import script and i mark all the clips that need to be looping as loop and set it’s wrapMode to Loop , the glitch appears in every cycle’s end .
my trick is , suppose my time for the clips in 3ds was noted as below
name start end loop
idle 1 - 301 yes
walk 302 - 342 yes
run 343 - 373 yes
jump 374 - 384 no
…
…
now to avoid the glitches in unity , bake all your animation when exporting it to fbx , look for all the animation which needs looping , mark them as loop and set it’s wrapMode to Loop and subtract the end frame by one , the example
Unity Animation split dialog
name start end wrapmode loop
idle 1 - 300 Loop yes
walk 302 - 341 Loop yes
run 343 - 372 Loop yes
jump 374 - 384 once no
…
…
as if you notice i just subtracted the end animation for all the loop animation by one in the split dialog and that did solve this issue for me
and baking the clips is really important to make this method work
hope it’s help
This issue is still on the go. What if you don’t use split animations and you actually make each animation seperate (model@animation). This issue is driving me crazy.
I have had this same issue in my game little Genius but I was able to fix the looping animation bug by checking the loop check box on the fbx file in unity. I tried making the wrap mode loop and that didn’t fix my problem and I did the subtracting one key frame and that didn’t fix my problem then I tried the loop check box with everything turn off and it fix my looping animation.
guys i may have found the solution, it is a quick fix if the problem still persists when coming from 3ds max,
in unity when you import your character, if lets say your animation is from 0 to 60 w.e it is on max …when you bring it in unity only use 0 to 59, you dont need the last frame, that is why you get a glitch, because its repeating a frame.
also i noticed that there is a glitch on max 2013 where the animation when using the first frame as last … it alters the animation
test it by just creating a key on first then copy without tweens,
to go around that well to sorta fix the problem you must change values on your TCB controls under key info, which is under biped apps , on your motion panel play around with the bias… that would smooth down the jumpy glitch ( it must be done each bone at a time ) well hope this helps anyone, it worked for me