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
51 changes: 36 additions & 15 deletions job_bundles/3dsmax_vray_denoiser/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
# 3ds Max V-Ray Denoiser Example

This job bundle demonstrates rendering 3ds Max scenes with V-Ray, including automatic VRIMG to EXR conversion with denoising preservation and intelligent frame chunking.
This job bundle demonstrates rendering 3ds Max scenes with V-Ray, including automatic VRIMG to EXR conversion with denoising preservation, using the Open Job Description task chunking extension to reduce scheduling overhead for multi-frame rendering.

## Task Chunking
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.

We don't support chunking from the submitter, so I will be more careful here.

Can we only change examples that have submitters that support chunking?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the feedback. My understanding is that these examples are intended to submit via Deadline CLIs. https://github.com/aws-deadline/deadline-cloud-samples?tab=readme-ov-file#job-bundle-samples Since these sample bundles don't go through the DCC submitters, they shouldn't be affected by whether the submitter plugins support chunking yet. Let me know if you have any concerns though — happy to discuss further!

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.

I think it would be better if we logged a corresponding ticket in 3dsmax, upgrade the submitter, then release the sample. Otherwise it is hard for any user to know how to use chunking for DCCs that we do not have the UX for


This job bundle uses the [Task Chunking](https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/rfcs/0001-task-chunking.md) extension with `rangeConstraint: CONTIGUOUS` to reduce scheduling overhead by grouping frames together into chunks.

```yaml
extensions:
- TASK_CHUNKING

steps:
- name: Render EXRs
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-4"` or `"5-9"`, which maps directly to `3dsmaxcmd.exe -start:N -end:N`.

## Job summary

This job bundle renders 3ds Max scenes with V-Ray, including automatic VRIMG to EXR conversion with denoising preservation. Task chunking amortizes 3ds Max's startup and scene loading time by rendering multiple frames per invocation.

## Features

- **Smart Frame Chunking**: Automatically handles both contiguous ranges (e.g., `1-100`) and non-contiguous ranges (e.g., `1-5,10,15-20`)
- **Task Chunking**: Uses `CHUNK[INT]` with contiguous frame ranges to reduce scheduling overhead by rendering multiple frames per task
- **Adaptive Chunking**: Optional target runtime allows the scheduler to adjust chunk sizes dynamically
- **VRIMG to EXR Conversion**: Converts V-Ray's native VRIMG format to industry-standard EXR while preserving denoising data
- **Automatic Cleanup**: Removes temporary VRIMG files after successful conversion
- **Error Handling**: Validates output directories and checks for required V-Ray tools
- **Flexible Output**: Supports custom output directories and frame ranges

## Requirements

Expand All @@ -22,18 +49,12 @@ This job bundle demonstrates rendering 3ds Max scenes with V-Ray, including auto
- **Scene File**: 3ds Max scene file (.max) to render
- **Frames**: Frame range specification (supports both `1-100` and `1,5,10-20` formats)
- **Output Directory**: Directory where final EXR files will be saved
- **Frames Per Task**: Number of frames to render per task (automatically adjusted for non-contiguous ranges to 1)

## Frame Chunking Behavior

The template intelligently handles different frame range formats:

- **Contiguous ranges** (e.g., `1-100`): Uses the specified Frames Per Task for efficient chunking
- **Non-contiguous ranges** (e.g., `1-5,10,15-20`): Automatically renders one frame per task regardless of Frames Per Task setting
- **Chunk Size**: Number of frames to render per chunk (default: 5)
- **Target Runtime (Seconds)**: Target runtime per chunk (default: 180, set to 0 to use fixed chunk sizes)

## Output Format

The job renders to V-Ray's native VRIMG format in a temporary directory, then converts to EXR format in the specified output directory. VRIMG files conserve all denoising elements including noise passes, beauty passes, and denoising data. This workflow preserves:
The job renders to V-Ray's native VRIMG format in a temporary directory, then converts to EXR format in the specified output directory. This workflow preserves:

