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.
This commit is contained in:
Campbell Barton
2010-12-30 12:50:44 +00:00
parent 9733e5f76f
commit 46feccfaea
2 changed files with 10 additions and 1 deletions

View File

@@ -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");

View File

@@ -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");