Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_graph/graph_edit.c
| Show First 20 Lines • Show All 572 Lines • ▼ Show 20 Lines | static int graphkeys_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 *graphkeys_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 GRAPH_OT_paste(wmOperatorType *ot) | void GRAPH_OT_paste(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* Identifiers */ | /* Identifiers */ | ||||
| ot->name = "Paste Keyframes"; | ot->name = "Paste Keyframes"; | ||||
| ot->idname = "GRAPH_OT_paste"; | ot->idname = "GRAPH_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 graph redo panel */ | // ot->invoke = WM_operator_props_popup; /* better wait for graph redo panel */ | ||||
| ot->get_description = graphkeys_paste_description; | |||||
| ot->exec = graphkeys_paste_exec; | ot->exec = graphkeys_paste_exec; | ||||
| ot->poll = graphop_editable_keyframes_poll; | ot->poll = graphop_editable_keyframes_poll; | ||||
| /* 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 2,431 Lines • Show Last 20 Lines | |||||