project: fixed bug where ocio config wouldn't automatically load from a saved project
This commit is contained in:
@@ -92,14 +92,10 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(Project* p, QWidget *parent) :
|
||||
void ProjectPropertiesDialog::accept()
|
||||
{
|
||||
try {
|
||||
OCIO::ConstConfigRcPtr config = OCIO::Config::CreateFromFile(ocio_filename_->text().toUtf8());
|
||||
|
||||
working_project_->set_default_input_colorspace(default_input_colorspace_->currentText());
|
||||
|
||||
// This should ripple changes throughout the program that the color config has changed, therefore must be done last
|
||||
working_project_->set_ocio_config(ocio_filename_->text());
|
||||
|
||||
// This should ripple changes throughout the program that the color config has changed, therefore must be done last
|
||||
working_project_->color_manager()->SetConfig(config);
|
||||
working_project_->set_default_input_colorspace(default_input_colorspace_->currentText());
|
||||
|
||||
QDialog::accept();
|
||||
} catch (OCIO::Exception& e) {
|
||||
|
||||
@@ -135,6 +135,8 @@ const QString &Project::ocio_config() const
|
||||
|
||||
void Project::set_ocio_config(const QString &ocio_config)
|
||||
{
|
||||
color_manager_.SetConfig(ocio_config);
|
||||
|
||||
ocio_config_ = ocio_config;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,15 @@ OCIO::ConstConfigRcPtr ColorManager::GetConfig() const
|
||||
|
||||
void ColorManager::SetConfig(const QString &filename)
|
||||
{
|
||||
SetConfig(OCIO::Config::CreateFromFile(filename.toUtf8()));
|
||||
OCIO::ConstConfigRcPtr cfg;
|
||||
|
||||
if (filename.isEmpty()) {
|
||||
cfg = OCIO::Config::CreateFromEnv();
|
||||
} else {
|
||||
cfg = OCIO::Config::CreateFromFile(filename.toUtf8());
|
||||
}
|
||||
|
||||
SetConfig(cfg);
|
||||
}
|
||||
|
||||
void ColorManager::SetConfig(OCIO::ConstConfigRcPtr config)
|
||||
|
||||
Reference in New Issue
Block a user