/blender:renderfrom blender
Use when writing or reviewing Python that sets Blender render, compositor, or sequencer state or defines a render engine, covering the output pipeline
Ships in blender. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Covers bpy code over render settings, color management, view layers, compositor effects, renders and their files, bakes, images, strips, and render engines.
[REFERENCES]:
RenderEngine subclassesGoverning member writes reset governed members:
| [INDEX] | [GOVERNING] | [RESETS] |
|---|---|---|
| [01] | image_settings.media_type | file_format outside the new media to PNG, OPEN_EXR_MULTILAYER, or FFMPEG |
| [02] | image_settings.media_type | ffmpeg at video_bitrate 0 to MKV, H264, constant_rate_factor MEDIUM, and 6000 |
| [03] | image_settings.file_format | color_mode and color_depth the format lacks to its first (JPEG RGB 8, OPEN_EXR 32) |
| [04] | image_settings.file_format | views_format MULTIVIEW off EXR to INDIVIDUAL |
| [05] | image_settings.file_format | linear_colorspace_settings.name to the working space on a linear format |
| [06] | display_settings.display_device | view_transform to a variant of its family the display offers, else Standard |
| [07] | view_settings.view_transform | look the new view lacks to None |
Governing writes keep every other member and refuse values outside live items:
file_format writes keep exr_codec and a linear_colorspace_settings.name naming a data space (Non-Color)look and move views both ways (AgX to AgX - HDR 1000 nits under Rec.2100-PQ, and back)file_format writes refuse a format outside the current media with TypeError, MULTI_LAYER_IMAGE holding OPEN_EXR_MULTILAYER alonelinear_colorspace_settings.name reads "" with an RNA warning until the first linear format write, and refuses "" with TypeErrorWrites follow mapping order, each governing member before the members it resets (display_settings before view_settings, file_format before color_depth, image_settings before ffmpeg). bl_rna.properties lists scene view_settings first and look before view_transform. Ordered assignment returns the host's error at its member:
def assigned(owner: Struct, values: Mapping[str, object], /) -> Outcome[None]:
def written(name: str, value: object) -> Outcome[None]:
match value:
case Mapping():
return assigned(getattr(owner, name), value)
case _ if value == getattr(owner, name):
return Ok(None)
case _:
return catch(setattr, exception=TypeError)(owner, name, value).map_error(partial(Fault.of, Reason.INVALID, owner.path_from_module(name)))
return reduce(lambda done, item: done.bind(lambda _: written(*item)), values.items(), Ok(None))
assigned(scene, {"display_settings": {"display_device": "Rec.2100-PQ"}, "view_settings": {"view_transform": "AgX"}}) returns INVALID at view_settings.view_transform with a cause listing the PQ display's views (AgX - HDR 1000 nits). Native calls keep preceding writes and changes to governed members omitted from the mapping.
Extensions store render state on Scene:
RenderSettings, ImageFormatSettings, view and display settings) refuse ID properties with TypeErrorbpy.props assigned to a nested settings class stays a class attribute, instance writes raising AttributeErrorRender code writes every member its output reads:
--factory-startup keep their render settings (border, crop, stamp, motion blur)render.compositor_device (GPU by default) and compositor_precision set compositor evaluationGPU compositing refuses renders past 8192 pixels a side, and results clamp each side to 8192 on GPU and 32768 on CPU with no member stating itscene.cycles.device = "GPU", then Cycles preferences compute_device_type and device use flags after refresh_devices()scene.cycles.denoiser lists the machine's denoisersPyOpenColorIO.GetCurrentConfig() returns Blender's live config, the file at bpy.data.colorspace.ocio_config_path with blender:* spaces added:
BLENDER_OCIO, else OCIO, else the bundled filegetCacheID(), and caches key by cache IDconfig.getDisplays() lists display_device identifiers, config.getViews(display) the view_transform identifiers a display offers<view> - <look>, else <family> - <look> for the family before -, else looks without -, and all views take Nonebpy.ops.wm.set_working_color_space(working_space=..., convert_colors=True) changes the read-only working spaceColors in code follow the working space and config names:
COLOR_GAMMA members (theme colors) sRGB-encodedmathutils.Color converts through from_srgb_to_scene_linear() and from_scene_linear_to_<space>() with no display, view, or lookconfig.getCanonicalName(<name, alias, or role>) returns, aliases written as is (Linear, Raw) raising TypeErrorcolorspace_settings.interop_id and ColorSpace.getInteropID() name a space across configs (data for Non-Color)bpy.data.colorspace.working_space_interop_id names the working space across configsCompositorNodeConvertColorSpace converts by space name or interop id, CompositorNodeConvertToDisplay applying display, view, and lookDisplayViewTransform(src=PyOpenColorIO.ROLE_SCENE_LINEAR, display=..., view=...) applies display and view at look None; a preceding ExposureContrastTransform adds exposure. Blender gamma, white balance, and curves stay outside that processor. PyOpenColorIO.ROLE_SCENE_LINEAR names the current working space. Premultiplied buffers divide alpha out of a copy, run one CPU processor, and multiply alpha back:
def displayed(config: PyOpenColorIO.Config, pixels: NDArray[np.float32], /, *, display: str, view: str) -> Outcome[NDArray[np.float32]]:
def encoded(processor: PyOpenColorIO.Processor) -> NDArray[np.float32]:
buffer, alpha = np.array(pixels, np.float32, order="C"), pixels[..., 3:]
nonzero = alpha != 0
np.divide(buffer[..., :3], alpha, out=buffer[..., :3], where=nonzero)
processor.getDefaultCPUProcessor().applyRGBA(buffer)
np.multiply(buffer[..., :3], alpha, out=buffer[..., :3], where=nonzero)
return buffer
transform = PyOpenColorIO.DisplayViewTransform(src=PyOpenColorIO.ROLE_SCENE_LINEAR, display=display, view=view)
return catch(config.getProcessor, exception=PyOpenColorIO.Exception)(transform).map(encoded).map_error(partial(Fault.of, Reason.INVALID, view))
display and view come from the scene's display_settings.display_device and view_settings.view_transform, config.getDefaultView("sRGB") reading Standard where new scenes hold AgX.
Baker writes a display, view, and looks as a LUT file in a format Baker.getFormats() lists, raising at construction on any other, and setDisplayView replaces its empty target space:
def cubed(config: PyOpenColorIO.Config, space: str, path: Path, /, *, display: str, view: str, form: str, looks: str = "", size: int = -1) -> Outcome[Path]:
def baked(baker: PyOpenColorIO.Baker) -> Outcome[Path]:
baker.setDisplayView(display, view)
return catch(baker.bake, exception=PyOpenColorIO.Exception)(str(path)).map(lambda _: path).map_error(partial(Fault.of, Reason.FAILED, str(path)))
made = catch(PyOpenColorIO.Baker, exception=PyOpenColorIO.Exception)(config=config, format=form, inputSpace=space, targetSpace="", looks=looks, cubeSize=size)
return made.map_error(partial(Fault.of, Reason.INVALID, form)).bind(baked)
looks takes OCIO look names, Blender's None look baking as "", and size keeps Baker's -1 default, the format's own cube size. Unknown spaces or looks and sizes below 2 raise at bake.
LUT bakes hold the OCIO transform alone:
view_settings.exposure, gamma, white balance, and curve_mapping stay out of the cubeACEScct) cover HDR input, a linear input space covering 0 to 1 aloneEvery view layer with use on renders and writes its passes:
scene.view_layers.new(name) starts with use and use_pass_combined on, its samples at 0 taking the scene's countbpy.ops.scene.view_layer_add(type="COPY") copies the active layer, background runs includedview_layer.layer_collection children set exclude, holdout, and indirect_only per collectionholdout collections render with alpha 0, and indirect_only collections reach Cycles bounces alone while EEVEE renders them directlyview_layer.material_override and world_override replace every material and the world in their layerPass flags sit on their engine's owner:
| [INDEX] | [OWNER] | [HOLDS] |
|---|---|---|
| [01] | view_layer | Shared use_pass_* and use_pass_cryptomatte_* flags, aovs, lightgroups |
| [02] | view_layer.cycles | use_pass_shadow_catcher, use_pass_volume_*, denoising_store_passes |
| [03] | view_layer.eevee | use_pass_transparent, use_pass_volume_direct, denoising_store_passes |
Engines write the passes they support, in an order of their own, and reads find parts by display name:
use_pass_shadow or use_pass_subsurface_*Noisy Image, and Noisy Shadow Catcher beside a shadow catcher, while scene and layer use_denoising are both onVolume Direct whenever flaggedview_layer.eevee.use_pass_bloom writes overwrite every EEVEE pass flag, True clearing transparent and volume flags and writing no partGrease Pencil with a Grease Pencil object alone, and Workbench writes Combined and Depth aloneview_layer.pass_alpha_threshold (0.5) keeps surfaces below it out of Depth, index, Normal, UV, and Vector partsShader AOVs write through AOV Output nodes matching their aov_name case for case, in Cycles and EEVEE alike:
view_layer.aovs.add() takes no name and makes the new AOV active, and code names it after the callVALUE AOVs write the node's Value input, COLOR AOVs its Color inputis_valid false and write no partuse_pass_cryptomatte_object, use_pass_cryptomatte_material, and use_pass_cryptomatte_asset write parts in Cycles and EEVEE alike:
view_layer.pass_cryptomatte_depth (2 to 16, 6 by default) sets the rank countCompositorNodeCryptomatteV2 mattes inside the compositor through source, scene, layer_name, and matte_id, a comma-separated name listLight groups gather emitters into Cycles parts <layer>.Combined_<group>, EEVEE writing none:
Object.lightgroup and World.lightgroup join a group by its stored name, storing any string with no faultview_layer.lightgroups.add(name=...) stores dots as _ and a taken name with _001, and renames rewrite each member's lightgroupCombined once every emitter (lights, emissive meshes, world) joins a groupCombined_<group> sockets, regrading groups with no renderbpy.ops.scene.view_layer_add_used_lightgroups and view_layer_remove_unused_lightgroups act on context.view_layerLight linking on an emitter names light_linking.receiver_collection and blocker_collection, Cycles and EEVEE honoring both:
collection_objects and collection_children items set light_linking.link_state, collection_objects aligning by index with objectsINCLUDE member light their INCLUDE members alone, else every object but their EXCLUDE members, child collections countingEXCLUDE members cast no shadow from the emitterscene.compositor_effects holds the compositor as a stack of SceneCompositorEffect items over CompositorNodeTree groups:
new(name=...) adds an active effect with enable_for_render and enable_for_preview onenable_for_render off, render.use_compositing = False skipping the stackenable_for_preview in place of enable_for_renderscene.view_layers[0] Combined pass at their first input, transparent black while that layer's use is offNodeSocketFloat oneNodeSocketFloat first inputs take image luminance, and later inputs their properties.inputs values whatever their namesnodes.new read the context scene until code sets scenerender_pre and animation frames edits before itscene.copy() shares effect groups with its source, effects sharing one group keeping their own input valuesscene.keyframe_insert(data_path=item.path_from_id("value")), frames reading keys on effect inputs or tree socketsStacks reconcile in place, keeping each surviving effect's input values and keys. SceneCompositorEffects holds new, remove, and clear alone, and move_compositor_effect_to_index moves an effect by name within context.scene, raising RuntimeError at its current index:
def stacked(context: bpy.types.Context, scene: bpy.types.Scene, groups: Sequence[bpy.types.CompositorNodeTree], /) -> None:
effects = scene.compositor_effects
names = frozenset(group.name for group in groups)
for stale in [effect for effect in effects if effect.name not in names]:
effects.remove(stale)
with context.temp_override(scene=scene):
for index, group in enumerate(groups):
if (effect := effects.get(group.name) or effects.new(name=group.name)).node_group != group:
effect.node_group = group
if effects.find(group.name) != index:
bpy.ops.scene.move_compositor_effect_to_index(name=group.name, index=index)
stacked(context, scene, (grade, bloom)) names each effect after its group, and new on a taken name suffixes it (Grade.001).
compositing_nodes_essentials.blend in bpy.utils.system_resource("DATAFILES", path="assets/nodes") holds built-in groups:
allow_usage_in_scene_compositor_effect set are effects (Bloom, Vignette, Film Grain), the rest helpers (Retime)CompositorNodeOutputFile nodes in an effect group write their own files during a render:
directory starts as a copy of render.filepath and names a folder (<dir>/r_ writing into <dir>/r_/)file_name at {blend_name}, format at OPEN_EXR_MULTILAYER 32-bit with codec NONE, and no itemsoverride_node_format take their own format<directory>/<file_name>.exr with one part per item, single-layer stills <directory>/<file_name><item>.<ext>sg_beauty0003.png), and # runs in file_name take the frame in every render, stills includedbpy.ops.render.render renders the context scene, and code picks scene, layer, frame, and camera before each call:
context.temp_override(scene=scene, view_layer=layer) renders scene at its own framescene="<name>" renders the named scene at context scene's frame and writes that frame onto itINVOKE_DEFAULT calls start a render job answering RUNNING_MODAL in a GUI session, background runs rendering at the callframe_start and frame_end override the range of one animation=True call, and raise RuntimeError on a stilltimeline_markers.new(name, frame=...).camera = camera binds a camera from that frame, earlier frames taking the first marker's cameraframe_set write a bound camera into scene.cameralayer= selects single-layer file output; background renders every layer with use on despite use_single_layeruse to the requested layer and restore prior flags afterwarduse off write a transparent image, and crash Blender writing EXR while compositor_effects is emptywrite_still under VIDEO) raise RuntimeError and set a background exit code of 1 a later success clearsrender_* handler call for itRender handlers fire render_init, then per frame render_pre, frame_change_pre, frame_change_post, render_post, and render_write, then render_complete or render_cancel:
render_* handlers take (scene, None), and render_stats (str, None) repeatedlyrender_write fires on calls that write files, after the file existsrender_pre through render_write before render_cancelrender.filepath writes in render_init set every file path of the call, writes in render_pre each animation frame's path alonesize (0, 0) and no pixels in background runssave_render(filepath, scene=scene) writes the active render slot, using scene's live result when that slot is the last rendered onebpy.app.is_job_running("RENDER") reads False in background runsRender calls name files from render.filepath, PNG output at frame 1, video under the default MKV container and scene range 1 to 250:
| [INDEX] | [CALL] | [FILEPATH] | [WRITES] |
|---|---|---|---|
| [01] | write_still=True | <dir>/a.png | <dir>/a.png |
| [02] | write_still=True | <dir>/b_#### | <dir>/b_####.png |
| [03] | animation=True | <dir>/b_## | <dir>/b_01.png |
| [04] | animation=True | <dir>/m_##_n_### | <dir>/m_##_n_001.png |
| [05] | animation=True | <dir>/c_ | <dir>/c_0001.png |
| [06] | animation=True | <dir>/a.png | <dir>/a.png0001.png |
| [07] | write_still=True | <dir>/ | <dir>/Untitled.png |
| [08] | animation=True | <dir>/ | <dir>/0001.png |
| [09] | write_still=True | <dir>/{blend_name}_t | <dir>/Unsaved_t.png |
| [10] | animation=True, VIDEO | <dir>/clip_ | <dir>/clip_0001-0250.mkv |
| [11] | animation=True, VIDEO | <dir>/shot.mkv | <dir>/shot.mkv |
| [12] | animation=True, VIDEO | <dir>/shot.mp4 | <dir>/shot.mp40001-0250.mkv |
Written names derive from render.filepath, its templates, and the scene format:
frame_start to frame_end whatever the call's rangerender.filepath and File Output paths resolve templates ({blend_name}, {scene_name}, {camera_name}, {resolution_x}, {fps}){{), a lone brace raising RuntimeError at frame_path and renderrender.frame_path(frame=..., view=...) returns the written name with templates expanded, bpy.path.abspath leaving them in bracesuse_file_extension swaps a known extension of another format (a.jpg written as a.png), and off it writes no extensionrender.file_extension reads the suffix the scene format writesRender settings decide what each write adds or skips:
use_overwrite = False skips existing animation frames with no handler call and use_placeholder writes an empty file before each frameimage_settings.use_preview writes a display-encoded JPEG beside each EXRrender.dither_intensitycolor_mode = "RGB" writes no alpha channel, and reloads read alpha 1Output color follows format and scene color management:
Rec.2100-PQ) hold PQ-encoded valuesimage_settings.color_management = "OVERRIDE" copies the scene's view and display settings once, view_settings then driving display formatslinear_colorspace_settings.name under OVERRIDE names the linear formats' space (ACEScg), view and exposure leaving linear files untouchedOVERRIDE item or node format, else scene image_settings under OVERRIDE, else scene display and viewMulti-view renders follow render.use_multiview and render.views, each view writing its file_suffix:
render.views_format = "STEREO_3D" renders left and right, "MULTIVIEW" every view with use, views.new views starting with no suffix<filepath><file_suffix>.<ext>, animations <filepath><frame><file_suffix>.<ext>image_settings.views_format = "STEREO_3D" packs views in one file, SIDEBYSIDE doubling width and TOPBOTTOM heightimage_settings.views_format = "MULTIVIEW" writes every view into one EXRbpy.ops.object.bake renders through Cycles into the image of each material's active Image Texture node:
RuntimeError("Current render engine does not support baking")selected_objects and active_object, an empty selection raising No valid selected objectsnodes.activeRuntimeErrorscene.render.bake starts with target at IMAGE_TEXTURES, save_mode at INTERNAL, use_clear on, and margin 16INTERNAL saves leave baked pixels in the image until save() or pack(), byte images storing values in their colorspaceOne scope adds a target node to every material, makes it active, and removes it after the bake on every path:
def baked(context: bpy.types.Context, item: bpy.types.Object, image: bpy.types.Image, /, *, kind: "rna_enums.BakePassTypeItems") -> Outcome[bpy.types.Image]:
with ExitStack() as scope:
for tree in {tree for slot in item.material_slots if slot.material is not None and (tree := slot.material.node_tree) is not None}:
if isinstance(target := tree.nodes.new(bpy.types.ShaderNodeTexImage.bl_idname), bpy.types.ShaderNodeTexImage):
scope.callback(setattr, tree.nodes, "active", tree.nodes.active)
scope.callback(tree.nodes.remove, target)
target.image, tree.nodes.active = image, target
with context.temp_override(active_object=item, selected_objects=[item]):
return catch(bpy.ops.object.bake, exception=RuntimeError)(type=kind, target="IMAGE_TEXTURES", save_mode="INTERNAL").map(lambda _: image).map_error(partial(Fault.of, Reason.FAILED, item.name))
baked(context, item, image, kind=context.scene.cycles.bake_type) bakes the pass the Bake panel shows, an unset type baking COMBINED whatever the scene holds.
Images hold a colorspace tag, a format, and an alpha mode the host applies at each read and write:
colorspace_settings.name before their first pixel write, a later colorspace write clearing pixels to blackbpy.data.colorspace.working_space, byte images sRGB, and is_data=True images Non-Colorfile_format PNG and alpha_mode STRAIGHT, and images.new defaults to alpha=False, saves writing RGB aloneNon-Color and round-trip through EXR unchanged, PNG saves dividing color by alphaalpha_mode PREMUL, PNG images to STRAIGHTcolorInteropID) at load, and a tag code writes persists in the .blend over itimage.save() writes image.file_format in its colorspace tag, path extensions choosing nothing (PNG bytes in a.exr):
file_format and filepath_raw, then call save(), the image becoming a file image at that pathsave(filepath=...) turns an image into a file image with image.filepath unset, its pixels lost at next reload or file loadsave() on a generated color image retags it sRGB in every format, alpha below 1 writing wrong colors that save_render() writes rightsave(save_copy=True) writes an identical file and keeps the image generatedimage.save_render(filepath, scene=scene) writes a copy in scene image_settings format and color managementScript-written pixels of a generated image persist through pack() or a saved file alone, a fake user keeping the image without them:
pack() stores float images as full-precision EXR and byte images as PNG, keeping the tagalpha_mode = "PREMUL", STRAIGHT premultiplying againTiled images (tiled=True) save one file per tile through <UDIM> in filepath_raw:
tiles.new() adds a tile with no buffer that save() refuses until bpy.ops.image.tile_fill() runs under temp_override(edit_image=image)bpy.ops.image.tile_add(number=..., fill=True) under the same override adds a filled tileExports take a caller-prepared scene's output format and color settings through save_render, keeping the image's source and tag:
def exported(image: bpy.types.Image, path: Path, scene: bpy.types.Scene, /) -> Outcome[Path]:
return catch(image.save_render, exception=RuntimeError)(str(path), scene=scene).map(lambda _: path).map_error(partial(Fault.of, Reason.UNWRITABLE, str(path)))
exported(image, path, scene) writes a half-float ACEScg EXR when the scene's output uses OVERRIDE color management, OPEN_EXR, depth 16, and linear colorspace ACEScg. Unwritable folders fail UNWRITABLE with the host's report as cause.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bsamiee/rasm --plugin blender7 skills in this plugin
/codingUse when writing or reviewing Python that runs inside Blender, covering bpy code from data references to host boundaries/debuggingUse when Python or native code inside Blender gives a wrong value, raises, hangs, crashes, or never stops at a breakpoint, covering debug endpoints, stops by code kind, extension reloads, stack dumps, crash reports, native frames, and GPU captures/extensionsUse when writing or reviewing a Blender extension's registration, preferences, or manifest, covering lifecycle and packagingOther plugins' skills for the same job