Ejemplo n.º 1
0
static int actkeys_copy_exec(bContext *C, wmOperator *op)
{
	bAnimContext ac;
	
	/* get editor data */
	if (ANIM_animdata_get_context(C, &ac) == 0)
		return OPERATOR_CANCELLED;

	/* copy keyframes */
	if (ac.datatype == ANIMCONT_GPENCIL) {
		/* FIXME... */
		BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for grease pencil mode");
		return OPERATOR_CANCELLED;
	}
	else if (ac.datatype == ANIMCONT_MASK) {
		/* FIXME... */
		BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for mask mode");
		return OPERATOR_CANCELLED;
	}
	else {
		if (copy_action_keys(&ac)) {
			BKE_report(op->reports, RPT_ERROR, "No keyframes copied to keyframes copy/paste buffer");
			return OPERATOR_CANCELLED;
		}
	}
	
	return OPERATOR_FINISHED;
}
Ejemplo n.º 2
0
static int actkeys_copy_exec(bContext *C, wmOperator *op)
{
	bAnimContext ac;
	
	/* get editor data */
	if (ANIM_animdata_get_context(C, &ac) == 0)
		return OPERATOR_CANCELLED;
	
	/* copy keyframes */
	if (ac.datatype == ANIMCONT_GPENCIL) {
		// FIXME...
	}
	else {
		if (copy_action_keys(&ac)) {	
			BKE_report(op->reports, RPT_ERROR, "No keyframes copied to keyframes copy/paste buffer");
			return OPERATOR_CANCELLED;
		}
	}
	
	return OPERATOR_FINISHED;
}