[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49431] trunk/blender/source/blender/ blenloader/intern/readfile.c: Expand function for masks, so no masks could be properly linked

Sergey Sharybin sergey.vfx at gmail.com
Tue Jul 31 22:54:28 CEST 2012


Revision: 49431
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49431
Author:   nazgul
Date:     2012-07-31 20:54:27 +0000 (Tue, 31 Jul 2012)
Log Message:
-----------
Expand function for masks, so no masks could be properly linked
in cases when they've got parenting to motion tracking data.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2012-07-31 19:46:46 UTC (rev 49430)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2012-07-31 20:54:27 UTC (rev 49431)
@@ -8931,6 +8931,37 @@
 		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 @@
 					case ID_MC:
 						expand_movieclip(fd, mainvar, (MovieClip *)id);
 						break;
+					case ID_MSK:
+						expand_mask(fd, mainvar, (Mask *)id);
+						break;
 					}
 					
 					do_it = TRUE;




More information about the Bf-blender-cvs mailing list