Skip to content

fix!(adaptor): Fix OCIO adaptor while baking. - #517

Merged
karthikbekalp merged 1 commit into
aws-deadline:mainlinefrom
karthikbekalp:fixOcio
Aug 11, 2026
Merged

fix!(adaptor): Fix OCIO adaptor while baking.#517
karthikbekalp merged 1 commit into
aws-deadline:mainlinefrom
karthikbekalp:fixOcio

Conversation

@karthikbekalp

Copy link
Copy Markdown
Contributor

What was the problem/requirement? (What/Why)

This PR introduced few changes :

  • changes the default color management to OCIO
  • the integration tests were failing and unable to render outputs.

What was the solution? (How)

  1. As this has potential to break customers expected color profile, marking this commit as backwards incompatible so that it bumps the version number.

  2. The tests were failing with the error, so this would have failed the renders as well.

2026-08-10T19:12:15.6460728Z 
2026-08-10T19:12:15.6461050Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT: OCIO view transform baked into beauty output: shared_job_settings0001.png
2026-08-10T19:12:15.6461462Z 
2026-08-10T19:12:15.6461645Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT: Traceback (most recent call last):
2026-08-10T19:12:15.6461923Z 
2026-08-10T19:12:15.6462665Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:   File "D:\a\deadline-cloud-for-cinema-4d\deadline-cloud-for-cinema-4d\src\deadline\cinema4d_adaptor\Cinema4DClient\plugin\DeadlineCloudClient.pyp", line 37, in <module>
2026-08-10T19:12:15.6463845Z 
2026-08-10T19:12:15.6463985Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:     main()
2026-08-10T19:12:15.6464196Z 
2026-08-10T19:12:15.6464886Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:   File "D:\a\deadline-cloud-for-cinema-4d\deadline-cloud-for-cinema-4d\src\deadline\cinema4d_adaptor\Cinema4DClient\cinema4d_client.py", line 137, in main
2026-08-10T19:12:15.6465615Z 
2026-08-10T19:12:15.6465756Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:     client.poll()
2026-08-10T19:12:15.6465982Z 
2026-08-10T19:12:15.6466914Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:   File "C:\Users\runneradmin\AppData\Local\hatch\env\virtual\deadline-cloud-for-cinema-4d\aGvmKxU6\integ\Lib\site-packages\openjd\adaptor_runtime_client\base_client_interface.py", line 212, in poll
2026-08-10T19:12:15.6467758Z 
2026-08-10T19:12:15.6468081Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:     self._perform_action(action)
2026-08-10T19:12:15.6468360Z 
2026-08-10T19:12:15.6469224Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:   File "C:\Users\runneradmin\AppData\Local\hatch\env\virtual\deadline-cloud-for-cinema-4d\aGvmKxU6\integ\Lib\site-packages\openjd\adaptor_runtime_client\base_client_interface.py", line 233, in _perform_action
2026-08-10T19:12:15.6470778Z 
2026-08-10T19:12:15.6470956Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:     action_func(a.args)
2026-08-10T19:12:15.6471195Z 
2026-08-10T19:12:15.6471807Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:   File "D:\a\deadline-cloud-for-cinema-4d\deadline-cloud-for-cinema-4d\src\deadline\cinema4d_adaptor\Cinema4DClient\cinema4d_handler.py", line 365, in start_render
2026-08-10T19:12:15.6472494Z 
2026-08-10T19:12:15.6472813Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:     self.render_data[c4d.RDATA_BAKE_OCIO_VIEW_TRANSFORM_RENDER] = orig_bake_flag
2026-08-10T19:12:15.6473221Z 
2026-08-10T19:12:15.6473446Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT:     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-08-10T19:12:15.6473764Z 
2026-08-10T19:12:15.6474001Z 0:00:26.120534	ADAPTOR_OUTPUT: STDOUT: TypeError: __setitem__ expected int or bool, not None
2026-08-10T19:12:15.6474334Z 
2026-08-10T19:12:15.6474511Z 0:00:27.120636	ADAPTOR_OUTPUT: STDOUT: Analytics error: 1003 - Generic
2026-08-10T19:12:15.6474904Z 
2026-08-10T19:12:15.6475093Z 0:00:27.120636	ADAPTOR_OUTPUT: STDOUT: Analytics error: 1003 - Generic
2026-08-10T19:12:15.6475340Z 
2026-08-10T19:12:15.6475816Z 0:00:31.135715	openjd_fail: Error encountered while running adaptor: Cinema4D exited early and did not render successfully, please check render logs. Exit code 0
2026-08-10T19:12:15.6476429Z 
2026-08-10T19:12:15.6477074Z 0:00:31.137736	ERROR: Entrypoint failed: openjd_fail: Error encountered while running adaptor: Cinema4D exited early and did not render successfully, please check render logs. Exit code 0
2026-08-10T19:12:15.6477710Z 

