Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-18 18:40:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-18 18:40:02 +0400
commit8e93f017ac0200688b237161b6e2aa0fc1efcf58 (patch)
tree6471481ba752d3dcb0ea13c289530ce2098c4874 /source/blender/blenloader/intern
parent6d76f140d08ebd2a990989768d1b34127b2a3b8a (diff)
do_version fix files with bad keyblock uid caused by byg [#31569]
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readfile.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a24e1256826..aa80a6bcff5 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2717,6 +2717,16 @@ static void direct_link_lamp(FileData *fd, Lamp *la)
/* ************ READ keys ***************** */
+static void do_versions_key_uidgen(Key *key)
+{
+ KeyBlock *block;
+
+ key->uidgen = 1;
+ for (block = key->block.first; block; block = block->next) {
+ block->uid = key->uidgen++;
+ }
+}
+
static void lib_link_key(FileData *fd, Main *main)
{
Key *key;
@@ -2724,12 +2734,7 @@ static void lib_link_key(FileData *fd, Main *main)
for (key = main->key.first; key; key = key->id.next) {
/*check if we need to generate unique ids for the shapekeys*/
if (!key->uidgen) {
- KeyBlock *block;
-
- key->uidgen = 1;
- for (block=key->block.first; block; block=block->next) {
- block->uid = key->uidgen++;
- }
+ do_versions_key_uidgen(key);
}
if (key->id.flag & LIB_NEED_LINK) {
@@ -7974,6 +7979,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+ if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 20)) {
+ Key *key;
+ for (key = main->key.first; key; key = key->id.next) {
+ do_versions_key_uidgen(key);
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */