anim_create
Render a simulation animation from an existing COMSOL plot group by exporting one frame per transient time step or solution and composing GIF/MP4 files with a fixed color range.
Instructions
Render a simulation animation from an existing plot group (custom pipeline).
Recommended default for building animations: exports one PNG per transient
time step (plot-group property t) or per solution (property solnum)
with a fixed colour range, then composes the frames into a GIF and/or MP4.
Works for transient heat/flow/structural studies and for parametric sweeps,
eigenfrequency and frequency-domain solution sets.
Args: plotgroup: plot group tag with the quantity to animate, e.g. "pg1". formats: ["gif"] (default), ["gif","mp4"] or ["mp4"]. MP4 requires imageio + imageio-ffmpeg (media_tools_status reports availability). fps: animation speed, frames per second (default 10). width: frame width in px (default 640). height: frame height in px (default 480). mode: "auto" (default; detects transient vs parametric from the dataset), "time" (transient time steps), "solutions" (1-based solution index), "static" (single frame). times: explicit time values for transient frames, e.g. [0,1,2,5,10] (interpolated times are supported by COMSOL). solnums: explicit 1-based solution indices, e.g. [1,2,3,4]. max_frames: cap the number of frames (evenly spaced selection). range_mode: "common" (default; one colour range for all frames, no flicker), "auto" (per-frame COMSOL range) or "manual" (use color_range). color_range: [min, max] data range for range_mode="manual", e.g. [293.15, 400.0] for a temperature animation. colortable: COMSOL colour table name, e.g. "ThermalLight" or "Rainbow". title: optional title text burned into every frame (Pillow overlay). loop: GIF loop count (0 = loop forever, default). output: explicit output file path (only when one format is requested), e.g. "C:/out/heat.gif". output_directory: directory for generated GIF/MP4 files. frames_directory: directory for intermediate PNG frames. keep_frames: keep intermediate PNG frames on disk (default false). model: model name/tag (None = current model).
Returns: JSON with frame count/directory/frames, mode used, colour range and the generated "gif"/"mp4" objects (path, size, frame count, duration, valid), plus "preview" (first frame PNG) and "primary" (best artifact path).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"plotgroup": "<plotgroup>"
},
"name": "anim_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | ||
| loop | No | ||
| mode | No | auto | |
| model | No | ||
| times | No | ||
| title | No | ||
| width | No | ||
| height | No | ||
| output | No | ||
| formats | No | ||
| solnums | No | ||
| plotgroup | Yes | ||
| colortable | No | ||
| max_frames | No | ||
| range_mode | No | common | |
| color_range | No | ||
| keep_frames | No | ||
| frames_directory | No | ||
| output_directory | No |