Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_legacy_convert.cc
| Show First 20 Lines • Show All 1,610 Lines • ▼ Show 20 Lines | void BKE_mesh_legacy_convert_uvs_to_generic(Mesh *mesh) | ||||
| /* Store layer names since they will be removed, used to set the active status of new layers. | /* Store layer names since they will be removed, used to set the active status of new layers. | ||||
| * Use intermediate #StringRef because the names can be null. */ | * Use intermediate #StringRef because the names can be null. */ | ||||
| const std::string active_uv = StringRef( | const std::string active_uv = StringRef( | ||||
| CustomData_get_active_layer_name(&mesh->ldata, CD_MLOOPUV)); | CustomData_get_active_layer_name(&mesh->ldata, CD_MLOOPUV)); | ||||
| const std::string default_uv = StringRef( | const std::string default_uv = StringRef( | ||||
| CustomData_get_render_layer_name(&mesh->ldata, CD_MLOOPUV)); | 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))) { | 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) { | for (const StringRefNull name : uv_layers_to_convert) { | ||||
| const MLoopUV *mloopuv = static_cast<const MLoopUV *>( | const MLoopUV *mloopuv = static_cast<const MLoopUV *>( | ||||
| CustomData_get_layer_named(&mesh->ldata, CD_MLOOPUV, name.c_str())); | CustomData_get_layer_named(&mesh->ldata, CD_MLOOPUV, name.c_str())); | ||||
| const uint32_t needed_boolean_attributes = threading::parallel_reduce( | const uint32_t needed_boolean_attributes = threading::parallel_reduce( | ||||
| IndexRange(mesh->totloop), | IndexRange(mesh->totloop), | ||||
| 4096, | 4096, | ||||
| ▲ Show 20 Lines • Show All 377 Lines • Show Last 20 Lines | |||||