Skip to Content

Single Server Rendering

This guide demonstrates how to automate multi-camera rendering from a single .blend file using Blender’s bpy module on Brender Cloud.

Example Files

Core Script

import bpy import os from pathlib import Path def render_cameras(): # Get the output folder from environment variable or use default output_folder = os.getenv('BC_OUTPUT_PATH', '/default/output/path') output_path = Path(output_folder) # Find all cameras in the scene cameras = [obj for obj in bpy.data.objects if obj.type == 'CAMERA'] if not cameras: print("No cameras found in scene") return scene = bpy.context.scene for camera in cameras: # Set the scene camera to the current camera scene.camera = camera # Build the output path for the current camera camera_output_path = output_path / f"{camera.name}" scene.render.filepath = str(camera_output_path) print(f"Rendering {camera.name} => {scene.render.filepath}") bpy.ops.render.render(animation=False, write_still=True) if __name__ == "__main__": render_cameras()

Key Components Explained

1. Camera Discovery

cameras = [obj for obj in bpy.data.objects if obj.type == 'CAMERA']

Finds all camera objects in the current Blender scene.

2. Output Configuration

scene.render.filepath = str(camera_output_path)

Uses BC_OUTPUT_PATH environment variable to set render destination paths.

⚠️

Use always BC_OUTPUT_PATH for proper path handling. Your render output may be lost if you use a hardcoded path.

3. Render Execution

bpy.ops.render.render(animation=False, write_still=True)

Renders single frame for each camera with final quality settings.

Environment Variables

Default Variables

VariableDescriptionExample Usage
BC_OUTPUT_PATHThe output folder for the current server, where rendered frames and other files are saved.bpy.context.scene.render.filepath = str(Path(os.getenv("BC_OUTPUT_PATH")) / "frame_####")
BC_SERVER_INDEXThe index of the current server within a server array; useful for distributing tasks.Set automatically during execution.
BC_SERVER_ARRAY_SIZETotal number of servers in use; this variable is only available when more than one server is active.Used to coordinate parallel tasks across servers.

Custom Variables

Add custom key-value pairs via the Add Env button in job configuration:

VariableDescriptionExample Usage
BC_CUSTOM_VARCustom environment variableos.getenv('BC_CUSTOM_VAR', 'default_value')

Custom variables should begin with BC_CUSTOM to avoid conflicts with predefined variables. They can be used to pass parameters or configuration options without modifying the script code.

Usage Steps

Upload Script

Test Script

  • Click on script name to access detail view
  • Click Test Script to run a test render
  • If successful, proceed to job configuration

Configure Job

  • Navigate to New Render
  • Upload your .blend file or .zip containing .blend and assets
  • Select multi_camera_render.py from the script dropdown
  • Choose 1 server for rendering (for multi-server rendering, see Multi-Server Rendering)

Launch Render

Expected Output

# BC_OUTPUT_PATH: /app/bc_output/ /app/bc_output/ ├── cam_001.png ├── cam_002.png └── cam_003.png

This script pattern works for 1-10 cameras. For larger quantities (>20 cameras), consider multi-server rendering.

Download Output

  • Navigate to Render Job Details > Click on job ID cell
  • Click Download to retrieve rendered frames (.zip)
  • Zip file contains all frames rendered by the script
Last updated on