diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/include/ED_mask.h | 3 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_ops.c | 9 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_shapekey.c | 59 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 11 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 2 |
5 files changed, 57 insertions, 27 deletions
diff --git a/source/blender/editors/include/ED_mask.h b/source/blender/editors/include/ED_mask.h index 0c4c2f4788c..0c2f6807632 100644 --- a/source/blender/editors/include/ED_mask.h +++ b/source/blender/editors/include/ED_mask.h @@ -32,6 +32,7 @@ #define __ED_MASK_H__ struct wmKeyConfig; +struct MaskLayer; /* mask_editor.c */ void ED_operatortypes_mask(void); @@ -42,6 +43,8 @@ void ED_operatormacros_mask(void); void ED_mask_draw(const bContext *C, const char draw_flag, const char draw_type); /* mask_shapekey.c */ +void ED_mask_layer_shape_auto_key(struct MaskLayer *masklay, const int frame); int ED_mask_layer_shape_auto_key_all(struct Mask *mask, const int frame); +int ED_mask_layer_shape_auto_key_select(struct Mask *mask, const int frame); #endif /* ED_TEXT_H */ diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index c9f2450afc3..599f3371cac 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -753,8 +753,11 @@ static int slide_point_modal(bContext *C, wmOperator *op, wmEvent *event) free_slide_point_data(op->customdata); - if (IS_AUTOKEY_ON(scene)) { - ED_mask_layer_shape_auto_key_all(data->mask, CFRA); + /* dont key sliding feather uw's */ + if ((data->action == SLIDE_ACTION_FEATHER && data->uw) == FALSE) { + if (IS_AUTOKEY_ON(scene)) { + ED_mask_layer_shape_auto_key(data->masklay, CFRA); + } } WM_event_add_notifier(C, NC_MASK | NA_EDITED, data->mask); @@ -880,10 +883,10 @@ static int delete_exec(bContext *C, wmOperator *UNUSED(op)) { Mask *mask = CTX_data_edit_mask(C); MaskLayer *masklay; - int mask_layer_shape_ofs = 0; for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { MaskSpline *spline; + int mask_layer_shape_ofs = 0; if (masklay->restrictflag & (MASK_RESTRICT_VIEW | MASK_RESTRICT_SELECT)) { continue; diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c index 38e8ed627f2..8da083ab400 100644 --- a/source/blender/editors/mask/mask_shapekey.c +++ b/source/blender/editors/mask/mask_shapekey.c @@ -141,23 +141,6 @@ void MASK_OT_shape_key_clear(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -int ED_mask_layer_shape_auto_key_all(Mask *mask, const int frame) -{ - MaskLayer *masklay; - int change = FALSE; - - for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { - MaskLayerShape *masklay_shape; - - masklay_shape = BKE_mask_layer_shape_varify_frame(masklay, frame); - BKE_mask_layer_shape_from_mask(masklay, masklay_shape); - change = TRUE; - } - - return change; -} - - static int mask_shape_key_feather_reset_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); @@ -249,3 +232,45 @@ void MASK_OT_shape_key_feather_reset(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } + + +/* *** Shape Key Utils *** */ + +void ED_mask_layer_shape_auto_key(MaskLayer *masklay, const int frame) +{ + MaskLayerShape *masklay_shape; + + masklay_shape = BKE_mask_layer_shape_varify_frame(masklay, frame); + BKE_mask_layer_shape_from_mask(masklay, masklay_shape); +} + +int ED_mask_layer_shape_auto_key_all(Mask *mask, const int frame) +{ + MaskLayer *masklay; + int change = FALSE; + + for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { + ED_mask_layer_shape_auto_key(masklay, frame); + change = TRUE; + } + + return change; +} + +int ED_mask_layer_shape_auto_key_select(Mask *mask, const int frame) +{ + MaskLayer *masklay; + int change = FALSE; + + for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { + + if (!ED_mask_layer_select_check(masklay)) { + continue; + } + + ED_mask_layer_shape_auto_key(masklay, frame); + change = TRUE; + } + + return change; +} diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 4b484b60ad3..c42264e4dac 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -508,8 +508,7 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) } /* set variable axis */ - vert[0][1] = vert[1][1] = - vert[2][0] = vert[3][0] = line; + vert[0][1] = vert[1][1] = vert[2][0] = vert[3][0] = line; glDrawArrays(GL_LINES, 0, 4); } @@ -1606,10 +1605,10 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, y2 = vb.ymax; } else { - x1 = ar->winrct.xmin; - y1 = ar->winrct.ymin; - x2 = ar->winrct.xmax; - y2 = ar->winrct.ymax; + x1 = ar->winrct.xmin; + y1 = ar->winrct.ymin; + x2 = ar->winrct.xmax; + y2 = ar->winrct.ymax; } } else { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 4e78138dd1b..fbbb5bdfae8 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4915,7 +4915,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) if (IS_AUTOKEY_ON(t->scene)) { Scene *scene = t->scene; - ED_mask_layer_shape_auto_key_all(mask, CFRA); + ED_mask_layer_shape_auto_key_select(mask, CFRA); } } } |