colormanager: use env variable as default config if it exists

This commit is contained in:
itsmattkc
2020-05-01 16:33:46 +10:00
parent 6433a0bb8c
commit 4290797389
+10
View File
@@ -61,6 +61,16 @@ OCIO::ConstConfigRcPtr ColorManager::GetDefaultConfig()
void ColorManager::SetUpDefaultConfig()
{
if (!qgetenv("OCIO").isEmpty()) {
try {
default_config_ = OCIO::Config::CreateFromEnv();
return;
} catch (OCIO::Exception& e) {
qWarning() << "Failed to load config from OCIO environment variable, loading default instead";
}
}
// Kind of hacky, but it'll work
QString dir = QDir(FileFunctions::GetTempFilePath()).filePath(QStringLiteral("ocioconf"));