From d86b6dcf1c03b4f235ab6b89a563adcc21209e9f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 31 Jul 2012 20:54:27 +0000 Subject: Expand function for masks, so no masks could be properly linked in cases when they've got parenting to motion tracking data. --- source/blender/blenloader/intern/readfile.c | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7e7561d58af..dee882c6737 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8931,6 +8931,37 @@ static void expand_movieclip(FileData *fd, Main *mainvar, MovieClip *clip) expand_animdata(fd, mainvar, clip->adt); } +static void expand_mask_parent(FileData *fd, Main *mainvar, MaskParent *parent) +{ + if (parent->id) { + expand_doit(fd, mainvar, parent->id); + } +} + +static void expand_mask(FileData *fd, Main *mainvar, Mask *mask) +{ + MaskLayer *mask_layer; + + if (mask->adt) + expand_animdata(fd, mainvar, mask->adt); + + for (mask_layer = mask->masklayers.first; mask_layer; mask_layer = mask_layer->next) { + MaskSpline *spline; + + for (spline = mask_layer->splines.first; spline; spline = spline->next) { + int i; + + for (i = 0; i < spline->tot_point; i++) { + MaskSplinePoint *point = &spline->points[i]; + + expand_mask_parent(fd, mainvar, &point->parent); + } + + expand_mask_parent(fd, mainvar, &spline->parent); + } + } +} + static void expand_main(FileData *fd, Main *mainvar) { ListBase *lbarray[MAX_LIBARRAY]; @@ -9014,6 +9045,9 @@ static void expand_main(FileData *fd, Main *mainvar) case ID_MC: expand_movieclip(fd, mainvar, (MovieClip *)id); break; + case ID_MSK: + expand_mask(fd, mainvar, (Mask *)id); + break; } do_it = TRUE; -- cgit v1.2.3