glTF exporter: do not split in primitives if materials are not exported

This commit is contained in:
Julien Duroure 2019-10-31 20:25:04 +01:00
parent 737fdfae6f
commit d709b46340
2 changed files with 5 additions and 2 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, 0, 12),
"version": (1, 0, 13),
'blender': (2, 81, 6),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -563,7 +563,10 @@ def extract_primitives(glTF, blender_mesh, blender_object, blender_vertex_groups
#
if not blender_polygon.material_index in material_idx_to_primitives:
if export_settings['gltf_materials'] is False:
primitive = material_idx_to_primitives[0]
vertex_index_to_new_indices = material_map[0]
elif not blender_polygon.material_index in material_idx_to_primitives:
primitive = material_idx_to_primitives[0]
vertex_index_to_new_indices = material_map[0]
else: