Project¶
Qualified name: algan.project.Project
- class Project(scene_functions, video_settings=None, file_path=None, *, video_directory='videos', screenshot_directory='screenshots', transcript_directory='transcripts', transcript_line_length=88, speech_source=None)[source]¶
Bases:
objectCoordinate a fixed collection of independently-authored Scene functions.
Scene IDs are their zero-based positions in
scene_functions. Output stems are<id>_<name>. Frame IDs are derived from the scene ID and the save-frame call’s local index, so rendering any subset produces the same names as rendering the whole project.- Parameters:
scene_functions – A nonempty iterable of callables. Each callable must be invokable with no arguments. Optional parameters are allowed.
file_path – Destination for
concatenate_videos(). It followsScene.save_videopath rules and defaults to the main script’s configured output filename.video_directory – Output directories. A bare directory name is placed under Algan’s standard output directory; a path with an explicit parent is used as supplied.
screenshot_directory – Output directories. A bare directory name is placed under Algan’s standard output directory; a path with an explicit parent is used as supplied.
transcript_directory – Output directories. A bare directory name is placed under Algan’s standard output directory; a path with an explicit parent is used as supplied.
transcript_line_length (int) – Maximum number of characters per transcript line.
video_settings (VideoSettings | None) – Optional settings used to author and render every project Scene.
speech_source – Optional speech generator installed on each Scene’s audio manager.
Methods
Concatenate the project's scene videos into
file_path.Return the stable project-global ID for one Scene save-frame call.
Run save-frame calls for one, many, or all project scenes.
Render full videos for one, many, or all project scenes.
Run the project action requested by command-line arguments.
- concatenate_videos(*, threads=None, reencode=False)[source]¶
Concatenate the project’s scene videos into
file_path.- Parameters:
threads (int | None)
- frame_id(scene, local_frame_index)[source]¶
Return the stable project-global ID for one Scene save-frame call.
- Parameters:
local_frame_index (int)
- Return type:
int
- render_screenshots(scenes=None, *, frames=None, stop_early=False, video_settings=None)[source]¶
Run save-frame calls for one, many, or all project scenes.
No scene videos are rendered.
scenesaccepts an ID, an unprefixed name, a full prefixed name, an iterable mixing those forms, orNonefor all scenes.- Parameters:
frames – Which save-frame calls to render, as a pattern or an iterable of them. A pattern is a frame index within its scene (
3), a glob ("s05_*"), or a plain substring ("perturbed"); names match with or without thes<scene>_f<index>_prefix, case-insensitively. Frames that match nothing are skipped without being rendered, which saves the render but not the authoring. Defaults toNone, meaning every frame.stop_early (bool) – Whether to abandon each scene as soon as every
framespattern has matched at least once, rather than authoring the rest of it. This is what makes iterating on an early frame of a long scene quick, but it leaves the scene half-run: its transcript is not synced and its later frames on disk stay as an earlier run left them. Requiresframes. Defaults to False.video_settings (VideoSettings | None)
- render_video(scenes=None, *, video_settings=None, overwrite=True, **save_video_kwargs)[source]¶
Render full videos for one, many, or all project scenes.
Scene save-frame calls are skipped.
scenesaccepts an ID, an unprefixed name, a full prefixed name, an iterable mixing those forms, orNonefor all scenes.- Parameters:
video_settings (VideoSettings | None)
overwrite (bool)
- run_cli(argv=None)[source]¶
Run the project action requested by command-line arguments.
argvdefaults to the current process arguments (excluding the executable/script name). The recognized arguments are:--render-screenshots [SCENE ...] [--frames PATTERN ...] [--stop-early] --render-video [SCENE ...] --concatenate-videos --video-settings PRESET --help
Scene values accept the same IDs and names as
render_video()andrender_screenshots(). Omitting them renders every scene. Unknown arguments are ignored so this can be called from scripts launched by tools that add their own command-line options – but-h/--helpis now handled here, so a script that wants its own help must parse it before calling this.Returns
Trueafter dispatching a recognized action andFalsewhen no project action was present.- Return type:
bool