This project creates a bar chart race animation of the Gross Domestic Product (GDP) of the world's ten largest economies from 1975 to 2025. The animation is generated using Blender and a Python script.
- Customizable: Easily configure the animation parameters, such as file paths, frame rates, colors, and layout, through a single
CONFIGdictionary in the Python script. - Dynamic Labels: The country and GDP labels animate along with the bars.
- Timeline: A timeline with a playhead indicates the current year of the animation.
- Grid Lines: Dynamic grid lines adjust to the data for better readability.
- Eevee Next Optimized: The script is optimized for Blender's Eevee Next render engine.
- Open Blender: Launch Blender (version 3.0 or newer is recommended).
- Go to the Scripting Workspace: Switch to the "Scripting" workspace using the tab at the top of the screen.
- Open the Script: In the Text Editor view, click the "Open" button in the header (it looks like a folder icon). Navigate to this project's directory and select the
gdp_bar_race.pyfile. - Run the Script: Click the "Run Script" button (the play icon) in the Text Editor's header. This will execute the script, clearing the default scene and generating all the elements for the bar chart race.
- Render the Animation: To generate the final video, go to the main menu at the top-left of the Blender window and select
Render > Render Animation. The video will be saved to the file path specified in the script'sCONFIGsection (by default, it will be namedgdp_data_1975_2025.mp4and saved in the same folder as the script).
The GDP data is stored in gdp_data_1975_2025.csv. This file contains the GDP data for the following ten countries from 1975 to 2025:
- USA
- China
- France
- UK
- Russia
- Japan
- Germany
- India
- Italy
- Canada
The GDP values are in billions of US dollars. The script displays them in trillions.
The gdp_bar_race.py script includes a CONFIG dictionary that allows you to easily customize the animation. Here are some of the key settings:
csv_path: Path to the GDP data file.output_path: Path to save the rendered animation.fps: Frames per second for the animation.frames_per_year: Number of frames to represent one year.start_yearandend_year: The range of years to animate.country_colors: A dictionary to set the color for each country's bar.font_sizes: A dictionary to control the size of the various text elements.layout: A dictionary to control the spacing and positioning of the chart elements.
This project is licensed under the MIT License. See the LICENSE file for details.
