rna collection sizes for face data layers were invalid.

This meant python could do...
  mesh.uv_textures[0] 
...on a mesh with 1 vertex color layer instead.
This commit is contained in:
Campbell Barton 2011-01-10 17:46:34 +00:00
parent bfcea85c6f
commit dd69f1968e

@ -372,7 +372,7 @@ static void rna_Mesh_uv_textures_begin(CollectionPropertyIterator *iter, Pointer
{
Mesh *me= (Mesh*)ptr->data;
CustomData *fdata= rna_mesh_fdata(me);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_uv_texture_check);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), rna_CustomDataLayer_length(ptr, CD_MTFACE), 0, rna_uv_texture_check);
}
static int rna_Mesh_uv_textures_length(PointerRNA *ptr)
@ -695,7 +695,7 @@ static void rna_Mesh_vertex_colors_begin(CollectionPropertyIterator *iter, Point
{
Mesh *me= (Mesh*)ptr->data;
CustomData *fdata= rna_mesh_fdata(me);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_vertex_color_check);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), rna_CustomDataLayer_length(ptr, CD_MCOL), 0, rna_vertex_color_check);
}
static int rna_Mesh_vertex_colors_length(PointerRNA *ptr)
@ -820,7 +820,7 @@ static void rna_Mesh_float_layers_begin(CollectionPropertyIterator *iter, Pointe
{
Mesh *me= (Mesh*)ptr->data;
CustomData *fdata= rna_mesh_fdata(me);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_float_layer_check);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), rna_CustomDataLayer_length(ptr, CD_PROP_FLT), 0, rna_float_layer_check);
}
static int rna_Mesh_float_layers_length(PointerRNA *ptr)
@ -851,7 +851,7 @@ static void rna_Mesh_int_layers_begin(CollectionPropertyIterator *iter, PointerR
{
Mesh *me= (Mesh*)ptr->data;
CustomData *fdata= rna_mesh_fdata(me);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_int_layer_check);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), rna_CustomDataLayer_length(ptr, CD_PROP_INT), 0, rna_int_layer_check);
}
static int rna_Mesh_int_layers_length(PointerRNA *ptr)
@ -882,7 +882,7 @@ static void rna_Mesh_string_layers_begin(CollectionPropertyIterator *iter, Point
{
Mesh *me= (Mesh*)ptr->data;
CustomData *fdata= rna_mesh_fdata(me);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_string_layer_check);
rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), rna_CustomDataLayer_length(ptr, CD_PROP_STR), 0, rna_string_layer_check);
}
static int rna_Mesh_string_layers_length(PointerRNA *ptr)