diff options
Diffstat (limited to 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_extract.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py index b5c09de7..69c3f1d6 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py @@ -621,12 +621,20 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp for color_index in range(0, color_max): color_name = COLOR_PREFIX + str(color_index) color = vertex_colors[color_name].data[loop_index].color - colors.append([ - color_srgb_to_scene_linear(color[0]), - color_srgb_to_scene_linear(color[1]), - color_srgb_to_scene_linear(color[2]), - 1.0 - ]) + if len(color) == 3: + colors.append([ + color_srgb_to_scene_linear(color[0]), + color_srgb_to_scene_linear(color[1]), + color_srgb_to_scene_linear(color[2]), + 1.0 + ]) + else: + colors.append([ + color_srgb_to_scene_linear(color[0]), + color_srgb_to_scene_linear(color[1]), + color_srgb_to_scene_linear(color[2]), + color[3] + ]) # |