Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a175698
poc(morph): open-source cmd.morph with rigid-segment screw interpolation
javierbq Oct 21, 2026
dca2ae4
docs(morph): design spec for smooth playback of multi-state objects
javierbq Oct 22, 2026
138b184
docs(morph): implementation plan (12 tasks: engine job layer, worker,…
javierbq Oct 22, 2026
e81767e
feat(morph): keep key frames exact under refinement; engine tests in …
javierbq Oct 22, 2026
fa14abb
feat(morph): job-layer building blocks (name, estimate, validation, l…
javierbq Oct 22, 2026
0ddd722
feat(morph): MorphJob step/pump pipeline, sync morph_object, cancel, …
javierbq Oct 22, 2026
e59cbcc
fix(morph): never carry surfaces; never claim a non-morph object's name
javierbq Oct 22, 2026
9bc2e35
feat(morph): publish morph jobs and sources in the object-panel poll;…
javierbq Oct 22, 2026
fe8cd92
feat(morph): compute legs on a worker thread; pump lands them on main
javierbq Oct 22, 2026
c42b6b4
fix(morph): keep the worker at most one leg ahead of pump
javierbq Oct 22, 2026
02b149a
fix(morph): release the worker when a leg lands, not when pump takes it
javierbq Oct 22, 2026
4dfd951
fix(morph): pump waits for the worker's next leg within its budget
javierbq Oct 22, 2026
1ff630c
feat(morph): MorphSettings model, clip mapping and completion rules
javierbq Oct 22, 2026
ef3c247
feat(morph): engine plumbing — payload, tray card, completion hook
javierbq Oct 22, 2026
a3887f0
feat(morph): Object panel capsule, sheet and badge
javierbq Oct 22, 2026
1018c1b
fix(morph): keep 4-digit counts on one line; stop playback on Delete …
javierbq Oct 22, 2026
2e176af
fix(morph): build each pump's frames while the morph is still hidden
javierbq Oct 22, 2026
18a1d97
fix(morph): no tick mark per state on long State sliders
javierbq Oct 22, 2026
6b03555
fix(morph): stop playback timers whose object is gone, and a morph's …
javierbq Oct 22, 2026
81e569d
fix(morph): Morph on a reloaded source rebuilds <source>_morph
javierbq Oct 22, 2026
bc9807f
fix(morph): clamp the sheet's pre-fill; red "Delete morph" on macOS
javierbq Oct 22, 2026
6ef98ce
fix(morph): keep pump() inside its budget once it builds what it landed
javierbq Oct 22, 2026
3858e05
fix(morph): name <source>_morph to Python only for a reloaded morph
javierbq Oct 22, 2026
7d28fb9
feat(morph): states clips remember a morph stride and remap on rebuild
javierbq Oct 22, 2026
5d8737d
feat(morph): Smooth transitions toggle in the Play-models sheet
javierbq Oct 22, 2026
85a500b
fix(morph): Play-models sheet owns its state; keep the morph settings…
javierbq Oct 22, 2026
87c081a
docs(morph): command reference and guide
javierbq Oct 22, 2026
5bedd63
docs(morph): fix review findings (round 1)
javierbq Oct 22, 2026
1bb1771
Merge remote-tracking branch 'origin/master' into worktree-morph-poc
javierbq Oct 22, 2026
66d1ceb
fix(morph): morph clips keep their stride through a session save (#901)
javierbq Oct 22, 2026
8177f61
fix(morph): hold the smooth Play-models Add as one action over an unt…
javierbq Oct 22, 2026
d8be721
feat(morph): make morphing visible to MCP clients (#904 MCP awareness)
javierbq Oct 22, 2026
d0d1c58
fix(morph): address integration review (round 1)
javierbq Oct 22, 2026
62a7ca8
fix(morph): address integration review (round 2)
javierbq Oct 22, 2026
3280a4e
Merge remote-tracking branch 'origin/master' into worktree-morph-poc
javierbq Oct 22, 2026
b2d8744
Merge remote-tracking branch 'origin/master' into worktree-morph-poc
javierbq Oct 26, 2026
f0780ac
fix(morph): cmd.morph refuses a state without coordinates and leaves …
javierbq Oct 26, 2026
b16fbe0
fix(morph): measured memory estimate, memory-scaled limits, refusals …
javierbq Oct 26, 2026
4ce2f27
fix(morph): document the measured memory model and refusal cards
javierbq Oct 26, 2026
c670dd2
fix(morph): address fix-1 review
javierbq Oct 26, 2026
fae3842
fix(morph): rigid fit by Horn's quaternion method, which always conve…
javierbq Oct 26, 2026
c4f8823
fix(morph): refuse two selections of one object; test pairing, rates,…
javierbq Oct 26, 2026
1768dbd
fix(morph): test loop=0, the linear method and rates through morph_ob…
javierbq Oct 26, 2026
caed394
fix(morph): address fix-2 review
javierbq Oct 26, 2026
df982a8
fix(morph): sculpt once per job in slices, no state pin, async alias,…
javierbq Oct 26, 2026
529c69e
fix(morph): address fix-3 review
javierbq Oct 26, 2026
19bfb13
fix(morph): sheets estimate from Python's bytes per frame, iOS memory…
javierbq Oct 26, 2026
d647e32
fix(morph): address fix-4 review
javierbq Oct 27, 2026
74f3aef
fix(morph): docs and MCP text match the shipped behaviour
javierbq Oct 27, 2026
cdbf939
fix(morph): address fix-5 review
javierbq Oct 27, 2026
c96117c
fix(morph): leave the Objects-panel players' pins out of saved sessions
javierbq Oct 27, 2026
2feeb1e
fix(morph): the Objects-panel players keep appkit_movie's registry
javierbq Oct 27, 2026
c26867d
fix(morph): address close-out B review
javierbq Oct 27, 2026
ca527b0
fix(morph): the Morph sheet's build hint counts one model's atoms
javierbq Oct 27, 2026
6122bc8
fix(morph): a clip's caption lays out in the part of it on screen
javierbq Oct 27, 2026
6fa25a4
fix(morph): the guide names the short not-built caption
javierbq Oct 27, 2026
12494d1
fix(morph): address close-out C review
javierbq Oct 27, 2026
5f08c12
fix(core): a deferred scene thumbnail no longer writes into a freed s…
javierbq Oct 27, 2026
08cf51c
fix(morph): address close-out D review
javierbq Oct 27, 2026
1575e9b
Merge branch 'master' into worktree-morph-poc
javierbq Oct 27, 2026
d36fc5d
test(morph): measure the timeline lane from its clip view
javierbq Oct 27, 2026
52bf3a9
Merge branch 'master' into worktree-morph-poc
javierbq Oct 27, 2026
4a79c87
fix(morph): refresh expired frame-cost figures oldest first
javierbq Oct 27, 2026
ad7d890
fix(morph): a partial save leaves out a nested group player's CGO pin
javierbq Oct 27, 2026
e42a4cf
fix(core): a queued scene thumbnail lands only in the scene it was for
javierbq Oct 28, 2026
42629bd
fix(morph): only a molecule named <source>_morph is a restored morph
javierbq Oct 28, 2026
6f1274d
fix(morph): Add waits while the morph it would name is still building
javierbq Oct 28, 2026
a813996
perf(morph): read a nested group's members from a binary session dump
javierbq Oct 28, 2026
83afd99
fix(morph): Smooth transitions only for a molecule
javierbq Oct 28, 2026
31ab08d
docs(morph): correct the guide, command help and agent guide against …
javierbq Oct 28, 2026
32658b0
docs(morph): screenshots of the morph controls in the guide
javierbq Oct 28, 2026
f10ca75
fix(movie): models hold outside their Play-models clips (stopgap, #920)
javierbq Oct 29, 2026
80619a4
fix(movie): renamed players, group CGOs and paired scene moves (review)
javierbq Oct 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/raymol-embedded-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ jobs:

- name: Run RayMol unit tests under embedded pymol
env:
# ortho_deferred_reentrant.py's Guard Malloc subtest makes a read of
# the freed deferred-job queue fault deterministically: fail, don't
# skip, if Guard Malloc cannot load here (e.g. a hardened-runtime
# Python that drops DYLD_INSERT_LIBRARIES). Drop this only knowingly.
# scene_thumbnail_defer.py's Guard Malloc subtests are the only ones
# that catch the freed-scene thumbnail write, and
# ortho_deferred_reentrant.py's makes a read of the freed
# deferred-job queue fault deterministically: fail, don't skip, if
# Guard Malloc cannot load here (e.g. a hardened-runtime Python that
# drops DYLD_INSERT_LIBRARIES). Drop this only knowingly.
RAYMOL_REQUIRE_GMALLOC: "1"
run: |
pymol -ckqy testing/testing.py --run \
Expand Down Expand Up @@ -138,16 +140,21 @@ jobs:
testing/tests/raymol/movie_object_settings.py \
testing/tests/raymol/movie_hold_model.py \
testing/tests/raymol/notes_session.py \
testing/tests/raymol/timeline_session.py \
testing/tests/raymol/ortho_deferred_reentrant.py \
testing/tests/jira/multistate_timeline.py \
testing/tests/raymol/metal_frees_gpu_buffers.py \
testing/tests/raymol/metal_pick.py \
testing/tests/raymol/metal_rt_reflect.py \
testing/tests/raymol/metal_rt_transparent.py \
testing/tests/raymol/metal_shader_sources.py \
testing/tests/raymol/morph_engine.py \
testing/tests/raymol/morph_jobs.py \
testing/tests/raymol/morph_panel.py \
testing/tests/raymol/scene_materials.py \
testing/tests/raymol/scene_object_settings.py \
testing/tests/raymol/scene_ttt.py \
testing/tests/raymol/scene_thumbnail_defer.py \
testing/tests/raymol/session_view_missing.py \
testing/tests/raymol/shadow_extent.py \
testing/tests/raymol/transparency_peel.py \
Expand Down
1 change: 1 addition & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default defineConfig({
{ label: 'Studio Lights & Atmosphere', slug: 'guides/lighting' },
{ label: 'Camera, Lens & Depth of Field', slug: 'guides/camera' },
{ label: 'Movies & Scenes', slug: 'guides/movies' },
{ label: 'Morphing', slug: 'guides/morph' },
],
},
{
Expand Down
Binary file added docs/src/assets/docs/morph-building.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/docs/morph-done.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/docs/morph-play-models.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/docs/morph-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/docs/morph-state-row.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/mcp-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ General tools:
| :--- | :--- |
| `run_pymol_command` | Executes a single PyMOL command statement (e.g., `fetch 1ubq, async=0`, `show cartoon`, `color marine, chain A`). |
| `run_python` | Evaluates Python code in a persistent execution namespace with access to the PyMOL API (`cmd`), NumPy (`np` if available), and Biopython (`Bio` if available). Global variables persist across consecutive calls. |
| `get_session_state` | Returns a structured JSON overview of the active session: loaded molecular objects, atom counts, named selections, current frame, the 18-float camera orientation matrix, and RayMol state (the light rig and atmosphere, render effects, materials, scenes and prediction jobs). |
| `get_session_state` | Returns a structured JSON overview of the active session: loaded molecular objects, atom counts, named selections, current frame, the 18-float camera orientation matrix, and RayMol state (the light rig and atmosphere, render effects, materials, scenes, prediction jobs and morphs). |
| `capture_viewport` | Renders the live 3D viewport and returns a PNG image. Rendered images use RayMol's full Metal pipeline (including active studio light rigs and materials) so the AI model sees the exact scene. |
| `search_pdb` | Queries the RCSB Protein Data Bank via full-text search and returns matching PDB identifiers for subsequent retrieval. |

Expand Down
379 changes: 379 additions & 0 deletions docs/src/content/docs/guides/morph.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions docs/src/content/docs/guides/movies.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ a speed multiplier):
- **Lockstep**: Moves all objects through the same model numbers together;
objects with fewer states hold their last model.

With Sweep or Loop, the clip's objects hold still outside it: before their
first clip on its first model, and after a clip on the model it ends on, until
their next Sweep or Loop clip (a Lockstep clip does not move them). Camera
moves and scene transitions outside the clip, such as a Roll placed before it,
do not play them.

To make the models glide instead of flip, turn on **Smooth transitions
(morph)** in the Play models sheet, or build a morph from the Object panel;
see [Morphing](/RayMol/guides/morph/).

## Build a Movie from Scenes

Assembling a movie from saved scenes produces rich, cinematic presentations
Expand Down
34 changes: 33 additions & 1 deletion docs/src/content/docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Standard PyMOL commands are fully supported in the command input bar and scripts

## RayMol commands

RayMol adds specialized commands for studio lighting, physically-based materials, automated SNFG glycan cartoon generation, screen-space box selection, structure prediction, generative design, multiple-sequence alignments, and metric scoring.
RayMol adds specialized commands for studio lighting, physically-based materials, automated SNFG glycan cartoon generation, screen-space box selection, structure prediction, generative design, multiple-sequence alignments, metric scoring, and smooth morphs of multi-state objects.

### Rendering & Lighting

Expand Down Expand Up @@ -284,6 +284,38 @@ Print the specification, units, scope, and expected ranges for metrics reported

---

### Movies & Playback

Commands that turn the models of a multi-state object into a smooth, looping morph. The [Morphing guide](/RayMol/guides/morph/) covers the Object panel's **Morph…** sheet and the Movie tab's **Smooth transitions (morph)** toggle, which run the same job.

#### `morph_object`
Build a smoothly playing morph of a multi-state object (an NMR ensemble, trajectory snapshots, predicted models). Each pair of consecutive models becomes `frames_per_model` states, the key frames are exact copies of the models, and the result is a separate object, `<source>_morph`: the source keeps its states and is hidden once the morph is complete. Inside the RayMol app the morph builds in the background, with a progress card in the tray; with `async_=0` it is complete when the command returns, which scripts and command-line PyMOL need (outside the app nothing lands the frames of a background morph). Running it again on the same source rebuilds the morph in place when it was built since RayMol was launched and is still loaded unchanged (reopening a session you saved with it in the same run, with no other session opened and no `reinitialize` (Clear Session) in between, keeps it recognised); the old morph is deleted as soon as the rebuild starts. After a relaunch, `reinitialize` or opening another session, or when the saved morph differs, it comes back as an ordinary multi-state object: pass `name=<source>_morph` to rebuild it in place; without a name a new `<source>_morph2` is built beside it. Refuses sources with one model, models with different atoms, discrete objects, objects whose atoms are not uniquely identified by segment, chain, residue number, residue name and atom name, objects with no atoms in altloc `A` or without one, objects that are not molecules, and morphs larger than the memory limit: 1 GB or a quarter of the computer's memory, whichever is larger (on iPhone and iPad, 400 MB or half the memory available to RayMol), against an estimate of the memory the finished morph holds (coordinates plus the representations the source shows, cartoon costing the most; see the guide's Memory and size). Nothing is created when a morph is refused; in the app the reason appears in a **Morph failed** card in the progress tray.
- **Syntax**: `morph_object source [, name [, frames_per_model [, loop [, method [, refinement [, rate [, copy_look [, async_ [, reuse ]]]]]]]]]`
- **Arguments**: `source` (multi-state object; every model must hold the same atoms), `name` (default `<source>_morph`, or `<source>_morph2`, … when that name is taken by anything other than a morph of `source` built (or being built) since RayMol was launched and still loaded as built; a molecule you create under a name an earlier (cancelled or deleted) morph had is not claimed. An explicit name may replace only such a morph or a molecule named `<source>_morph` or `<source>_morph<N>`; any other existing object is refused), `frames_per_model` (default `15`, at least `2`), `loop` (default `1`: the last model morphs back into the first), `method` (`rigimol`, the default, moves rigid segments on screw paths; `linear` interpolates every atom in a straight line), `refinement` (sculpting clean-up cycles on the intermediate frames, default `3`; `0` for none), `rate` (`linear` by default, `sinusoidal`, `ramp_up`, `ramp_down`), `copy_look` (default `1`: copy the settings set on the source object), `async_` (default `1`; `async=0` works too, as for `fetch`), `reuse` (default `0`; `1` keeps an existing morph built with the same settings from the unchanged source since RayMol was launched and still loaded unchanged, including one in a session you saved with it and reopened in the same run, with no other session opened and no `reinitialize` (Clear Session) in between)
- **Guide**: [Morphing](/RayMol/guides/morph/)
- **Example**: `fetch 2kpo, async=0` then `morph_object 2kpo` in the app, or `morph_object 2kpo, async_=0` in a script (300 states from 20 models); `morph_object 2kpo, frames_per_model=30, loop=0, async_=0` builds 570 states ending on model 20

#### `morph_cancel`
Stop a morph that is being built: the partial object is deleted and the source is shown again. Its tray card then reads "Morph cancelled: 2kpo_morph" until dismissed. Cancelling a rebuild also loses the previous morph, which was deleted when the rebuild started.
- **Syntax**: `morph_cancel name`
- **Arguments**: `name` (the morph object being built, such as `2kpo_morph`, not its source)
- **Example**: `morph_cancel 2kpo_morph`

#### `morph_dismiss`
Clear the tray card of a morph that was cancelled or failed (a completed morph leaves no card).
- **Syntax**: `morph_dismiss name`
- **Arguments**: `name` (the morph object the card names, such as `2kpo_morph`, not its source; a morph refused while a finished morph held its name is listed as `2kpo_morph (refused)`: dismiss it by that name)
- **Example**: `morph_dismiss 2kpo_morph`

#### `morph`
Interpolate between two conformations, from two objects or two states of one, into a new multi-state object. RayMol's open-source implementation of the PyMOL command: rigid segments found by core and hinge analysis move along screw paths, and sculpting cleans up the intermediates. It runs to completion before returning, keeps only the paired atoms, and hides the input objects; it does not copy object settings or show a progress card.
- **Syntax**: `morph name, sele1 [, sele2 [, state1 [, state2 [, refinement [, steps [, method [, match [, quiet [, rate [, core_fraction [, min_hinge [, hinge_blend [, hide [, color_segments ]]]]]]]]]]]]]]`
- **Arguments**: `name` (object to create; it cannot be one of the input objects, a selection, or an existing object that is not a molecule, such as a group, map or CGO. An existing molecule of that name, such as the output of an earlier `morph`, is replaced once the new morph is built; a morph that fails leaves it as it was), `sele1`, `sele2` (default `sele1`; each must lie within one object. Two different selections of one object pair only with `match=in` or `like`, which morph the atoms both hold; to morph chain A into chain B, `create` them as separate objects first), `state1` (default `1`; `0` morphs through every model of `sele1` and back to model 1), `state2` (default `2` when both selections are the same atoms, otherwise `1`; with `state1=0`, `state2=0` stops at the last model), `refinement` (default `3`), `steps` (states per leg, default `30`), `method` (`rigimol` default, or `linear`), `match` (how two objects' atoms are paired: `align` default, `super`, `in`, `like`, or an alignment object), `rate` (`linear` default, `sinusoidal`, `ramp_up`, `ramp_down`), `core_fraction` (default `0.5`), `min_hinge` (default `6` residues), `hinge_blend` (default `3` residues), `hide` (default `1`: disable the inputs), `color_segments` (default `0`; `1` colours the result by rigid segment)
- **Guide**: [Morphing](/RayMol/guides/morph/#morph-between-two-structures)
- **Example**: `fetch 1akeA 4akeA, async=0`, `align 1akeA, 4akeA`, `morph mout, 1akeA, 4akeA`

---

## Python scripting & startup

Run `.pml` command scripts or `.py` Python scripts using the console `run` command or `@` syntax:
Expand Down
Loading
Loading