Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new ocioview app (alpha) #1816

Merged
merged 17 commits into from
Aug 31, 2023

Conversation

michdolan
Copy link
Collaborator

ocioview is a visual editor for OCIO configs, written in Python. The app currently consists of two main components; a viewer and a config editor. The viewer is an expanded version of pyociodisplay with pan/zoom and pixel sampling support. Multiple viewers can be loaded in different tabs. The config editor is a tabbed model/view interface for the current config. Models for each config item type interface directly with the config in memory. The app's scene file is a config. This design allows dynamic interconnectivity between config items, reducing risk of errors during config authoring. Undo/redo stack support for most features is implemented.

These two components are linked with 10 possible transform subscriptions. Each subscription tracks the transform(s) for one config item, and each viewer can subscribe to any of these transforms. This provides fast visual feedback for transform editing. There is also a code view linked to the active viewer, which displays a CTF and GLSL representation of the viewer's processor, as well as the current config YAML.

This PR accounts for the core functionality needed for authoring a config, but there is still much more that could be done. I will continue working on ocioview, but want to invite others to contribute as well. There is plenty to refine and add, and this project is a great opportunity to improve the accessibility and interactivity of OCIO config authoring.

In terms of reviewing the code; it's a lot. There's ~15k lines of code here. There are bugs that still need to be squashed, which I am continuing to work on, but the best way to review is probably to try it out. Once the initial version is merged, we can iterate on smaller subsets of the application. Thanks for taking a look!

Some caveats:

  • I developed this app on Windows, and have not done any testing on Linux or Mac. The code is cross-platform by nature of being Python, but there may be subtle issues I haven't anticipated.
  • ocioview depends on the OIIO and imath Python bindings, which are not currently available on PyPI. I intend to contribute a Python script to make building the dependencies simpler, but for now users will need to provide their own builds.
  • The code currently references PySide2 directly, rather than using a shim like Qt.py. I plan to update the code to use PySide6 soon, to be compatible with VFX reference platform 2024. It may make sense to adopt a shim (Qt.py or QtPy) at a later date.
  • There is currently no test suite for the application itself, but this is certainly an area for improvement.
  • There are some OCIO features which have not yet been implemented: grading transforms, virtual views, active/inactive state of color spaces.

Screenshots:

ocioview_001 ocioview_015 ocioview_018 ocioview_019 ocioview_020 ocioview_021

Signed-off-by: Michael Dolan <michdolan@gmail.com>
@KelSolaar
Copy link
Contributor

Oh exciting!

Signed-off-by: Michael Dolan <michdolan@gmail.com>
Signed-off-by: Michael Dolan <michdolan@gmail.com>
@remia
Copy link
Collaborator

remia commented Jul 30, 2023

Looks amazing @michdolan! I haven't looked at the code in details yet but had some issues running ocioview on mac OS so I did some quick changes to make it work (moved to PySide6 as I had issues with PySide2 on Python 3.11, removed Imath for install simplicity, and made OIIO optional for the same reason) but no guarantee I didn't break stuff in the process. In case that can help others testing it, here is: https://github.com/remia/OpenColorIO/tree/ocioview-mac.

Signed-off-by: Michael Dolan <michdolan@gmail.com>
@michdolan
Copy link
Collaborator Author

I made some performance improvements. Previously code for all the code views was updating with any change. Now code is only updated with code views being actively viewed, and when toggling between code views, an update will be requested immediately and then the view will receive updates on relevant changes. All code updates are asynchronous, so this lessens the amount of background processing (pygments syntax highlighting and HTML formatting) fighting the GUI thread for the GIL.

CTF formatting is now also clearing LUT data from 1D/3D LUT transforms (which were a big bottleneck when present). Instead there is now a note where the LUT data would be, informing the user to export the CTF for the complete data. A "Export CTF" button at the top of the view can facilitate this.

image

The shader view now also provides a box to choose the shading language to display. The viewer's language doesn't change; just the displayed code.

image

Signed-off-by: Michael Dolan <michdolan@gmail.com>
@michdolan
Copy link
Collaborator Author

