Fix: Working space menu shows blank entry with custom OCIO config

If the name of the scene linear space is different in another config, make
sure we update bmain to use that name.

Pull Request: https://projects.blender.org/blender/blender/pulls/145884
This commit is contained in:
Brecht Van Lommel
2025-09-07 20:04:18 +02:00
parent dc2b672184
commit 514b9f4ec3
2 changed files with 4 additions and 5 deletions

View File

@@ -401,9 +401,6 @@ const char *IMB_colormanagement_working_space_get_default();
const char *IMB_colormanagement_working_space_get();
bool IMB_colormanagement_working_space_set_from_name(const char *name);
bool IMB_colormanagement_working_space_set_from_matrix(
const char *name, const blender::float3x3 &scene_linear_to_xyz);
void IMB_colormanagement_working_space_check(Main *bmain,
const bool for_undo,
const bool have_editable_assets);

View File

@@ -3177,7 +3177,7 @@ bool IMB_colormanagement_working_space_set_from_name(const char *name)
return true;
}
bool IMB_colormanagement_working_space_set_from_matrix(
static bool imb_colormanagement_working_space_set_from_matrix(
const char *name, const blender::float3x3 &scene_linear_to_xyz)
{
StringRefNull interop_id;
@@ -3239,8 +3239,10 @@ void IMB_colormanagement_working_space_check(Main *bmain,
const blender::float3x3 current_scene_linear_to_xyz = blender::colorspace::scene_linear_to_xyz;
/* Change the working space to the one from the blend file. */
const bool working_space_changed = IMB_colormanagement_working_space_set_from_matrix(
const bool working_space_changed = imb_colormanagement_working_space_set_from_matrix(
bmain->colorspace.scene_linear_name, bmain->colorspace.scene_linear_to_xyz);
/* Update scene linear name in case it is different for this config. */
STRNCPY(bmain->colorspace.scene_linear_name, global_role_scene_linear);
if (!working_space_changed) {
return;
}