diff --git a/src/docs/HISTORY.md b/src/docs/HISTORY.md index 75fc9a23a..188753252 100644 --- a/src/docs/HISTORY.md +++ b/src/docs/HISTORY.md @@ -7,6 +7,9 @@ v1.2.8 Compare Mode. - A/B Wipe Comparison now properly follows the cursor when zoomed in. - Fixed and simplified bakeOCIO.py demo script. +- Fixed changing displayOptions through python not reflecting the changes in + the UI. +- Fixed compareDemo.py script to reflect new A/B Comparison changes. v1.2.7 diff --git a/src/lib/mrvApp/mrvMainControl.cpp b/src/lib/mrvApp/mrvMainControl.cpp index 0dd1f1064..9d56d955f 100644 --- a/src/lib/mrvApp/mrvMainControl.cpp +++ b/src/lib/mrvApp/mrvMainControl.cpp @@ -220,11 +220,13 @@ namespace mrv Viewport* view = p.ui->uiView; view->setLUTOptions(p.lutOptions); view->setDisplayOptions({p.displayOptions}); + view->updateDisplayOptions(); if (p.ui->uiSecondary) { view = p.ui->uiSecondary->viewport(); view->setLUTOptions(p.lutOptions); view->setDisplayOptions({p.displayOptions}); + view->updateDisplayOptions(); } auto display = p.ui->uiTimeline->getDisplayOptions(); @@ -261,7 +263,6 @@ namespace mrv { TLRENDER_P(); - App* app = p.ui->app; p.volume = app->volume(); p.mute = app->isMuted(); diff --git a/src/lib/mrvGL/mrvTimelineViewport.cpp b/src/lib/mrvGL/mrvTimelineViewport.cpp index 912c7d73e..fc6ca3bdf 100644 --- a/src/lib/mrvGL/mrvTimelineViewport.cpp +++ b/src/lib/mrvGL/mrvTimelineViewport.cpp @@ -805,7 +805,7 @@ namespace mrv if (value == p.lutOptions) return; p.lutOptions = value; - + auto display = p.ui->uiTimeline->getDisplayOptions(); display.lut = value; p.ui->uiTimeline->setDisplayOptions(display); @@ -830,6 +830,44 @@ namespace mrv if (value == p.displayOptions) return; p.displayOptions = value; + + const auto& d = p.displayOptions[0]; + + float gamma, saturation, gain; + if (d.levels.enabled) + { + gamma = d.levels.gamma; + } + else + { + gamma = 1.0; + } + if (d.color.enabled) + { + gain = d.color.brightness.x; + saturation = d.color.saturation.x; + + if (d.exrDisplay.exposure > 0.001F) + { + gain /= d.exrDisplay.exposure; + } + } + else + { + gain = 1.0; + saturation = 1.0; + } + + // + // Update UI sliders + // + p.ui->uiGain->value(gain); + p.ui->uiGainInput->value(gain); + p.ui->uiGamma->value(gamma); + p.ui->uiGammaInput->value(gamma); + p.ui->uiSaturation->value(saturation); + p.ui->uiSaturationInput->value(saturation); + redraw(); } @@ -2062,7 +2100,6 @@ namespace mrv { TLRENDER_P(); - p.displayOptions.resize(p.videoData.size()); if (p.displayOptions.empty()) { @@ -2358,7 +2395,7 @@ namespace mrv const timeline::DisplayOptions& d) noexcept { TLRENDER_P(); - + for (auto& display : p.displayOptions) { display = d; @@ -2405,23 +2442,21 @@ namespace mrv } void TimelineViewport::_updateMonitorDisplayView( - const int screen, - const timeline::OCIOOptions& o) const noexcept + const int screen, const timeline::OCIOOptions& o) const noexcept { TLRENDER_P(); - + if (this != p.ui->uiView) return; if (screen != p.previous_screen) { p.previous_screen = screen; - const std::string& combined = - ocio::combineView(o.display, o.view); + const std::string& combined = ocio::combineView(o.display, o.view); p.ui->uiOCIOView->copy_label(combined.c_str()); } } - + void TimelineViewport::hsv_to_info( const image::Color4f& hsv, area::Info& info) const noexcept { diff --git a/src/lib/mrvPy/Cmds.cpp b/src/lib/mrvPy/Cmds.cpp index 8d1a49cba..c2cbb4fee 100644 --- a/src/lib/mrvPy/Cmds.cpp +++ b/src/lib/mrvPy/Cmds.cpp @@ -110,7 +110,6 @@ namespace mrv2 void compare(const int itemA, const int itemB, timeline::CompareMode mode) { - auto model = filesModel(); auto o = model->observeCompareOptions()->get(); @@ -224,7 +223,7 @@ namespace mrv2 ViewerUI* ui = App::ui; toggle_data_window_cb(nullptr, ui); } - + void toggleDisplayWindow() { ViewerUI* ui = App::ui; @@ -236,13 +235,13 @@ namespace mrv2 ViewerUI* ui = App::ui; toggle_safe_areas_cb(nullptr, ui); } - + void toggleIgnoreDisplayWindow() { ViewerUI* ui = App::ui; toggle_ignore_display_window_cb(nullptr, ui); } - + void toggleAutoNormalize() { ViewerUI* ui = App::ui; @@ -357,7 +356,7 @@ namespace mrv2 } return out; } - + /** * \brief Refresh the UI. * @@ -531,15 +530,15 @@ Used to run main commands and get arguments and set the display, image, compare, cmds.def( "setMute", &mrv2::cmd::setMute, _("Set the muting of the audio."), py::arg("mute")); - + cmds.def( "toggleAutoNormalize", &mrv2::cmd::toggleAutoNormalize, _("Toggle Image Auto Normalize.")); - + cmds.def( "toggleDataWindow", &mrv2::cmd::toggleDataWindow, _("Toggle Data Window.")); - + cmds.def( "toggleDisplayWindow", &mrv2::cmd::toggleDisplayWindow, _("Toggle Display Window.")); @@ -547,15 +546,15 @@ Used to run main commands and get arguments and set the display, image, compare, cmds.def( "toggleIgnoreDisplayWindow", &mrv2::cmd::toggleIgnoreDisplayWindow, _("Toggle Ignored Display Window on OpenEXRs.")); - + cmds.def( "toggleInvalidValues", &mrv2::cmd::toggleInvalidValues, _("Toggle Image invalid values.")); - + cmds.def( "toggleSafeAreas", &mrv2::cmd::toggleSafeAreas, _("Toggle Safe Areas.")); - + cmds.def("volume", &mrv2::cmd::volume, _("Get the playback volume.")); cmds.def(