glTF exporter: fix buffer size with Draco compression

This commit is contained in:
Julien Duroure 2019-11-12 22:36:45 +01:00
parent febdff331a
commit dc02819553
2 changed files with 8 additions and 1 deletions

View File

@ -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, 3),
"version": (1, 1, 4),
'blender': (2, 81, 6),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -249,6 +249,13 @@ def __compress_primitive(primitive, dll, export_settings):
primitive.extensions['KHR_draco_mesh_compression'] = extension
# Remove buffer views from the accessors of the attributes which compressed.
attributes['POSITION'].buffer_view = None
if enable_normals:
attributes['NORMAL'].buffer_view = None
for tex_coord in tex_coord_attrs:
tex_coord.buffer_view = None
# Set to triangle list mode.
primitive.mode = 4