DummySceneFileWriter¶
完整名称: manim.utils.testing.\_test\_class\_makers.DummySceneFileWriter
- class DummySceneFileWriter(renderer, scene_name, **kwargs)[source]¶
基类:
SceneFileWriter
SceneFileWriter 的委托,用于测试帧。
方法
将新的部分影片文件路径添加到 scene.partial_movie_files 和当前章节(通过哈希)。
Manim 内部使用,用于将动画流式传输到 FFMPEG 以进行显示或写入文件。
通过删除最旧的部分影片文件来清理缓存。
Manim 内部使用,用于将构成场景的独立部分影片文件合并为一个场景的视频文件。
连接每个章节的部分影片文件。
Manim 内部使用,用于优雅地停止向 FFMPEG 流式传输。
初始化输出目录。
Manim 内部使用,用于将帧写入 FFMPEG 输入缓冲区。
属性
force_output_as_scene_name
- 参数:
渲染器 (CairoRenderer | OpenGLRenderer)
场景名称 (StrPath)
kwargs (Any)
- add_partial_movie_file(hash_animation)[source]¶
将新的部分影片文件路径添加到 scene.partial_movie_files 和当前章节(通过哈希)。此方法将根据哈希计算路径。此外,它还将新动画添加到当前章节。
- 参数:
hash_animation (str) – 动画的哈希值。
- 返回类型:
无
- begin_animation(allow_write=True, file_path=None)[source]¶
Manim 内部使用,用于将动画流式传输到 FFMPEG 以进行显示或写入文件。
- 参数:
允许写入 (bool) – 是否写入视频文件。
文件路径 (StrPath | None)
- 返回类型:
任何
- end_animation(allow_write=False)[source]¶
Manim 内部使用,用于优雅地停止向 FFMPEG 流式传输。
- 参数:
允许写入 (bool) – 是否写入视频文件。
- 返回类型:
无
- init_output_directories(scene_name)[source]¶
初始化输出目录。
注意
目录从
config
读取,例如config['media_dir']
。如果目标目录尚不存在,则会创建它们。- 参数:
场景名称 (StrPath)
- 返回类型:
无
- write_frame(frame_or_renderer, num_frames=1)[source]¶
Manim 内部使用,用于将帧写入 FFMPEG 输入缓冲区。
- 参数:
帧或渲染器 (PixelArray | OpenGLRenderer) – 帧的像素数组。
帧数 (int) – 写入帧的次数。
- 返回类型:
无