Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 48 additions & 21 deletions job_bundles/afterfx_render_one_task/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
# After Effects Render - one task

## Use case for this job

This is an After Effects job bundle that allows the user
to submit a job that uses aerender to render a frame range
as a single task. This means the entire workload will render
on one worker as one command.

It accepts the following job parameters that modify the render:
* Project file
* Comp name
* Input directory
* Output directory
* Start frame
* End frame

This job bundle expects a user to specify an input directory that
contains all the file references that are required to render.
Generally, the project file should be within this directory to
ensure relative paths are preserved.
# After Effects Render with Contiguous Chunks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we keep both one task and chunking to help the reader know they all work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"One task" in the original title was misleading, in my opinion. The old sample had 1 step rendering frames 0–50, which produced 51 tasks. The new sample preserves exactly the same frame range (0–50) and the same step and task count — nothing about what the job template does has changed. The only addition is the TASK_CHUNKING extension element in the template, which enables the chunking capability.

The title change was meant to more clearly reflect what this job template sample actually demonstrates.

This job bundle renders After Effects compositions using aerender with the [Task Chunking](https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/rfcs/0001-task-chunking.md) extension.

## Task Chunking

This job bundle uses the [Task Chunking](https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/rfcs/0001-task-chunking.md) extension with `rangeConstraint: CONTIGUOUS` for efficient rendering. Chunking reduces scheduling overhead by grouping frames together, and the single `Frames` parameter accepts ranges (`1-50`), individual frames (`5,7,32`), stepped ranges (`1-100:2`), or combinations (`1-10,15,20-30:2`).

## Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| Project file | After Effects project file (.aep, .aepx) | - |
| Comp name | Composition to render | - |
| Input directory | Directory containing input files | - |
| Output directory | Render output directory | - |
| Frames | Frame range (e.g., `0-100`) | `0-50` |
| Chunk Size | Number of frames per chunk | `10` |
| Target Runtime | Target seconds per chunk (0 to disable) | `300` |

## Task Chunking

This template uses the `TASK_CHUNKING` extension:

```yaml
extensions:
- TASK_CHUNKING

steps:
- name: RenderComp
parameterSpace:
taskParameterDefinitions:
- name: Frame
type: CHUNK[INT]
range: "{{Param.Frames}}"
chunks:
defaultTaskCount: "{{Param.ChunkSize}}"
targetRuntimeSeconds: "{{Param.TargetRuntime}}"
rangeConstraint: CONTIGUOUS
```

Each chunk expands to a contiguous range like `"0-9"` or `"10-19"`, which maps directly to aerender's `-s` (start) and `-e` (end) arguments.

