diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2014-10-07 19:39:17 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2014-10-07 19:39:17 +0400 |
commit | 189c2e9277d4abd3b750a5a60ef42549dcfe359d (patch) | |
tree | 1430a845f4aab56b9133c3d8c6ffac09ee6dd92a /source/blender/editors/mask | |
parent | 771bad9c6abaad4b742935e5d55067f281287650 (diff) | |
parent | 1519b6a23e0341e25bf5a5c714f9f3d119ab8781 (diff) |
Merge branch 'master' into soc-2014-viewport_contextsoc-2014-viewport_context
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_ops.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 1acdff8b824..e2eb32e86d9 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -550,6 +550,8 @@ void ED_keymap_mask(wmKeyConfig *keyconf) /* duplicate */ WM_keymap_add_item(keymap, "MASK_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "MASK_OT_copy_splines", CKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "MASK_OT_paste_splines", VKEY, KM_PRESS, KM_CTRL, 0); /* for image editor only */ WM_keymap_add_item(keymap, "UV_OT_cursor_set", ACTIONMOUSE, KM_PRESS, 0, 0); diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index 9f8388f1fe0..c3959f90318 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -580,7 +580,10 @@ static bool spline_under_mouse_get(const bContext *C, } } } - if (closest_spline != NULL) { + /* TODO(sergey): Chech whether tesellated spline point is closer + * to the mouse than the spline center. + */ + if (closest_dist_squared < 32.0f * 32.0f && closest_spline != NULL) { *mask_layer_r = closest_layer; *mask_spline_r = closest_spline; return true; @@ -2294,6 +2297,10 @@ static int copy_splines_exec(bContext *C, wmOperator *UNUSED(op)) Mask *mask = CTX_data_edit_mask(C); MaskLayer *mask_layer = BKE_mask_layer_active(mask); + if (mask_layer == NULL) { + return OPERATOR_CANCELLED; + } + BKE_mask_clipboard_copy_from_layer(mask_layer); return OPERATOR_FINISHED; @@ -2331,6 +2338,10 @@ static int paste_splines_exec(bContext *C, wmOperator *UNUSED(op)) Mask *mask = CTX_data_edit_mask(C); MaskLayer *mask_layer = BKE_mask_layer_active(mask); + if (mask_layer == NULL) { + mask_layer = BKE_mask_layer_new(mask, ""); + } + BKE_mask_clipboard_paste_to_layer(CTX_data_main(C), mask_layer); /* TODO: only update edited splines */ |