diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-21 16:45:03 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-21 16:45:51 +0300 |
commit | dc67e63acb52eacf2f1451ce5000f4500a8217d6 (patch) | |
tree | 225379c22d595f636bf21a88e3622ffd43edf319 /source/blender/blenkernel/intern/mask.c | |
parent | 903e5d39729023883e40641b0fed605a686e72f3 (diff) |
Mask: Fix missing remap of active spline/point on copy
Diffstat (limited to 'source/blender/blenkernel/intern/mask.c')
-rw-r--r-- | source/blender/blenkernel/intern/mask.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index 9a9b3757ef2..43fc8152c7b 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -225,6 +225,16 @@ MaskLayer *BKE_mask_layer_copy(const MaskLayer *masklay) MaskSpline *spline_new = BKE_mask_spline_copy(spline); BLI_addtail(&masklay_new->splines, spline_new); + + if (spline == masklay->act_spline) { + masklay_new->act_spline = spline_new; + } + + if (masklay->act_point >= spline->points && + masklay->act_point < spline->points + spline->tot_point) { + const size_t point_index = masklay->act_point - spline->points; + masklay_new->act_point = spline_new->points + point_index; + } } /* correct animation */ |