[Bf-blender-cvs] [ab049a3] asset-engine: More WIP towards integrating AE/assets_uuids in append/link process...

Bastien Montagne noreply at git.blender.org
Thu May 28 19:52:35 CEST 2015


Commit: ab049a335d6036350d9221309aa6c26108b34a21
Author: Bastien Montagne
Date:   Thu May 28 19:51:25 2015 +0200
Branches: asset-engine
https://developer.blender.org/rBab049a335d6036350d9221309aa6c26108b34a21

More WIP towards integrating AE/assets_uuids in append/link process...

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

M	source/blender/editors/space_file/file_ops.c
M	source/blender/makesdna/DNA_ID.h
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 449ee3d..5892a8e 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -845,6 +845,7 @@ static void file_sfile_to_operator(
         wmOperator *op, SpaceFile *sfile, char filepath[FILE_MAX_LIBEXTRA], const bool is_fake)
 {
 	PropertyRNA *prop, *prop_files, *prop_dirs;
+	/* Note filebrowser does not create ae for default NONE 'engine', we'll get NULL in this case here. */
 	AssetEngine *ae = filelist_assetengine_get(sfile->files);
 	AssetUUIDList *uuids;
 	FileDirEntryArr *selection;
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index cccae82..fb76f9b 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -163,7 +163,7 @@ typedef struct Library {
 	ID *idblock;
 	struct FileData *filedata;
 	/* path name used for reading, can be relative and edited in the outliner.
-     * In case it's an asset engine, it's path to aset engine 'root' (meaning depends on asset engine). */
+     * In case it's an asset engine, it's path from asset engine's 'root'. */
 	char name[1024];
 
 	/* absolute filepath, this is only for convenience, 'name' is the real path used on file read but in
@@ -179,6 +179,8 @@ typedef struct Library {
 	char asset_engine[64];  /* MAX_ST_NAME */
 	int asset_engine_version;
 	int pad_i1;
+	/* 'Path' to asset engine's root of the reprository, can be an url, whatever... */
+	char asset_engine_root[1024];
 } Library;
 
 enum eIconSizes {
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 1603f80..6e0e436 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2618,7 +2618,7 @@ static short wm_link_append_flag(wmOperator *op)
  */
 static void wm_link_append_do_libgroup(
         bContext *C, wmOperator *op, const char *root, const char *libname, char *group, char *name,
-        const short flag, GSet **todo_libraries)
+        AssetEngineType *aet, const short flag, GSet **todo_libraries)
 {
 	Main *bmain = CTX_data_main(C);
 	Main *mainl;
@@ -2662,14 +2662,10 @@ static void wm_link_append_do_libgroup(
 
 		RNA_BEGIN (op->ptr, itemptr, "files")
 		{
-			int asset_uuid[4];
 			char curr_libname[FILE_MAX];
 			int curr_idcode;
 
 			RNA_string_get(&itemptr, "name", relname);
-			RNA_int_get_array(&itemptr, "asset_uuid", asset_uuid);
-
-			printf("asset uuid %s: %d, %d, %d, %d\n", relname, asset_uuid[0], asset_uuid[1], asset_uuid[2], asset_uuid[3]);
 
 			BLI_join_dirfile(path, sizeof(path), root, relname);
 
@@ -2681,6 +2677,12 @@ static void wm_link_append_do_libgroup(
 				curr_idcode = BKE_idcode_from_name(group);
 
 				if ((idcode == curr_idcode) && (BLI_path_cmp(curr_libname, libname) == 0)) {
+					AssetUUID asset_uuid;
+
+					RNA_int_get_array(&itemptr, "asset_uuid", asset_uuid.uuid_asset);
+					RNA_int_get_array(&itemptr, "variant_uuid", asset_uuid.uuid_variant);
+					RNA_int_get_array(&itemptr, "revision_uuid", asset_uuid.uuid_revision);
+
 					BLO_library_append_named_part_ex(C, mainl, &bh, name, idcode, flag);
 				}
 				else if (is_first_run) {
@@ -2787,7 +2789,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
 		name = NULL;
 	}
 
-	wm_link_append_do_libgroup(C, op, root, libname, group, name, flag, &todo_libraries);
+	wm_link_append_do_libgroup(C, op, root, libname, group, name, aet, flag, &todo_libraries);
 
 	if (todo_libraries) {
 		GSetIterator libs_it;
@@ -2797,7 +2799,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
 
 			BLO_library_path_explode(libpath, libname, &group, NULL);
 
-			wm_link_append_do_libgroup(C, op, root, libname, group, NULL, flag, &todo_libraries);
+			wm_link_append_do_libgroup(C, op, root, libname, group, NULL, aet, flag, &todo_libraries);
 		}
 
 		BLI_gset_free(todo_libraries, MEM_freeN);




More information about the Bf-blender-cvs mailing list