本文へ移動
cccskills
無料GitHub で公開

blender-render-automation

Automate Blender rendering from the command line. Use when the user wants to set up renders, batch render scenes, configure Cycles or EEVEE, set up cameras and lights, render animations, create materials and shaders, or build a render pipeline with Blender Python scripting.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md9.4 KB
  • _scores.json2.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Blender Render Automation

Overview

Automate Blender's rendering pipeline from the terminal. Configure render engines (Cycles/EEVEE), set up cameras and lighting, create materials, and batch render scenes or animations — all headlessly via Python scripts.

Instructions

1. Configure the render engine

import bpy

scene = bpy.context.scene

# Cycles (ray-traced, production quality)
scene.render.engine = 'CYCLES'
cycles = scene.cycles
cycles.samples = 256
cycles.use_denoising = True
cycles.denoiser = 'OPENIMAGEDENOISE'
cycles.device = 'GPU'
prefs = bpy.context.preferences.addons['cycles'].preferences
prefs.compute_device_type = 'OPTIX'  # or 'CUDA', 'HIP', 'ONEAPI', 'METAL'
prefs.get_devices()
for device in prefs.devices:
    device.use = device.type != 'CPU'  # GPU only; leave CPU on to add it as a helper

# EEVEE (fast, real-time). The engine id changed: 'BLENDER_EEVEE_NEXT' in
# Blender 4.2-4.5, 'BLENDER_EEVEE' again from 5.0. Reading the accepted
# values avoids hardcoding either.
ids = [e.identifier for e in scene.render.bl_rna.properties['engine'].enum_items]
scene.render.engine = 'BLENDER_EEVEE' if 'BLENDER_EEVEE' in ids else 'BLENDER_EEVEE_NEXT'
scene.eevee.taa_render_samples = 64

blender -E help lists the engines your build accepts. EEVEE in background mode still needs a working OpenGL context; on a server without a display use Cycles, or run Blender under a virtual display.

2. Output resolution and format

render = bpy.context.scene.render
render.resolution_x = 1920
render.resolution_y = 1080
render.resolution_percentage = 100
render.image_settings.file_format = 'PNG'  # PNG, JPEG, OPEN_EXR, TIFF
render.image_settings.color_mode = 'RGBA'
render.film_transparent = True  # transparent background

Blender 5.0 added image_settings.media_type ('IMAGE', 'MULTI_LAYER_IMAGE', 'VIDEO'). Set it before file_format, otherwise choosing 'FFMPEG' fails (see the video example below). The attribute does not exist in 4.x.

3. Cameras and lighting

import math
from mathutils import Vector

# Camera
bpy.ops.object.camera_add(location=(7, -6, 5))
camera = bpy.context.active_object
target = Vector((0, 0, 1))
direction = target - camera.location
camera.rotation_euler = direction.to_track_quat('-Z', 'Y').to_euler()
cam_data = camera.data
cam_data.lens = 50
cam_data.dof.use_dof = True
cam_data.dof.focus_distance = 5
cam_data.dof.aperture_fstop = 2.8
bpy.context.scene.camera = camera

# Track-to constraint (auto-aim)
track = camera.constraints.new(type='TRACK_TO')
track.target = bpy.data.objects["MySubject"]

# Area light
bpy.ops.object.light_add(type='AREA', location=(0, -4, 3))
area = bpy.context.active_object
area.data.energy = 500
area.data.size = 2

# HDRI environment lighting
world = bpy.context.scene.world or bpy.data.worlds.new("World")
bpy.context.scene.world = world
world.use_nodes = True  # deprecated no-op in 5.0 (nodes are always on), required in 4.x
nodes = world.node_tree.nodes
links = world.node_tree.links
nodes.clear()
bg = nodes.new('ShaderNodeBackground')
env = nodes.new('ShaderNodeTexEnvironment')
output = nodes.new('ShaderNodeOutputWorld')
env.image = bpy.data.images.load("/home/render/hdri/studio_small_09_2k.hdr")
links.new(env.outputs['Color'], bg.inputs['Color'])
links.new(bg.outputs['Background'], output.inputs['Surface'])

4. Create materials

