diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-02 09:25:14 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-02 09:25:14 +0400 |
commit | f3c47a66b0cb3bb70505ed46522e6c557769eaa5 (patch) | |
tree | 843833bd2ec06f5250004f2462b25d4d7f879e67 /source/blender/editors/animation/fmodifier_ui.c | |
parent | b47605d841d0c01b31199bce4499548ecf259bf1 (diff) |
NLA SoC: Separating out F-Modifier API
* F-Modifier API is now in its own file in blenkernel
* Renamed and refactored these so that they're no dependent on F-Curves, since all they really used was the fcu->modifiers list
* Added missing license blocks to a few files
Diffstat (limited to 'source/blender/editors/animation/fmodifier_ui.c')
-rw-r--r-- | source/blender/editors/animation/fmodifier_ui.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 5968817a9a6..b5a99877247 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -112,23 +112,23 @@ static void validate_fmodifier_cb (bContext *C, void *fcm_v, void *dummy) } /* callback to set the active modifier */ -static void activate_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) +static void activate_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) { - FCurve *fcu= (FCurve *)fcu_v; + ListBase *modifiers = (ListBase *)fmods_v; FModifier *fcm= (FModifier *)fcm_v; - /* call API function to set the active modifier for active F-Curve */ - fcurve_set_active_modifier(fcu, fcm); + /* call API function to set the active modifier for active modifier-stack */ + set_active_fmodifier(modifiers, fcm); } /* callback to remove the given modifier */ -static void delete_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) +static void delete_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) { - FCurve *fcu= (FCurve *)fcu_v; + ListBase *modifiers = (ListBase *)fmods_v; FModifier *fcm= (FModifier *)fcm_v; - /* remove the given F-Modifier from the F-Curve */ - fcurve_remove_modifier(fcu, fcm); + /* remove the given F-Modifier from the active modifier-stack */ + remove_fmodifier(modifiers, fcm); } /* --------------- */ @@ -588,6 +588,7 @@ static void draw_modifier__limits(uiBlock *block, FModifier *fcm, int *yco, shor void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco) { FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + ListBase *modifiers= &fcu->modifiers; // XXX fixme... should be arg uiBut *but; short active= (fcm->flag & FMODIFIER_FLAG_ACTIVE); short width= 314; @@ -607,7 +608,7 @@ void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, FCurve *fcu, FModifier *fcm /* checkbox for 'active' status (for now) */ but= uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_ACTIVE, B_REDR, ICON_RADIOBUT_OFF, 25, *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is active one."); - uiButSetFunc(but, activate_fmodifier_cb, fcu, fcm); + uiButSetFunc(but, activate_fmodifier_cb, modifiers, fcm); /* name */ if (fmi) @@ -620,7 +621,7 @@ void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, FCurve *fcu, FModifier *fcm /* delete button */ but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 10+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier."); - uiButSetFunc(but, delete_fmodifier_cb, fcu, fcm); + uiButSetFunc(but, delete_fmodifier_cb, modifiers, fcm); uiBlockSetEmboss(block, UI_EMBOSS); } |