diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-01-30 09:09:40 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-01-30 09:09:40 +0300 |
commit | 60ed79fc0ced4a802fca7fa5b4cf3c295d76fe98 (patch) | |
tree | f420b04f4d6c2430aac0f2444060338e99e618d9 /io_scene_gltf2 | |
parent | 6b465fdceb8d05c5836c55234f07fb7a658246e2 (diff) |
glTF importer: Fix viewport color display after recent Workbench changes
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py index 18e2aefb..cfa6b83c 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py @@ -36,7 +36,11 @@ class BlenderPbr(): # If there is no diffuse texture, but only a color, wihtout # vertex_color, we set this color in viewport color if pypbr.color_type == gltf.SIMPLE and not vertex_color: - material.diffuse_color = pypbr.base_color_factor[:3] + # Manage some change in beta version on 20190129 + if len(material.diffuse_color) == 3: + material.diffuse_color = pypbr.base_color_factor[:3] + else: + material.diffuse_color = pypbr.base_color_factor # delete all nodes except output for node in list(node_tree.nodes): |