Fix #106745: Subdivision surface crash with more than 8 UV maps
Before 6c774feba2, the maximum number of UV maps was
enforced throughout Blender. Now it has to be enforced in the few places
that actually have the limit. In the future the limit of the subsurf
could be lifted, but that isn't done now to keep the crash fix simple.
This commit is contained in:
@@ -85,7 +85,8 @@ struct SubdivMeshContext {
|
||||
static void subdiv_mesh_ctx_cache_uv_layers(SubdivMeshContext *ctx)
|
||||
{
|
||||
Mesh *subdiv_mesh = ctx->subdiv_mesh;
|
||||
ctx->num_uv_layers = CustomData_number_of_layers(&subdiv_mesh->ldata, CD_PROP_FLOAT2);
|
||||
ctx->num_uv_layers = std::min(CustomData_number_of_layers(&subdiv_mesh->ldata, CD_PROP_FLOAT2),
|
||||
MAX_MTFACE);
|
||||
for (int layer_index = 0; layer_index < ctx->num_uv_layers; layer_index++) {
|
||||
ctx->uv_layers[layer_index] = static_cast<float2 *>(CustomData_get_layer_n_for_write(
|
||||
&subdiv_mesh->ldata, CD_PROP_FLOAT2, layer_index, subdiv_mesh->totloop));
|
||||
|
||||
Reference in New Issue
Block a user