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:
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ca367d8d06b..1b0dfb7e431 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7447,9 +7447,13 @@ static void direct_link_mask(FileData *fd, Mask *mask)
MaskSpline *spline;
MaskLayerShape *masklay_shape;
+ /* can't use newdataadr since it's a pointer within an array */
+ MaskSplinePoint *act_point_search = NULL;
+
link_list(fd, &masklay->splines);
for (spline = masklay->splines.first; spline; spline = spline->next) {
+ MaskSplinePoint *points_old = spline->points;
int i;
spline->points = newdataadr(fd, spline->points);
@@ -7460,6 +7464,14 @@ static void direct_link_mask(FileData *fd, Mask *mask)
if (point->tot_uw)
point->uw = newdataadr(fd, point->uw);
}
+
+ /* detect active point */
+ if ((act_point_search == NULL) &&
+ (masklay->act_point >= points_old) &&
+ (masklay->act_point < points_old + spline->tot_point))
+ {
+ act_point_search = &spline->points[masklay->act_point - points_old];
+ }
}
link_list(fd, &masklay->splines_shapes);
@@ -7477,7 +7489,7 @@ static void direct_link_mask(FileData *fd, Mask *mask)
}
masklay->act_spline = newdataadr(fd, masklay->act_spline);
- masklay->act_point = newdataadr(fd, masklay->act_point);
+ masklay->act_point = act_point_search;
}
}