Skip to content

Blender Isometric Car Renderer

This script automates the process of rendering an isometric car model in Blender from multiple angles and compiles the resulting images into a spritesheet. The script ensures correct lighting, camera positioning, rendering settings, and image processing using Blender’s Python API and Pillow for image manipulation.

Camera and Light Setup

  • Ensures an orthographic camera is present; otherwise, creates one.
  • Configures an isometric perspective with predefined angles.
  • Adds a SUN light source named "Iso_Light" if not found.
  • Positions the light to create soft shadows.

Car Model Setup

  • Searches for an object named "car-model".
  • Moves the camera to a fixed isometric position.
  • Ensures all constraints on the car are muted for rotation control.

Rendering Settings

  • Output format: PNG (with transparency).
  • Image resolution: 80x80 pixels per sprite.
  • Anti-aliasing: Disabled for sharp pixel rendering.
  • Frame count: 60 (adjustable for smoother rotation).
  • Rendering engine: Eevee (optimized for speed).

Rendering Process

  1. Loops through 60 angles, rotating the car around its Z-axis.
  2. Clears animation data and applies new rotation values.
  3. Renders each frame and saves it as a PNG file.

Spritesheet Generation

  • Uses the Pillow library to combine all rendered images.
  • Arranges images in one row, each offset horizontally.
  • Saves the final spritesheet as "spritesheet.png" in the output folder.

Output Directory

  • The script automatically creates a //sprites folder inside the Blender project directory.
  • Individual frames are saved as car_00.png, car_01.png, … car_59.png.
  • The final spritesheet is named "spritesheet.png".

Example Usage

Running the Script in Blender

  1. Open Blender.
  2. Switch to the Scripting tab.
  3. Create a new script, paste the code, and run it.

Customization Options

ParameterDescriptionDefault Value
anglesNumber of rotation frames60
image_sizeResolution of each sprite(80, 80)
camera.data.ortho_scaleCamera zoom level6
light.data.energyLight intensity5
output_folderSave location for images"//sprites"