diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-30 15:50:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-30 15:50:44 +0300 |
commit | 46feccfaea1818ef4ea91fe9694c7826e443fb58 (patch) | |
tree | 57779ba08f083d90c49060f57b3a5317b993cf11 /source/blender/makesrna/intern/makesrna.c | |
parent | 9733e5f76fdc87c3c5801a372f86062d47f844d4 (diff) |
Fix for bug #25367 didn't ensure the problem wasn't happening elsewhere.
add a check in makesrna, found FollowPathConstraint.offset was a float wrapped as an int.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index e5b1d11ccf9..1eeb83c11d2 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -45,6 +45,8 @@ #endif #endif +static const char *rna_property_typename(PropertyType type); + /* Replace if different */ #define TMP_EXT ".tmp" @@ -644,6 +646,13 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr } return NULL; } + + /* error check to ensure floats are not wrapped as ints/bools */ + if(dp->dnatype && (strcmp(dp->dnatype, "float") == 0 || strcmp(dp->dnatype, "double") == 0) && prop->type != PROP_FLOAT) { + fprintf(stderr, "rna_def_property_set_func: %s.%s is a float but wrapped as type '%s'.\n", srna->identifier, prop->identifier, rna_property_typename(prop->type)); + DefRNA.error= 1; + return NULL; + } } func= rna_alloc_function_name(srna->identifier, prop->identifier, "set"); |