Some python code to visualise/animate solar system simulations in Blender

Hi everyone! I’m working on solar system simulations for the Geologic past. Before diving into the analysis too much, I wanted to visualize my model output in 3d and animate it through time. Since I know some basics of Blender I thought I’d write a python script (my first python script, normally I use R for my analysis!) and see how far I could get!

I’ve now released everything on my github. Currently it’s just a script you can copy over, not an addon.

Here’s a video of one of the simulations I made:

  • at first the Sun is at the same scale as the planets, 1000x enlarged. Then I scale only the Sun down to it’s “true” size with respect to the orbits, but leave the planets at 1000x.

The next two videos are looking at a veeery different time scale: here we see the ages fly by at a rapid pace, to see how Earth’s eccentricity (the degree to which the orbit is elliptical) changed over the past 405 thousand years.


And here’s a shot from above with an orthographic view, because the perspective may be a little incorrect because I didn’t mess with the blender units too much and 1 unit is 1 astronomical unit (~the distance between the Earth and the Sun).

Beside the python code, I’ve included a .blend file with animations for the first 20 frames of the modern simulation. It also includes the night sky by NASA. And some simulations for the past 405 thousand years!

The work is heavily inspired by the Solar System Simulator Blender addon and I’m using the PyOrb python package for conversion between orbital elements and Cartesian Coordinates (regular xyz stuff).

The source code for the orbital solution simulator will be made is now available! as soon as my professor has published his paper on it!

3 Likes