This script procedurally generates animated asteroids in Blender, complete with style, shape, props, and texture variation using triplanar shading.
Palettes are from lospec, except for dusty-space, which was created by me for a game.
The project can either:
- Generate a grid of procedurally created asteroid meshes.
- Render animated spritesheets and APNGs (if
CREATE_ASTEROIDS_ONLYis set toFalse).
Note: APNG uses RGBA for compatibility. Palette indexing is only applied to the spritesheet.
The project also creates a preview_timestamp.html file for easy viewing of generated asteroids.
You can open it in any browser. The seed can be copied from existing asteroids to regenerate either the style or shape.
- Blender 4.0 or newer
Pillow(Python Imaging Library) installed for image handlingExtra Mesh ObjectsExtension installed in Blender
To install Pillow inside Blender's Python environment (on Windows):
"C:\Program Files\Blender Foundation\Blender 4.x\4.x\python\bin\python.exe" -m pip install Pillow --target="C:\Program Files\Blender Foundation\Blender 4.x\4.x\python\lib\site-packages"To run the script:
- Open the
asteroid_generator.xxx.blendfile in Blender. - Open the
Text Editorand the script namedasteroid_generator.py. - Adjust the configuration parameters as needed.
- Click
Run Scriptor press Alt+P to start generation. - Wait for the script to finish. Check the system console for progress or errors.
- When done, open
preview.html(in the output folder) to view all generated asteroids in a browser.
Props must be organized under a Blender collection called Props.
Each child collection inside Props represents a prop type,
and should contain one or more objects that will be randomly selected.
Each asteroid can only select props from within one prop type, or none.
Each prop object name can include metadata in square brackets at the end of its name:
angle: Max rotation variation in degrees from the surface normal.scale: Multiplier for random scale variation (centered around 1.0).height: Maximum upward offset from the asteroid surface.
Example prop name: Antenna [angle=25,scale=0.1,height=0.2]
Textures are loaded dynamically based on PNG files in TEXTURE_PATH using filenames of the form:
name_diffuse.pngname_normal.pngname_emission.png [optional]
Example rock material:
rock_diffuse.pngrock_normal.pngrock_emission.png
If edited, the base material (named Asteroid) can contain the following named nodes:
- Image Texture node:
Diffuse - Image Texture node:
Normal - Image Texture node:
Emission - Value node:
Triplanar Scale - Value node:
Roughness - RGB node:
Tint
If you find any bugs or have feedback, please open an issue in the GitHub repository.


