AWS Thinkbox Discussion Forums

Draft Multichannel EXR to Multipart EXR

As blender does not support rendering multipart exrs, which makes nuke crawl to a halt, can we use draft to convert them? I have only found old posts regarding exr 2.0 support.

Yes, automating video processing tasks, including converting and extracting channels from multi-channel EXR (OpenEXR) files. You will need to writing a custom Draft script that reads the multi-channel EXR files, extracts each channel, and saves them as individual files. Below is a basic guide on how to accomplish this task.

Preliminary Steps:

Before you start, ensure you have Deadline and Draft installed and configured in your environment. Draft comes bundled with Deadline but may require additional setup steps to be fully operational.

Writing a Draft Script for Channel Extraction:

You will write a Python script utilizing Draft to read an EXR file, extract its channels, and save them as separate files. Here’s a simplified version of such a script:

import Draft
from DraftParamParser import *

# Replace 'input.exr' with the path to your multi-channel EXR file
inputFilePath = ('input.exr')
# Specify the output directory and file format for the extracted channels
outputDirectory = ('/path/to/output/')
outputFormat = '.png'  # You can change this to .exr, .jpg, etc.

# Create an image object from the input file
image = Draft.Image.ReadFromFile(inputFilePath)

# Get a list of all channel names in the image
channels = image.GetChannelNames()

# Loop through each channel, extract it, and save it as a separate file
for channel in channels:
    # Create a new image with a single channel
    singleChannelImage = Draft.Image.CreateImage(image.width, image.height, 32, [channel])
    singleChannelImage.CopyChannel(channel, image, channel)
    
    # Build the output file path
    outputFilePath = outputDirectory + channel + outputFormat
    
    # Save the extracted channel
    singleChannelImage.WriteToFile(outputFilePath)

print("Channels extracted successfully.")

Running Your Draft Script:

To run the Draft script, you can execute it manually from a command line if you have a Draft standalone license. Alternatively, you can submit it as a job through Deadline using a Draft job submission form, which allows you to run Draft scripts across multiple nodes in your render farm.

  1. Manually: If you have the Draft standalone setup, you can run the script using the Python executable that comes with Draft. The command might look something like this:
"/path/to/Draft/python" "/path/to/your/script.py"

Deadline: To submit the script as a Deadline job, you can use the “Draft Template” job submission form in the Deadline Monitor. This involves:

  • Opening the Deadline Monitor and navigating to the Submit menu.
  • Choosing the “Draft” submission option.
  • Filling in the job details and specifying the path to your Draft script.
  • Submitting the job to the farm.
Privacy | Site terms | Cookie preferences