From 9eb6b25db071472c26b05f0da0f40894d298a67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Mon, 9 Sep 2024 10:02:54 -0300 Subject: [PATCH] Fixed OCIO bug with nuke-default's config. Simplified code. --- src/docs/HISTORY.md | 2 ++ src/lib/mrvFl/mrvOCIO.cpp | 3 ++- src/lib/mrvGL/mrvTimelineViewport.cpp | 15 ++------------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/docs/HISTORY.md b/src/docs/HISTORY.md index 148b11813..837673d38 100644 --- a/src/docs/HISTORY.md +++ b/src/docs/HISTORY.md @@ -20,6 +20,8 @@ v1.2.7 - Added hotkeys entries for saturation more and saturation less. By default, they are not assigned. - Fixed tooltip in Gain slider not showing up. +- Fixed an OCIO bug when setting from the command-line the display/view with + nuke-default's config.ocio. v1.2.6 diff --git a/src/lib/mrvFl/mrvOCIO.cpp b/src/lib/mrvFl/mrvOCIO.cpp index 233c459b5..bdb75d433 100644 --- a/src/lib/mrvFl/mrvOCIO.cpp +++ b/src/lib/mrvFl/mrvOCIO.cpp @@ -673,6 +673,7 @@ namespace mrv const std::string& combined, std::string& display, std::string& view) { + if (combined.empty() || combined == kInactive) { display.clear(); @@ -698,7 +699,7 @@ namespace mrv .arg(combined); throw std::runtime_error(err); } - + display = view.substr(pos + 1, view.size()); view = view.substr(0, pos - 1); pos = display.find(')'); diff --git a/src/lib/mrvGL/mrvTimelineViewport.cpp b/src/lib/mrvGL/mrvTimelineViewport.cpp index 3c6e66d5e..2c6bb8342 100644 --- a/src/lib/mrvGL/mrvTimelineViewport.cpp +++ b/src/lib/mrvGL/mrvTimelineViewport.cpp @@ -1999,19 +1999,8 @@ namespace mrv int viewIndex = m->value(); if (viewIndex >= 0) { - std::string combined; - const Fl_Menu_Item* item = m->child(viewIndex); - char name[1024]; - int ok = m->item_pathname(name, sizeof(name) - 1, item); - if (ok == 0) - { - combined = name; - } - - if (combined != _("None")) - { - ocio::splitViewIntoDisplayView(combined, o.display, o.view); - } + const std::string& combined = ocio::view(); + ocio::splitViewIntoDisplayView(combined, o.display, o.view); } std::string look = p.ui->uiOCIOLook->label();