[Bf-extensions-cvs] [067ccc71] master: glTF exporter: fix normals export

Julien Duroure noreply at git.blender.org
Wed May 22 23:19:29 CEST 2019


Commit: 067ccc71c20dbe3ac82fd47364c632d5a8c760b3
Author: Julien Duroure
Date:   Wed May 22 23:19:02 2019 +0200
Branches: master
https://developer.blender.org/rBA067ccc71c20dbe3ac82fd47364c632d5a8c760b3

glTF exporter: fix normals export

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

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

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

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 18f057c9..2f82e0d6 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, 10),
+    "version": (0, 9, 11),
     '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 9cd6b177..4c6d2555 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
@@ -392,6 +392,10 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp
     """
     print_console('INFO', 'Extracting primitive: ' + blender_mesh.name)
 
+    if blender_mesh.has_custom_normals:
+        # Custom normals are all (0, 0, 0) until calling calc_normals_split() or calc_tangents().
+        blender_mesh.calc_normals_split()
+
     use_tangents = False
     if blender_mesh.uv_layers.active and len(blender_mesh.uv_layers) > 0:
         try:



More information about the Bf-extensions-cvs mailing list