AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.74k stars 430 forks source link

[ocioview] Unable to load image in ocioview on macOS #1978

Open mjtitchener-fn opened 1 month ago

mjtitchener-fn commented 1 month ago

After the recent changes committed for ocioview I can no longer load an image. The following error is printed in the Terminal when I attempt this.

[ocioview Error]: 'ProcessorContext' object has no attribute 'direction'
Traceback (most recent call last):
  File "/Volumes/ws/ocio/dev/source/src/apps/ocioview/ocioview/viewer_dock.py", line 111, in load_image
    image_viewer.load_image(image_path=image_path)
  File "/Volumes/ws/ocio/dev/source/src/apps/ocioview/ocioview/viewer/image_viewer.py", line 330, in load_image
    self.image_plane.load_image(image_path)
  File "/Volumes/ws/ocio/dev/source/src/apps/ocioview/ocioview/viewer/image_plane.py", line 355, in load_image
    self._ocio_proc_context.direction,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ProcessorContext' object has no attribute 'direction'
<LogRecord: ocioview, 40, /Volumes/ws/ocio/dev/source/src/apps/ocioview/main.py, 26, "[ocioview Error]: 'ProcessorContext' object has no attribute 'direction'
Traceback (most recent call last):
  File "/Volumes/ws/ocio/dev/source/src/apps/ocioview/ocioview/viewer_dock.py", line 111, in load_image
    image_viewer.load_image(image_path=image_path)
  File "/Volumes/ws/ocio/dev/source/src/apps/ocioview/ocioview/viewer/image_viewer.py", line 330, in load_image
    self.image_plane.load_image(image_path)
  File "/Volumes/ws/ocio/dev/source/src/apps/ocioview/ocioview/viewer/image_plane.py", line 355, in load_image
    self._ocio_proc_context.direction,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ProcessorContext' object has no attribute 'direction'">

I believe the problem is here... https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/7e91b0e9a6e194181e11a777d338ea2b4c4d315f/src/apps/ocioview/ocioview/viewer/image_plane.py#L355

It seems the fix is simply...

self._ocio_proc_context.transform_direction

(I've tested this locally and it works).

From referring to... https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/7e91b0e9a6e194181e11a777d338ea2b4c4d315f/src/apps/ocioview/ocioview/processor_context.py#L27

@michdolan If this is all that's required I'm happy to create a PR with this simple change.

KelSolaar commented 1 month ago

Confirming that this is the only requirement (I have it in my draft PR for the chromaticity inspector).