animation#

Export.animation(filename: str, width: int | None = None, height: int | None = None, passes: int = 4, anim_type: int = 0, frames: int | None = None, starting_frame: int = 0, frames_per_second: float = 60.0, format_options: str | None = '', raytrace: bool = False) None#

Generate an MPEG4 animation file.

An MPEG4 animation file can be generated from temporal data, flipbooks, keyframes, or animated traces.

Parameters:
filenamestr

Name for the MPEG4 file to save to local disk.

widthint, optional

Width of the image in pixels. The default is None, in which case ensight.objs.core.WINDOWSIZE[0] is used.

heightint, optional

Height of the image in pixels. The default is None, in which case ensight.objs.core.WINDOWSIZE[1] is used.

passesint, optional

Number of antialiasing passes. The default is 4.

anim_typeint, optional

Type of the animation to render. The default is 0, in which case "ANIM_TYPE_SOLUTIONTIME" is used. This table provides descriptions by each option number and name:

Name

Animation type

0: ANIM_TYPE_SOLUTIONTIME

Animation over all solution times

1: ANIM_TYPE_ANIMATEDTRACES

Records animated rotations and traces

2: ANIM_TYPE_FLIPBOOK

Records current flipbook animation

3: ANIM_TYPE_KEYFRAME

Records current kKeyframe animation

framesint, optional

Number of frames to save. The default is None. The default for all but ANIM_TYPE_ANIMATEDTRACES covers all timesteps, flipbook pages, or keyframe steps. If ANIM_TYPE_ANIMATEDTRACES is specified, this keyword is required.

starting_frameint, optional

Keyword for saving a subset of the complete collection of frames. The default is 0.

frames_per_secondfloat, optional

Number of frames per second for playback in the saved animation. The default is 60.0.

format_optionsstr, optional

More specific options for the MPEG4 encoder. The default is "".

raytracebool, optional

Whether to render the image with the raytracing engine. The default is False.

Examples

>>> s = LocalLauncher().start()
>>> data = f"{s.cei_home}/ensight{s.cei_suffix}gui/demos/Crash Queries.ens"
>>> s.ensight.objs.ensxml_restore_file(data)
>>> quality = "Quality Best Type 1"
>>> s.ensight.utils.export.animation("local_file.mp4", format_options=quality)