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>2018-08-23 14:40:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-23 14:40:30 +0300
commit0cbbcac23e47a686519b89c9cac7b2df2e4a4458 (patch)
tree19a662d0fd89039250091ba1486341257de2fbbe /release/datafiles
parent7f8014f918422d2968b0b14ec5440aae89599fea (diff)
Icons: clamp material color from 0..1
Warn about out of range colors too.
Diffstat (limited to 'release/datafiles')
-rw-r--r--release/datafiles/blender_icons_geom.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/release/datafiles/blender_icons_geom.py b/release/datafiles/blender_icons_geom.py
index f3af7f997c1..644d0756234 100644
--- a/release/datafiles/blender_icons_geom.py
+++ b/release/datafiles/blender_icons_geom.py
@@ -93,6 +93,9 @@ def object_material_colors(ob):
for node in node_tree.nodes
if node.type == 'RGB'
), color_default)
+ if min(color) < 0.0 or max(color) > 1.0:
+ print(f"Material: {material.name!r} has color out of 0..1 range {color!r}")
+ color = tuple(max(min(c, 1.0), 0.0) for c in color)
material_colors.append(color)
return material_colors