Spline is a good instrument for creating interactive 3D scenes which can be very straightforward to combine into the net. To construct spectacular interactions right here, you don’t have to know 3D or coding, and that is the primary benefit of Spline.
In Spline, you’ll be able to already create animations utilizing occasions and states, however not too long ago, a brand new instrument was added: Timeline. It will probably provide help to convey the standard of your animations to a brand new degree.
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 best way to export and combine your closing animation on the net.
What’s a Timeline
Timeline is a instrument that has existed virtually so long as animation itself. It’s utilized in varied packages for movement design and 3D graphics.
The reason being that Timeline is a really common option to animate. And it’s primarily based solely on two primary components:
- 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 selected second in time.
The only 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 first, 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 fashion, 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 end result ought to occur. And every part that occurs between keyframes is the animation itself.
Essential: to animate an object with Timeline you want not less than two keyframes with totally different values of the identical property.
Timeline vs States
For many who have already animated objects in Spline, you already know that animations are normally made with States (and totally different Occasions as triggers). At first, it might look comparable: with States, you set totally 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 similar time. So in case your sphere ought to transfer, change dimension, and alter shade, it is going to do all of that without delay. There isn’t a option to make the sphere first begin transferring, then, in the midst of the animation, change dimension, and solely on the finish change shade.
And right here Timeline involves the rescue – as a result of with Timeline, all these properties can change independently, with totally different speeds, and never relying on one another.
The second large benefit of Timeline is that it’s merely rather more handy when that you must 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’ll make a traditional 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:
Should you look intently, 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 avoid wasting time, I ready a Spline file with the beginning object. Simply comply with 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 essential to know that Timeline is a particular mode. When it’s lively, many of the modifications you make will keep inside this mode. So my recommendation is: flip off Timeline if you wish to make modifications to the article or the scene that shouldn’t be animated. For instance, enhancing the fabric of an object.
On the similar time, one large benefit of Timeline is you can see the animation instantly within the viewport and make modifications 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
Whenever you need to animate an object with Timeline, you first choose it after which select what property to animate from the checklist. Nearly all objects have the identical set of properties out there — place, rotation, scale, materials, and so forth. 3D path, digital camera, and cloner have just a few further choices.
In our case, we need to make the article “bounce up and down,” so we are going to select to animate the place.
Step 3: Organising
Let’s take a more in-depth have a look at the Timeline window and what it’s fabricated from.
On the left, we see a listing of timelines ¹ – right here you’ll be able to create a number of variations of animations with the identical scene. Timelines will 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 monitor ⁴ (in our case, place)
- the checklist of properties ⁵ (this may be a number of properties of 1 object, or a number of objects on the similar 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’ll be able to handle the scale of the timeline window, make it smaller or larger.

Once we added place animation to our ball, we obtained a blue “bar.” At first and on the finish of this bar, there are keyframes. Our aim 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 area 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; generally you’ll be able to miss urgent enter.
Keep 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 proper properties panel. And now, we’re transferring our object to the highest (based on the Y axis).
And for those who 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 appear to be bouncing. We have to add realism, and that realism comes from the truth that when a ball bounces, it strikes at totally different speeds at totally 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 world with the graph if it appears too small to work in. Strive the pinch gesture for those who 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 modifications 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 at last slowly stops on the backside.
However in actual life, when a ball hits the bottom, it immediately slows down on affect, after which shortly accelerates upwards. We have to present this on the graph by adjusting the curve handles (much like drawing curves with the Pen Device).
Each dot on this graph represents a keyframe, so technically, you’ll be able to 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: Closing touches
Our ball is bouncing extra realistically now, however for an ideal end result, 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 in case you are nonetheless on this mode. Be sure that the ball is chosen. Press Animate and select Scale.
You’ll instantly see a brand new monitor for the dimensions values. On the primary keyframe, the values are 1, 1, 1. However since our animation really begins in the mean 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 seems to be squashed. Let’s additionally be sure that on the finish of the animation, it goes again to its regular type. 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. Strive experimenting with the graph of the Scale property — altering it is going to present you ways the animation can look totally 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 need to present it extra like in gradual movement, we are able to merely stretch the primary animation bar to extend (or lower) its length. This fashion, 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 for those who click on it at first, nothing occurs – that’s as a result of that you must 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 checklist select Timeline Animation. Don’t neglect to set the Loop parameter to Infinite if you would like your animation to play with out stopping.
There are additionally other ways to export this animation.
If you wish to combine the animation into a web site, first resolve the way it ought to begin: routinely, on hover over the ball, or on click on. Be sure you 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 choose the mixing technique that works finest for you. And don’t neglect to press the ‘’Replace…” button when you’ve got some edits performed.
☝️ Do not forget that totally different platforms like Framer, Wix, Webflow, and others could require totally different variations of the embed code. You will discover 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’ll be able to 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 digital camera and animate its place. Mess around with kinds and colours, and also you would possibly uncover one thing sudden.
Or, you’ll be able to check out my closing venture and discover what different objects and properties I’ve animated utilizing Timeline
I’d like to see what you give you — so be happy to share your individual outcomes! And keep in mind: the extra you observe, the extra pure Timeline (and animation typically) will really feel.
Should you loved this tutorial and need to go deeper into Spline and the fundamentals of Web3D, you’ll be able to take a look at my Spline Design Course. As a small bonus, you should use the promo code “codrops” to get 50% off.


