Skip to content

pyocioamf: Add AMF v2.0 and OCIO 2.5+ support#2325

Open
giardiello wants to merge 3 commits into
AcademySoftwareFoundation:mainfrom
giardiello:feature/pyocioamf-amf-v2-support
Open

pyocioamf: Add AMF v2.0 and OCIO 2.5+ support#2325
giardiello wants to merge 3 commits into
AcademySoftwareFoundation:mainfrom
giardiello:feature/pyocioamf-amf-v2-support

Conversation

@giardiello

@giardiello giardiello commented Jul 5, 2026

Copy link
Copy Markdown

Summary

This PR enhances pyocioamf with support for AMF v2.0 and OCIO 2.5+ configurations. It supersedes #2232 (closed to move the branch onto a fresh public fork and add the refinements below).

  • AMF v2.0 support with automatic version detection from namespace URI or version attribute
  • OCIO 2.5+ config support using the amf_transform_ids interchange attribute for transform lookup
  • New CLI options for flexible conversion control
  • Split CTF generation for the AMF v2.0 workingLocation marker
  • New example file demonstrating the v2.0 format

Changes

AMF Version Support

  • Auto-detects v1.0 vs v2.0 from namespace URI (urn:ampas:aces:amf:v1.0 / v2.0) or version attribute
  • Handles both v1.0 element names (SOPNode/SatNode) and v2.0 names (ASC_SOP/ASC_SAT)

OCIO Config Compatibility

  • For OCIO 2.5+ configs: uses the dedicated amf_transform_ids interchange attribute
  • For OCIO 2.1-2.4 configs: falls back to description-based transform ID search
  • Multi-strategy ACES2065-1 colorspace resolution via aces_interchange role, then common names, then alias matching (works across config naming variants)

CLI Enhancements

  • --config: specify a custom OCIO config file (supports OCIO 2.1+)
  • --no-idt / --no-lmt / --no-odt: exclude input / look / output transforms
  • --split-by-working-location: generate split CTFs at the workingLocation marker
  • --ignore-applied-tag: process transforms even when applied="true"
  • --output-prefix / --output-dir: collision-free output naming for batch/concurrent use

Robustness

  • check_lut_path now always returns an absolute path so OCIO's CTF write() resolves referenced LUTs correctly regardless of the current working directory

New Files

  • example_v2.amf: AMF v2.0 example with ASC_SOP/ASC_SAT elements

Backwards Compatibility

All existing functionality is preserved: the script auto-detects the AMF version and OCIO config version, and defaults to prior behavior when no CLI options are given.

This commit enhances pyocioamf with several new features:

- AMF v2.0 support with automatic version detection from namespace URI
  or version attribute. Handles both v1.0 element names (SOPNode/SatNode)
  and v2.0 names (ASC_SOP/ASC_SAT).

- OCIO 2.5+ config support using the amf_transform_ids interchange
  attribute for transform lookup. Falls back to description-based
  search for OCIO 2.1-2.4 configs.

- New CLI options:
  - --config: Specify a custom OCIO config file
  - --no-idt: Exclude input transform from conversion
  - --no-lmt: Exclude look transforms from conversion
  - --no-odt: Exclude output transform from conversion
  - --split-by-working-location: Generate split CTFs based on
    workingLocation marker (AMF v2.0 feature)

- Dynamic ACES2065-1 colorspace detection using role lookup,
  common name search, and alias matching.

- New example_v2.amf demonstrating AMF v2.0 format.

Signed-off-by: giardiello <giardiello@me.com>
- Remove incorrect AMF version association with CDL element names.
  SOPNode/SatNode and ASC_SOP/ASC_SAT are both valid ASC CDL naming
  conventions, not version-specific.

- Simplify ACES2065-1 colorspace detection to use the aces_interchange
  role, which is defined in all standard ACES configs.

- Update README to clarify CDL element naming conventions.

Signed-off-by: giardiello <giardiello@me.com>
…tions

Port refinements from the Netflix amf-nuke-converter vendored copy:

- Restore multi-strategy ACES2065-1 colorspace resolution (aces_interchange
  role, then common names, then alias search) so conversion works across
  config naming variants.
- Always return absolute paths from check_lut_path so OCIO's CTF write()
  resolves referenced LUTs correctly regardless of current directory.
- Add --ignore-applied-tag to process transforms even when applied="true".
- Add --output-prefix and --output-dir for collision-free batch output.

Signed-off-by: giardiello <giardiello@me.com>
@giardiello

Copy link
Copy Markdown
Author

@doug-walker Sorry if this was messy, I've updated the script and re-issued a PR.

@giardiello giardiello force-pushed the feature/pyocioamf-amf-v2-support branch from a755ecd to fb1853a Compare July 5, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant