ProteinMotion
PYTHON API · METAL · EEVEE

Protein animation
in Python

Load a protein structure or trajectory, add animations and labels, and export a video. Render cartoons, ball-and-stick models, ribbons, and molecular surfaces.

Python 3.11+ · Apple silicon · MIT licensed

CALMODULIN IN FOCUS01:08 · EEVEE · 60 FPS
Depth of field · atomic detail · surfacesChapters and code
01

Molecular representations

Cartoon, ribbon, atoms & surfaces

02

Animation

Movement, color & transparency

03

Labels & measurements

Residues, distances & interactions

04

States & trajectories

NMR ensembles & MD playback

PYTHON SCENES

Define each animation
in a Python script.

Create a protein object, add it to a scene, and call play() to animate it. The API follows Manim’s scene syntax. Set the duration of each animation and combine animations in one call to run them together.

Read a complete script

ProteinMotion runs as a standalone package. Use the exported videos in Manim, presentations, or a video editor.

scene.pyINSIDE A PROTEINSCENE
python
class MyFilm(ProteinScene):
    def construct(self):
        p = Protein.from_file("protein.cif").cartoon()
        self.add(p)
        self.camera.frame(p)

        helix = p.select(residues=(23, 34))
        self.play(Colorize(helix, "#50e0d0"), run_time=1.5)
        self.play(Write(helix.callout("α helix")))
        self.focus(helix, run_time=1.5)
        self.play(PlayTrajectory(p), run_time=8)

Numerical properties

Color residues by B factors, RMSF, or custom values. Use cartoon thickness and a color scale to show the range.

View code and output

Plots that follow the movie

Show distance traces, contact maps, and a sequence strip alongside trajectory playback.

View code and output

Density maps and slices

Load an MRC or CCP4 map, change its contour level, and move a slice through the volume.

View code and output

Depth of field with EEVEE

Set lens focus on selected residues and animate focus changes as the camera moves. The homepage film uses EEVEE for helix close-ups, transparent surroundings, and molecular surfaces. Install Blender separately to render the scene.

View the film and full script

Use with an AI agent

The ProteinMotion Movies skill provides instructions and examples for writing scenes, rendering videos, and checking the results. Use it with an agent that can read local files and run Python commands.

Set up the skill

Example structures and scripts

Ubiquitin, calmodulin, troponin C, and GroEL/GroES examples are included.

View examples