Color Management: Better preserve views when switching between displays

Also match prefixes, so that switching between PQ and HLG keeps an
ACES view regardless of the HDR nits.

Pull Request: https://projects.blender.org/blender/blender/pulls/146504
This commit is contained in:
Brecht Van Lommel
2025-09-20 13:55:38 +02:00
committed by Brecht Van Lommel
parent fc8bc41b84
commit acb6faf8eb

View File

@@ -981,6 +981,17 @@ static StringRefNull colormanage_find_matching_view_name(const ocio::Display *di
}
}
const int64_t separator_offset = view_name.find(" - ");
if (separator_offset != -1) {
const StringRef view_short_name = view_name.substr(0, separator_offset);
for (const int view_index : blender::IndexRange(display->get_num_views())) {
const ocio::View *view = display->get_view_by_index(view_index);
if (view->name().startswith(view_short_name)) {
return view->name();
}
}
}
if (const ocio::View *view = display->get_default_view()) {
return view->name();
}