Skip to main content

Blender render helper

Project description

brender – Blender Render Helper

Automate and streamline your Blender animation rendering workflow with brender, a lightweight Python tool that handles parallel frame rendering, audio mixing, and video encoding using ffmpeg.

Perfect for artists and technical directors who want fast, scriptable renders with preprocessing control—ideal for test renders, batch jobs, or CI/CD pipelines.

🚀 Features

  • Parallel rendering using multiple Blender instances
  • 🎧 Automatic audio mixing from Blender’s sequencer
  • 🎬 Video assembly via ffmpeg (supports ProRes, H.264, and more)
  • ⚙️ Customizable output: format, codec, resolution, skip frames
  • 🔧 Pre-render hooks to modify scene settings (e.g., simplify, lower res)
  • 💾 Smart temp file management and output naming
  • 🐍 Pure Python – works alongside your existing scripts

☕ Support

If you find this project helpful, consider supporting me:

ko-fi

📦 Installation

pip install brender

⚙️ Requirements

  • Blender (installed or available in PATH)
  • ffmpeg (must be in PATH or set via .ffmpeg_bin)
  • Python 3.9+

Optional: Set custom Blender binary path:

export BLENDER_BIN="/path/to/blender"

🖼️ Basic Usage

Create a render script (e.g., render.py) in your project directory:

from brender import Render

# Define preprocessing logic (optional)
def prepare(scene):
    scene.render.resolution_percentage = 25   # Render at 25% resolution
    scene.render.use_simplify = True           # Enable simplifications
    scene.render.simplify_child_particles = 0.1
    scene.render.use_motion_blur = False       # Disable expensive effects

# Initialize renderer
r = Render()

# Set your .blend file
r.blender_file = "path/to/your/animation.blend"

# Optional: Skip every Nth frame (great for preview renders)
r.skip_factor = 4  # Render every 4th frame

# Optional: Customize output
r.output_dir = "/tmp/my_render"                # Custom output folder
r.container = "mp4"                            # Output format
r.video_args = "-c:v libx264 -crf 23 -pix_fmt yuv420p"
r.audio_args = "-c:a aac -b:a 192k"

# Start rendering!
r.render_video()  # Renders frames + mixes audio + encodes video
r.wait()          # Wait for all processes to finish

print("Final video:", r.final_video)

Run it:

python render.py

Output will go to:

/tmp/my_render/Scene_1_100_4_6.mp4

(Scene name, start-end frame, skip factor, effective FPS)


🔍 How It Works

  1. Inspect Scene: Reads frame range, FPS, and checks for audio.
  2. Render Frames: Splits the timeline across CPU cores and renders in parallel.
  3. Mix Audio: Exports audio mix from Blender’s sequencer (if present).
  4. Encode Video: Uses ffmpeg to combine frames and audio into final video.

All intermediate files (frames, audio) are stored under a temp directory named after your .blend file.


🛠️ Configuration Options

Attribute Default Description
blender_file BLENDER_FILE env Path to .blend file
scene_name "Scene" Name of the scene to render
skip_factor 1 Render every Nth frame (1 = all frames)
workers max(2, cpu_count // 4) Number of parallel Blender processes
container "mov" Output container: mov, mp4, avi, mkv
video_args "-c:v prores_ks -profile:v 5" FFmpeg video encoding args
audio_args "" FFmpeg audio encoding args
frames_format "png" Frame format: png, jpg, exr, etc.
output_dir /tmp/<blend-name> Root output directory
ffmpeg_bin "ffmpeg" Path to ffmpeg executable

Example: Fast preview with H.264:

r.container = "mp4"
r.video_args = "-c:v libx264 -preset fast -crf 22 -pix_fmt yuv420p"
r.audio_args = "-c:a aac -b:a 128k"
r.skip_factor = 2

🤝 Feedback & Contributions

Have ideas or issues? Open an issue or PR on Github!

brender – because rendering should be simple and fast.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brender-0.1.1.tar.gz (240.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brender-0.1.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file brender-0.1.1.tar.gz.

File metadata

  • Download URL: brender-0.1.1.tar.gz
  • Upload date:
  • Size: 240.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for brender-0.1.1.tar.gz
Algorithm Hash digest
SHA256 98fb432c2578d3d36240a89624a1bcdf1a67bc9b1e3686786ac4bf46527ab58c
MD5 969401043d83e79e6b15c2dc2444750d
BLAKE2b-256 c573e180ef8b64956495b7b9055bfc2590e76c27c63c7a5304bfe39a564c8600

See more details on using hashes here.

File details

Details for the file brender-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: brender-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for brender-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19ff8c7eb56ea1d2bfe0236540682ba191e337cc46a48318a3c2a845bf9223ae
MD5 19f4cc37075ed9b8c80baf863aacab84
BLAKE2b-256 588d9844e0b40bec9d3d4978d94a32b6b6d6fab95dba0e80ca07cce881bee599

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page