Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_nla/nla_edit.c
| Show First 20 Lines • Show All 2,635 Lines • ▼ Show 20 Lines | static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) | ||||
| WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); | WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); | ||||
| /* done */ | /* done */ | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void NLA_OT_fmodifier_add(wmOperatorType *ot) | void NLA_OT_fmodifier_add(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | |||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Add F-Modifier"; | ot->name = "Add F-Modifier"; | ||||
| ot->idname = "NLA_OT_fmodifier_add"; | ot->idname = "NLA_OT_fmodifier_add"; | ||||
| ot->description = "Add F-Modifier to the active/selected NLA-Strips"; | ot->description = "Add F-Modifier to the active/selected NLA-Strips"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->invoke = WM_menu_invoke; | ot->invoke = WM_menu_invoke; | ||||
| ot->exec = nla_fmodifier_add_exec; | ot->exec = nla_fmodifier_add_exec; | ||||
| ot->poll = nlaop_poll_tweakmode_off; | ot->poll = nlaop_poll_tweakmode_off; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* id-props */ | /* id-props */ | ||||
| ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_fmodifier_type_items, 0, "Type", ""); | ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_fmodifier_type_items, 0, "Type", ""); | ||||
| RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION); | RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION); | ||||
| RNA_def_enum_funcs(ot->prop, nla_fmodifier_itemf); | RNA_def_enum_funcs(ot->prop, nla_fmodifier_itemf); | ||||
| RNA_def_boolean(ot->srna, | prop = RNA_def_boolean(ot->srna, | ||||
| "only_active", | "only_active", | ||||
| true, | true, | ||||
| "Only Active", | "Only Active", | ||||
| "Only add a F-Modifier of the specified type to the active strip"); | "Only add a F-Modifier of the specified type to the active strip"); | ||||
| RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ACTION); | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Copy F-Modifiers Operator | /** \name Copy F-Modifiers Operator | ||||
| * \{ */ | * \{ */ | ||||
| ▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | void NLA_OT_fmodifier_paste(wmOperatorType *ot) | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->exec = nla_fmodifier_paste_exec; | ot->exec = nla_fmodifier_paste_exec; | ||||
| ot->poll = nlaop_poll_tweakmode_off; | ot->poll = nlaop_poll_tweakmode_off; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* properties */ | /* properties */ | ||||
| RNA_def_boolean( | ot->prop = RNA_def_boolean( | ||||
| ot->srna, "only_active", true, "Only Active", "Only paste F-Modifiers on active strip"); | ot->srna, "only_active", true, "Only Active", "Only paste F-Modifiers on active strip"); | ||||
| RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION); | |||||
| RNA_def_boolean( | RNA_def_boolean( | ||||
| ot->srna, | ot->srna, | ||||
| "replace", | "replace", | ||||
| false, | false, | ||||
| "Replace Existing", | "Replace Existing", | ||||
| "Replace existing F-Modifiers, instead of just appending to the end of the existing list"); | "Replace existing F-Modifiers, instead of just appending to the end of the existing list"); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||