Skip to main content

AI Studio and lecture notes

The website ships with two AI-assisted editors and a player mode built for articles. They use the same wanim runtime as the rest of the site.

Want an external model to write the scene?

These pages are written for people. If you want ChatGPT, Claude, a local model or another code generator to write a wanim scene, give it https://wanim.org/LLM.txt. That file is the complete, self-contained reference: the supported subset, InteractiveScene, controls, presentation modes and the sharing API.

AI Studio​

Open Studio to edit a single animation:

  • Describe the change in the chat panel. The assistant answers with a short summary and a unified diff against the current file; the preview reruns from the first changed segment.
  • If the new scene fails to compile or run, Studio sends the error back and asks the model for a repair automatically (at most twice).
  • If a diff cannot be applied, the assistant retries with the error and can fall back to the complete file.
  • The player offers Default, Two-view and Slides pacing. The mode is host-side and never changes your Python source. Two-view is the article mode: the animation loops, and double-clicking the canvas opens the live blueprint.
  • Share creates a link that opens the same scene in the playground.

Two-view mode​

two-view is the mode used by lecture notes and article embeds. It has two states:

  1. The animation loops from construct() (or from the blueprint's initial values when the scene is interactive).
  2. Double-clicking the canvas switches to the live blueprint. The reader can move sliders, drag points and press play; the animation restarts from the current state.

Write the scene for both states: blueprint() builds the controls and the picture, construct() is the short loop worth watching. SEPARATE = True makes the loop play construct() only and the interaction view show blueprint() only.

Lecture notes​

Open the lecture-note Studio for a long-form document with many scenes:

  • The editor is Markdown. A fenced code block tagged wanim is compiled and previewed inline; write prose and formulas around it as usual.
  • Each block has its own AI conversation. The assistant edits that block's code; the rest of the note is untouched.
  • Inside a note, every wanim block plays in two-view mode.
  • Drafts live in this browser. Publishing creates a read-only KV copy and an edit token; the public page is https://wanim.org/notes?show=<id>. The editor keeps the token, so another browser sees a fork, not the original.
  • Export the whole note or the current article as Markdown, with or without media.

Which page should I use?​

NeedPage
One animation, interactive or notStudio
Ask about an idea, get prose plus live scenesChat
A lecture or article with many animationsLecture notes
Embed a finished scenePlayground or Using wanim