It certainly does look like an export issue, and we were able to reproduce it. Export with a rotation curve that is unstepped - resampled curves when opening the FBX in Max. Export with the same curve but stepped - no resampling, FBX imports fine.
I couldn’t figure out how to attach a file to the existing bug rapport, but here is the Max file. It’s basically the original Max file but with everything except the camera stripped out.
EDIT: The reason we didn’t think it was an export issue initially is because we’ve had this problem for multiple projects and years, and past FBX:s did not have their keys resampled when reimported into Max. This makes sense if not resampling is as new as 5.3.
Not yet. I keep poking at this on my spare time though.
I’ve asked 3 of our animators so far (the last one was last friday), and not one was aware of that issue, or how to work around it.
Everything I found online says: “Bake Animation”, which is exactly what you want to avoid, so it’s not exactly helpful
The next step is to request a 3DS license.
I’ll update you when I have more info.
I found things that export/import correctly:
A) Basic primitives (Bones, points, cubes, etc) that are not at the Root of the scene, with default settings
I found things that export to FBX by baking, so you’ll lose your stepped keys
B) Cameras
C) Others?
And I found things that exported correctly, but imported incorrectly in Unity:
D) Pretty much anything in A) but at the root of the scene;
This is about as far as I’m investigating. I can’t do much about B) and C); the problem is definitely between FBX and 3DSMax.
As for D), I’m looking to see if I can fix D).
Otherwise, if you need to animate a camera using stepped keys, you’ll need to animate the rotation and position on a proxy object that’s not a root node.
I’ve attached an example package (.fbx file and .max file) of things that are working correctly.
As a general rule, if something is doing processing for you
keeping the up vector constant (camera I think)
constraining a rotation (IK)
indirectly moving something (sliders and other controllers)
physics
… it will probably have to be baked, and you’ll lose precise control of it.
Thing is, we should just be exporting animations, so no camera should be included at export time? We do have a camera in our Max scene though, so we’ll try removing that and see what happens…
Very sorry for the very late reply! I did not have email notifications and was caught up in other tasks. I think I was able to turn them on now.
No, it was the one I linked in #41, this one. I think however it might be based on the same FisherOutro scene in 833901, only having everything but the camera stripped out?
Right now we’re going to and fro this task (whenever we remember it) as there are a lot of things to do right now, but we have decided that we (a tech-artist and I) will move back to it next week and actually dedicate a day to do some more tests.
Just wanted to say that I’m very happy with Unity fixing this issue! Stepped animation keys are working great here now! We had to convert this manually before (duplicating clip, and selecting all keys → stepped in Unity) - and it’s a relief to not have to worry about this now.
Has anyone been able to get this working using catrig? The step keys work for me using default bones and base objects exported from 3ds max. But, specifcally cat rigs curves are still being resampled.
We are exporting animation FBX files from Max, Maya to unity. The rotation curve has only two key frames in Max, Maya. But Unity automatically adds interpolated key frames in every time step. The Unity animation importer settings are ResampleCurves: off; Anim.Compression: off;
We have tried enable Anim.Compression, which will reduce key frames, but still not giving the two original key frames that are defined in Max, Maya.
We also tried different export settings in Maya, Quaternion Interpolating Mode:
<1> Retain Quaternion Interpolation
<2> Set As Euler Interpolation
<3> Resample as Euler Interpolation
All three options can’t fix the issue.
On the other hand, the position curves are correctly imported to Unity, showing the same key frames as in Max, Maya, without any added key frames.
I spent quite some time searching online, and this thread seems to be the most relevant. You have mentioned “as long as you are not using unity-unsupported FBX features like pre- and post- rotations on your joints”, how to set those in Maya or Max?
I’d really appreciate it if you can provide some advice. Thanks in advance.
I don’t have much experience with either software (I know the FBX SDK, but not necessarily how it maps to Autodesk software), but I have asked our animators if they can help you.
In the meantime, here is what I know:
In motion builder, these options are named pre and post rotation, and are configuration options on the bones themselves.
In Maya, I think they are named joint orient and rotation orient, but I don’t know how to set them
In 3DS Max, I think these options are named pivot options, and I also don’t know how to set them
Finally, I do know that 3DS Max cameras use custom joint parameters, which make their rotations impossible to import as-is in Unity, and these are always baked.
David is correct in what is mentioned above, but here’s a little more detail on the subject…
First, in addition to pre & post rotations, there is one more thing to keep in mind when exporting/importing animation from Maya/Max, and that’s world axis. Maya & Max do not have the same world axis orientation as Unity and therefore need to be converted when imported. This means that the only way to be 100% sure that your animation does not get resampled on import is to have a non-animated root. Animating a single cube with no parent will result in resampled curves.
As for the Maya/Max/MotionBuilder pre & post rotations options, here’s some screenshots of what they look like in Maya, Max & MotionBuilder…
Thanks a lot, @DavidGeoffroy , @yanghai
Our animator had just found another approach. In Maya, create a cube, and place the camera under the cube. Do all the translation, rotation, scale changes on the Cube. The only curve that changes on the camera is the field of view attribute. Export the .FBX file to unity, with ResampleCurves: off; Anim.Compression: off;
All curves are showing the same key frames as in Maya, without any added key frames.
You consistently post such brilliant ideas, I just wanted to say thanks from 5 yrs in the future
We were struggling with how we could experiment with stepped-style anims, without a ton of re-authoring. I knew I could probably step through a single clip easily enough, but couldn’t think how I could retain AnimatorController support w/ blending and layers. Your suggestion obviously checks all the boxes in it’s pure elegance.
For anyone interested, you can get a step style anim using this simple script:
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Animations;
using UnityEngine;
public class SteppedAnimator : MonoBehaviour
{
[Range(1, 60)]
public int fps = 12;
protected int _framesToSkip = 0;
protected Animator _animator;
protected void Start() => _animator = GetComponent<Animator>();
private void Update()
{
var skipCount = Mathf.RoundToInt(60f / fps) - 1;
_animator.speed = 1 + skipCount;
_animator.enabled = _framesToSkip == 0;
if (_animator.enabled)
{
_framesToSkip = skipCount;
}
else
{
_framesToSkip -= 1;
}
}
}
It just enables the Animator once every X frames, and also increases the speed by that same amount so that the overall animation plays at the same speed. Works like a charm, no curve adjusting needed
I’m not sure about that technique, but if you’re still looking for an answer I do know that I ran into the issue of simulating lower framerate animations (aka, stop motion) a few months ago. I came up with a script that you can put on any game object with an Animator Component, and it’ll conform to the framerate you tell it to. It works with layers, blends, and everything Mechanim can do!