Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_action/action_edit.c
| Show First 20 Lines • Show All 642 Lines • ▼ Show 20 Lines | static int actkeys_paste_exec(bContext *C, wmOperator *op) | ||||
| } | } | ||||
| /* set notifier that keyframes have changed */ | /* set notifier that keyframes have changed */ | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static char *actkeys_paste_description(bContext *UNUSED(C), | |||||
| wmOperatorType *UNUSED(op), | |||||
| PointerRNA *ptr) | |||||
| { | |||||
| /* Custom description if the 'flipped' option is used. */ | |||||
| if (RNA_boolean_get(ptr, "flipped")) { | |||||
| return BLI_strdup("Paste keyframes from mirrored bones if they exist"); | |||||
| } | |||||
| /* Use the default description in the other cases. */ | |||||
| return NULL; | |||||
| } | |||||
| void ACTION_OT_paste(wmOperatorType *ot) | void ACTION_OT_paste(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Paste Keyframes"; | ot->name = "Paste Keyframes"; | ||||
| ot->idname = "ACTION_OT_paste"; | ot->idname = "ACTION_OT_paste"; | ||||
| ot->description = | ot->description = | ||||
| "Paste keyframes from copy/paste buffer for the selected channels, starting on the current " | "Paste keyframes from copy/paste buffer for the selected channels, starting on the current " | ||||
| "frame"; | "frame"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| // ot->invoke = WM_operator_props_popup; // better wait for action redo panel | // ot->invoke = WM_operator_props_popup; // better wait for action redo panel | ||||
| ot->get_description = actkeys_paste_description; | |||||
| ot->exec = actkeys_paste_exec; | ot->exec = actkeys_paste_exec; | ||||
| ot->poll = ED_operator_action_active; | ot->poll = ED_operator_action_active; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* props */ | /* props */ | ||||
| RNA_def_enum(ot->srna, | RNA_def_enum(ot->srna, | ||||
| ▲ Show 20 Lines • Show All 1,279 Lines • Show Last 20 Lines | |||||