Fix #34372: mesh.verts.foreach_set not working with normals, regression due to my

bugfix for multidimensional arrays.
This commit is contained in:
Brecht Van Lommel
2013-02-28 16:37:15 +00:00
parent 08f737c3b9
commit c0a3ebedb3

View File

@@ -3196,18 +3196,16 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
return 0;
}
/* check item array */
itemlen = RNA_property_array_length(&itemptr, itemprop);
/* dynamic array? need to get length per item */
if (itemprop->getlength) {
itemprop = NULL;
}
/* try to access as raw array */
else if (RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) {
int arraylen;
/* check item array */
itemlen = RNA_property_array_length(&itemptr, itemprop);
arraylen = (itemlen == 0) ? 1 : itemlen;
int arraylen = (itemlen == 0) ? 1 : itemlen;
if (in.len != arraylen * out.len) {
BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d)",
out.len * arraylen, in.len);