anim_export
Export a COMSOL plot group as a movie or numbered PNG image sequence with configurable format, frame rate, and resolution, then validate frame counts and report output paths.
Instructions
Export a COMSOL-native animation of a plot group (movie or image sequence).
Creates result().export().create(tag, "Animation"), applies the COMSOL
6.4 Animation properties, runs it, and validates the output (GIF frame
count with Pillow, video frame count with imageio).
Args: plotgroup: plot group tag to animate, e.g. "pg1" (see anim_list / plot_list). format: movie container: "gif" (no external deps, default), "avi" or "webm". output: output path. Movie: e.g. "C:/out/heat.gif". For kind="imageseq" pass the frame base path, e.g. "C:/out/frame" -> frame1.png, frame2.png, ... Omit to auto-generate under the artifact workspace. kind: "movie" (default) or "imageseq" (numbered PNG frames). fps: frames per second for movies (positive int, default 10). maxframes: number of frames (>= 2, default 25). Fewer stored solutions produce fewer frames; COMSOL samples the available range evenly. width: frame width in px (default 640, used when size="manual"). height: frame height in px (default 480). size: "manual" (default) | "current" | "hd". sweeptype: "solutions" (default) | "parameter" | "globalparameter" | "dde" | "streamline". solnumtype: parametric sweep selection: "all" (default) | "level1" | "level2" | "level3" | "inner" | "outer". solnum: explicit 1-based solution numbers to animate, e.g. [1,3,5]. looplevel: explicit loop-level solution indices, e.g. [1,2,3,4]. framesel: "all" | "number" (COMSOL default "number" = use maxframes). background: "current" | "color" | "fromtheme" | "transparent". reverse: true = play the animation backwards (time reversal). image_options: "on"/"off" — enable optional image components (title/legend/axes/logo). show_legend: plot legend on/off when image_options="on". show_title: plot title on/off when image_options="on". extra_properties: raw COMSOL Animation export properties to override, e.g. {"repeat": "forever", "resolution": "150"}. tag: explicit export feature tag (auto "anim1", "anim2", ...). model: model name/tag (None = current model).
Returns: JSON with path, size, format, frame count, dimensions, fps, duration and valid flag; for image sequences also frame_paths.
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_export"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | ||
| tag | No | ||
| kind | No | movie | |
| size | No | manual | |
| model | No | ||
| width | No | ||
| format | No | gif | |
| height | No | ||
| output | No | ||
| solnum | No | ||
| reverse | No | ||
| framesel | No | ||
| looplevel | No | ||
| maxframes | No | ||
| plotgroup | Yes | ||
| sweeptype | No | ||
| background | No | ||
| show_title | No | ||
| solnumtype | No | ||
| show_legend | No | ||
| image_options | No | ||
| extra_properties | No |