52 const int frame =
CFRA;
80 ot->
name =
"Insert Shape Key";
81 ot->
description =
"Insert mask shape keyframe for active mask layer at the current frame";
82 ot->
idname =
"MASK_OT_shape_key_insert";
95 const int frame =
CFRA;
108 if (mask_layer_shape) {
126 ot->
name =
"Clear Shape Key";
127 ot->
description =
"Remove mask shape keyframe for active mask layer at the current frame";
128 ot->
idname =
"MASK_OT_shape_key_clear";
141 const int frame =
CFRA;
143 bool changed =
false;
151 if (mask_layer->splines_shapes.first) {
160 for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape;
161 mask_layer_shape = mask_layer_shape->
next) {
172 for (
int i = 0; i < spline->tot_point; i++) {
177 shape_ele_dst->
value[6] = shape_ele_src->
value[6];
210 ot->
name =
"Feather Reset Animation";
211 ot->
description =
"Reset feather weights on all selected points animation values";
212 ot->
idname =
"MASK_OT_shape_key_feather_reset";
233 const int frame =
CFRA;
235 bool changed =
false;
250 if (mask_layer->splines_shapes.first) {
254 for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape;
255 mask_layer_shape = mask_layer_shape_next) {
259 mask_layer_shape_next = mask_layer_shape->
next;
263 if (mask_layer_shape_lastsel ==
NULL) {
264 mask_layer_shape_lastsel = mask_layer_shape;
266 if ((mask_layer_shape->
next ==
NULL) ||
268 mask_layer_shape_a = mask_layer_shape_lastsel;
269 mask_layer_shape_b = mask_layer_shape;
270 mask_layer_shape_lastsel =
NULL;
273 mask_layer_shape_next = mask_layer_shape->
next;
278 if (mask_layer_shape_a && mask_layer_shape_b) {
286 for (mask_layer_shape_tmp = mask_layer_shape_a;
287 mask_layer_shape_tmp && (mask_layer_shape_tmp != mask_layer_shape_tmp_last);
288 mask_layer_shape_tmp = mask_layer_shape_tmp_next) {
289 mask_layer_shape_tmp_next = mask_layer_shape_tmp->
next;
290 BLI_remlink(&mask_layer->splines_shapes, mask_layer_shape_tmp);
295 for (mask_layer_shape_tmp = shapes_tmp.
first; mask_layer_shape_tmp;
296 mask_layer_shape_tmp = mask_layer_shape_tmp->
next) {
299 mask_layer, mask_layer_shape_tmp->
frame);
305 for (mask_layer_shape_tmp = shapes_tmp.
first; mask_layer_shape_tmp;
306 mask_layer_shape_tmp = mask_layer_shape_tmp_next) {
312 mask_layer_shape_tmp_next = mask_layer_shape_tmp->
next;
316 mask_layer, mask_layer_shape_tmp->
frame);
322 for (
int i = 0; i < spline->tot_point; i++) {
330 memcpy(shape_ele_dst->
value, shape_ele_src->
value,
sizeof(
float[6]));
333 shape_ele_dst->
value[6] = shape_ele_src->
value[6];
368 ot->
name =
"Re-Key Points of Selected Shapes";
370 "Recalculate animation data on selected points for frames selected in the dopesheet";
371 ot->
idname =
"MASK_OT_shape_key_rekey";
397 bool changed =
false;
409 bool changed =
false;
struct Scene * CTX_data_scene(const bContext *C)
struct Mask * CTX_data_edit_mask(const bContext *C)
#define MASKPOINT_ISSEL_ANY(p)
struct MaskLayerShape * BKE_mask_layer_shape_find_frame(struct MaskLayer *masklay, const int frame)
void BKE_mask_layer_shape_unlink(struct MaskLayer *masklay, struct MaskLayerShape *masklay_shape)
struct MaskLayerShape * BKE_mask_layer_shape_verify_frame(struct MaskLayer *masklay, const int frame)
void BKE_mask_layer_shape_from_mask(struct MaskLayer *masklay, struct MaskLayerShape *masklay_shape)
struct MaskLayerShape * BKE_mask_layer_shape_alloc(struct MaskLayer *masklay, const int frame)
void BKE_mask_layer_evaluate(struct MaskLayer *masklay, const float ctime, const bool do_newframe)
void BKE_mask_layer_shape_free(struct MaskLayerShape *masklay_shape)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void DEG_id_tag_update(struct ID *id, int flag)
#define MASK_RESTRICT_SELECT
#define MASK_RESTRICT_VIEW
Object is a sort of wrapper for general info.
bool ED_maskedit_mask_poll(bContext *C)
bool ED_mask_layer_select_check(const struct MaskLayer *mask_layer)
static int mask_shape_key_insert_exec(bContext *C, wmOperator *UNUSED(op))
void MASK_OT_shape_key_insert(wmOperatorType *ot)
void MASK_OT_shape_key_feather_reset(wmOperatorType *ot)
void MASK_OT_shape_key_rekey(wmOperatorType *ot)
void MASK_OT_shape_key_clear(wmOperatorType *ot)
bool ED_mask_layer_shape_auto_key_select(Mask *mask, const int frame)
void ED_mask_layer_shape_auto_key(MaskLayer *mask_layer, const int frame)
bool ED_mask_layer_shape_auto_key_all(Mask *mask, const int frame)
static int mask_shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
static int mask_shape_key_feather_reset_exec(bContext *C, wmOperator *UNUSED(op))
static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
float value[MASK_OBJECT_SHAPE_ELEM_SIZE]
struct MaskLayerShape * next
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)