[Bf-extensions-cvs] [df726ecd] blender-v2.91-release: BlenderKit: fix T75935

Vilém Duha noreply at git.blender.org
Tue Oct 27 08:03:45 CET 2020


Commit: df726ecd2bad8cdcdfec57ab0d161fa8ac4ef247
Author: Vilém Duha
Date:   Tue Oct 27 08:01:57 2020 +0100
Branches: blender-v2.91-release
https://developer.blender.org/rBAdf726ecd2bad8cdcdfec57ab0d161fa8ac4ef247

BlenderKit: fix  T75935

Disable purging algorithm, was too simple and was causing trouble like purging background scene.

===================================================================

M	blenderkit/download.py

===================================================================

diff --git a/blenderkit/download.py b/blenderkit/download.py
index a80678fc..e3a69ea8 100644
--- a/blenderkit/download.py
+++ b/blenderkit/download.py
@@ -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:



More information about the Bf-extensions-cvs mailing list