For the MA, I delivered a scripting assignment at the beginning of the year. It was a python script in Maya that allows the creation of an animated solar system.
You can find the script on GitHub
The latest version can be found on GitHub, and hopefully I’ll give it one or two more updates. As it has some issues I couldn’t resolve in time for delivery. Plus now I noticed that additional definitions (or even classes) could have done the trick.
The file has a ReadMe so that you can generate your own planets in Maya. The script generates a sphere, then applies a textureDeformer node. The deformer is connected to a noise node. Another sphere is generated without the deformations, to simulate water. A surface shader is assigned to each of them, with a defined color from the UI, the non-deformed sphere has a lower value. The spheres are then grouped and animated through an expression. And lastly stored in a global list.
The solar system creates a sun, then runs through all the items in the list and generates a curve to whom each planet is attached to. The motion path speed is defined by the size of the planet and the speed factor in the UI. Each orbit takes the size of the previous planet and adds a random value to the next one, in order to avoid any overlapping. Finally, the script adjusts the time slider, the far clip plane of the camera, frames the solar system and plays the animation.
Each planet can have its own moons, which are treated as mini-solar systems on their own, grouped and then parented to the motion path like any planet.
It was a fun script to do, and it took a couple of days to create, little less than a week. If you’re interested in expanding it don’t forget to share the results!