diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-04-29 00:15:46 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-04-29 00:15:46 +0300 |
commit | 266d99ee42c3faf228ba523b9906b504dc66d6c0 (patch) | |
tree | 3b935626cf4a23a21c6459b34363e284e2477091 /source | |
parent | 5ad251770b0ec566fbcd4f67c5e5f68055d87625 (diff) |
More WIP code for actual assets reload.
Nothing working yet, need to solve some issue with rootpath actually...
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/asset.c | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/asset.c b/source/blender/blenkernel/intern/asset.c index 71f457baaad..3f4894d41c5 100644 --- a/source/blender/blenkernel/intern/asset.c +++ b/source/blender/blenkernel/intern/asset.c @@ -208,6 +208,7 @@ static void asset_engine_load_pre(AssetEngine *engine, AssetUUIDList *r_uuids, F BKE_filedir_entryarr_clear(r_entries); MEM_freeN(r_uuids->uuids); + r_uuids->uuids = NULL; r_uuids->nbr_uuids = 0; return; } diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index 25991ad8cf8..9bcef8ba22a 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -1261,8 +1261,21 @@ static int wm_assets_reload_exec(bContext *C, wmOperator *op) asset_update_engines_uuids_fetch(&engines, bmain, NULL, UUID_TAG_ASSET_RELOAD, false); for (AssetUpdateCheckEngine *auce = engines.first; auce; auce = auce->next) { + FileDirEntryArr *paths = BKE_asset_engine_uuids_load_pre(auce->ae, &auce->uuids); + + printf("Engine %s (ver. %d) returned root path '%s'\n", auce->ae->type->name, auce->ae->type->version, paths->root); + for (FileDirEntry *en = paths->entries.first; en; en = en->next) { + printf("\t-> %s\n", en->relpath); + } + + BKE_filedir_entryarr_clear(paths); + MEM_freeN(paths); + } + + /* Cleanup. */ + for (AssetUpdateCheckEngine *auce = engines.first; auce; auce = auce->next) { BKE_asset_engine_free(auce->ae); - MEM_freeN(auce->uuids.uuids); + MEM_SAFE_FREE(auce->uuids.uuids); } BLI_freelistN(&engines); |