- All denoising elements and passes
- Multi-channel data
Expand All @@ -45,7 +66,7 @@ The job renders to V-Ray's native VRIMG format in a temporary directory, then co
### Scene Tweaks

**Max > Render Setup > V-Ray > Enable built-in frame buffer > Save raw image output:**
- Give it a local location on the Worker: `C:\Temp\<output>.vrimg`
- Give it a local location on the Worker: `C:\Temp\<output>.vrimg`
- You can use any name instead of the `<output>` placeholder

**Render Elements Configuration:**
Expand All @@ -64,11 +85,11 @@ The job renders to V-Ray's native VRIMG format in a temporary directory, then co
1. **Fill in job details** - You will see a GUI submission window
2. **Configure scene parameters:**
- Fill in the scene file location
- Set start and end frame
- Set the frame range
- Specify the output directory
3. **Select job attachments:**
- Select all the assets in the job attachments which scene needs to render
- Include tyFlow cache files if applicable
4. **Submit** the job

The job will handle the rest automatically, including format conversion and cleanup.
The job will handle the rest automatically, including format conversion and cleanup.
79 changes: 39 additions & 40 deletions job_bundles/3dsmax_vray_denoiser/template.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
specificationVersion: 'jobtemplate-2023-09'
extensions:
- TASK_CHUNKING
name: 3ds Max V-Ray Render
description: |
This job bundle renders a 3ds Max scene using V-Ray with frame chunking support.
This job bundle renders a 3ds Max scene using V-Ray with task chunking support.

Features:
- Frame chunking for efficient parallel rendering
- Contiguous task chunking
- VRIMG to EXR conversion with denoising preservation
- Automatic cleanup of temporary files
- Error handling and validation

Requirements:
- 3ds Max 2025 installed on Windows worker hosts
- V-Ray plugin for 3ds Max
Expand Down Expand Up @@ -38,8 +40,7 @@ parameterDefinitions:
label: Frames
groupLabel: Render Parameters
default: "0-10"
description: Frame range to render (e.g., 1-100, 1,5,10-20)

description: Frame range to render (e.g., 1-100, 1,5,10-20).
- name: OutputDirectory
type: PATH
objectType: DIRECTORY
Expand All @@ -50,22 +51,36 @@ parameterDefinitions:
groupLabel: Render Parameters
description: Choose the render output directory.

- name: FramesPerTask
- name: ChunkSize
type: INT
userInterface:
control: SPIN_BOX
label: Frames Per Task
label: Chunk Size
groupLabel: Render Parameters
default: 1
default: 5
minValue: 1
description: Number of frames to render per task
description: Number of frames to render per chunk.

- name: TargetRuntime
type: INT
userInterface:
control: SPIN_BOX
label: Target Runtime (Seconds)
groupLabel: Render Parameters
default: 180
description: Target runtime per chunk in seconds (0 to disable adaptive chunking).

steps:
- name: Render EXRs
parameterSpace:
taskParameterDefinitions:
- name: Frame
type: INT
range: "{{Param.Frames}}:{{Param.FramesPerTask}}"
type: CHUNK[INT]
range: "{{Param.Frames}}"
chunks:
defaultTaskCount: "{{Param.ChunkSize}}"
targetRuntimeSeconds: "{{Param.TargetRuntime}}"
rangeConstraint: CONTIGUOUS
script:
embeddedFiles:
- name: render_script
Expand All @@ -77,53 +92,37 @@ steps:
setlocal enabledelayedexpansion
echo Starting 3ds Max render...
echo Scene: {{Param.SceneFile}}
echo Original Frame Range: {{Param.Frames}}

set /a taskStart={{Task.Param.Frame}}

