Reference navigation
On this page
CLASS · v0.9.1
EEVEEOptions
Configure the optional EEVEE renderer. Blender 4.5+ is installed separately.
from proteinmotion import EEVEEOptionsConstructor
EEVEEOptions(
blender: str | None=None,
samples: int=64,
supersampling: float=1.5,
max_blur: float=24.0,
max_opacity_layers: int=64,
timeout: float=180.0,
)Parameters
| Parameter | Default | Description |
|---|---|---|
blenderstr | None | None | Optional Blender executable path. Otherwise use PROTEINMOTION_BLENDER, PATH or the macOS application. |
samplesint | 64 | Positive number of EEVEE samples per pixel; default 64. |
supersamplingfloat | 1.5 | Spatial resolution multiplier of at least 1. Output is downsampled to the requested size. |
max_blurfloat | 24.0 | Maximum depth-of-field blur size in output pixels. |
max_opacity_layersint | 64 | Maximum distinct positive opacity levels per frame. Rendering cost grows with this count. |
timeoutfloat | 180.0 | Seconds allowed for Blender startup or one frame before an error is raised. |
Notes
Defaults use fixed sampling, 1.5× spatial supersampling, and scene-linear group fades. Each opacity level adds a render layer.
Attributes
| Name | Description |
|---|---|
blender | Optional Blender executable path. Otherwise use PROTEINMOTION_BLENDER, PATH or the macOS application. |
samples | Positive number of EEVEE samples per pixel; default 64. |
supersampling | Spatial resolution multiplier of at least 1. Output is downsampled to the requested size. |
max_blur | Maximum depth-of-field blur size in output pixels. |
max_opacity_layers | Maximum distinct positive opacity levels per frame. Rendering cost grows with this count. |
timeout | Seconds allowed for Blender startup or one frame before an error is raised. |
Example and output
This excerpt runs inside a scene’s construct() method. The full example file includes imports, structure loading, and camera setup. Run it from a repository checkout.
Code Full script
"""Calmodulin 1CLL: select a helix, fade its context, then pull lens focus.
Render with:
proteinmotion render examples/eevee_focus.py HelixFocus --renderer eevee \
--width 960 --height 540 --fps 60 -o helix-focus.mp4
Requires Blender 4.5+. The camera motion illustrates the deposited structure.
"""
from pathlib import Path
from proteinmotion import FocusPull, Protein, ProteinScene, SetOpacity, Text, Write
DATA = Path(__file__).resolve().parent / "data"
class HelixFocus(ProteinScene):
def construct(self):
protein = Protein.from_file(DATA / "1cll.cif", chains="A").cartoon(color="#7299b4").center()
protein.rotate(0.9, axis=(0, 0, 1))
helix = protein.select(chain="A", residues=(5, 19))
helix.set_color("#ffb34c")
# The context selection includes every atom outside the highlighted helix.
context = protein.select(chain="A", residues=[4, *range(20, 149)])
far_region = protein.select(chain="A", residues=(82, 92), atoms="CA")
self.add(protein)
self.camera.frame(protein, aspect=self.width / self.height).zoom(1.5)
self.camera.set_focus(protein, chain="A", residues=(5, 19), atoms="CA", fstop=4)
self.add(Text("Calmodulin · 1CLL", position=(0.055, 0.9), font_size=30))
label = helix.callout(
"Alpha helix",
subtitle="Chain A · residues 5–19",
position=(0.68, 0.13),
color="#ffb34c",
font_size=38,
)
self.play(Write(label), run_time=0.8)
self.play(SetOpacity(context, 0.06), run_time=1)
self.play(self.camera.animate.orbit(theta=0.28), run_time=2)
self.wait(0.4)
self.play(FocusPull(self.camera, far_region, fstop=2.8), SetOpacity(context, 0.35), run_time=1.4)
self.wait(0.4)
self.play(FocusPull(self.camera, helix, fstop=4), SetOpacity(context, 0.06), run_time=1.2)
self.wait(0.8)Output Preview · 8.0 s · 60 fps
Calmodulin: highlight residues 5–19, fade the surrounding cartoon, and change lens focus.