DummySceneFileWriter¶
Qualified name: manim.utils.testing.\_test\_class\_makers.DummySceneFileWriter
- class DummySceneFileWriter(settings)[source]¶
Bases:
SceneFileWriterDelegate of SceneFileWriter used to test the frames.
Methods
Append a planned segment path to the writer and current section.
Start a segment job for one animation when video writing is enabled.
Used internally by Manim to combine the separate partial movie files that make up a Scene into a single video file for that Scene.
Concatenate partial movie files for each section.
Seal the current segment job when video writing is enabled.
Take ownership of one top-left C-contiguous
uint8RGBA frame.Attributes
gif_file_pathReturn the planned GIF artifact path.
image_file_pathReturn the planned still or video-fallback image path.
image_sequence_directoryReturn the planned PNG-sequence directory.
movie_file_pathReturn the planned primary video artifact path.
output_nameReturn the planned logical output stem as a compatibility view.
partial_movie_directoryReturn the planned silent-segment cache directory.
sections_output_dirReturn the planned sections directory, or the legacy empty path.
- Parameters:
settings (_SceneFileWriterSettings)
- add_partial_movie_file(hash_animation)[source]¶
Append a planned segment path to the writer and current section.
The list retains one entry per animation so explicit animation indices select the corresponding segment.
- Parameters:
hash_animation (str | None) – Hash of the animation.
- Return type:
None
- begin_animation(allow_write=True, *, animation_index, file_path=None)[source]¶
Start a segment job for one animation when video writing is enabled.
- Parameters:
allow_write (bool) – Whether this animation needs a new segment.
animation_index (int) – Scene-local animation index used to select and label the segment.
file_path (TypeAliasForwardRef('~manim.typing.StrPath') | None) – Explicit segment target, or
Noneto use the planned cache path.
- Return type:
Any
- combine_to_movie()[source]¶
Used internally by Manim to combine the separate partial movie files that make up a Scene into a single video file for that Scene.
- Return type:
None
- combine_to_section_videos()[source]¶
Concatenate partial movie files for each section.
- Return type:
None
- end_animation(allow_write=False)[source]¶
Seal the current segment job when video writing is enabled.
- Parameters:
allow_write (bool) – Whether the current animation has an open segment job.
- Return type:
None
- write_frame(pixels, *, repeat=1)[source]¶
Take ownership of one top-left C-contiguous
uint8RGBA frame.The caller must not mutate or reuse
pixelsafter this method returns because video encoding can consume the array asynchronously.- Parameters:
pixels (PixelArray)
repeat (int)
- Return type:
None