diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2017-10-16 12:16:13 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2017-10-16 12:22:35 +0300 |
commit | a78b3ee53aa53020b086a6df25c0e28491223dcc (patch) | |
tree | bd883e95580f5777f7eae7cac4e47f182ac9fc00 /source/blender/editors/mask/mask_add.c | |
parent | 4842cc017c3bb7df2070c2f96605190ff88e6a2e (diff) | |
parent | 49f4ac17bf704614de59a4db7a65c205c085d694 (diff) |
Merge remote-tracking branch 'origin/master' into openvdbopenvdb
Diffstat (limited to 'source/blender/editors/mask/mask_add.c')
-rw-r--r-- | source/blender/editors/mask/mask_add.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index e3e8f35e7d8..69335195b96 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -770,15 +770,19 @@ static int create_primitive_from_points(bContext *C, wmOperator *op, const float new_spline = BKE_mask_spline_add(mask_layer); new_spline->flag = MASK_SPLINE_CYCLIC | SELECT; - new_spline->tot_point = num_points; new_spline->points = MEM_recallocN(new_spline->points, - sizeof(MaskSplinePoint) * new_spline->tot_point); + sizeof(MaskSplinePoint) * num_points); mask_layer->act_spline = new_spline; mask_layer->act_point = NULL; + const int spline_index = BKE_mask_layer_shape_spline_to_index(mask_layer, new_spline); + for (i = 0; i < num_points; i++) { + new_spline->tot_point = i + 1; + MaskSplinePoint *new_point = &new_spline->points[i]; + BKE_mask_parent_init(&new_point->parent); copy_v2_v2(new_point->bezt.vec[1], points[i]); mul_v2_fl(new_point->bezt.vec[1], scale); @@ -787,6 +791,12 @@ static int create_primitive_from_points(bContext *C, wmOperator *op, const float new_point->bezt.h1 = handle_type; new_point->bezt.h2 = handle_type; BKE_mask_point_select_set(new_point, true); + + if (mask_layer->splines_shapes.first) { + BKE_mask_layer_shape_changed_add(mask_layer, + spline_index + i, + true, true); + } } WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask); |