Color Management: fix crash when displaying render preview if OCIO was disabled buildtime
This commit is contained in:
@@ -78,6 +78,11 @@ ConstConfigRcPtr *OCIO_getCurrentConfig(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ConstConfigRcPtr *OCIO_getDefaultConfig(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void OCIO_setCurrentConfig(const ConstConfigRcPtr *config)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -59,6 +59,7 @@ extern "C" {
|
||||
|
||||
|
||||
ConstConfigRcPtr *OCIO_getCurrentConfig(void);
|
||||
ConstConfigRcPtr *OCIO_getDefaultConfig(void);
|
||||
void OCIO_setCurrentConfig(const ConstConfigRcPtr *config);
|
||||
|
||||
ConstConfigRcPtr *OCIO_configCreateFromEnv(void);
|
||||
|
||||
@@ -56,6 +56,11 @@ ConstConfigRcPtr *OCIO_getCurrentConfig(void)
|
||||
return CONFIG_DEFAULT;
|
||||
}
|
||||
|
||||
ConstConfigRcPtr *OCIO_getDefaultConfig(void)
|
||||
{
|
||||
return CONFIG_DEFAULT;
|
||||
}
|
||||
|
||||
void OCIO_setCurrentConfig(const ConstConfigRcPtr *)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -565,6 +565,10 @@ void IMB_colormanagement_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (config == NULL) {
|
||||
config = OCIO_getDefaultConfig();
|
||||
}
|
||||
|
||||
if (config) {
|
||||
OCIO_setCurrentConfig(config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user