diff options
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a632b2bb12e..1fcc572238c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4848,6 +4848,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Object *ob; bArmature *arm; Mesh *me; + Key *key; Scene *sce= main->scene.first; while(sce){ @@ -4941,6 +4942,29 @@ static void do_versions(FileData *fd, Library *lib, Main *main) mesh_strip_loose_faces(me); } } + + for(key= main->key.first; key; key= key->id.next) { + KeyBlock *kb; + int index= 1; + + /* trick to find out if we already introduced adrcode */ + for(kb= key->block.first; kb; kb= kb->next) + if(kb->adrcode) break; + + if(kb==NULL) { + for(kb= key->block.first; kb; kb= kb->next) { + if(kb==key->refkey) { + if(kb->name[0]==0) + strcpy(kb->name, "Basis"); + } + else { + if(kb->name[0]==0) + sprintf(kb->name, "Key %d", index); + kb->adrcode= index++; + } + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ |