Fix T104044: keep order of UVMaps on load

Use a Vector<std::string> , instead of a Set<std::string> as a Set does
not keep the same order when iterating over it.

Differential Revision: https://developer.blender.org/D17103
This commit is contained in:
Martijn Versteegh 2023-01-24 11:14:41 +01:00 committed by Baardaap
parent e56f284843
commit a73a2d345f
Notes: blender-bot 2023-02-14 10:54:29 +01:00
Referenced by issue #104044, Regression: UVMap channels order breaks after scene reload
1 changed files with 2 additions and 2 deletions

View File

@ -1616,9 +1616,9 @@ void BKE_mesh_legacy_convert_uvs_to_generic(Mesh *mesh)
const std::string default_uv = StringRef(
CustomData_get_render_layer_name(&mesh->ldata, CD_MLOOPUV));
Set<std::string> uv_layers_to_convert;
Vector<std::string> uv_layers_to_convert;
for (const int uv_layer_i : IndexRange(CustomData_number_of_layers(&mesh->ldata, CD_MLOOPUV))) {
uv_layers_to_convert.add_as(CustomData_get_layer_name(&mesh->ldata, CD_MLOOPUV, uv_layer_i));
uv_layers_to_convert.append(CustomData_get_layer_name(&mesh->ldata, CD_MLOOPUV, uv_layer_i));
}
for (const StringRefNull name : uv_layers_to_convert) {