[Bf-blender-cvs] [9ab3099] asset-engine: Add asset engine version to uuids list struct.

Bastien Montagne noreply at git.blender.org
Tue May 26 21:18:54 CEST 2015


Commit: 9ab309901d52b2666cd796a2a78a78957e0baae1
Author: Bastien Montagne
Date:   Tue May 26 21:18:28 2015 +0200
Branches: asset-engine
https://developer.blender.org/rB9ab309901d52b2666cd796a2a78a78957e0baae1

Add asset engine version to uuids list struct.

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

M	source/blender/blenkernel/intern/asset.c
M	source/blender/editors/space_file/filelist.c
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesrna/intern/rna_asset.c

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

diff --git a/source/blender/blenkernel/intern/asset.c b/source/blender/blenkernel/intern/asset.c
index 7b1d298..09ad758 100644
--- a/source/blender/blenkernel/intern/asset.c
+++ b/source/blender/blenkernel/intern/asset.c
@@ -166,6 +166,7 @@ AssetUUIDList *BKE_asset_engine_load_pre(AssetEngine *engine, FileDirEntryArr *r
 
 	uuids->uuids = MEM_mallocN(sizeof(*uuids->uuids) * nbr_entries, __func__);
 	uuids->nbr_uuids = nbr_entries;
+	uuids->asset_engine_version = engine->type->version;
 
 	for (i = 0, en = r_entries->entries.first; en; i++, en = en->next) {
 		FileDirEntryVariant *var = BLI_findlink(&en->variants, en->act_variant);
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 6414409..e601138 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1600,6 +1600,7 @@ FileDirEntry *filelist_entry_find_uuid(struct FileList *filelist, const int uuid
 
 			uuids->uuids = MEM_callocN(sizeof(*uuids->uuids), __func__);
 			uuids->nbr_uuids = 1;
+			uuids->asset_engine_version = engine->type->version;
 			uuid = &uuids->uuids[0];
 
 			memcpy(uuid->uuid_asset, uuid, sizeof(uuid->uuid_asset));
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 8bf05e7..cccae82 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -122,7 +122,8 @@ typedef struct AssetUUID {
 
 typedef struct AssetUUIDList {
 	AssetUUID *uuids;
-	int nbr_uuids, pad;
+	int nbr_uuids;
+	int asset_engine_version;
 } AssetUUIDList;
 
 /* watch it: Sequence has identical beginning. */
diff --git a/source/blender/makesrna/intern/rna_asset.c b/source/blender/makesrna/intern/rna_asset.c
index 019d01d..ac3b8ce 100644
--- a/source/blender/makesrna/intern/rna_asset.c
+++ b/source/blender/makesrna/intern/rna_asset.c
@@ -691,6 +691,10 @@ static void rna_def_asset_uuid_list(BlenderRNA *brna)
 	RNA_def_property_struct_type(prop, "AssetUUID");
 	RNA_def_property_ui_text(prop, "UUIDs", "Collection of asset UUIDs");
 
+	prop = RNA_def_int(srna, "asset_engine_version", 0, 0, INT_MAX, "Asset Engine Version",
+	                   "Asset engine version those uuids were generated from", 0, INT_MAX);
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
 	rna_def_asset_uuid(brna);
 }




More information about the Bf-blender-cvs mailing list