Made another push that adds persistent settings for tracking recent config and image locations, along with recent file menus. Transform subscriptions now have a suffix which indicates the item type, for clarity. I also updated the interface for working with transform directionality in the viewer, also to be more clear.

I'm done making changes to this PR outside of addressing feedback. I've squashed most of the bugs I could find through manual testing. Additional work can happen in other PRs.

@remia
Copy link
Collaborator

remia commented Aug 11, 2023

@michdolan Did you think about how you want ocioview to be versioned and distributed?

Copy link
Collaborator

@doug-walker doug-walker left a comment

Choose a reason for hiding this comment

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

I have not had time to review everything, but I haven't found anything to comment on in that regard (your code is always excellent Michael!). It seems like we should merge what you have here as a basis for further development.

The one thing that would be great to add would be some kind of readme to explain the current development status, what platforms it's been tested on, and what are the planned next steps. (You have some of this in the description in the PR, but people may not see that once it's merged.)

I tried to test this on macOS using Remi's branch. I just created a virtual env and then ran pip3 install -r requirements.txt. The UI launched and I was able to load a config and an image but some stuff seems broken. For example, the second of the drop-down menus seems locked to pass-through and I could not get it to load a display/view transform. Not sure if this is a problem with Remi's branch or something I'm doing wrong (probably the latter). We'll need to add some documentation for people.

How would you like to proceed with merging this @michdolan ?

@michdolan
Copy link
Collaborator Author

michdolan commented Aug 28, 2023

I can address the readme/docs and versioning in a near-future PR. Once this is merged and @remia 's changes are merged, I have another PR in the works that improves a number of areas and adds a curve viewer. I can include the docs with that PR, if that's ok with you all.

Copy link
Collaborator

@remia remia left a comment

Choose a reason for hiding this comment

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

I haven't reviewed the PR in details but I think it's fine to merge (code quality looks really good) and improve incrementally (as needed) as Michael suggests.

@michdolan
Copy link
Collaborator Author

README is now added. I also pushed my updates and current work on the curve viewer, which has linear and logarithmic scales. I'll have further work on it in a future PR:
image

Signed-off-by: Michael Dolan <michdolan@gmail.com>
Signed-off-by: Michael Dolan <michdolan@gmail.com>
Signed-off-by: Michael Dolan <michdolan@gmail.com>
@doug-walker doug-walker merged commit 957ccd5 into AcademySoftwareFoundation:main Aug 31, 2023
21 checks passed
brkglvn01 pushed a commit to brkglvn01/OpenColorIO that referenced this pull request Oct 23, 2023
* Initial commit of ocioview

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Improve config version selection and reloading

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Bug fixes and improved warnings

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Improve async log and code routing

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Add settings, improve transform interface

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Fix viewer and code view update bugs

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Add README and inspector panel with curve viewer

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Curve viewer log fix

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Add curve view labels

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Update README, improve curve grid rendering

Signed-off-by: Michael Dolan <michdolan@gmail.com>

---------

Signed-off-by: Michael Dolan <michdolan@gmail.com>
Co-authored-by: Rémi Achard <remiachard@gmail.com>
Signed-off-by: Brooke <beg9562@rit.edu>
doug-walker pushed a commit to autodesk-forks/OpenColorIO that referenced this pull request Dec 6, 2023
* Initial commit of ocioview

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Improve config version selection and reloading

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Bug fixes and improved warnings

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Improve async log and code routing

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Add settings, improve transform interface

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Fix viewer and code view update bugs

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Add README and inspector panel with curve viewer

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Curve viewer log fix

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Add curve view labels

Signed-off-by: Michael Dolan <michdolan@gmail.com>

* Update README, improve curve grid rendering

Signed-off-by: Michael Dolan <michdolan@gmail.com>

---------

Signed-off-by: Michael Dolan <michdolan@gmail.com>
Co-authored-by: Rémi Achard <remiachard@gmail.com>
Signed-off-by: Doug Walker <Doug.Walker@autodesk.com>
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.

4 participants