Skip to content
Snippets Groups Projects
Commit e890169e authored by Julien Duroure's avatar Julien Duroure
Browse files

glTF exporter: clamp base color factor to [0,1], as hard rgb values can be outside

parent 726d08c9
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (3, 4, 25),
"version": (3, 4, 26),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
......
......@@ -71,6 +71,9 @@ def __gather_base_color_factor(blender_material, export_settings):
if rgb is None: rgb = [1.0, 1.0, 1.0]
if alpha is None: alpha = 1.0
# Need to clamp between 0.0 and 1.0: Blender color can be outside this range
rgb = [max(min(c, 1.0), 0.0) for c in rgb]
rgba = [*rgb, alpha]
if rgba == [1, 1, 1, 1]: return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment