diff options
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py index a5929c05..61e84b16 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py @@ -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 |