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:
authorCampbell Barton <ideasman42@gmail.com>2012-01-01 13:39:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-01 13:39:43 +0400
commit2c072d8f85fe38e3188813dd09147d1d32c775b5 (patch)
tree1543955ea10360b4c4b6953214bf2b633e08adc5 /source/blender/makesrna/intern/rna_define.c
parentf01ac19c3c720505b35aca520935845e9c8af862 (diff)
rna api - set hard min/max for colors which are float properties but internally use chars to 0/1.
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index caf43793996..53944f7ec5c 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -1628,6 +1628,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
PropertyDefRNA *dp;
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
@@ -1652,6 +1653,11 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
}
}
}
+
+ if(dp->dnatype && strcmp(dp->dnatype, "char") == 0) {
+ fprop->hardmin= fprop->softmin= 0.0f;
+ fprop->hardmax= fprop->softmax= 1.0f;
+ }
}
rna_def_property_sdna(prop, structname, propname);