Jump to content

3ds max exporter animation problem


Recommended Posts

Babylon 3ds max exporter parses animation curves in a strange way. It ignores key frames and somewhat simplifies the curve. That is why some animations are exported totally wrong. It is not a big problem when you play the whole animation, but when you loop a part of it you can see the glitches (drifting, absence of animation with small value changes). I'm saying that this is exporter problem because I've opened exported .babylon file and found a strange animation data: my animation range is [300-450] but there is nothing in .babylon file about this range. There are frames before and after. That causes my object to drift from wrong value to another wrong value.




I really need to find out a way to get all frames exported, or at least to set the distance between them. And remove the "simplification" that ignores animation with small values.

Please, help!


Link to comment
Share on other sites

Hi Luaacro!



Hello tihomirov :)
​Can you send me an example of your curve in a 3ds Max project file ?
This should work but I​ would like to compare with a 3ds Max project of Michel Rousseau
Thanks :)


I will send you my scene 12 hours later (when I'll be at work).


Before, what tool are you using to create your animations and what type of controller are you using to build your animations ?

The Rotation Controller. And as far as I remember all other problematic animations are also Rotation Controllers, but I'm not sure, because they are a part of a complex animation with bones and IK and I never dug that deep.

Link to comment
Share on other sites

Your .babylon file is just the same as mine. So Exporter works the same for both of us :)

But after putting this .babylon file in sandbox I realized that it plays the whole animation. But what I was saying is that when you play the whole animation - you can't notice problems. But if you will loop middle part of animation (150-225) you will see it.

Let me be more specific.


Here is part of an exported .babylon file:

"name":"Ship","position":[0.0,0.0,0.0],"rotation":[0.0,0.0,0.0],"scaling":[1.0,1.0,1.0],"rotationQuaternion":[-0.0349,0.0,0.0,-0.9994],"actions":null,"animations":[{"name":"rotationQuaternion animation","property":"rotationQuaternion","dataType":2,"loopBehavior":1,"framePerSecond":60,"keys":[{"frame":0,"values":[-0.0349,0.0,0.0,-0.9994]},{"frame":1,"values":[-0.0396,0.0,0.0,-0.9992]},{"frame":14,"values":[-0.0867,0.0,0.0,-0.9962]},{"frame":27,"values":[-0.1065,0.0,0.0,-0.9943]},{"frame":36,"values":[-0.1014,0.0,0.0,-0.9948]},{"frame":56,"values":[-0.0439,0.0,0.0,-0.999]},{"frame":71,"values":[-0.0198,0.0,0.0,-0.9998]},{"frame":350,"values":[-0.0349,0.0,0.0,-0.9994]},{"frame":351,"values":[-0.038,0.0,0.0,-0.9993]},{"frame":384,"values":[-0.1041,0.0,0.0,-0.9946]},{"frame":417,"values":[-0.1031,0.0,0.0,-0.9947]},{"frame":450,"values":[-0.0349,0.0,0.0,-0.9994]}]}]


It describes the animation of "Ship" object.

You can see, that there is a huge gap between frame 71 and frame 350. But if you check the next image, which represents the actual Ship animation in 3ds max, you will see that there are key frames in that span. And animation is not linear. And if you loop from frame 150 to frame 225 you will get wrong animation in Babylon. Because there is no info in exported .babylon file about this range.




Maybe I've send the wrong version of .max file last time. I'm attaching it again. It should have animation looped from 150 frame to 225 frame.


Link to comment
Share on other sites

Great! Now the animation is looped from frame 150 to 225. Can't you see that it is not smooth? For example you can look at lower right tentacle. It jumps. The ship is also jumping after slowly leaning backwards. But you can check the .max file and see that frames 150 and 225 are identical. I've showed you the part of exported file and mentioned that there is no information about animation between frames 71 and 350 in ship animation. This is the cause of bad animation in BabylonJS. Can you tell me, why there is no frames between 71 and 350 in .babylon file? I expect this question will help you understand what I'm talking about better :)

Thank you for your patience!

Link to comment
Share on other sites

There are a lot of new frames in .babylon! Animation is much smoother, but i still can see that it is jumping. I think that is because keyframes (150, 255 etc) are not in .babylon file. Maybe you can add a babylon param to the object that will indicate the step (in frames) of exported baked animation? For example every 10th or 5th frame. Then everybody will be able to create loops between frames that are multiplication of this param. It will solve this problem once and for all!

Link to comment
Share on other sites

  • 2 weeks later...

I think I am still having issue with interpolating between gaps of missing frames from the export. As I look at the babylon file there are quite a lot of missing frames, and I am getting weird jumps during animation playback. Is there a way to ensure that every single frame is exported?


Here is a babylonjs playground example. focus the camera on the face and press the "P" key to see the animation. 




I also have the max file if it helps. It is very large though. 250+ MB





Link to comment
Share on other sites

Sorry to high jack this thread (go gators!), but I am actually interested in a mechanism for removing frames.  The mocaps I am looking at are recorded at 120 fps, I wish to remove as many frames as possible which you could derive dynamically using interpolation at what ever the scene ends up running at.  I figure I am going to have to have some kind of fuzzy logic tolerance to get a big reduction.


Is the 3ds max exporter actively doing this?  I am not that familiar with C#, but if it is, where in the source is it being done?  Thanks!

Link to comment
Share on other sites

No, the blender exporter does not does not remove frames, but for non-skeleton animations (position, rotation, & scaling animations of meshes / cameras / lights), I believe the user does not have to include every frame. 


I was not planning to run the mocap files through Blender, but read them directly in JS.  Theoretically, if it was in JS / TS, then it could be available to irrespective of origin, if broken out.  Am debating whether to have a toTypescript() method, which would allow you to both convert the mocap to bone animation & strip frames "offline" to the actual real time performance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...