DummySceneFileWriter

Qualified name: manim.utils.testing.\_test\_class\_makers.DummySceneFileWriter

class DummySceneFileWriter(settings)[source]

Bases: SceneFileWriter

Delegate of SceneFileWriter used to test the frames.

Methods

add_partial_movie_file

Append a planned segment path to the writer and current section.

begin_animation

Start a segment job for one animation when video writing is enabled.

combine_to_movie

Used internally by Manim to combine the separate partial movie files that make up a Scene into a single video file for that Scene.

combine_to_section_videos

Concatenate partial movie files for each section.

end_animation

Seal the current segment job when video writing is enabled.

write_frame

Take ownership of one top-left C-contiguous uint8 RGBA frame.

Attributes

gif_file_path

Return the planned GIF artifact path.

image_file_path

Return the planned still or video-fallback image path.

image_sequence_directory

Return the planned PNG-sequence directory.

movie_file_path

Return the planned primary video artifact path.

output_name

Return the planned logical output stem as a compatibility view.

partial_movie_directory

Return the planned silent-segment cache directory.

sections_output_dir

Return 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 None to 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 uint8 RGBA frame.

The caller must not mutate or reuse pixels after this method returns because video encoding can consume the array asynchronously.

Parameters:
Return type:

None