/* 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 (copy_action_keys(&ac)) {
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- if(ac.reports==NULL) {
+ if (ac.reports==NULL) {
ac.reports= op->reports;
}
/* paste 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 (paste_action_keys(&ac, offset_mode, merge_mode)) {
duplicate_action_keys(&ac);
/* validate keyframes after editing */
- ANIM_editkeyframes_refresh(&ac);
+ if (ac.datatype != ANIMCONT_GPENCIL)
+ ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- return OPERATOR_FINISHED; // xxx - start transform
+ return OPERATOR_FINISHED;
}
static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- /* to give to transform */
- RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
}
/* ******************** Delete Keyframes Operator ************************* */
delete_action_keys(&ac);
/* validate keyframes after editing */
- ANIM_editkeyframes_refresh(&ac);
+ if (ac.datatype != ANIMCONT_GPENCIL)
+ ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
+ // XXX...
+ if (ac.datatype == ANIMCONT_GPENCIL)
+ return OPERATOR_PASS_THROUGH;
+
/* get snapping mode */
mode= RNA_enum_get(op->ptr, "type");
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
+ // XXX...
+ if (ac.datatype == ANIMCONT_GPENCIL)
+ return OPERATOR_PASS_THROUGH;
+
/* get mirroring mode */
mode= RNA_enum_get(op->ptr, "type");