Merge branch 'blender-v2.91-release'

This commit is contained in:
Julien Duroure 2020-10-28 18:30:49 +01:00
commit 9a824ed39e
4 changed files with 8 additions and 6 deletions

View File

@ -80,7 +80,8 @@ def check_missing():
def check_unused():
'''find assets that have been deleted from scene but their library is still present.'''
#this is obviously broken. Blender should take care of the extra data automaticlaly
return;
used_libs = []
for ob in bpy.data.objects:
if ob.instance_collection is not None and ob.instance_collection.library is not None:
@ -96,7 +97,7 @@ def check_unused():
used_libs.append(ps.settings.instance_collection)
for l in bpy.data.libraries:
if l not in used_libs:
if l not in used_libs and l.getn('asset_data'):
print('attempt to remove this library: ', l.filepath)
# have to unlink all groups, since the file is a 'user' even if the groups aren't used at all...
for user_id in l.users_id:

View File

@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 5, 0),
"version": (1, 5, 1),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -91,9 +91,10 @@ def do_primitives(gltf, mesh_idx, skin_idx, mesh, ob):
num_cols = max(i, num_cols)
num_shapekeys = 0
for morph_i, _ in enumerate(pymesh.primitives[0].targets or []):
if pymesh.shapekey_names[morph_i] is not None:
num_shapekeys += 1
if len(pymesh.primitives) > 0: # Empty primitive tab is not allowed, but some invalid files...
for morph_i, _ in enumerate(pymesh.primitives[0].targets or []):
if pymesh.shapekey_names[morph_i] is not None:
num_shapekeys += 1
# -------------
# We'll process all the primitives gathering arrays to feed into the