diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-06 20:19:30 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-06 20:19:30 +0400 |
commit | ee307bec882a639c4574480dc7d0505b9812b8dc (patch) | |
tree | fdfc61e03f1146b8d5aed1f050a4d22a85fd5b1e /source/blender/blenloader | |
parent | f7a0499f167613206cef3e707cc9e3ef04a5eb30 (diff) |
Fix #30798: when linking a datablock, it got simply added to the back of the
list, now the linked datablocks are sorted by name too (but still appear after
the non-linked datablocks).
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 798c48dfaac..737a182bbe0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -14587,9 +14587,17 @@ static ID *append_named_part(Main *mainl, FileData *fd, const char *idname, cons found= 1; id= is_yet_read(fd, mainl, bhead); if (id==NULL) { + /* not read yet */ read_libblock(fd, mainl, bhead, LIB_TESTEXT, &id); + + if (id) { + /* sort by name in list */ + ListBase *lb= which_libbase(mainl, idcode); + id_sort_by_name(lb, id); + } } else { + /* already linked */ printf("append: already linked\n"); oldnewmap_insert(fd->libmap, bhead->old, id, 1); if (id->flag & LIB_INDIRECT) { |