Easing imported animation

Hi,

Is it possible to ease an animation that is imported as part of a .babylon file from 3ds max?
Does this also apply to imported animations because i have tried this but it doenst seem to do the trick.
Or is the best option to just create the exact animation with easing in 3ds max before exporting?

I would do the separation between custom eased animation made with code and animation exported with a DCC. When exported from a DCC, I’d keep the animation as-is. If I need to change something with it (easing, timings, …) I would do it in the DCC only.
@PatrickRyan do you proceduraly tweak exported animations?

@Axel_Musch, I would agree with @Cedric about separating animations generated in code with animations from a DCC tool. In both cases we are applying a curve to describe the delta-over-time in a parameter value. The difference is that in the DCC tool, we are using their editor to shape what that curve looks like and in code we need to use an easing function to describe what that curve looks like.

If you get into a situation where you need to change the easing function procedurally, I would generate your animations in code where you can simply create a new animation clip and specify the easing function before playing it on your target. This allows you to have full control over the animations and is the approach I used in this demo for all the animations on the meshes. Rather than creating a bunch of animations, I create a function to create a new animation whenever I need to play an animation, passing the animation keys that the target cares about. In this demo, I am only using one easing function, but I could have easily expanded it to use more than one by passing the easing function I wanted.

The question to ask when thinking about changing the curve from a file coming from a DCC tool is “how do we change it?” If we assign a new easing function, are we just overwriting the curve from the DCC tool? Are we using some sort of additive manipulation of the curve from the DCC animation? Do we retain the minimum/maximum values from the curve, but just change where those minimum/maximum values are in the curve? For example, if I switch from an ease-out-elastic curve to an ease-in-ease-out quintic curve using DCC curve data, am I transferring the value of the highest point of the elastic curve to the ending value of the quintic curve? I could see where there may be some disagreement about what it means to remap DCC curve data to a procedural easing.

You can always import your DCC animations but when you need to play a differently-eased curve, just play a different animation on your target, whether than comes from a DCC tool or is generated in code. Or, you could read the curve data of your DCC animation and use the min/max values found in that curve and the length of the animation to generate a new animation clip using a difference easing function in code to then play on your target.

I think there are answers for you no matter how you prefer to generate your animations. If you are worried about needing to create many animation curves in your DCC tool which will increase your file size, you can create your alternate curves in code to apply when necessary. If you have to deal with unknown animations coming from various imported files, but need to do things like match clip length, you could analyze the clip on load and use that data to create different motion so that the source does not matter. Or you could just create your animations in code and have full control over the key:value pairs and easing in one go. It all depends on what you are trying to accomplish.

I hope this helps, but feel free to ping back with more questions.

2 Likes