diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2018-12-15 08:30:27 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2018-12-15 08:30:27 +0300 |
commit | 6d933c0e3ac8048e8a04f2b42bcd21a667818c2e (patch) | |
tree | 95799aa9467fc4bdfa69e7a5192411fd312e7e8a /io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py | |
parent | b55002b7c33154d2b66166aaf0c2a0b287ec9e42 (diff) |
glTF importer: fix material import / vertex color
Fixed a bug when a same material sometimes uses vertex color, sometimes doesn't
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py b/io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py index 81cfd76e..c3d0cb22 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py @@ -23,17 +23,17 @@ class BlenderEmissiveMap(): raise RuntimeError("%s should not be instantiated" % cls) @staticmethod - def create(gltf, material_idx): + def create(gltf, material_idx, vertex_color): """Create emissive map.""" engine = bpy.context.scene.render.engine if engine in ['CYCLES', 'BLENDER_EEVEE']: - BlenderEmissiveMap.create_nodetree(gltf, material_idx) + BlenderEmissiveMap.create_nodetree(gltf, material_idx, vertex_color) - def create_nodetree(gltf, material_idx): + def create_nodetree(gltf, material_idx, vertex_color): """Create node tree.""" pymaterial = gltf.data.materials[material_idx] - material = bpy.data.materials[pymaterial.blender_material] + material = bpy.data.materials[pymaterial.blender_material[vertex_color]] node_tree = material.node_tree BlenderTextureInfo.create(gltf, pymaterial.emissive_texture.index) |