diff --git a/indra/newview/alfloaterlightbox.cpp b/indra/newview/alfloaterlightbox.cpp index f9eb141fa66a2df3b50abcd6db59c1dc1c166b9f..406e3e98226168ccfbb69f9add88954e7ca1ac24 100644 --- a/indra/newview/alfloaterlightbox.cpp +++ b/indra/newview/alfloaterlightbox.cpp @@ -53,9 +53,10 @@ ALFloaterLightBox::~ALFloaterLightBox() BOOL ALFloaterLightBox::postBuild() { - updateTonemapper(); - mTonemapConnection = gSavedSettings.getControl("RenderToneMapType")->getSignal()->connect([&](LLControlVariable* control, const LLSD&, const LLSD&){ updateTonemapper(); }); + updateTonemapper(); + mTonemapConnection = gSavedSettings.getControl("RenderToneMapType")->getSignal()->connect([&](LLControlVariable* control, const LLSD&, const LLSD&){ updateTonemapper(); }); mCASConnection = gSavedSettings.getControl("RenderSharpenMethod")->getSignal()->connect([&](LLControlVariable* control, const LLSD&, const LLSD&){ updateCAS(); }); + populateLUTCombo(); return TRUE; } @@ -65,6 +66,27 @@ void ALFloaterLightBox::draw() LLFloater::draw(); } +void ALFloaterLightBox::populateLUTCombo() +{ + LLComboBox* lut_combo = getChild<LLComboBox>("colorlut_combo"); + const std::string& user_luts = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colorlut"); + if(boost::filesystem::is_directory(user_luts)) + { + if(!boost::filesystem::is_empty(user_luts)) + { + lut_combo->addSeparator(); + } + for (boost::filesystem::directory_entry& lut : boost::filesystem::directory_iterator(user_luts)) + { + std::string lut_stem = lut.path().stem().string(); + std::string lut_filename = lut.path().filename().string(); + lut_combo->add(lut_stem, lut_filename); + } + lut_combo->selectByValue(gSavedSettings.getString("RenderColorGradeLUT")); + lut_combo->resetDirty(); + } +} + void ALFloaterLightBox::onClickResetControlDefault(const LLSD& userdata) { const std::string& control_name = userdata.asString(); diff --git a/indra/newview/alfloaterlightbox.h b/indra/newview/alfloaterlightbox.h index 1db556a97ce5220174df74ad8be92fde613f9b75..872265b396218c070bdef6c4c434c734b5fe12e0 100644 --- a/indra/newview/alfloaterlightbox.h +++ b/indra/newview/alfloaterlightbox.h @@ -50,6 +50,7 @@ class ALFloaterLightBox final : public LLFloater void onClickResetGroupDefault(const LLSD& userdata); void updateTonemapper(); void updateCAS(); + void populateLUTCombo(); boost::signals2::scoped_connection mTonemapConnection; boost::signals2::scoped_connection mCASConnection; diff --git a/indra/newview/alrenderutils.cpp b/indra/newview/alrenderutils.cpp index 0ea6f0ae776bddd4be613a29a6516e3f45e70878..617ab60354ead1dbc490b7f2986949d1ff6e605f 100644 --- a/indra/newview/alrenderutils.cpp +++ b/indra/newview/alrenderutils.cpp @@ -471,6 +471,12 @@ bool ALRenderUtil::setupColorGrade() if (!lut_name.empty()) { std::string lut_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colorlut", lut_name); + + if(!gDirUtilp->fileExists(lut_path)) + { + lut_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colorlut", lut_name); + } + if (!lut_path.empty()) { std::string temp_exten = gDirUtilp->getExtension(lut_path);