diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-08-07 07:59:51 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-08-07 08:00:14 +0300 |
commit | 26c53aa581b0faad7656e40dc83d157fa0bba93a (patch) | |
tree | bc2c86bc91fc04786d916b9ca18bc2d140111472 /io_scene_gltf2 | |
parent | 8ca469749f4d007f696bae3e6d529c25a77f52e3 (diff) |
glTF exporter: export vertex color alpha
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-x | io_scene_gltf2/__init__.py | 2 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_extract.py | 20 |
2 files changed, 15 insertions, 7 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index 7f49cc4c..fb2423aa 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -15,7 +15,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (0, 9, 43), + "version": (0, 9, 44), 'blender': (2, 80, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', 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] + ]) # |