What is the impact of this change?

This will fix the render output issue for the tests.

How was this change tested?

  • Have you run the unit tests?
    Yes

  • Have you run the integration tests? (Add your integration test report below)

Yes and it passes: https://github.com/aws-deadline/deadline-cloud-for-cinema-4d/actions/runs/31440614832/job/93624348257

  • Have you made changes to the submitter?
    No

Was this change documented?

Yes

Is this a breaking change?

Yes, customers who want the old non OCIO behavior need to use the older 0.11.* version.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@karthikbekalp
karthikbekalp requested a review from a team as a code owner August 10, 2026 23:48
@github-actions github-actions Bot added the waiting-on-maintainers Waiting on the maintainers to review. label Aug 10, 2026
Signed-off-by: Karthik Bekal Pattathana <133984042+karthikbekalp@users.noreply.github.com>
# and restores this flag in finalize_tile_render.
orig_bake_flag = self.render_data[c4d.RDATA_BAKE_OCIO_VIEW_TRANSFORM_RENDER]
self.render_data[c4d.RDATA_BAKE_OCIO_VIEW_TRANSFORM_RENDER] = False
orig_bake_flag = rd.GetBool(c4d.RDATA_BAKE_OCIO_VIEW_TRANSFORM_RENDER)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

BaseContainer.GetBool(id) silently defaults to False when the id is not present in the container, so the "original" value we capture here is not necessarily the value C4D was actually using.

RDATA_BAKE_OCIO_VIEW_TRANSFORM_RENDER was added in 2025.2, and a render data container deserialized from an older scene (or one where the parameter has never been explicitly touched) may not carry an entry for it — in that case C4D falls back to the description default while GetBool here returns False. The finally block then writes False back into the container, which is a change, not a restore: the flag is now explicitly disabled on the shared self.render_data for the rest of the session (the comment above notes the document is reused across renders).

The subsequent 8-bit non-tile renders re-enter this branch and bake manually, so beauty output stays correct, but a later render in the same session that relies on the render-time bake — e.g. a 16-bit output, which bake_ocio excludes at line 339 and therefore never bakes manually — would come out un-tone-mapped where it previously was not.

Two ways to make the save/restore faithful:

  • Only restore when the parameter was actually present, e.g. capture had_flag = rd.GetType(c4d.RDATA_BAKE_OCIO_VIEW_TRANSFORM_RENDER) != 0 alongside the value and skip the write-back (or rd.RemoveData(...)) when it was absent.
  • Or read through the RenderData object so the description default is honoured, and pass an explicit preset matching that default rather than relying on GetBool's implicit False.

Note the same pattern exists in tile_rendering.setup_tile_render (line 195), so whichever fix is chosen is probably worth applying in both places for consistency.

@karthikbekalp
karthikbekalp merged commit b3b0d41 into aws-deadline:mainline Aug 11, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-maintainers Waiting on the maintainers to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants