diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-07 16:55:18 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-07 16:55:18 +0400 |
commit | 27d42c63d9b507b1771ed5a7923c389c719b877b (patch) | |
tree | 8dd4ca61e197a7053633f62b4a5d8091957724c4 /source/blender/blenloader/intern/writefile.c | |
parent | e122dc0748f6a4d77b236e26beba93e2a9a36bf0 (diff) |
Camera tracking integration
===========================
Commiting camera tracking integration gsoc project into trunk.
This commit includes:
- Bundled version of libmv library (with some changes against official repo,
re-sync with libmv repo a bit later)
- New datatype ID called MovieClip which is optimized to work with movie
clips (both of movie files and image sequences) and doing camera/motion
tracking operations.
- New editor called Clip Editor which is currently used for motion/tracking
stuff only, but which can be easily extended to work with masks too.
This editor supports:
* Loading movie files/image sequences
* Build proxies with different size for loaded movie clip, also supports
building undistorted proxies to increase speed of playback in
undistorted mode.
* Manual lens distortion mode calibration using grid and grease pencil
* Supervised 2D tracking using two different algorithms KLT and SAD.
* Basic algorithm for feature detection
* Camera motion solving. scene orientation
- New constraints to "link" scene objects with solved motions from clip:
* Follow Track (make object follow 2D motion of track with given name
or parent object to reconstructed 3D position of track)
* Camera Solver to make camera moving in the same way as reconstructed camera
This commit NOT includes changes from tomato branch:
- New nodes (they'll be commited as separated patch)
- Automatic image offset guessing for image input node and image editor
(need to do more tests and gather more feedback)
- Code cleanup in libmv-capi. It's not so critical cleanup, just increasing
readability and understanadability of code. Better to make this chaneg when
Keir will finish his current patch.
More details about this project can be found on this page:
http://wiki.blender.org/index.php/User:Nazg-gul/GSoC-2011
Further development of small features would be done in trunk, bigger/experimental
features would first be implemented in tomato branch.
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 1e0ef4a6a16..f49148342ec 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -128,6 +128,7 @@ Any case: direct data is ALWAYS after the lib block #include "DNA_vfont_types.h" #include "DNA_world_types.h" #include "DNA_windowmanager_types.h" +#include "DNA_movieclip_types.h" #include "MEM_guardedalloc.h" // MEM_freeN #include "BLI_blenlib.h" @@ -2258,6 +2259,9 @@ static void write_screens(WriteData *wd, ListBase *scrbase) else if(sl->spacetype==SPACE_USERPREF) { writestruct(wd, DATA, "SpaceUserPref", 1, sl); } + else if(sl->spacetype==SPACE_CLIP) { + writestruct(wd, DATA, "SpaceClip", 1, sl); + } sl= sl->next; } @@ -2506,6 +2510,38 @@ static void write_scripts(WriteData *wd, ListBase *idbase) } } +static void write_movieclips(WriteData *wd, ListBase *idbase) +{ + MovieClip *clip; + + clip= idbase->first; + while(clip) { + if(clip->id.us>0 || wd->current) { + MovieTracking *tracking= &clip->tracking; + MovieTrackingTrack *track; + writestruct(wd, ID_MC, "MovieClip", 1, clip); + + if(tracking->reconstruction.camnr) + writestruct(wd, DATA, "MovieReconstructedCamera", tracking->reconstruction.camnr, tracking->reconstruction.cameras); + + track= tracking->tracks.first; + while(track) { + writestruct(wd, DATA, "MovieTrackingTrack", 1, track); + + if(track->markers) + writestruct(wd, DATA, "MovieTrackingMarker", track->markersnr, track->markers); + + track= track->next; + } + } + + clip= clip->id.next; + } + + /* flush helps the compression for undo-save */ + mywrite(wd, MYWRITE_FLUSH, 0); +} + /* context is usually defined by WM, two cases where no WM is available: * - for forward compatibility, curscreen has to be saved * - for undofile, curscene needs to be saved */ @@ -2582,6 +2618,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil write_windowmanagers(wd, &mainvar->wm); write_screens (wd, &mainvar->screen); } + write_movieclips (wd, &mainvar->movieclip); write_scenes (wd, &mainvar->scene); write_curves (wd, &mainvar->curve); write_mballs (wd, &mainvar->mball); |