Fix #111117: Partially revert a280e8a6

The size check was incorrect for mixed triangle/ngon/quad meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/112879
This commit is contained in:
Martijn Versteegh
2023-10-01 00:17:46 +02:00
committed by Martijn Versteegh
parent cc7da09c1b
commit 3f633503d3

View File

@@ -5288,7 +5288,7 @@ static int foreach_parse_args(BPy_PropertyRNA *self,
bool *r_attr_signed)
{
int array_tot;
int target_tot;
// int target_tot;
*r_size = *r_attr_tot = 0;
*r_attr_signed = false;
@@ -5333,6 +5333,11 @@ static int foreach_parse_args(BPy_PropertyRNA *self,
}
*r_size = RNA_raw_type_sizeof(*r_raw_type);
#if 0
/* This size check does not work as the size check is based on the size of the first element
* and elements in the collection/arrray can have different sizes (i.e. for mixed
* quad/triangle meshes). See for example issue #111117 */
if ((*r_attr_tot) < 1) {
*r_attr_tot = 1;
}
@@ -5347,6 +5352,7 @@ static int foreach_parse_args(BPy_PropertyRNA *self,
target_tot);
return -1;
}
#endif
}
/* Check 'r_attr_tot' otherwise we don't know if any values were set.