From 39e591d3d04015b84fe5f12e7ef5af6507df92af Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 10 Jun 2012 15:26:50 +0000 Subject: Support for per-track Grease Pencil datablocks for motion tracking Originally was needed to reach easy way of defining masks used for tracking (do eliminate textures which doesn't belong to feature when tracking. Implemented as alternative to GP datablock for clip and added switch between per-clip and per-track GP datablocks -- internal limitations of GP doesn't allow to display all GP datablocks easily. So either you see.edit GP associated with clip or with track. GP strokes associated with track are relative to track's position, following tracks during tracking and could be shared between several tracks. Masking code presents in libmv and there's rasterizer of GP datablocks for masks in blender's tracking module, but they still need to be glued together. Some documentation cound be found at this page: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker#Grease_Pencil --- source/blender/blenloader/intern/readfile.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 85d597ccbdd..fccdcbef564 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6164,17 +6164,35 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip) } } +static void lib_link_movieTracks(FileData *fd, MovieClip *clip, ListBase *tracksbase) +{ + MovieTrackingTrack *track; + + for (track = tracksbase->first; track; track = track->next) { + track->gpd = newlibadr_us(fd, clip->id.lib, track->gpd); + } +} + static void lib_link_movieclip(FileData *fd, Main *main) { MovieClip *clip; for (clip = main->movieclip.first; clip; clip = clip->id.next) { if (clip->id.flag & LIB_NEEDLINK) { + MovieTracking *tracking = &clip->tracking; + MovieTrackingObject *object; + if (clip->adt) lib_link_animdata(fd, &clip->id, clip->adt); clip->gpd = newlibadr_us(fd, clip->id.lib, clip->gpd); + lib_link_movieTracks(fd, clip, &tracking->tracks); + + for (object = tracking->objects.first; object; object = object->next) { + lib_link_movieTracks(fd, clip, &object->tracks); + } + clip->id.flag -= LIB_NEEDLINK; } } -- cgit v1.2.3