REM Check if this is a non-contiguous range (contains commas)
echo {{Param.Frames}} | findstr "," >nul
if !errorlevel! equ 0 (
REM Non-contiguous range - always render single frame
set /a taskEnd=!taskStart!
echo Non-contiguous range detected - rendering single frame: !taskStart!
) else (
REM Contiguous range - check if we need to limit the end frame
set /a taskEnd=!taskStart!+{{Param.FramesPerTask}}-1

REM Extract the actual end frame from the range to avoid going beyond it
for /f "tokens=2 delims=-" %%a in ("{{Param.Frames}}") do set maxFrame=%%a
if !taskEnd! gtr !maxFrame! set taskEnd=!maxFrame!

echo Contiguous range - rendering frames !taskStart! to !taskEnd!

REM Parse contiguous chunk range "START-END"
for /f "tokens=1,2 delims=-" %%a in ("{{Task.Param.Frame}}") do (
set /a taskStart=%%a
set /a taskEnd=%%b
)


echo Rendering frames !taskStart! to !taskEnd!

REM Validate output directory
mkdir "{{Param.OutputDirectory}}" 2>nul
echo test > "{{Param.OutputDirectory}}\test.tmp" 2>nul || (
echo ERROR: Cannot write to output directory
exit /b 1
)
del "{{Param.OutputDirectory}}\test.tmp" 2>nul

REM Check vrimg2exr exists
if not exist "C:\ProgramData\Autodesk\ApplicationPlugins\VRay3dsMax2025\bin\vrimg2exr.exe" (
echo ERROR: vrimg2exr.exe not found
exit /b 1
)

REM Render frame range for this chunk
"C:\Program Files\Autodesk\3ds Max 2025\3dsmaxcmd.exe" -start:!taskStart! -end:!taskEnd! "{{Param.SceneFile}}"
if %ERRORLEVEL% NEQ 0 (
echo ERROR: 3dsmaxcmd failed with exit code %ERRORLEVEL%
exit /b %ERRORLEVEL%
)

if !taskStart! equ !taskEnd! (
echo 3ds Max render completed successfully for frame !taskStart!
) else (
echo 3ds Max render completed successfully for frames !taskStart! to !taskEnd!
)

echo 3ds Max render completed successfully for frames !taskStart! to !taskEnd!
echo Converting .vrimg files to .exr and moving to output...
set converted=0
for %%f in ("C:\temp\*.vrimg") do (
Expand Down
64 changes: 55 additions & 9 deletions job_bundles/maya_cli_render/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,70 @@
# Maya CLI Render

## Job summary
# Maya CLI Render with Contiguous Chunks

This job bundle renders a Maya software renderer scene with the
[Maya CLI `Render` command](https://help.autodesk.com/view/MAYAUL/2025/ENU/?guid=GUID-EB558BC0-5C2B-439C-9B00-F97BCB9688E4).
[Maya CLI `Render` command](https://help.autodesk.com/view/MAYAUL/2025/ENU/?guid=GUID-EB558BC0-5C2B-439C-9B00-F97BCB9688E4)
using the [Task Chunking](https://github.com/OpenJobDescription/openjd-specifications/blob/mainline/rfcs/0001-task-chunking.md)
extension to reduce scheduling overhead by grouping frames into chunks.

## Features

- **Task Chunking**: Uses `CHUNK[INT]` with contiguous frame ranges to reduce scheduling overhead by rendering multiple frames per chunk
- **Adaptive Chunking**: Optional target runtime allows the scheduler to adjust chunk sizes dynamically

## Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| Maya Scene File | Maya scene file (.ma, .mb) to render | `fallinggears.ma` |
| Frames | Frame range (e.g., `1-60`) | `1-60` |
| Chunk Size | Number of frames per chunk | `10` |
| Target Runtime | Target seconds per chunk (0 to use fixed chunk sizes) | `180` |
| Camera Name | Camera to render | `persp` |
| Image Width | Output image width | `960` |
| Image Height | Output image height | `540` |
| Output Directory | Render output directory | `output` |
| Project Path | Maya project directory | `.` |

## Task Chunking

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

```yaml
extensions:
- TASK_CHUNKING

steps:
- name: Render
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 `"1-10"` or `"11-20"`, which maps directly to Maya's `-s` (start) and `-e` (end) arguments.

Reference: [Maya Common Renderer Flags](https://help.autodesk.com/view/MAYAUL/2025/ENU/?guid=GUID-0280AB86-8ABE-4F75-B1B9-D5B7DBB7E25A)

## Usage

To run it, you will need a Maya installation available in the PATH in one of the following ways:
* As a conda package when your queue has a conda queue environment set up to
provide virtual environments for jobs. For more information see the developer guide section
[Provide applications for yor jobs](https://docs.aws.amazon.com/deadline-cloud/latest/developerguide/provide-applications.html).
[Provide applications for your jobs](https://docs.aws.amazon.com/deadline-cloud/latest/developerguide/provide-applications.html).
* Installed on the worker hosts that run the job. You can customize your Deadline Cloud
queues, fleets, and this job to fit your own production pipeline.

The core of this job is an embedded template file called `render.sh` that invokes
the Maya CLI `Render` command. The command is a template that substitutes job parameters and the
frame task parameter.
frame chunk parameter.

The `Render` command is part of an Open Job Description step. It expands to a task per frame by
defining a parameter space using the Frames job parameter. It limits the fleets it will run on
by including host requirements for Linux.
The `Render` command is part of an Open Job Description step. It groups frames into contiguous
chunks using the task chunking extension, and each chunk is rendered in a single Maya invocation.
It limits the fleets it will run on by including host requirements for Linux.

The rest of the job template consists of the parameter definitions. This metadata specifies
the names, types, and descriptions of each parameter, along with information on what user
Expand Down
36 changes: 32 additions & 4 deletions job_bundles/maya_cli_render/template.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
specificationVersion: 'jobtemplate-2023-09'
extensions:
- TASK_CHUNKING
name: Maya CLI Render
description: |
This job bundle renders a Maya software renderer scene with the Maya CLI `Render` command.
This job bundle renders a Maya software renderer scene with the Maya CLI `Render` command,
using contiguous task chunking to amortize Maya's startup and scene loading time across
multiple frames.

To run it, you will need a Maya installation available in the PATH in one of the following ways:
* As a conda package when your queue has a conda queue environment set up to
Expand Down Expand Up @@ -40,6 +44,22 @@ parameterDefinitions:
label: Frames
groupLabel: Render Parameters
default: 1-60
- name: ChunkSize
type: INT
userInterface:
control: SPIN_BOX
label: Chunk Size
groupLabel: Render Parameters
default: 10
description: Number of frames to render per chunk.
- name: TargetRuntime
type: INT
userInterface:
control: SPIN_BOX
label: Target Runtime (Seconds)
groupLabel: Render Parameters
default: 180
description: Target runtime per chunk in seconds (0 to disable adaptive chunking).
- name: CameraName
type: STRING
userInterface:
Expand Down Expand Up @@ -97,8 +117,12 @@ steps:
parameterSpace:
taskParameterDefinitions:
- name: Frame
type: INT
type: CHUNK[INT]
range: "{{Param.Frames}}"
chunks:
defaultTaskCount: "{{Param.ChunkSize}}"
targetRuntimeSeconds: "{{Param.TargetRuntime}}"
rangeConstraint: CONTIGUOUS
script:
embeddedFiles:
- name: Render
Expand All @@ -109,12 +133,16 @@ steps:

cd '{{Param.ProjectPath}}'

# Extract start and end frames from the contiguous chunk range "START-END"
START_FRAME="$(echo '{{Task.Param.Frame}}' | cut -d- -f1)"
END_FRAME="$(echo '{{Task.Param.Frame}}' | cut -d- -f2)"

set -x
Render -r sw \
-proj '{{Param.ProjectPath}}' \
-rd '{{Param.OutputDir}}' \
-s {{Task.Param.Frame}} \
-e {{Task.Param.Frame}} \
-s "$START_FRAME" \
-e "$END_FRAME" \
-pad 4 \
-fnc "name.#.ext" \
-cam {{Param.CameraName}} \
Expand Down
Loading