-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ocioview: app mode, tests, color space menus, bug fixes (#2006)
* black code formatting Signed-off-by: Michael Dolan <[email protected]> * Handle empty image in chromaticities inspector Signed-off-by: Michael Dolan <[email protected]> * Allow unsetting shared view rule Signed-off-by: Michael Dolan <[email protected]> * Qt6 compatibility fixes Signed-off-by: Michael Dolan <[email protected]> * Bug fixes, unit test framework setup Signed-off-by: Michael Dolan <[email protected]> * Add initial unit tests Signed-off-by: Michael Dolan <[email protected]> * Add application mode Signed-off-by: Michael Dolan <[email protected]> * Add new color space combo Signed-off-by: Michael Dolan <[email protected]> * Use color space menu helper Signed-off-by: Michael Dolan <[email protected]> * Move mode select to top of window Signed-off-by: Michael Dolan <[email protected]> * Fix mode viewer context switching Signed-off-by: Michael Dolan <[email protected]> * Recombine viewers Signed-off-by: Michael Dolan <[email protected]> --------- Signed-off-by: Michael Dolan <[email protected]> Co-authored-by: Thomas Mansencal <[email protected]>
- Loading branch information
Showing
54 changed files
with
2,625 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,17 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright Contributors to the OpenColorIO Project. | ||
|
||
import logging | ||
import os | ||
import sys | ||
from pathlib import Path | ||
|
||
import PyOpenColorIO as ocio | ||
from PySide6 import QtCore, QtGui, QtWidgets | ||
|
||
import ocioview.log_handlers # Import to initialize logging | ||
from ocioview.main_window import OCIOView | ||
from ocioview.style import QSS, DarkPalette | ||
|
||
|
||
ROOT_DIR = Path(__file__).resolve().parent.parent | ||
FONTS_DIR = ROOT_DIR / "fonts" | ||
|
||
|
||
def excepthook(exc_type, exc_value, exc_tb): | ||
"""Log uncaught errors""" | ||
if issubclass(exc_type, KeyboardInterrupt): | ||
sys.__excepthook__(exc_type, exc_value, exc_tb) | ||
return | ||
logging.error(f"{exc_value}", exc_info=exc_value) | ||
from ocioview.setup import setup_app | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.excepthook = excepthook | ||
|
||
# OpenGL core profile needed on macOS to access programmatic pipeline | ||
gl_format = QtGui.QSurfaceFormat() | ||
gl_format.setProfile(QtGui.QSurfaceFormat.CoreProfile) | ||
gl_format.setSwapInterval(1) | ||
gl_format.setVersion(4, 0) | ||
QtGui.QSurfaceFormat.setDefaultFormat(gl_format) | ||
|
||
# Create app | ||
app = QtWidgets.QApplication(sys.argv) | ||
|
||
# Initialize style | ||
app.setStyle("fusion") | ||
app.setPalette(DarkPalette()) | ||
app.setStyleSheet(QSS) | ||
app.setEffectEnabled(QtCore.Qt.UI_AnimateCombo, False) | ||
|
||
font = app.font() | ||
font.setPointSize(8) | ||
app.setFont(font) | ||
|
||
# Clean OCIO environment to isolate working config | ||
for env_var in ( | ||
ocio.OCIO_CONFIG_ENVVAR, | ||
ocio.OCIO_ACTIVE_VIEWS_ENVVAR, | ||
ocio.OCIO_ACTIVE_DISPLAYS_ENVVAR, | ||
ocio.OCIO_INACTIVE_COLORSPACES_ENVVAR, | ||
ocio.OCIO_OPTIMIZATION_FLAGS_ENVVAR, | ||
ocio.OCIO_USER_CATEGORIES_ENVVAR, | ||
): | ||
if env_var in os.environ: | ||
del os.environ[env_var] | ||
app = setup_app() | ||
|
||
# Start ocioview | ||
ocioview = OCIOView() | ||
ocioview.show() | ||
ocio_view = OCIOView() | ||
ocio_view.show() | ||
|
||
sys.exit(app.exec_()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.