[Bf-extensions-cvs] [7e2fa377] master: glTF exporter: fix additional Vertex Color normalization

Julien Duroure noreply at git.blender.org
Mon Oct 17 15:08:16 CEST 2022


Commit: 7e2fa377ab1fcd622126e805f1ec7b15c077bbd0
Author: Julien Duroure
Date:   Mon Oct 17 15:08:11 2022 +0200
Branches: master
https://developer.blender.org/rBA7e2fa377ab1fcd622126e805f1ec7b15c077bbd0

glTF exporter: fix additional Vertex Color normalization

===================================================================

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py

===================================================================

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 98eb2353..fb8d316f 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, 4, 35),
+    "version": (3, 4, 36),
     '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_gather_primitive_attributes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py
index 565378d1..833b6734 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py
@@ -148,7 +148,7 @@ def __gather_attribute(blender_primitive, attribute, export_settings):
         "POSITION": True
     }
 
-    if (attribute.startswith("_COLOR") or attribute.startswith("COLOR_")) and blender_primitive["attributes"][attribute]['component_type'] == gltf2_io_constants.ComponentType.UnsignedShort:
+    if (attribute.startswith("_") or attribute.startswith("COLOR_")) and blender_primitive["attributes"][attribute]['component_type'] == gltf2_io_constants.ComponentType.UnsignedShort:
         # Byte Color vertex color, need to normalize
 
         data['data'] *= 65535



More information about the Bf-extensions-cvs mailing list