Spline is a superb instrument for creating interactive 3D scenes which are very simple to combine into the online. To construct spectacular interactions right here, you don’t have to know 3D or coding, and that is the principle benefit of Spline.
In Spline, you may already create animations utilizing occasions and states, however lately, a brand new instrument was added: Timeline. It may possibly aid you convey the standard of your animations to a brand new stage.
On this tutorial, we’ll use a easy instance to discover what the Timeline instrument is, the way it works (and the way it differs from States), and the way to export and combine your remaining animation on the internet.
What’s a Timeline
Timeline is a instrument that has existed nearly so long as animation itself. It’s utilized in numerous packages for movement design and 3D graphics.
The reason being that Timeline is a really common strategy to animate. And it’s based mostly solely on two foremost elements:
- An object (or extra precisely, its property)
- A keyframe
With a keyframe, we connect some worth of an object’s property (for instance, place) to a particular second in time.
The best instance is a transferring object. Let’s say we wish our object to maneuver from left to proper in 1 second. We place the primary keyframe at the beginning, the place the article is to the left. Then we set the second keyframe at first seconds, and transfer the article to level B. This manner, for the second keyframe, we are saying: “at this second, the property ought to have this worth.”
That’s it. Keyframes are positioned within the moments the place the consequence ought to occur. And every little thing that occurs between keyframes is the animation itself.
Vital: to animate an object with Timeline you want at the least two keyframes with completely different values of the identical property.
Timeline vs States
For many who have already animated objects in Spline, you already know that animations are often made with States (and completely different Occasions as triggers). At first, it might look comparable: with States, you set completely different properties for an object (for instance, place), and you then outline the time interval between these states.
However the large distinction between Timeline and States is that this: when animation occurs between states, all properties change on the identical time. So in case your sphere ought to transfer, change measurement, and alter coloration, it’ll do all of that without delay. There isn’t any strategy to make the sphere first begin transferring, then, in the midst of the animation, change measurement, and solely on the finish change coloration.
And right here Timeline involves the rescue – as a result of with Timeline, all these properties can change independently, with completely different speeds, and never relying on one another.
The second large benefit of Timeline is that it’s merely rather more handy when it’s essential to animate a number of objects in a single scene.
Timeline in Spline
Now, let’s create a easy animation in Spline utilizing Timeline and see the way it works. We are going to make a basic animation that’s usually used to be taught the fundamentals of animation — a bouncing ball.
In the long run, it is best to have an animation that appears like this:
If you happen to look carefully, it’s not only a bouncing ball – it additionally deforms each time it hits the ground. Creating such an animation with States could be problematic and far much less versatile.
To save lots of time, I ready a Spline file with the beginning object. Simply observe this hyperlink and duplicate this scene: Hyperlink to spline scene
Step 1: Activating Timeline
Activate the Timeline mode. To do that, change the toggle on the highest toolbar. When you allow Timeline, you will note a big panel seem on the backside.
It’s necessary to know that Timeline is a particular mode. When it’s lively, a lot of the adjustments you make will keep inside this mode. So my recommendation is: flip off Timeline if you wish to make adjustments to the article or the scene that shouldn’t be animated. For instance, modifying the fabric of an object.
On the identical time, one large benefit of Timeline is you can see the animation straight within the viewport and make adjustments whereas it’s enjoying.
Step 2: Making use of animation
Choose our ball object, and within the Timeline panel on the backside, search for the button +Animate
While you wish to animate an object with Timeline, you first choose it after which select what property to animate from the listing. Virtually all objects have the identical set of properties accessible — place, rotation, scale, materials, and so forth. 3D path, digicam, and cloner have a couple of extra choices.
In our case, we wish to make the article “bounce up and down,” so we are going to select to animate the place.
Step 3: Establishing
Let’s take a better take a look at the Timeline window and what it’s made from.
On the left, we see a listing of timelines ¹ – right here you may create a number of variations of animations with the identical scene. Timelines could be created, deleted, and renamed.
The remainder of the window is the precise Timeline. It has:
- the time ruler ²
- the Playhead ³ (to shortly journey throughout your timeline)
- the property observe ⁴ (in our case, place)
- the listing of properties ⁵ (this may be a number of properties of 1 object, or a number of objects on the identical time)
- and a few controls:
- Play ⁶(to preview the animation, not the identical Play button within the prime toolbar)
- S ⁷ – timeline size (by default it’s 5 sec)
- The Loop change ⁸ (to play animation constantly)
- The Graph Editor toggle ⁹ (we are going to discuss this later)
Additionally, you may handle the scale of the timeline window, make it smaller or larger.

