diff options
author | Jacques Lucke <jacques@blender.org> | 2020-11-06 19:33:00 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-11-06 19:33:13 +0300 |
commit | 37ef37711d997899041d84e8c7a17e1fbb4efab9 (patch) | |
tree | e27bdc0042524a585074285360e618c20e00ef9d /source/blender/blenkernel/intern/anim_visualization.c | |
parent | a3a6443bfd8ac16824bdbf349913696531f348a1 (diff) |
Refactor: move MotionPath .blend I/O to blenkernel
Ref T76372.
Diffstat (limited to 'source/blender/blenkernel/intern/anim_visualization.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_visualization.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/anim_visualization.c b/source/blender/blenkernel/intern/anim_visualization.c index 5452e2513fb..ecd71ec08fe 100644 --- a/source/blender/blenkernel/intern/anim_visualization.c +++ b/source/blender/blenkernel/intern/anim_visualization.c @@ -34,6 +34,8 @@ #include "GPU_batch.h" +#include "BLO_read_write.h" + /* ******************************************************************** */ /* Animation Visualization */ @@ -224,3 +226,32 @@ bMotionPath *animviz_verify_motionpaths(ReportList *reports, /* return it */ return mpath; } + +void animviz_motionpath_blend_write(BlendWriter *writer, bMotionPath *mpath) +{ + /* sanity checks */ + if (mpath == NULL) { + return; + } + + /* firstly, just write the motionpath struct */ + BLO_write_struct(writer, bMotionPath, mpath); + + /* now write the array of data */ + BLO_write_struct_array(writer, bMotionPathVert, mpath->length, mpath->points); +} + +void animviz_motionpath_blend_read_data(BlendDataReader *reader, bMotionPath *mpath) +{ + /* sanity check */ + if (mpath == NULL) { + return; + } + + /* relink points cache */ + BLO_read_data_address(reader, &mpath->points); + + mpath->points_vbo = NULL; + mpath->batch_line = NULL; + mpath->batch_points = NULL; +} |