From 5ebe822f4b022e9d10eafe41359c7a47eac16148 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Wed, 12 Dec 2012 17:50:35 +0000 Subject: Fix for range checks in generated RNA functions. The code was skipping the value clamping for float and int properties if using the min/max values of the respective number format, but not taking into account range callbacks of the property. --- source/blender/makesrna/intern/makesrna.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 6fa53f4e029..1d9b737ba29 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -760,7 +760,7 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array) if (prop->type == PROP_INT) { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; - if (iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) { + if (iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX || iprop->range) { if (array) fprintf(f, "CLAMPIS(values[i], "); else fprintf(f, "CLAMPIS(value, "); if (iprop->range) { @@ -776,7 +776,7 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array) else if (prop->type == PROP_FLOAT) { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; - if (fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) { + if (fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX || fprop->range) { if (array) fprintf(f, "CLAMPIS(values[i], "); else fprintf(f, "CLAMPIS(value, "); if (fprop->range) { -- cgit v1.2.3