Fix T93541: Use warning instead of error for exceeding layer limits

Instead of using RPT_ERROR, use RPT_WARNING which will not raise an
exception to Python. This broke some scripts (including FBX import)
which already check for a None return value.

Ref D13458

Reviewed By: campbellbarton
This commit is contained in:
Jesse Yurkovich 2021-12-03 17:01:10 +11:00 committed by Philipp Oeser
parent 490f1648a7
commit c37cd35469
Notes: blender-bot 2023-02-14 18:28:11 +01:00
Referenced by issue #93479, 3.0 Potential candidates for corrective releases
Referenced by issue blender/blender-addons#93541, Blender 3.0 cannot import FBX (containing more than 8 UV layers)
1 changed files with 6 additions and 6 deletions

View File

@ -267,7 +267,7 @@ int ED_mesh_uv_texture_add(
layernum_dst = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPUV);
if (layernum_dst >= MAX_MTFACE) {
BKE_reportf(reports, RPT_ERROR, "Cannot add more than %i UV maps", MAX_MTFACE);
BKE_reportf(reports, RPT_WARNING, "Cannot add more than %i UV maps", MAX_MTFACE);
return -1;
}
@ -287,7 +287,7 @@ int ED_mesh_uv_texture_add(
else {
layernum_dst = CustomData_number_of_layers(&me->ldata, CD_MLOOPUV);
if (layernum_dst >= MAX_MTFACE) {
BKE_reportf(reports, RPT_ERROR, "Cannot add more than %i UV maps", MAX_MTFACE);
BKE_reportf(reports, RPT_WARNING, "Cannot add more than %i UV maps", MAX_MTFACE);
return -1;
}
@ -393,7 +393,7 @@ int ED_mesh_color_add(
layernum = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPCOL);
if (layernum >= MAX_MCOL) {
BKE_reportf(reports, RPT_ERROR, "Cannot add more than %i vertex color layers", MAX_MCOL);
BKE_reportf(reports, RPT_WARNING, "Cannot add more than %i vertex color layers", MAX_MCOL);
return -1;
}
@ -411,7 +411,7 @@ int ED_mesh_color_add(
else {
layernum = CustomData_number_of_layers(&me->ldata, CD_MLOOPCOL);
if (layernum >= MAX_MCOL) {
BKE_reportf(reports, RPT_ERROR, "Cannot add more than %i vertex color layers", MAX_MCOL);
BKE_reportf(reports, RPT_WARNING, "Cannot add more than %i vertex color layers", MAX_MCOL);
return -1;
}
@ -529,7 +529,7 @@ int ED_mesh_sculpt_color_add(
layernum = CustomData_number_of_layers(&em->bm->vdata, CD_PROP_COLOR);
if (layernum >= MAX_MCOL) {
BKE_reportf(
reports, RPT_ERROR, "Cannot add more than %i sculpt vertex color layers", MAX_MCOL);
reports, RPT_WARNING, "Cannot add more than %i sculpt vertex color layers", MAX_MCOL);
return -1;
}
@ -548,7 +548,7 @@ int ED_mesh_sculpt_color_add(
layernum = CustomData_number_of_layers(&me->vdata, CD_PROP_COLOR);
if (layernum >= MAX_MCOL) {
BKE_reportf(
reports, RPT_ERROR, "Cannot add more than %i sculpt vertex color layers", MAX_MCOL);
reports, RPT_WARNING, "Cannot add more than %i sculpt vertex color layers", MAX_MCOL);
return -1;
}