Fix adding feather points when there's deformed spline for mask

Deformed spline should be re-evaluated after adding new feather points
Used both BKE_mask_update_display and DAG_id_tag_update because of:

- If adding feather point is happening from macro which adds point and
  slides it, deformed spline should be updated immediatelly so sliding
  operator will use updated feather,
- If adding happens outside of such macro, update DAG is necessary to
  make needed updates in other areas (such as compositor, i.e.)
This commit is contained in:
Sergey Sharybin
2012-05-31 10:01:21 +00:00
parent 998c34a7fa
commit efe289f312

View File

@@ -1317,12 +1317,17 @@ static int add_feather_vertex_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
if (find_nearest_diff_point(C, mask, co, threshold, TRUE, &maskobj, &spline, &point, &u, NULL)) {
Scene *scene = CTX_data_scene(C);
float w = BKE_mask_point_weight(spline, point, u);
BKE_mask_point_add_uw(point, u, w);
BKE_mask_update_display(mask, scene->r.cfra);
WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
DAG_id_tag_update(&mask->id, 0);
return OPERATOR_FINISHED;
}