[Bf-blender-cvs] [f34c098] asset-engine: Add 'bl_version' to asset engine type, needed to support asset engine in file read/write!

Bastien Montagne noreply at git.blender.org
Tue May 26 17:23:26 CEST 2015


Commit: f34c098f0c8a7c8a01a001d1eb6f9cac6c0ab4db
Author: Bastien Montagne
Date:   Tue May 26 17:21:10 2015 +0200
Branches: asset-engine
https://developer.blender.org/rBf34c098f0c8a7c8a01a001d1eb6f9cac6c0ab4db

Add 'bl_version' to asset engine type, needed to support asset engine in file read/write!

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

M	release/scripts/startup/bl_operators/amber.py
M	source/blender/blenkernel/BKE_asset.h
M	source/blender/makesrna/intern/rna_asset.c

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

diff --git a/release/scripts/startup/bl_operators/amber.py b/release/scripts/startup/bl_operators/amber.py
index ef30ec2..62c3780 100644
--- a/release/scripts/startup/bl_operators/amber.py
+++ b/release/scripts/startup/bl_operators/amber.py
@@ -253,6 +253,7 @@ class AmberTag(PropertyGroup):
 
 class AssetEngineAmber(AssetEngine):
     bl_label = "Amber"
+    bl_version = 1
 
     tags = CollectionProperty(name="Tags", type=AmberTag, description="Filtering tags")
     active_tag_index = IntProperty(name="Active Tag", options={'HIDDEN'})
diff --git a/source/blender/blenkernel/BKE_asset.h b/source/blender/blenkernel/BKE_asset.h
index d20472b..abf379a 100644
--- a/source/blender/blenkernel/BKE_asset.h
+++ b/source/blender/blenkernel/BKE_asset.h
@@ -117,6 +117,8 @@ typedef struct AssetEngineType {
 
 	/* type info */
 	char idname[64]; /* best keep the same size as BKE_ST_MAXNAME */
+	int version;
+
 	char name[64];
 	int flag;
 
diff --git a/source/blender/makesrna/intern/rna_asset.c b/source/blender/makesrna/intern/rna_asset.c
index dc8d29a..019d01d 100644
--- a/source/blender/makesrna/intern/rna_asset.c
+++ b/source/blender/makesrna/intern/rna_asset.c
@@ -1082,6 +1082,10 @@ static void rna_def_asset_engine(BlenderRNA *brna)
 	RNA_def_property_string_sdna(prop, NULL, "type->idname");
 	RNA_def_property_flag(prop, PROP_REGISTER);
 
+	prop = RNA_def_property(srna, "bl_version", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "type->version");
+	RNA_def_property_flag(prop, PROP_REGISTER);
+
 	prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "type->name");
 	RNA_def_property_flag(prop, PROP_REGISTER);




More information about the Bf-blender-cvs mailing list