diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2022-02-12 15:36:55 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2022-02-12 15:36:55 +0300 |
commit | ef29d3b8f4264fcb229e73e6c418b1f5b54deddd (patch) | |
tree | f4054d16493091c8a1c0ccbec2e46eaaa4b23e26 /io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py | |
parent | c268b58c2472f3a2c708f23253af83c3b3c2df55 (diff) | |
parent | dc2d9b0864daf6805c89632004f8c98c91cc311b (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py index d4af9529..a3f8423c 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py @@ -262,7 +262,9 @@ def __gather_clearcoat_extension(blender_material, export_settings): clearcoat_extension['clearcoatFactor'] = clearcoat_socket.default_value clearcoat_enabled = clearcoat_extension['clearcoatFactor'] > 0 elif __has_image_node_from_socket(clearcoat_socket): - clearcoat_extension['clearcoatFactor'] = 1 + fac = gltf2_blender_get.get_factor_from_socket(clearcoat_socket, kind='VALUE') + # default value in glTF is 0.0, but if there is a texture without factor, use 1 + clearcoat_extension['clearcoatFactor'] = fac if fac != None else 1.0 has_clearcoat_texture = True clearcoat_enabled = True @@ -272,7 +274,9 @@ def __gather_clearcoat_extension(blender_material, export_settings): if isinstance(clearcoat_roughness_socket, bpy.types.NodeSocket) and not clearcoat_roughness_socket.is_linked: clearcoat_extension['clearcoatRoughnessFactor'] = clearcoat_roughness_socket.default_value elif __has_image_node_from_socket(clearcoat_roughness_socket): - clearcoat_extension['clearcoatRoughnessFactor'] = 1 + fac = gltf2_blender_get.get_factor_from_socket(clearcoat_roughness_socket, kind='VALUE') + # default value in glTF is 0.0, but if there is a texture without factor, use 1 + clearcoat_extension['clearcoatRoughnessFactor'] = fac if fac != None else 1.0 has_clearcoat_roughness_texture = True # Pack clearcoat (R) and clearcoatRoughness (G) channels. |