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>2019-12-29 15:12:19 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-12-29 15:12:19 +0300
commitd504a09ab5eae0e07863a0a816bc1af935f50f40 (patch)
tree17254392f2e6c3873620285d44e8ddb06edb38ad
parent24cc252dc6f69edac3d811085253f7cbae690085 (diff)
glTF exporter: Draco: bug when exporting Blender instances
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rw-r--r--io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py6
2 files changed, 7 insertions, 1 deletions
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_')]