45 const int frame = scene->
r.
cfra;
49 bool mask_was_animated =
false;
50 bool mask_now_animated =
false;
72 if (mask_was_animated != mask_now_animated) {
88 ot->
name =
"Insert Shape Key";
89 ot->
description =
"Insert mask shape keyframe for active mask layer at the current frame";
90 ot->
idname =
"MASK_OT_shape_key_insert";
103 const int frame = scene->
r.
cfra;
105 bool changed =
false;
107 bool mask_was_animated =
false;
108 bool mask_now_animated =
false;
121 if (mask_layer_shape) {
131 if (mask_was_animated != mask_now_animated) {
147 ot->
name =
"Clear Shape Key";
148 ot->
description =
"Remove mask shape keyframe for active mask layer at the current frame";
149 ot->
idname =
"MASK_OT_shape_key_clear";
162 const int frame = scene->
r.
cfra;
164 bool changed =
false;
190 for (
int i = 0; i < spline.
tot_point; i++) {
228 ot->
name =
"Feather Reset Animation";
229 ot->
description =
"Reset feather weights on all selected points animation values";
230 ot->
idname =
"MASK_OT_shape_key_feather_reset";
251 const int frame = scene->
r.
cfra;
253 bool changed =
false;
272 for (mask_layer_shape = mask_layer.
splines_shapes.first(); mask_layer_shape;
273 mask_layer_shape = mask_layer_shape_next)
278 mask_layer_shape_next = mask_layer_shape->
next;
282 if (mask_layer_shape_lastsel ==
nullptr) {
283 mask_layer_shape_lastsel = mask_layer_shape;
285 if ((mask_layer_shape->
next ==
nullptr) ||
289 mask_layer_shape_a = mask_layer_shape_lastsel;
290 mask_layer_shape_b = mask_layer_shape;
291 mask_layer_shape_lastsel =
nullptr;
294 mask_layer_shape_next = mask_layer_shape->
next;
299 if (mask_layer_shape_a && mask_layer_shape_b) {
300 ListBaseT<MaskLayerShape> shapes_tmp = {
nullptr,
nullptr};
307 for (mask_layer_shape_tmp = mask_layer_shape_a;
308 mask_layer_shape_tmp && (mask_layer_shape_tmp != mask_layer_shape_tmp_last);
309 mask_layer_shape_tmp = mask_layer_shape_tmp_next)
311 mask_layer_shape_tmp_next = mask_layer_shape_tmp->
next;
317 for (mask_layer_shape_tmp = shapes_tmp.first(); mask_layer_shape_tmp;
318 mask_layer_shape_tmp = mask_layer_shape_tmp->
next)
322 &mask_layer, mask_layer_shape_tmp->
frame);
328 for (mask_layer_shape_tmp = shapes_tmp.first(); mask_layer_shape_tmp;
329 mask_layer_shape_tmp = mask_layer_shape_tmp_next)
336 mask_layer_shape_tmp_next = mask_layer_shape_tmp->
next;
340 &mask_layer, mask_layer_shape_tmp->
frame);
344 mask_layer_shape_tmp_rekey->
data);
347 for (
int i = 0; i < spline.
tot_point; i++) {
351 std::swap(*shape_ele_src, *shape_ele_dst);
356 shape_ele_dst->
point, shape_ele_src->
point,
sizeof(shape_ele_src->
point));
395 ot->
name =
"Re-Key Points of Selected Shapes";
397 "Recalculate animation data on selected points for frames selected in the dopesheet";
398 ot->
idname =
"MASK_OT_shape_key_rekey";
427 if (mask_was_animated != mask_now_animated) {
436 bool changed =
false;
448 bool changed =
false;
bool ED_mask_layer_shape_auto_key_select(const bContext *C, Mask *mask, int frame)
MaskLayerShape * BKE_mask_layer_shape_alloc(MaskLayer *masklay, int frame)
void BKE_mask_layer_evaluate(MaskLayer *masklay, float ctime, bool do_newframe)
bool BKE_mask_layer_is_animated(MaskLayer &mask_layer)
void BKE_mask_layer_shape_from_mask(MaskLayer *masklay, MaskLayerShape *masklay_shape)
void BKE_mask_layer_shape_unlink(MaskLayer *masklay, MaskLayerShape *masklay_shape)
bool BKE_mask_point_selected(const MaskSplinePoint *p)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void DEG_id_tag_update(ID *id, unsigned int flags)
void ED_mask_layer_shape_auto_key(const bContext *C, MaskLayer *mask_layer, int frame)
Mask * CTX_data_edit_mask(const bContext *C)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool ED_maskedit_mask_visible_splines_poll(bContext *C)
static wmOperatorStatus mask_shape_key_rekey_exec(bContext *C, wmOperator *op)
bool ED_mask_layer_shape_auto_key_all(const bContext *C, Mask *mask, int frame)
void MASK_OT_shape_key_insert(wmOperatorType *ot)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Main * CTX_data_main(const bContext *C)
MaskLayerShape * BKE_mask_layer_shape_find_frame(MaskLayer *masklay, int frame)
MaskLayerShape * BKE_mask_layer_shape_verify_frame(MaskLayer *masklay, int frame)
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
static wmOperatorStatus mask_shape_key_feather_reset_exec(bContext *C, wmOperator *)
bool ED_mask_layer_select_check(const MaskLayer *mask_layer)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void MASK_OT_shape_key_clear(wmOperatorType *ot)
void BKE_mask_layer_shape_free(MaskLayerShape *masklay_shape)
static wmOperatorStatus mask_shape_key_insert_exec(bContext *C, wmOperator *)
static void select_only_layer_shape(MaskLayer *mask_layer, MaskLayerShape *mask_layer_shape)
static wmOperatorStatus mask_shape_key_clear_exec(bContext *C, wmOperator *)
void MASK_OT_shape_key_rekey(wmOperatorType *ot)
void MASK_OT_shape_key_feather_reset(wmOperatorType *ot)
struct MaskLayerShape * next
ListBaseT< MaskLayerShape > splines_shapes
MaskLayerVisibility visibility_flag
ListBaseT< MaskSpline > splines
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT