From 9d0b7b168fdd69108f095cefed6c3feb0e327ea2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 Feb 2012 08:13:45 +0000 Subject: Camera tracking: animation datablock for MovieClip Added AnimData block to MovieClip datablock which allows to animate different properties in clip. Currently supports animation of stabilization influence only. -- svn merge -r44129:44130 ^/branches/soc-2011-tomato --- source/blender/blenloader/intern/readfile.c | 5 +++++ source/blender/blenloader/intern/writefile.c | 3 +++ 2 files changed, 8 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ff737339835..fe80dd7bd90 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6050,6 +6050,8 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip) MovieTracking *tracking= &clip->tracking; MovieTrackingObject *object; + clip->adt= newdataadr(fd, clip->adt); + if(fd->movieclipmap) clip->cache= newmclipadr(fd, clip->cache); else clip->cache= NULL; @@ -6087,6 +6089,9 @@ static void lib_link_movieclip(FileData *fd, Main *main) clip= main->movieclip.first; while(clip) { if(clip->id.flag & LIB_NEEDLINK) { + if (clip->adt) + lib_link_animdata(fd, &clip->id, clip->adt); + clip->gpd= newlibadr_us(fd, clip->id.lib, clip->gpd); clip->id.flag -= LIB_NEEDLINK; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ae4bc936193..e221f261d55 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2564,6 +2564,9 @@ static void write_movieclips(WriteData *wd, ListBase *idbase) MovieTrackingObject *object; writestruct(wd, ID_MC, "MovieClip", 1, clip); + if(clip->adt) + write_animdata(wd, clip->adt); + write_movieTracks(wd, &tracking->tracks); write_movieReconstruction(wd, &tracking->reconstruction); -- cgit v1.2.3 From 071706e48f720744c82b98409f199b7561cb404c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 Feb 2012 10:54:21 +0000 Subject: Missed this changes needed to fully support animation data in movie clips. Thanks to Joshua pointed into missed changes! --- source/blender/blenloader/intern/readfile.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fe80dd7bd90..fc8f8e2e2e1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -14085,6 +14085,11 @@ static void expand_sound(FileData *fd, Main *mainvar, bSound *snd) expand_doit(fd, mainvar, snd->ipo); // XXX depreceated - old animation system } +static void expand_movieclip(FileData *fd, Main *mainvar, MovieClip *clip) +{ + if (clip->adt) + expand_animdata(fd, mainvar, clip->adt); +} static void expand_main(FileData *fd, Main *mainvar) { @@ -14168,6 +14173,10 @@ static void expand_main(FileData *fd, Main *mainvar) break; case ID_PA: expand_particlesettings(fd, mainvar, (ParticleSettings *)id); + break; + case ID_MC: + expand_movieclip(fd, mainvar, (MovieClip *)id); + break; } doit= 1; -- cgit v1.2.3