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>2010-12-14 07:44:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-14 07:44:07 +0300
commit2fe540e0f2ae79c23d60bd86858f22e0376dc5fd (patch)
tree4eeb68236635a975d25c6eafabe647d46a8d92d5 /source/blender/makesrna/intern/rna_define.c
parent98f642dd31c3d73d41f37df67d8d1f83693e2d26 (diff)
disallow RNA color values to be set to negative values. Material colors could be set to -100.0 if typed in manually, this is sure to cause bad/unpredictable behavior.
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 214a79dbd34..b061fbccd37 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -887,6 +887,8 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
fprop->hardmax= FLT_MAX;
if(ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
+ fprop->hardmin= 0.0f; /* disallow colors to go below zero */
+
fprop->softmin= 0.0f;
fprop->softmax= 1.0f;
}