Reference: [After Effects Automated Rendering](https://helpx.adobe.com/after-effects/using/automated-rendering-network-rendering.html)

## Usage

This job bundle expects a user to specify an input directory that contains all the file references required to render. Generally, the project file should be within this directory to ensure relative paths are preserved.
82 changes: 51 additions & 31 deletions job_bundles/afterfx_render_one_task/template.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
specificationVersion: jobtemplate-2023-09
name: After Effects Render - one task
extensions:
- TASK_CHUNKING
name: After Effects Render with Contiguous Chunks
description: >
A simple job bundle that allows a user to select
a project file and enter a comp to render with aerender.
A job bundle that renders an After Effects composition using aerender
with task chunking.

parameterDefinitions:

Expand Down Expand Up @@ -55,32 +57,39 @@ parameterDefinitions:
control: CHOOSE_DIRECTORY
label: Output directory
groupLabel: Inputs/outputs
description: The render output directory
description: The render output directory.

# Frame range
- name: StartFrame
- name: Frames
type: STRING
userInterface:
control: LINE_EDIT
label: Frames
groupLabel: Frame range
default: "0-50"
description: The frame range to render (e.g., 0-50).
- name: ChunkSize
type: INT
userInterface:
control: SPIN_BOX
label: Start Frame
label: Chunk Size
groupLabel: Frame range
default: 0
description: The first frame to render.
- name: EndFrame
default: 10
minValue: 1
description: Number of frames per chunk.
- name: TargetRuntime
type: INT
userInterface:
control: SPIN_BOX
label: End Frame
label: Target Runtime (Seconds)
groupLabel: Frame range
default: 50
description: The last frame to render.
default: 300
description: Target runtime per chunk (0 to disable adaptive chunking).

# Software Environment
- name: CondaPackages
type: STRING
userInterface:
# This parameter is for a queue environment, not used directly in the job,
# so leave the GUI for the queue environment to display.
control: HIDDEN
default: aftereffects
description: >
Expand All @@ -89,37 +98,48 @@ parameterDefinitions:

steps:
- name: RenderComp
parameterSpace:
taskParameterDefinitions:
- name: Frame
type: CHUNK[INT]
range: "{{Param.Frames}}"
chunks:
defaultTaskCount: "{{Param.ChunkSize}}"
targetRuntimeSeconds: "{{Param.TargetRuntime}}"
# After Effects aerender uses -s (start) and -e (end) for frame ranges
# https://helpx.adobe.com/after-effects/using/automated-rendering-network-rendering.html
rangeConstraint: CONTIGUOUS
script:
actions:
onRun:
command: python
args:
- "{{Task.File.Run}}"
- "{{Param.OutputDirectory}}"
- "aerender"
- "-project"
- "{{Param.ProjectFile}}"
- "-comp"
- "{{Param.CompName}}"
- "-output"
- "{{Param.OutputDirectory}}/output_[####].png"
- "-s"
- "{{Param.StartFrame}}"
- "-e"
- "{{Param.EndFrame}}"
embeddedFiles:
- name: Run
type: TEXT
data: |
import os
import sys
import subprocess

# Ensure the output directory exists
os.makedirs(sys.argv[1], exist_ok=True)
# Parse contiguous chunk range (e.g., "0-50" or "10-10")
chunk = "{{Task.Param.Frame}}"
start_frame, end_frame = chunk.split("-")

# Ensure the output directory exists (use raw string to avoid escape sequences)
os.makedirs(r"{{Param.OutputDirectory}}", exist_ok=True)

# Run the After Effects subprocess
subprocess.run(sys.argv[2:], check=True)
# Run aerender with the chunk's frame range
cmd = [
"aerender",
"-project", r"{{Param.ProjectFile}}",
"-comp", "{{Param.CompName}}",
"-output", r"{{Param.OutputDirectory}}/output_[####].png",
"-s", start_frame,
"-e", end_frame
]
print(f"Rendering frames {start_frame} to {end_frame}")
subprocess.run(cmd, check=True)
hostRequirements:
attributes:
- name: attr.worker.os.family
Expand Down
44 changes: 44 additions & 0 deletions job_bundles/blender_render/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Blender Render

This job bundle renders Blender scenes using the [Task Chunking](https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/rfcs/0001-task-chunking.md) extension.

## Task Chunking

This job bundle uses the [Task Chunking](https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/rfcs/0001-task-chunking.md) extension with `rangeConstraint: CONTIGUOUS` for efficient rendering. Chunking reduces scheduling overhead by grouping frames together, and the single `Frames` parameter accepts ranges (`1-50`), individual frames (`5,7,32`), stepped ranges (`1-100:2`), or combinations (`1-10,15,20-30:2`).

## Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| Blender Scene File | Blender scene file (.blend) to render | - |
| Frames | Frame range (e.g., `1-10,15,20-100:2`) | `1-10,15,20-100:2` |
| Chunk Size | Number of frames per chunk | `5` |
| Target Runtime | Target seconds per chunk (0 to disable) | `600` |
| Output Directory | Render output directory | `./output` |
| Output File Pattern | Output filename pattern | `output_####` |
| Output File Format | Image format | `JPEG` |

## Task Chunking

This template uses the `TASK_CHUNKING` extension with `rangeConstraint: NONCONTIGUOUS`:

```yaml
extensions:
- TASK_CHUNKING

steps:
- name: RenderBlender
parameterSpace:
taskParameterDefinitions:
- name: Frame
type: CHUNK[INT]
range: "{{Param.Frames}}"
chunks:
defaultTaskCount: "{{Param.ChunkSize}}"
targetRuntimeSeconds: "{{Param.TargetRuntime}}"
rangeConstraint: NONCONTIGUOUS
```

Each chunk expands to an arbitrary frame set like `"1-3,5,7-10:2"`. A Python script converts this to Blender's `--render-frame` format (e.g., `1,3,5,9..11,15`).

Reference: [Blender Command Line Arguments](https://docs.blender.org/manual/en/latest/advanced/command_line/arguments.html)
Loading