[Bf-extensions-cvs] [d504a09a] master: glTF exporter: Draco: bug when exporting Blender instances

Julien Duroure noreply at git.blender.org
Sun Dec 29 13:13:43 CET 2019


Commit: d504a09ab5eae0e07863a0a816bc1af935f50f40
Author: Julien Duroure
Date:   Sun Dec 29 13:12:19 2019 +0100
Branches: master
https://developer.blender.org/rBAd504a09ab5eae0e07863a0a816bc1af935f50f40

glTF exporter: Draco: bug when exporting Blender instances

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

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py

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

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 1b581b8c..7e8f9abf 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": (1, 1, 28),
+    "version": (1, 1, 29),
     'blender': (2, 81, 6),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
index a8554efc..9189be58 100644
--- a/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
+++ b/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
@@ -206,6 +206,12 @@ def __compress_primitive(primitive, dll, export_settings):
         return
 
     positions = attributes['POSITION']
+
+    # Skip nodes without a position buffer.
+    # This happens with Blender instances, i.e. multiple nodes sharing the same mesh.
+    if attributes['POSITION'].buffer_view is None:
+        return
+
     normals = attributes['NORMAL'] if 'NORMAL' in attributes else None
     uvs = [attributes[attr] for attr in attributes if attr.startswith('TEXCOORD_')]
     weights = [attributes[attr] for attr in attributes if attr.startswith('WEIGHTS_')]



More information about the Bf-extensions-cvs mailing list