After we added place animation to our ball, we obtained a blue “bar.” Firstly and on the finish of this bar, there are keyframes. Our objective now could be to make three positions for the ball: backside (on the ground), prime, and backside once more.
This implies we are going to want 3 keyframes.
Choose the primary keyframe and ensure all values within the Place discipline are set to 0.
Transfer the playhead to the center of the bar (0.5 sec on the ruler). At this second, the ball ought to be on the prime. So we have to inform Spline the place it ought to be. You may transfer the ball manually or simply sort the values 0, 150, 0 within the Place fields. As quickly as you modify a property, a brand new keyframe will seem.
Then, choose the final keyframe, and be sure that all values are set to 0.
Click on by all 3 keyframes simply to make certain that all values are set appropriately; typically you may miss urgent enter.
Bear in mind, these three enter fields within the Place property are the X, Y, and Z coordinates of the article. They match the values you see in the best properties panel. And now, we’re transferring our object to the highest (in accordance with the Y axis).
And in case you set the timeline size to 1 sec and activate Loop, after which press Play (or simply hit spacebar), the ball will bounce with out a pause.
Step 4: The Graph Editor
A ball that solely strikes up and down doesn’t actually seem like bouncing. We have to add realism, and that realism comes from the truth that when a ball bounces, it strikes at completely different speeds at completely different moments. To regulate this pace, we’d like the Graph Editor.
Change the Timeline into Graph Editor mode, and you will note a graph.
You may zoom in on the realm with the graph if it appears too small to work in. Attempt the pinch gesture in case you work from a laptop computer, or cmd (Ctrl) + scroll mouse up/down.
There may be nothing sophisticated right here. What we see is solely a graph of how the property worth adjustments over time. In our case, the Y place (the inexperienced curve) easily goes from the begin to the center, and from the center to the top. This implies our ball easily goes up, then slowly stops on the prime, then easily accelerates down, and eventually slowly stops on the backside.
However in actual life, when a ball hits the bottom, it out of the blue slows down on affect, after which shortly accelerates upwards. We have to present this on the graph by adjusting the curve handles (just like drawing curves with the Pen Software).
Each dot on this graph represents a keyframe, so technically, you may fine-tune your animation extra precisely by transferring these dots and adjusting the curves.
In the long run, the curve ought to look one thing like within the video.
Step 5: Ultimate touches
Our ball is bouncing extra realistically now, however for an ideal consequence, it must also deform on affect (squash). To do that, we have to add one other animation property to the Timeline – Scale.
Flip off the Graph Editor if you’re nonetheless on this mode. Be certain that the ball is chosen. Press Animate and select Scale.
You’ll instantly see a brand new observe for the dimensions values. On the primary keyframe, the values are 1, 1, 1. However since our animation really begins in the intervening time when the ball is already bouncing off the bottom, it ought to be squashed at this level. So let’s set the values to 1, 0.7, 1.
Now the ball appears squashed. Let’s additionally make it possible for on the finish of the animation, it goes again to its regular kind. So on the second keyframe, set the dimensions values again to 1, 1, 1.
Then, transfer this keframe to 0.5sec.
That’s it, now the ball bounces and deforms when it hits the bottom. Attempt experimenting with the graph of the Scale property — altering it’ll present you the way the animation can look completely different.
One other benefit of Timeline is the general animation pace. For instance, if we don’t like that our ball is bouncing too quick and we wish to present it extra like in gradual movement, we are able to merely stretch the principle animation bar to extend (or lower) its length. This manner, all of the keyframes are evenly scaled alongside the timeline.
Preview and Export
Together with the Play button within the timeline, there’s additionally a Play button within the prime toolbar to preview the entire scene. However in case you click on it at first, nothing occurs – that’s as a result of it’s essential to create an occasion that may set off the Timeline animation.
For instance, whereas the Ball object is chosen, create a Begin occasion, and within the Actions listing select Timeline Animation. Don’t neglect to set the Loop parameter to Infinite in order for you your animation to play with out stopping.
There are additionally alternative ways to export this animation.
If you wish to combine the animation into an internet site, first resolve the way it ought to begin: routinely, on hover over the ball, or on click on. You’ll want to arrange the Occasion that may set off the Timeline. In our case, it’s set to Begin. After that, simply go to the Export window and decide the mixing methodology that works greatest for you. And don’t neglect to press the ‘’Replace…” button when you have got some edits executed.
☝️ Keep in mind that completely different platforms like Framer, Wix, Webflow, and others might require completely different variations of the embed code. You could find what works with what within the Spline documentation.
If you wish to reserve it as a video, I like to recommend utilizing the Video tab within the Export window. Right here you may choose your timeline, and the length of the video will match the size of your timeline (though you may make it longer if wanted). That is particularly helpful if you wish to create seamless loops.
Experiment by including extra properties to your timeline — attempt animating rotation, and even add a digicam and animate its place. Mess around with types and colours, and also you would possibly uncover one thing sudden.
Or, you may check out my remaining challenge and discover what different objects and properties I’ve animated utilizing Timeline
I’d like to see what you provide you with — so be happy to share your personal outcomes! And bear in mind: the extra you apply, the extra pure Timeline (and animation normally) will really feel.
If you happen to loved this tutorial and wish to go deeper into Spline and the fundamentals of Web3D, you may try my Spline Design Course. As a small bonus, you should use the promo code “codrops” to get 50% off.









