[Bf-blender-cvs] [266d99e] asset-experiments: More WIP code for actual assets reload.

Bastien Montagne noreply at git.blender.org
Thu Apr 28 23:16:53 CEST 2016


Commit: 266d99ee42c3faf228ba523b9906b504dc66d6c0
Author: Bastien Montagne
Date:   Thu Apr 28 23:15:46 2016 +0200
Branches: asset-experiments
https://developer.blender.org/rB266d99ee42c3faf228ba523b9906b504dc66d6c0

More WIP code for actual assets reload.

Nothing working yet, need to solve some issue with rootpath actually...

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

M	source/blender/blenkernel/intern/asset.c
M	source/blender/windowmanager/intern/wm_files_link.c

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

diff --git a/source/blender/blenkernel/intern/asset.c b/source/blender/blenkernel/intern/asset.c
index 71f457b..3f4894d 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 25991ad..9bcef8b 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);




More information about the Bf-blender-cvs mailing list