diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-09-16 18:57:50 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-09-17 16:23:03 +0300 |
commit | 59787f0f2f74fed8159554c105c6c01802070271 (patch) | |
tree | bfe81ca85d26dbd8467a142bd635e727889f10bf /io_scene_gltf2/blender | |
parent | d7d2bad09f8c04d3e86081481fc700ae3c834800 (diff) |
glTF exporter: Manage basic color when shader tree is not used
Diffstat (limited to 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py | 9 |
1 files changed, 9 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 05f94202..d0cf4517 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 @@ -47,6 +47,9 @@ def __filter_pbr_material(blender_material, export_settings): def __gather_base_color_factor(blender_material, export_settings): + if not blender_material.use_nodes: + return [*blender_material.diffuse_color[:3], 1.0] + rgb, alpha = None, None alpha_socket = gltf2_blender_get.get_socket(blender_material, "Alpha") @@ -99,6 +102,9 @@ def __gather_extras(blender_material, export_settings): def __gather_metallic_factor(blender_material, export_settings): + if not blender_material.use_nodes: + return blender_material.metallic + metallic_socket = gltf2_blender_get.get_socket(blender_material, "Metallic") if metallic_socket is None: metallic_socket = gltf2_blender_get.get_socket_old(blender_material, "MetallicFactor") @@ -134,6 +140,9 @@ def __gather_metallic_roughness_texture(blender_material, orm_texture, export_se def __gather_roughness_factor(blender_material, export_settings): + if not blender_material.use_nodes: + return blender_material.roughness + roughness_socket = gltf2_blender_get.get_socket(blender_material, "Roughness") if roughness_socket is None: roughness_socket = gltf2_blender_get.get_socket_old(blender_material, "RoughnessFactor") |