Example #1
0
static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op))
{
	bAnimContext ac;
	
	/* get editor data */
	if (ANIM_animdata_get_context(C, &ac) == 0)
		return OPERATOR_CANCELLED;
		
	/* delete keyframes */
	if (!delete_action_keys(&ac))
		return OPERATOR_CANCELLED;
	
	/* set notifier that keyframes have changed */
	WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_REMOVED, NULL);
	
	return OPERATOR_FINISHED;
}
Example #2
0
static int actkeys_delete_exec(bContext *C, wmOperator *op)
{
	bAnimContext ac;
	
	/* get editor data */
	if (ANIM_animdata_get_context(C, &ac) == 0)
		return OPERATOR_CANCELLED;
		
	/* delete keyframes */
	delete_action_keys(&ac);
	
	/* validate keyframes after editing */
	ANIM_editkeyframes_refresh(&ac);
	
	/* set notifier that keyframes have changed */
	WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
	
	return OPERATOR_FINISHED;
}
Example #3
0
static int actkeys_delete_exec(bContext *C, wmOperator *op)
{
	bAnimContext ac;
	bool changed;
	
	/* get editor data */
	if (ANIM_animdata_get_context(C, &ac) == 0)
		return OPERATOR_CANCELLED;
		
	/* delete keyframes */
	changed = delete_action_keys(&ac);
	
	/* validate keyframes after editing */
	if (!ELEM(ac.datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
		ANIM_editkeyframes_refresh(&ac);
	
	/* set notifier that keyframes have changed */
	WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
	
	if (changed)
		BKE_report(op->reports, RPT_INFO, "Deleted selected keyframes");

	return OPERATOR_FINISHED;
}