diff options
Diffstat (limited to 'source/blender/blenkernel/intern/anim_sys.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 69e70cffdb2..98c01351f32 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -69,6 +69,8 @@ #include "RNA_access.h" +#include "BLO_read_write.h" + #include "nla_private.h" #include "atomic_ops.h" @@ -308,6 +310,55 @@ void BKE_keyingsets_free(ListBase *list) } } +void BKE_keyingsets_blend_write(BlendWriter *writer, ListBase *list) +{ + LISTBASE_FOREACH (KeyingSet *, ks, list) { + /* KeyingSet */ + BLO_write_struct(writer, KeyingSet, ks); + + /* Paths */ + LISTBASE_FOREACH (KS_Path *, ksp, &ks->paths) { + /* Path */ + BLO_write_struct(writer, KS_Path, ksp); + + if (ksp->rna_path) { + BLO_write_string(writer, ksp->rna_path); + } + } + } +} + +void BKE_keyingsets_blend_read_data(BlendDataReader *reader, ListBase *list) +{ + LISTBASE_FOREACH (KeyingSet *, ks, list) { + /* paths */ + BLO_read_list(reader, &ks->paths); + + LISTBASE_FOREACH (KS_Path *, ksp, &ks->paths) { + /* rna path */ + BLO_read_data_address(reader, &ksp->rna_path); + } + } +} + +void BKE_keyingsets_blend_read_lib(BlendLibReader *reader, ID *id, ListBase *list) +{ + LISTBASE_FOREACH (KeyingSet *, ks, list) { + LISTBASE_FOREACH (KS_Path *, ksp, &ks->paths) { + BLO_read_id_address(reader, id->lib, &ksp->id); + } + } +} + +void BKE_keyingsets_blend_read_expand(BlendExpander *expander, ListBase *list) +{ + LISTBASE_FOREACH (KeyingSet *, ks, list) { + LISTBASE_FOREACH (KS_Path *, ksp, &ks->paths) { + BLO_expand(expander, ksp->id); + } + } +} + /* ***************************************** */ /* Evaluation Data-Setting Backend */ |