diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-29 14:24:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-29 14:24:42 +0400 |
commit | 79c2571e56e79c28d6f22984112387d83782162a (patch) | |
tree | e634b4a3da1f60729d48172be667578f0b06f420 /source/blender/blenloader/intern | |
parent | 18f134304c0c6181668a0a8c22289fcaeb472432 (diff) |
user-preferences for addons. currently unused, example & docs still to come.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index eda2cb4243a..8ddd69f2f03 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8646,6 +8646,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) wmKeyMap *keymap; wmKeyMapItem *kmi; wmKeyMapDiffItem *kmdi; + bAddon *addon; bfd->user = user= read_struct(fd, bhead, "user def"); @@ -8683,7 +8684,14 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) for (kmi=keymap->items.first; kmi; kmi=kmi->next) direct_link_keymapitem(fd, kmi); } - + + for (addon = user->addons.first; addon; addon = addon->next) { + addon->prop = newdataadr(fd, addon->prop); + if (addon->prop) { + IDP_DirectLinkProperty(addon->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + } + } + // XXX user->uifonts.first = user->uifonts.last= NULL; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index b1dce046438..680a02eed30 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -850,8 +850,12 @@ static void write_userdef(WriteData *wd) write_keymapitem(wd, kmi); } - for (bext= U.addons.first; bext; bext=bext->next) + for (bext= U.addons.first; bext; bext=bext->next) { writestruct(wd, DATA, "bAddon", 1, bext); + if (bext->prop) { + IDP_WriteProperty(bext->prop, wd); + } + } for (style= U.uistyles.first; style; style= style->next) { writestruct(wd, DATA, "uiStyle", 1, style); |