def create_pbr_material(name, color, metallic=0.0, roughness=0.5):
    mat = bpy.data.materials.new(name)
    mat.use_nodes = True  # deprecated no-op in 5.0, required in 4.x
    # look the node up by type: names are localized on non-English UIs
    bsdf = next(n for n in mat.node_tree.nodes if n.type == 'BSDF_PRINCIPLED')
    bsdf.inputs['Base Color'].default_value = (*color, 1)
    bsdf.inputs['Metallic'].default_value = metallic
    bsdf.inputs['Roughness'].default_value = roughness
    return mat

def create_glass_material(name, color=(1, 1, 1), ior=1.45):
    mat = bpy.data.materials.new(name)
    mat.use_nodes = True
    bsdf = next(n for n in mat.node_tree.nodes if n.type == 'BSDF_PRINCIPLED')
    bsdf.inputs['Base Color'].default_value = (*color, 1)
    bsdf.inputs['Transmission Weight'].default_value = 1.0
    bsdf.inputs['Roughness'].default_value = 0.0
    bsdf.inputs['IOR'].default_value = ior
    return mat

obj = bpy.data.objects["MyCube"]
obj.data.materials.append(create_pbr_material("BlueMetal", (0.1, 0.3, 0.8), metallic=1.0, roughness=0.2))

5. Render frames and animations

# Single frame
scene.render.filepath = "//renders/hero.png"  # // = folder of the .blend
bpy.ops.render.render(write_still=True)

# Animation as image sequence
scene.frame_start = 1
scene.frame_end = 250
scene.render.fps = 24
scene.render.filepath = "//renders/anim/frame_"  # frames get a number suffix: frame_0001.png
bpy.ops.render.render(animation=True)

# Animation as video
scene.render.filepath = "//renders/animation.mp4"
if hasattr(scene.render.image_settings, 'media_type'):  # Blender 5.0+
    scene.render.image_settings.media_type = 'VIDEO'
scene.render.image_settings.file_format = 'FFMPEG'
scene.render.ffmpeg.format = 'MPEG4'
scene.render.ffmpeg.codec = 'H264'
bpy.ops.render.render(animation=True)

CLI (no script needed). Arguments run in the order given, so put the frame/animation flag last:

blender -b scene.blend -E CYCLES -o //renders/frame_#### -F PNG -f 1
blender -b scene.blend -s 1 -e 100 -o //renders/shot_#### -a
blender -b scene.blend --python setup_render.py -f 1 -- --cycles-device OPTIX

# characters set the frame-number padding; -F overrides the saved format. Arguments after a lone -- are ignored by Blender, so your own script can read them from sys.argv and Cycles reads --cycles-device.

6. Batch render multiple cameras

import os

output_dir = bpy.path.abspath("//renders/cameras")
os.makedirs(output_dir, exist_ok=True)
scene = bpy.context.scene
for cam in [obj for obj in bpy.data.objects if obj.type == 'CAMERA']:
    scene.camera = cam
    scene.render.filepath = os.path.join(output_dir, f"{cam.name}.png")
    bpy.ops.render.render(write_still=True)

Examples

Example 1: Product shot render pipeline

User request: "Set up a clean studio render for a 3D product"

Output: Script that clears the scene, imports the product OBJ, creates a white backdrop with PBR material, sets up three-point lighting (key area light, fill, rim), adds a camera with Track-To constraint aimed at the product, configures Cycles at 128 samples with denoising, transparent background (RGBA), and renders at 2000x2000.

Run it with blender -b --factory-startup --python product_shot.py --python-exit-code 1; the result is renders/product_2000.png with a transparent background.

Example 2: Batch render turntable animation

User request: "Render a 360-degree turntable of my model — 36 frames"

Output: Script that creates a camera, loops 36 steps around the model at equal angular intervals using cos/sin, renders each frame with Cycles + denoising to a numbered PNG sequence, then provides the ffmpeg command to assemble into an MP4.

blender -b turntable.blend --python turntable.py
ffmpeg -framerate 12 -i renders/turntable/frame_%04d.png -c:v libx264 -pix_fmt yuv420p turntable.mp4

The result is 36 PNGs (frame_0001.png to frame_0036.png) and a 3-second MP4.

