Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-03 23:56:19 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-03 23:56:19 +0400
commit36df48eef63e4bc629ffae6f9b7c300ba2fdb35d (patch)
tree26777253d4b4af4dc32182a9e12f983ca34913d9 /source/blender/makesrna/intern/makesrna.c
parent83c0fd65faa69491454c1eabd87bcf4c2c4b1237 (diff)
2.5:
* Fix crash in python with enum properties, and don't throw error if no matching identifier is found. This shouldn't happen, but it should break a python script either, which is not at fault. * Fix a wrong variable initialization in fluidsim.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r--source/blender/makesrna/intern/makesrna.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index c42bc866f99..059afad4c70 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1568,22 +1568,20 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
int i, defaultfound= 0;
if(eprop->item) {
- fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {", srna->identifier, strnest, prop->identifier, eprop->totitem);
+ fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {", srna->identifier, strnest, prop->identifier, eprop->totitem+1);
for(i=0; i<eprop->totitem; i++) {
fprintf(f, "{%d, ", eprop->item[i].value);
rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", ");
fprintf(f, "%d, ", eprop->item[i].icon);
rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", ");
- rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}");
- if(i != eprop->totitem-1)
- fprintf(f, ", ");
+ rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}, ");
if(eprop->defaultvalue == eprop->item[i].value)
defaultfound= 1;
}
- fprintf(f, "};\n\n");
+ fprintf(f, "{0, NULL, 0, NULL, NULL}};\n\n");
if(!defaultfound) {
fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default is not in items.\n", srna->identifier, errnest, prop->identifier);