Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2022-09-28 09:25:51 +0300
committerJulien Duroure <julien.duroure@gmail.com>2022-09-28 09:25:51 +0300
commit4feb92043cbd412f1ba69ea3fe2768169db48d91 (patch)
tree1d71b907b93d8e0686e79d9d850bbc9fcef4c9d7
parent06ad75f38d7c568553ffe1a4c37cf7049f0c3e92 (diff)
glTF exporter: Fix color attribute export
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_extract.py22
2 files changed, 10 insertions, 14 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index b3327fd3..7ae843d5 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (3, 3, 31),
+ "version": (3, 3, 32),
'blender': (3, 3, 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 61906ba0..fd1dce31 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
@@ -35,20 +35,16 @@ def extract_primitives(blender_mesh, uuid_for_skined_data, blender_vertex_groups
if blender_mesh.uv_layers.active:
tex_coord_max = len(blender_mesh.uv_layers)
- color_max = 0
- if export_settings[gltf2_blender_export_keys.COLORS]:
- color_max = len(blender_mesh.vertex_colors)
-
colors_attributes = []
- rendered_color_idx = blender_mesh.attributes.render_color_index
-
- if color_max > 0:
- colors_attributes.append(rendered_color_idx)
- # Then find other ones
- colors_attributes.extend([
- i for i in range(len(blender_mesh.color_attributes)) if i != rendered_color_idx \
- and blender_mesh.vertex_colors.find(blender_mesh.color_attributes[i].name) != -1
- ])
+ if export_settings[gltf2_blender_export_keys.COLORS]:
+ rendered_color_idx = blender_mesh.attributes.render_color_index
+
+ if rendered_color_idx > -1:
+ colors_attributes.append(rendered_color_idx)
+ # Then find other ones
+ colors_attributes.extend([
+ i for i in range(len(blender_mesh.color_attributes)) if i != rendered_color_idx
+ ])
armature = None