diff options
Diffstat (limited to 'source/blender/editors/mask/mask_add.c')
-rw-r--r-- | source/blender/editors/mask/mask_add.c | 62 |
1 files changed, 48 insertions, 14 deletions
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index d10c420e28c..df30870007f 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -31,7 +31,9 @@ #include "mask_intern.h" /* own include */ -/******************** add vertex *********************/ +/* -------------------------------------------------------------------- */ +/** \name Add Vertex + * \{ */ static void setup_vertex_point(Mask *mask, MaskSpline *spline, @@ -160,7 +162,11 @@ static void setup_vertex_point(Mask *mask, ED_mask_select_flush_all(mask); } -/* **** add extrude vertex **** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Add Extrude Vertex + * \{ */ static void finSelectedSplinePoint(MaskLayer *mask_layer, MaskSpline **spline, @@ -206,7 +212,11 @@ static void finSelectedSplinePoint(MaskLayer *mask_layer, } } -/* **** add subdivide vertex **** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Add Subdivide Vertex + * \{ */ static void mask_spline_add_point_at_index(MaskSpline *spline, int point_index) { @@ -248,7 +258,7 @@ static bool add_vertex_subdivide(const bContext *C, Mask *mask, const float co[2 &u, NULL)) { Scene *scene = CTX_data_scene(C); - const float ctime = CFRA; + const float ctime = scene->r.cfra; MaskSplinePoint *new_point; int point_index = point - spline->points; @@ -285,7 +295,7 @@ static bool add_vertex_extrude(const bContext *C, const float co[2]) { Scene *scene = CTX_data_scene(C); - const float ctime = CFRA; + const float ctime = scene->r.cfra; MaskSpline *spline; MaskSplinePoint *point; @@ -384,13 +394,13 @@ static bool add_vertex_extrude(const bContext *C, static bool add_vertex_new(const bContext *C, Mask *mask, MaskLayer *mask_layer, const float co[2]) { Scene *scene = CTX_data_scene(C); - const float ctime = CFRA; + const float ctime = scene->r.cfra; MaskSpline *spline; MaskSplinePoint *new_point = NULL, *ref_point = NULL; if (!mask_layer) { - /* if there's no mask layer currently operationg on, create new one */ + /* If there's no mask layer currently operating on, create new one. */ mask_layer = BKE_mask_layer_new(mask, ""); mask->masklay_act = mask->masklay_tot - 1; } @@ -492,6 +502,12 @@ static int add_vertex_handle_cyclic( return OPERATOR_PASS_THROUGH; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Add Vertex Operator + * \{ */ + static int add_vertex_exec(bContext *C, wmOperator *op) { MaskViewLockState lock_state; @@ -567,7 +583,7 @@ void MASK_OT_add_vertex(wmOperatorType *ot) /* api callbacks */ ot->exec = add_vertex_exec; ot->invoke = add_vertex_invoke; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -585,7 +601,11 @@ void MASK_OT_add_vertex(wmOperatorType *ot) 1.0f); } -/******************** add feather vertex *********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Add Feather Vertex Operator + * \{ */ static int add_feather_vertex_exec(bContext *C, wmOperator *op) { @@ -677,7 +697,11 @@ void MASK_OT_add_feather_vertex(wmOperatorType *ot) 1.0f); } -/******************** common primitive functions *********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Common Primitive Functions + * \{ */ static BezTriple *points_to_bezier(const float (*points)[2], const int num_points, @@ -812,7 +836,11 @@ static void define_primitive_add_properties(wmOperatorType *ot) FLT_MAX); } -/******************** primitive add circle *********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Primitive Add Circle Operator + * \{ */ static int primitive_circle_add_exec(bContext *C, wmOperator *op) { @@ -834,7 +862,7 @@ void MASK_OT_primitive_circle_add(wmOperatorType *ot) /* api callbacks */ ot->exec = primitive_circle_add_exec; ot->invoke = primitive_add_invoke; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -843,7 +871,11 @@ void MASK_OT_primitive_circle_add(wmOperatorType *ot) define_primitive_add_properties(ot); } -/******************** primitive add suqare *********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Primitive Add Square Operator + * \{ */ static int primitive_square_add_exec(bContext *C, wmOperator *op) { @@ -865,7 +897,7 @@ void MASK_OT_primitive_square_add(wmOperatorType *ot) /* api callbacks */ ot->exec = primitive_square_add_exec; ot->invoke = primitive_add_invoke; - ot->poll = ED_operator_mask; + ot->poll = ED_maskedit_visible_splines_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -873,3 +905,5 @@ void MASK_OT_primitive_square_add(wmOperatorType *ot) /* properties */ define_primitive_add_properties(ot); } + +/** \} */ |