diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-03 05:10:46 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-03 05:10:46 +0400 |
commit | 28d371d1178642e17f5dfc300f1500a132ce7149 (patch) | |
tree | 8b6eb6ae7ac36b4a1823e5725ed92f29b1e528c8 /source/blender/editors/space_graph/graph_edit.c | |
parent | e55d90b340d15944d53414419d8f4671f435af75 (diff) |
NLA SoC: Assorted fixes
* Made NLA Editing functions more aware of transitions.
- A transition can only be added between a pair of action-clips. Previous, two transitions could be added next to each other, which has undefined behaviour
- Deleting a strip with transition(s) on either side will remove the transitions too. Feedback welcome on this
- The 'type' setting for NLA-Strips is no longer editable. This was dangerous as it could result in transitions with undefined behaviour (though nothing would happen).
* Menus for adding F-Modifiers now only show relevant modifiers (i.e. 'Invalid' is not included in the list, and 'Cycles' doesn't need to be shown for NLA since we've got repeat)
* Function Generator and Noise F-Modifiers now have complete GUI's. A few settings were missed during the porting process.
* F-Modifier buttons now have their source-ID's included in the RNA Pointers used. This didn't get them animateable directly, but is a step closer.
Diffstat (limited to 'source/blender/editors/space_graph/graph_edit.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 9a50c5cc203..2cade676817 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -73,6 +73,7 @@ #include "BKE_report.h" #include "BKE_utildefines.h" +#include "UI_interface.h" #include "UI_view2d.h" #include "BIF_transform.h" @@ -1743,6 +1744,34 @@ void GRAPH_OT_smooth (wmOperatorType *ot) /* ******************** Add F-Modifier Operator *********************** */ +/* present a special customised popup menu for this, with some filtering */ +static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *event) +{ + uiPopupMenu *pup; + uiLayout *layout; + int i; + + pup= uiPupMenuBegin(C, "Add F-Curve Modifier", 0); + layout= uiPupMenuLayout(pup); + + /* start from 1 to skip the 'Invalid' modifier type */ + for (i = 1; i < FMODIFIER_NUM_TYPES; i++) { + FModifierTypeInfo *fmi= get_fmodifier_typeinfo(i); + + /* check if modifier is valid for this context */ + if (fmi == NULL) + continue; + + /* add entry to add this type of modifier */ + uiItemEnumO(layout, fmi->name, 0, "GRAPH_OT_fmodifier_add", "type", i); + } + uiItemS(layout); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1793,7 +1822,7 @@ void GRAPH_OT_fmodifier_add (wmOperatorType *ot) ot->idname= "GRAPH_OT_fmodifier_add"; /* api callbacks */ - ot->invoke= WM_menu_invoke; + ot->invoke= graph_fmodifier_add_invoke; ot->exec= graph_fmodifier_add_exec; ot->poll= graphop_active_fcurve_poll; |