[Bf-blender-cvs] [018fffbe774] master: Fix failing assert when loading file with untraceable custom asset library

Julian Eisel noreply at git.blender.org
Thu Mar 11 13:22:24 CET 2021


Commit: 018fffbe77414e2d6b80dc50d5f3d2d5bbf71169
Author: Julian Eisel
Date:   Thu Mar 11 13:02:47 2021 +0100
Branches: master
https://developer.blender.org/rB018fffbe77414e2d6b80dc50d5f3d2d5bbf71169

Fix failing assert when loading file with untraceable custom asset library

When loading a file with an asset browser open, and it showed a custom asset
library that can't be found currently (e.g. because the file is from somebody
else), the `BLI_assert(0)` in `rna_FileAssetSelectParams_asset_library_get()`
would fail.

There was code to handle this case already, but unlike I thought it didn't run
right after file read. Now it does.

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

M	source/blender/editors/space_file/space_file.c

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

diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 83bb8abf5d8..039ab3d6907 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -193,6 +193,8 @@ static void file_init(wmWindowManager *UNUSED(wm), ScrArea *area)
   if (sfile->runtime == NULL) {
     sfile->runtime = MEM_callocN(sizeof(*sfile->runtime), __func__);
   }
+  /* Validate the params right after file read. */
+  fileselect_refresh_params(sfile);
 }
 
 static void file_exit(wmWindowManager *wm, ScrArea *area)



More information about the Bf-blender-cvs mailing list