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 | |
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')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 2 |
2 files changed, 10 insertions, 1 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"); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index ffc42eb97e4..f83644bd4cb 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1113,7 +1113,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); - prop= RNA_def_property(srna, "offset", PROP_INT, PROP_TIME); + prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); |