Merge branch 'master' into blender2.8
[blender.git] / source / blender / makesrna / intern / makesrna.c
index 40028eec4c842ef5969d6665c8ed8918f9cca677..0b2efe2705993651d0c6a4e9be0e1b034d97d750 100644 (file)
@@ -970,7 +970,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                                                        fprintf(f, ";\n");
                                                }
                                                else if (rna_color_quantize(prop, dp)) {
-                                                       fprintf(f, "            data->%s[i] = FTOCHAR(values[i]);\n", dp->dnaname);
+                                                       fprintf(f, "            data->%s[i] = unit_float_to_uchar_clamp(values[i]);\n", dp->dnaname);
                                                }
                                                else {
                                                        if (dp->dnatype)