Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_nla/nla_edit.c
| Show First 20 Lines • Show All 2,168 Lines • ▼ Show 20 Lines | |||||
| /* present a special customised popup menu for this, with some filtering */ | /* present a special customised popup menu for this, with some filtering */ | ||||
| static int nla_fmodifier_add_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) | static int nla_fmodifier_add_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| uiPopupMenu *pup; | uiPopupMenu *pup; | ||||
| uiLayout *layout; | uiLayout *layout; | ||||
| int i; | int i; | ||||
| pup = uiPupMenuBegin(C, IFACE_("Add F-Modifier"), ICON_NONE); | pup = UI_popup_menu_begin(C, IFACE_("Add F-Modifier"), ICON_NONE); | ||||
| layout = uiPupMenuLayout(pup); | layout = UI_popup_menu_layout(pup); | ||||
| /* start from 1 to skip the 'Invalid' modifier type */ | /* start from 1 to skip the 'Invalid' modifier type */ | ||||
| for (i = 1; i < FMODIFIER_NUM_TYPES; i++) { | for (i = 1; i < FMODIFIER_NUM_TYPES; i++) { | ||||
| FModifierTypeInfo *fmi = get_fmodifier_typeinfo(i); | FModifierTypeInfo *fmi = get_fmodifier_typeinfo(i); | ||||
| /* check if modifier is valid for this context */ | /* check if modifier is valid for this context */ | ||||
| if (fmi == NULL) | if (fmi == NULL) | ||||
| continue; | continue; | ||||
| if (i == FMODIFIER_TYPE_CYCLES) /* we already have repeat... */ | if (i == FMODIFIER_TYPE_CYCLES) /* we already have repeat... */ | ||||
| continue; | continue; | ||||
| /* add entry to add this type of modifier */ | /* add entry to add this type of modifier */ | ||||
| uiItemEnumO(layout, "NLA_OT_fmodifier_add", fmi->name, 0, "type", i); | uiItemEnumO(layout, "NLA_OT_fmodifier_add", fmi->name, 0, "type", i); | ||||
| } | } | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| uiPupMenuEnd(C, pup); | UI_popup_menu_end(C, pup); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) | static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| bAnimContext ac; | bAnimContext ac; | ||||
| ▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines | |||||