Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-08-01 00:54:27 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-08-01 00:54:27 +0400
commitd86b6dcf1c03b4f235ab6b89a563adcc21209e9f (patch)
tree8425344e69f30aa8d12295d52c11e6365fa2c90e /source/blender/blenloader
parent32bd936f18aa2a1eb0dae971bab8d5aaf46acd9f (diff)
Expand function for masks, so no masks could be properly linked
in cases when they've got parenting to motion tracking data.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c34
1 files changed, 34 insertions, 0 deletions
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;