Guidelines

  • Always use --background (-b) for headless rendering. Add --python-exit-code 1 so a script error fails your CI job instead of exiting 0.
  • Do not run scripts on blend-files you did not make: Blender auto-runs embedded scripts unless started with --disable-autoexec.
  • Per-shot settings belong in the script, not the .blend: start from --factory-startup to keep user preferences from changing results.
  • Cycles is physically accurate but slow. EEVEE is fast but approximate. Use EEVEE for previews, Cycles for final output.
  • Enable denoising to get clean results with fewer samples — 128-256 with denoising often matches 1000+ without.
  • For GPU rendering, call prefs.get_devices() after setting compute_device_type.
  • Render animations as image sequences (PNG), not directly to video. If a render crashes mid-way, you keep completed frames.
  • Use film_transparent = True and RGBA for renders needing transparent backgrounds.
  • HDRI environment maps produce the most realistic lighting. Free HDRIs at Poly Haven.
  • The Principled BSDF handles most materials — adjust Base Color, Metallic, Roughness, and Transmission Weight (named plain Transmission before Blender 4.0).
  • Blender 5.0 renamed render passes (for example Z is now Depth, DiffCol is Diffuse Color) and moved the compositor to scene.compositing_node_group; scripts that touch either need a version check.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Scripts and configures production rendering in Autodesk 3ds Max with the V-Ray and Corona renderers: output size and files, render elements, denoising, light mix, batch and command-line rendering, and network rendering. Use when a user asks to set up a production render, render several cameras in one batch, render from the command line or on a render farm, add render passes for compositing, or cut render time for archviz and product shots.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

Covers scripting Autodesk 3ds Max, the 3D modeling and rendering application, with MAXScript and Python (pymxs): scene manipulation, object creation, material assignment, camera and light setup, batch operations, and file I/O. Use when tasks involve automating repetitive 3ds Max workflows, batch processing scenes, running scripts headless with 3dsmaxbatch, creating custom tools, or scripting scene setup for archviz, product visualization, or VFX.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

3proxy

無料

3proxy is a small open-source proxy server that runs HTTP/HTTPS, SOCKS4/5, SNI and TCP/UDP port-mapping proxies from one config file. Use when a user asks to set up an HTTP or SOCKS5 proxy, add proxy users and passwords, write 3proxy access rules, chain or rotate upstream (parent) proxies, limit bandwidth, connections or monthly traffic per user, run 3proxy in Docker, or fix a 3proxy.cfg that will not start.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

Builds Agent2Agent (A2A) servers and clients, the open protocol (originally from Google, now under the Linux Foundation) that lets AI agents from different frameworks call each other. Use when the user wants to create an A2A-compliant agent, build an Agent Card, implement task management, connect agents across frameworks, set up agent discovery, handle streaming responses, implement push notifications, or orchestrate multi-agent workflows. Trigger words: a2a, agent to agent, agent2agent, a2a protocol, a2a server, a2a client, agent card, agent interoperability, agent collaboration, multi-agent, agent discovery, a2a sdk, a2a task.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

Plans a controlled experiment (A/B test) so its result can be trusted: writes the hypothesis, picks one primary metric and the guardrails, computes sample size and run time, specifies how visitors are assigned and when exposure is logged, and reads out the result with a confidence interval. Use when someone says "set up an A/B test", "split test this page", "how many visitors do I need", "how long should the experiment run", "is this result significant", "can I stop the test early", or wants to test a headline, price, layout or onboarding change against the current version.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

ably

無料

Ably is a hosted realtime messaging service: clients publish and subscribe to named channels over WebSockets, see who is present, replay message history, and resume after a dropped connection. Use when a user asks to "add realtime updates", "push live notifications to the browser", "show who is online", "add a chat room with typing indicators", "publish from a serverless function", or "authenticate Ably clients without exposing the API key". Covers the ably 2.x JavaScript SDK (Realtime and REST), JWT token authentication, presence, history and rewind, batch publishing, and the @ably/chat 1.x SDK.

日本語の概要は準備中です。原文の説明を表示しています。

TerminalSkills/skills1652026年10月4日 更新

TerminalSkills のスキルをすべて見る

このスキルの問題を報告する