glTF importer: fix bug importing file with no mesh / bug with faceless primitives
This commit is contained in:
parent
f9e25350dc
commit
bb1d6edaa6
|
@ -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, 80),
|
||||
"version": (0, 9, 81),
|
||||
'blender': (2, 81, 6),
|
||||
'location': 'File > Import-Export',
|
||||
'description': 'Import-Export as glTF 2.0',
|
||||
|
|
|
@ -278,7 +278,7 @@ class BlenderGlTF():
|
|||
mesh.is_weight_animated = False
|
||||
|
||||
# Calculate names for each mesh's shapekeys
|
||||
for mesh in gltf.data.meshes:
|
||||
for mesh in gltf.data.meshes or []:
|
||||
mesh.shapekey_names = []
|
||||
used_names = set()
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class BlenderPrimitive():
|
|||
bme_verts.ensure_lookup_table()
|
||||
|
||||
# Add edges/faces to bmesh
|
||||
mode = pyprimitive.mode or 4
|
||||
mode = 4 if pyprimitive.mode is None else pyprimitive.mode
|
||||
edges, faces = BlenderPrimitive.edges_and_faces(mode, indices)
|
||||
# NOTE: edges and vertices are in terms of pidxs!
|
||||
for edge in edges:
|
||||
|
|
Loading…
Reference in New Issue