[Bf-extensions-cvs] [1f38515d] master: BlenderKit: forgot one instance of the save_mainfile call in previous fix
Vilem Duha
noreply at git.blender.org
Sun Oct 3 19:07:47 CEST 2021
Commit: 1f38515d87fb78443f2ead17b4e95411f43dc1b2
Author: Vilem Duha
Date: Sun Oct 3 19:07:38 2021 +0200
Branches: master
https://developer.blender.org/rBA1f38515d87fb78443f2ead17b4e95411f43dc1b2
BlenderKit: forgot one instance of the save_mainfile call in previous fix
fixes crash of background blender during asset unpacking
===================================================================
M blenderkit/resolutions.py
===================================================================
diff --git a/blenderkit/resolutions.py b/blenderkit/resolutions.py
index 7a3f3671..f92f68c6 100644
--- a/blenderkit/resolutions.py
+++ b/blenderkit/resolutions.py
@@ -171,6 +171,7 @@ def unpack_asset(data):
#mark asset browser asset
data_block = None
if asset_data['assetType'] == 'model':
+
for c in bpy.data.collections:
if c.get('asset_data') is not None:
c.asset_mark()
@@ -193,6 +194,8 @@ def unpack_asset(data):
tags.new('description: ' + asset_data['description'])
tags.new('tags: ' + ','.join(asset_data['tags']))
#
+ # if this isn't here, blender crashes when saving file.
+ bpy.context.preferences.filepaths.file_preview_type = 'NONE'
bpy.ops.wm.save_mainfile(compress=False)
# now try to delete the .blend1 file
More information about the Bf-extensions-cvs
mailing list