In this short tutorial, we will see how to use Blender's animation Cycle modifier to create cyclic animations, meaning we will make certain keyframes repeat themselves cyclically throughout the clip's duration.



Video Transcript

Hello everyone!

In this short tutorial, we will see how to use Blender's animation Cycle modifier to create cyclic animations, meaning we will make certain keyframes repeat themselves cyclically throughout the clip's duration.

The animation curves between keyframes are called F-Curves, and Blender provides us with modifiers, aptly named "F-Curve Modifiers", that allow us to easily transform them.

One of these modifiers is Cycle, which repeats two or more control points (i.e., keyframes) in a cyclical manner.

This is a basic tutorial and was created using Blender 3.3; however, the
F-Curve Cycle modifier has been available for several versions and will likely continue to be available in the future.

As a practical example, we will create the alternating activation of two LEDs in a 3D electronic circuit model that I am showing on video.

First, I position two different Point Light sources near the two LED diodes, which have semi-transparent colored containers. Therefore, it is enough to add a white Point Light in the center of one LED, duplicate it, and move the copy inside the other LED.

Blender adds new objects where the 3D Cursor is located.

To position the 3D Cursor at the center of the first LED, I select the circuit, switch to Edit Mode, deselect everything, and then select one of the upper vertex rings of the LED with ALT and left-click on an edge of the ring I want to select.

Finally, I press SHIFT+S and choose "Cursor to Selected" from the menu that appears on the screen before returning to Object Mode.

The Point Light source can be easily added from the Add menu in the 3D Viewport (the shortcut is SHIFT+A).

The second light source can be obtained, as mentioned earlier, by duplicating the first, so I press SHIFT+D and move the copy inside the second LED.

It is not necessary to position the second Point Light exactly in the center of the vertex ring of the second LED, but I take this opportunity to tell you how to move an object to the point where the 3D Cursor is located.

I switch to Edit Mode, select the vertex ring of the second LED (also in this case, with ALT and click on an edge of the vertex ring I am interested in), and position the 3D Cursor there with SHIFT+S and "Cursor to Selected".

After that, I go back to Object Mode, select the second light source, press SHIFT+S, and select "Selection to Cursor" this time.

To better appreciate the effect, I make the virtual universe background black, setting Background RGB to black in the World tab of the Properties editor.

To take a look at the preview of the result, I press the Z key while the mouse cursor is inside the 3D Viewport and choose Rendered from the selector that appears on the screen.

The two Point Light sources have too low an intensity; however, to set the lighting correctly, we need to act on both the Power and Radius parameters of the Point Light.

For example, setting 0.1 Watt for Power with the default value of Radius (25 cm) will result in very dim and, above all, white lighting!

This is because the Radius parameter indicates the size of the light source, so it is as if we placed a 25 cm radius light bulb in the scene, which we can see by zooming out: the circle that appears when we select the Point Light represents its dimensions!

By setting a much more suitable value for Radius, such as 0.1 cm, we will achieve the desired result.

Before going any further, let's set the Radius to 0.1 cm for the second light source as well, to avoid unpleasant surprises. In this case, however, set Power to 0, because initially, the second LED will be off.

Finally, it's time to talk about animation!

The footage I intend to create consists of 250 frames, at 25 frames per second.

The LED on/off cycle must last 2 seconds, so obviously, each LED will stay on for 1 second, or 25 frames.

First, I position myself at frame 1 of the animation and insert an animation keyframe for the Power field of the first LED. I do this by placing the mouse cursor over the Power field of the Point Light, then right-click and choose "Insert keyframe" from the menu that appears on the screen. Alternatively, when the mouse cursor is over the Power field, I can press the I key directly, which is the shortcut for Insert Keyframe.

The Power field will change color, and in the Timeline, we will see a diamond appear, indicating that we have indeed inserted an animation keyframe.

The first LED must turn off at frame 26, or after one second of animation, so I move to the 26th frame of the animation, set Power to 0, and insert a keyframe for this value...

... is everything done?

Well, not quite! In an animation like this, the Power value would drop from 0.1 Watt to 0 Watt over the course of the 25 frames; however, we want the LED to turn off instantly, from 0.1 to 0 Watts.

To solve this problem, I position myself at frame 25 of the Timeline, where Power is 4 milliWatts (value interpolated by Blender), write 0.1 Watt in the Power field, and insert the keyframe.

We're not done yet: for the same reason, I position myself at frame 50 of the animation and insert the keyframe for Power with its value set to 0 Watt; this way, when the animation becomes cyclic, the value will instantly change to 1 at frame 51.

After that, the first LED will be on for the first 25 frames with constant intensity and off from frame 26 to frame 50.

I need to perform the same operation but with inverted Power values for the second Point Light.

After selecting the second Point Light, I position myself at the first frame of the animation and insert a keyframe for the Power field with a value of 0 Watt.

Then I move to the 25th frame to insert a keyframe for Power, still at 0 Watt (because I want an instant, not gradual, turn-on).

At the 26th frame of the animation, I write 0.1 Watt in the Power field and insert an animation keyframe.

Then I move to the 50th frame of the animation and insert a keyframe for Power at 0.1 Watt, concluding the animation cycle.

Examining the result obtained up to this point in Rendered mode in the 3D Viewport, we see that the first cycle is executed correctly; obviously, from the 51st frame onwards, the second LED will be permanently on, while the first LED will remain off.

Now it's finally time to make this animation cyclic, which is the main topic of this tutorial!

We open the Graph Editor and select the first Point Light to examine its animation curves.

We will notice the presence of only one curve: Power, obviously.

If the curve should have an exaggerated size, we can compress the scale of the Graph Editor with CTRL and the middle mouse button, moving the mouse horizontally or vertically, depending on the axis to be compressed or expanded, to better view the curve.

The values we inserted are clearly visible, and for each keyframe, the value of the Power field is also visible in the F-Curve tab of the Graph Editor (which you can open or hide with the N key).

To make this animation cyclic, we select all existing control points with one of Blender's selection tools, such as the A key, the B key, or any other method that comes to mind; then, we open the Modifiers tab in the Sidebar (shortcut N, as mentioned earlier) and add a Cycles modifier: done!

We repeat the same operation for the second Point Light: we select its Point channel in the Graph Editor, select all the control points of the curve, and add a Cycle modifier.

In our case, the default settings of the Cycle modifier will work just fine for both light sources; however, I want to point out the possibility of limiting the cyclic repetition to a specific frame range of the animation: it will be enough to select the "Restrict Frame Range" checkbox and set the frames for the Start and End fields.

By opening a 3D Viewport editor and starting the animation in Rendered mode, we can examine the result obtained; I would like to note that, when selecting one of the two Point Lights, in the Timeline we will only find the keyframes we set, as the others are not physically present but are created by the Cycle modifier.

In fact, a large part of the tutorial focused on setting up the scene, as using the modifier is quite simple, but I took the opportunity to discuss other topics such as Radius for Point Lights and the proper setup of keyframes to achieve instant on and off for the LEDs.

Well, I hope this tutorial was helpful to you!

See you soon!

This website is intended solely to showcase some of my work and has no promotional purpose. Please note that I am not currently seeking - nor will I respond to - requests for custom work, consulting services, or any other form of professional collaboration.


EXTENDED PRIVACY AND COOKIE USAGE POLICY