[Bf-blender-cvs] [b2d5d53] gooseberry: Added back the deprecated KeyFrom struct in Key, for backward compatibility.

Lukas Tönne noreply at git.blender.org
Tue May 19 15:20:00 CEST 2015


Commit: b2d5d53fc846125b957c16572508f22e3b22ac8f
Author: Lukas Tönne
Date:   Tue May 19 15:19:06 2015 +0200
Branches: gooseberry
https://developer.blender.org/rBb2d5d53fc846125b957c16572508f22e3b22ac8f

Added back the deprecated KeyFrom struct in Key, for backward
compatibility.

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

M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/makesdna/DNA_key_types.h

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

diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 50acc05..269a045 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1056,4 +1056,13 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 			}
 		}
 	}
+
+	/* from_extra has been moved to fromtype, fromindex */
+	if (!DNA_struct_elem_find(fd->filesdna, "Key", "int", "fromindex")) {
+		Key *key;
+		for (key = main->key.first; key; key = key->id.next) {
+			key->fromtype = key->from_extra.type;
+			key->fromindex = key->from_extra.index;
+		}
+	}
 }
diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h
index 2bb41f3..5ab67d2 100644
--- a/source/blender/makesdna/DNA_key_types.h
+++ b/source/blender/makesdna/DNA_key_types.h
@@ -78,6 +78,12 @@ typedef enum eKeyOwnerType {
 	KEY_OWNER_CACHELIB      = 5,
 } eKeyOwnerType;
 
+/* DEPRECATED */
+typedef struct KeyFrom {
+	int type DNA_DEPRECATED;
+	int index DNA_DEPRECATED; /* index of owner in the id */
+} KeyFrom;
+
 typedef struct Key {
 	ID id;
 	struct AnimData *adt;	/* animation data (must be immediately after id for utilities to use it) */ 
@@ -98,6 +104,7 @@ typedef struct Key {
 	struct Ipo *ipo  DNA_DEPRECATED;  /* old animation system, deprecated for 2.5 */
 
 	ID *from;
+	KeyFrom from_extra  DNA_DEPRECATED;
 	int fromtype; /* supplementary type of the Key owner */
 	int fromindex; /* index of owner in the id */




More information about the Bf-blender-cvs mailing list