diff options
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/action_draw.c | 206 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 75 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_header.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 376 |
4 files changed, 228 insertions, 440 deletions
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 0912edb7076..39a477f30fb 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -46,11 +46,11 @@ /* Types --------------------------------------------------------------- */ #include "DNA_listBase.h" +#include "DNA_anim_types.h" #include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_camera_types.h" #include "DNA_curve_types.h" -#include "DNA_ipo_types.h" #include "DNA_object_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" @@ -65,7 +65,7 @@ #include "BKE_action.h" #include "BKE_depsgraph.h" -#include "BKE_ipo.h" +#include "BKE_fcurve.h" #include "BKE_key.h" #include "BKE_material.h" #include "BKE_object.h" @@ -408,7 +408,7 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) int items, height; /* build list of channels to draw */ - filter= (ANIMFILTER_FORDRAWING|ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS); + filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS); items= ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* Update max-extent of channels here (taking into account scrollers): @@ -484,40 +484,6 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) strcpy(name, "Action"); } break; - case ANIMTYPE_FILLIPOD: /* ipo (dopesheet) expand widget */ - { - Object *ob = (Object *)ale->data; - - group = 4; - indent = 1; - special = ICON_IPO; - - if (FILTER_IPO_OBJC(ob)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; - - //sel = SEL_OBJC(base); - strcpy(name, "IPO Curves"); - } - break; - case ANIMTYPE_FILLCOND: /* constraint channels (dopesheet) expand widget */ - { - Object *ob = (Object *)ale->data; - - group = 4; - indent = 1; - special = ICON_CONSTRAINT; - - if (FILTER_CON_OBJC(ob)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; - - //sel = SEL_OBJC(base); - strcpy(name, "Constraints"); - } - break; case ANIMTYPE_FILLMATD: /* object materials (dopesheet) expand widget */ { Object *ob = (Object *)ale->data; @@ -647,83 +613,9 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) strcpy(name, agrp->name); } break; - case ANIMTYPE_ACHAN: /* action channel */ - { - bActionChannel *achan= (bActionChannel *)ale->data; - - group= (ale->grp) ? 1 : 0; - grp= ale->grp; - - indent = 0; - special = -1; - - offset= (ale->id) ? 21 : 0; - - if (EXPANDED_ACHAN(achan)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; - - if (EDITABLE_ACHAN(achan)) - protect = ICON_UNLOCKED; - else - protect = ICON_LOCKED; - - if (achan->ipo) { - if (achan->ipo->muteipo) - mute = ICON_MUTE_IPO_ON; - else - mute = ICON_MUTE_IPO_OFF; - } - - sel = SEL_ACHAN(achan); - strcpy(name, achan->name); - } - break; - case ANIMTYPE_CONCHAN: /* constraint channel */ - { - bConstraintChannel *conchan = (bConstraintChannel *)ale->data; - - group= (ale->grp) ? 1 : 0; - grp= ale->grp; - - if (ale->id) { - if (ale->ownertype == ANIMTYPE_ACHAN) { - /* for constraint channels under Action in Dopesheet */ - indent= 2; - offset= 21; - } - else { - /* for constraint channels under Object in Dopesheet */ - indent= 2; - offset = 0; - } - } - else { - /* for normal constraint channels in Action Editor */ - indent= 2; - offset= 0; - } - - if (EDITABLE_CONCHAN(conchan)) - protect = ICON_UNLOCKED; - else - protect = ICON_LOCKED; - - if (conchan->ipo) { - if (conchan->ipo->muteipo) - mute = ICON_MUTE_IPO_ON; - else - mute = ICON_MUTE_IPO_OFF; - } - - sel = SEL_CONCHAN(conchan); - strcpy(name, conchan->name); - } - break; - case ANIMTYPE_ICU: /* ipo-curve channel */ + case ANIMTYPE_FCURVE: /* F-Curve channel */ { - IpoCurve *icu = (IpoCurve *)ale->data; + FCurve *fcu = (FCurve *)ale->data; indent = 2; protect = -1; // for now, until this can be supported by others @@ -732,7 +624,7 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) grp= ale->grp; if (ale->id) { - if ((GS(ale->id->name)==ID_MA) || (ale->ownertype == ANIMTYPE_ACHAN)) + if (GS(ale->id->name) == ID_MA) offset= 21; else offset= 0; @@ -740,67 +632,23 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) else offset= 0; - if (icu->flag & IPO_MUTE) + if (fcu->flag & FCURVE_MUTED) mute = ICON_MUTE_IPO_ON; else mute = ICON_MUTE_IPO_OFF; - if (EDITABLE_ICU(icu)) + if (EDITABLE_FCU(fcu)) protect = ICON_UNLOCKED; else protect = ICON_LOCKED; - sel = SEL_ICU(icu); - if (saction->pin) - strcpy(name, getname_ipocurve(icu, NULL)); // xxx func to eventually eliminate - else - strcpy(name, getname_ipocurve(icu, ac->obact)); // xxx func to eventually eliminate - } - break; - case ANIMTYPE_FILLIPO: /* ipo expand widget */ - { - bActionChannel *achan = (bActionChannel *)ale->data; - - indent = 1; - special = geticon_ipo_blocktype(achan->ipo->blocktype); // xxx func to eventually eliminate - - group= (ale->grp) ? 1 : 0; - grp= ale->grp; - - offset= (ale->id) ? 21 : 0; - - if (FILTER_IPO_ACHAN(achan)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; - - sel = SEL_ACHAN(achan); - strcpy(name, "IPO Curves"); - } - break; - case ANIMTYPE_FILLCON: /* constraint expand widget */ - { - bActionChannel *achan = (bActionChannel *)ale->data; - - indent = 1; - special = ICON_CONSTRAINT; - - group= (ale->grp) ? 1 : 0; - grp= ale->grp; - - offset= (ale->id) ? 21 : 0; + sel = SEL_FCU(fcu); - if (FILTER_CON_ACHAN(achan)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; - - sel = SEL_ACHAN(achan); - strcpy(name, "Constraint"); + // for now, we just print the full path... this needs more work! + sprintf(name, "%s[%d]", fcu->rna_path, fcu->array_index); } break; - case ANIMTYPE_SHAPEKEY: /* shapekey channel */ { KeyBlock *kb = (KeyBlock *)ale->data; @@ -1138,7 +986,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) } /* build list of channels to draw */ - filter= (ANIMFILTER_FORDRAWING|ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS); + filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS); items= ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* Update max-extent of channels here (taking into account scrollers): @@ -1185,22 +1033,10 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) sel = SEL_AGRP(agrp); } break; - case ANIMTYPE_ACHAN: - { - bActionChannel *achan = (bActionChannel *)ale->data; - sel = SEL_ACHAN(achan); - } - break; - case ANIMTYPE_CONCHAN: - { - bConstraintChannel *conchan = (bConstraintChannel *)ale->data; - sel = SEL_CONCHAN(conchan); - } - break; - case ANIMTYPE_ICU: + case ANIMTYPE_FCURVE: { - IpoCurve *icu = (IpoCurve *)ale->data; - sel = SEL_ICU(icu); + FCurve *fcu = (FCurve *)ale->data; + sel = SEL_FCU(fcu); } break; case ANIMTYPE_GPLAYER: @@ -1221,10 +1057,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) else glColor4ub(col1b[0], col1b[1], col1b[2], 0x22); } break; - - case ANIMTYPE_FILLIPOD: - case ANIMTYPE_FILLACTD: - case ANIMTYPE_FILLCOND: + case ANIMTYPE_DSSKEY: { if (sel) glColor4ub(col2b[0], col2b[1], col2b[2], 0x45); @@ -1321,11 +1154,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) case ALE_GROUP: draw_agroup_channel(di, aki, ale->data, y); break; - case ALE_IPO: - draw_ipo_channel(di, aki, ale->key_data, y); - break; - case ALE_ICU: - draw_icu_channel(di, aki, ale->key_data, y); + case ALE_FCURVE: + draw_fcurve_channel(di, aki, ale->key_data, y); break; case ALE_GPFRAME: draw_gpl_channel(di, aki, ale->data, y); diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 87741d82a1a..6a7e7d7421e 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -97,7 +97,7 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max) int filter; /* get data to filter, from Action or Dopesheet */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* set large values to try to override */ @@ -293,6 +293,7 @@ void free_actcopybuf () */ static short copy_action_keys (bAnimContext *ac) { +#if 0 // XXX old animation system ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; @@ -372,6 +373,7 @@ static short copy_action_keys (bAnimContext *ac) /* free temp memory */ BLI_freelistN(&anim_data); +#endif // XXX old animation system /* everything went fine */ return 0; @@ -379,6 +381,7 @@ static short copy_action_keys (bAnimContext *ac) static short paste_action_keys (bAnimContext *ac) { +#if 0 // XXX old animation system ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; @@ -495,6 +498,8 @@ static short paste_action_keys (bAnimContext *ac) } #endif +#endif // XXX old animation system + return 0; } @@ -595,7 +600,7 @@ static void delete_action_keys (bAnimContext *ac) if (ac->datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and delete selected keys */ @@ -655,7 +660,7 @@ static void clean_action_keys (bAnimContext *ac, float thresh) int filter; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_ONLYFCU); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and clean curves */ @@ -727,7 +732,7 @@ static void sample_action_keys (bAnimContext *ac) int filter; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_ONLYFCU); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and add keys between selected keyframes on every frame */ @@ -837,12 +842,12 @@ void ACT_OT_keyframes_sample (wmOperatorType *ot) /* ******************** Set Extrapolation-Type Operator *********************** */ +// XXX rename this operator... + /* defines for set extrapolation-type for selected keyframes tool */ EnumPropertyItem prop_actkeys_expo_types[] = { - {IPO_HORIZ, "CONSTANT", "Constant", ""}, - {IPO_DIR, "DIRECTIONAL", "Extrapolation", ""}, - {IPO_CYCL, "CYCLIC", "Cyclic", ""}, - {IPO_CYCLX, "CYCLIC_EXTRAPOLATION", "Cyclic Extrapolation", ""}, + {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", "Constant Extrapolation", ""}, + {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", "Linear Extrapolation", ""}, {0, NULL, NULL, NULL} }; @@ -854,14 +859,14 @@ static void setexpo_action_keys(bAnimContext *ac, short mode) int filter; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); - /* loop through setting mode per ipo-curve - * Note: setting is on IPO-curve level not keyframe, so no need for Keyframe-Editing API - */ - for (ale= anim_data.first; ale; ale= ale->next) - setexprap_ipoloop(ale->key_data, mode); + /* loop through setting mode per F-Curve */ + for (ale= anim_data.first; ale; ale= ale->next) { + FCurve *fcu= (FCurve *)ale->data; + fcu->extend= mode; + } /* cleanup */ BLI_freelistN(&anim_data); @@ -917,9 +922,9 @@ void ACT_OT_keyframes_expotype (wmOperatorType *ot) /* defines for set ipo-type for selected keyframes tool */ EnumPropertyItem prop_actkeys_ipo_types[] = { - {IPO_CONST, "CONSTANT", "Constant Interpolation", ""}, - {IPO_LIN, "LINEAR", "Linear Interpolation", ""}, - {IPO_BEZ, "BEZIER", "Bezier Interpolation", ""}, + {BEZT_IPO_CONST, "CONSTANT", "Constant Interpolation", ""}, + {BEZT_IPO_LIN, "LINEAR", "Linear Interpolation", ""}, + {BEZT_IPO_BEZ, "BEZIER", "Bezier Interpolation", ""}, {0, NULL, NULL, NULL} }; @@ -932,14 +937,14 @@ static void setipo_action_keys(bAnimContext *ac, short mode) BeztEditFunc set_cb= ANIM_editkeyframes_ipo(mode); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* loop through setting BezTriple interpolation * Note: we do not supply BeztEditData to the looper yet. Currently that's not necessary here... */ for (ale= anim_data.first; ale; ale= ale->next) - ANIM_ipo_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, ANIM_editkeyframes_ipocurve_ipotype); + ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); /* cleanup */ BLI_freelistN(&anim_data); @@ -1012,7 +1017,7 @@ static void sethandles_action_keys(bAnimContext *ac, short mode) BeztEditFunc set_cb= ANIM_editkeyframes_handles(mode); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* loop through setting flags for handles @@ -1025,17 +1030,17 @@ static void sethandles_action_keys(bAnimContext *ac, short mode) /* check which type of handle to set (free or aligned) * - check here checks for handles with free alignment already */ - if (ANIM_ipo_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, NULL)) + if (ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, NULL)) toggle_cb= ANIM_editkeyframes_handles(HD_FREE); else toggle_cb= ANIM_editkeyframes_handles(HD_ALIGN); /* set handle-type */ - ANIM_ipo_keys_bezier_loop(NULL, ale->key_data, NULL, toggle_cb, calchandles_fcurve); + ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, toggle_cb, calchandles_fcurve); } else { /* directly set handle-type */ - ANIM_ipo_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); + ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); } } @@ -1127,11 +1132,11 @@ static int actkeys_cfrasnap_exec(bContext *C, wmOperator *op) memset(&bed, 0, sizeof(BeztEditData)); /* loop over action data, averaging values */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac.data, ac.datatype); for (ale= anim_data.first; ale; ale= ale->next) - ANIM_ipo_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); BLI_freelistN(&anim_data); @@ -1186,7 +1191,7 @@ static void snap_action_keys(bAnimContext *ac, short mode) if (ac->datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_ONLYFCU); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* get beztriple editing callbacks */ @@ -1200,14 +1205,14 @@ static void snap_action_keys(bAnimContext *ac, short mode) Object *nob= ANIM_nla_mapping_get(ac, ale); if (nob) { - ANIM_nla_mapping_apply_ipocurve(nob, ale->key_data, 0, 1); - ANIM_icu_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); - ANIM_nla_mapping_apply_ipocurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); } //else if (ale->type == ACTTYPE_GPLAYER) // snap_gplayer_frames(ale->data, mode); else - ANIM_icu_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); } BLI_freelistN(&anim_data); } @@ -1307,7 +1312,7 @@ static void mirror_action_keys(bAnimContext *ac, short mode) if (ac->datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_ONLYFCU); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* mirror keyframes */ @@ -1315,14 +1320,14 @@ static void mirror_action_keys(bAnimContext *ac, short mode) Object *nob= ANIM_nla_mapping_get(ac, ale); if (nob) { - ANIM_nla_mapping_apply_ipocurve(nob, ale->key_data, 0, 1); - ANIM_icu_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); - ANIM_nla_mapping_apply_ipocurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); } //else if (ale->type == ACTTYPE_GPLAYER) // snap_gplayer_frames(ale->data, mode); else - ANIM_icu_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); } BLI_freelistN(&anim_data); } diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index 2695f77e902..30449ed0c30 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -1640,21 +1640,14 @@ void action_header_buttons(const bContext *C, ARegion *ar) xco += 5; uiBlockBeginAlign(block); - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOOBJ, B_REDR, ICON_OBJECT, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Non-Armature Objects"); - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOARM, B_REDR, ICON_ARMATURE, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Armature Objects"); + //uiDefIconButBitI(block, TOGN, ADS_FILTER_NOOBJ, B_REDR, ICON_OBJECT, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Non-Armature Objects"); + //uiDefIconButBitI(block, TOGN, ADS_FILTER_NOARM, B_REDR, ICON_ARMATURE, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Armature Objects"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSHAPEKEYS, B_REDR, ICON_EDIT, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display ShapeKeys"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMAT, B_REDR, ICON_MATERIAL, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Materials"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Lamps"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Cameras"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Curves"); uiBlockEndAlign(block); - xco += 5; - - uiBlockBeginAlign(block); - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOIPOS, B_REDR, ICON_IPO, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Object IPO's"); - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOACTS, B_REDR, ICON_ACTION, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Actions"); - uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCONSTRAINTS, B_REDR, ICON_CONSTRAINT, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Object Constraints"); - uiBlockEndAlign(block); xco += 30; } else if (saction->mode == SACTCONT_ACTION) { // not too appropriate for shapekeys atm... diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 58574df7788..c4e2d0b972a 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -88,7 +88,8 @@ * keyframe to where the mouse clicked, */ // XXX port this to new listview code... -static void *get_nearest_action_key (bAnimContext *ac, int mval[2], float *selx, short *sel, short *ret_type, bActionChannel **par) +// XXX just merge this into the existing code! +static void *get_nearest_action_key (bAnimContext *ac, int mval[2], float *selx, short *sel, short *ret_type, bActionGroup **par) { ListBase anim_data = {NULL, NULL}; ListBase anim_keys = {NULL, NULL}; @@ -100,134 +101,127 @@ static void *get_nearest_action_key (bAnimContext *ac, int mval[2], float *selx, rctf rectf; void *data = NULL; float xmin, xmax, x, y; - int clickmin, clickmax; + int channel_index; short found = 0; - /* action-channel */ + /* action-group */ *par= NULL; + UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); - clickmin = (int) ((-y) / (ACHANNEL_STEP)); - clickmax = clickmin; + UI_view2d_listview_view_to_cell(v2d, 0, ACHANNEL_STEP, 0, (float)ACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index); /* x-range to check is +/- 7 on either side of mouse click (size of keyframe icon) */ UI_view2d_region_to_view(v2d, mval[0]-7, mval[1], &rectf.xmin, &rectf.ymin); UI_view2d_region_to_view(v2d, mval[0]+7, mval[1], &rectf.xmax, &rectf.ymax); - if (clickmax < 0) { - *ret_type= ANIMTYPE_NONE; - return NULL; - } - /* filter data */ - filter= (ANIMFILTER_FORDRAWING | ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); - for (ale= anim_data.first; ale; ale= ale->next) { - if (clickmax < 0) - break; - if (clickmin <= 0) { - /* found match - must return here... */ - Object *nob= ANIM_nla_mapping_get(ac, ale); - ActKeysInc *aki= init_aki_data(ac, ale); - - /* apply NLA-scaling correction? */ - if (nob) { - xmin= get_action_frame(nob, rectf.xmin); - xmax= get_action_frame(nob, rectf.xmax); - } - else { - xmin= rectf.xmin; - xmax= rectf.xmax; - } - - /* make list of keyframes */ - if (ale->key_data) { - switch (ale->datatype) { - case ALE_OB: - { - Object *ob= (Object *)ale->key_data; - ob_to_keylist(ob, &anim_keys, NULL, aki); - } - break; - case ALE_ACT: - { - bAction *act= (bAction *)ale->key_data; - action_to_keylist(act, &anim_keys, NULL, aki); - } - break; - case ALE_IPO: - { - Ipo *ipo= (Ipo *)ale->key_data; - ipo_to_keylist(ipo, &anim_keys, NULL, aki); - } - break; - case ALE_ICU: - { - IpoCurve *icu= (IpoCurve *)ale->key_data; - icu_to_keylist(icu, &anim_keys, NULL, aki); - } - break; + /* get channel */ + ale= BLI_findlink(&anim_data, channel_index); + if (ale == NULL) { + /* channel not found */ + printf("Error: animation channel (index = %d) not found in mouse_action_keys() \n", channel_index); + + BLI_freelistN(&anim_data); + return NULL; + } + + { + /* found match - must return here... */ + Object *nob= ANIM_nla_mapping_get(ac, ale); + ActKeysInc *aki= init_aki_data(ac, ale); + + /* apply NLA-scaling correction? */ + if (nob) { + xmin= get_action_frame(nob, rectf.xmin); + xmax= get_action_frame(nob, rectf.xmax); + } + else { + xmin= rectf.xmin; + xmax= rectf.xmax; + } + + /* make list of keyframes */ + if (ale->key_data) { + switch (ale->datatype) { + case ALE_OB: + { + Object *ob= (Object *)ale->key_data; + ob_to_keylist(ob, &anim_keys, NULL, aki); } - } - else if (ale->type == ANIMTYPE_GROUP) { - bActionGroup *agrp= (bActionGroup *)ale->data; - agroup_to_keylist(agrp, &anim_keys, NULL, aki); - } - else if (ale->type == ANIMTYPE_GPDATABLOCK) { - /* cleanup */ - BLI_freelistN(&anim_data); - - /* this channel currently doens't have any keyframes... must ignore! */ - *ret_type= ANIMTYPE_NONE; - return NULL; - } - else if (ale->type == ANIMTYPE_GPLAYER) { - bGPDlayer *gpl= (bGPDlayer *)ale->data; - gpl_to_keylist(gpl, &anim_keys, NULL, aki); - } - - /* loop through keyframes, finding one that was clicked on */ - for (ak= anim_keys.first; ak; ak= ak->next) { - if (IN_RANGE(ak->cfra, xmin, xmax)) { - *selx= ak->cfra; - found= 1; break; + case ALE_ACT: + { + bAction *act= (bAction *)ale->key_data; + action_to_keylist(act, &anim_keys, NULL, aki); } + break; + case ALE_FCURVE: + { + FCurve *fcu= (FCurve *)ale->key_data; + fcurve_to_keylist(fcu, &anim_keys, NULL, aki); + } + break; } - /* no matching keyframe found - set to mean frame value so it doesn't actually select anything */ - if (found == 0) - *selx= ((xmax+xmin) / 2); - - /* figure out what to return */ - if (ac->datatype == ANIMCONT_ACTION) { - *par= ale->owner; /* assume that this is an action channel */ - *ret_type= ale->type; - data = ale->data; - } - else if (ac->datatype == ANIMCONT_SHAPEKEY) { - data = ale->key_data; - *ret_type= ANIMTYPE_ICU; - } - else if (ac->datatype == ANIMCONT_DOPESHEET) { - data = ale->data; - *ret_type= ale->type; - } - else if (ac->datatype == ANIMCONT_GPENCIL) { - data = ale->data; - *ret_type= ANIMTYPE_GPLAYER; - } - - /* cleanup tempolary lists */ - BLI_freelistN(&anim_keys); - anim_keys.first = anim_keys.last = NULL; - + } + else if (ale->type == ANIMTYPE_GROUP) { + bActionGroup *agrp= (bActionGroup *)ale->data; + agroup_to_keylist(agrp, &anim_keys, NULL, aki); + } + else if (ale->type == ANIMTYPE_GPDATABLOCK) { + /* cleanup */ BLI_freelistN(&anim_data); - return data; + /* this channel currently doens't have any keyframes... must ignore! */ + *ret_type= ANIMTYPE_NONE; + return NULL; + } + else if (ale->type == ANIMTYPE_GPLAYER) { + bGPDlayer *gpl= (bGPDlayer *)ale->data; + gpl_to_keylist(gpl, &anim_keys, NULL, aki); + } + + /* loop through keyframes, finding one that was clicked on */ + for (ak= anim_keys.first; ak; ak= ak->next) { + if (IN_RANGE(ak->cfra, xmin, xmax)) { + *selx= ak->cfra; + found= 1; + break; + } + } + /* no matching keyframe found - set to mean frame value so it doesn't actually select anything */ + if (found == 0) + *selx= ((xmax+xmin) / 2); + + /* figure out what to return */ + if (ac->datatype == ANIMCONT_ACTION) { + *par= ale->owner; /* assume that this is an action channel */ + *ret_type= ale->type; + data = ale->data; + } + else if (ac->datatype == ANIMCONT_SHAPEKEY) { + data = ale->key_data; + *ret_type= ANIMTYPE_FCURVE; + } + else if (ac->datatype == ANIMCONT_DOPESHEET) { + data = ale->data; + *ret_type= ale->type; } - --clickmin; - --clickmax; + else if (ac->datatype == ANIMCONT_GPENCIL) { + data = ale->data; + *ret_type= ANIMTYPE_GPLAYER; + } + + /* cleanup tempolary lists */ + BLI_freelistN(&anim_keys); + anim_keys.first = anim_keys.last = NULL; + + BLI_freelistN(&anim_data); + + return data; } /* cleanup */ @@ -262,15 +256,22 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel) bAnimListElem *ale; int filter; + BeztEditData bed; + BeztEditFunc test_cb, sel_cb; + /* determine type-based settings */ if (ac->datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); /* filter data */ ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); + /* init BezTriple looping data */ + memset(&bed, 0, sizeof(BeztEditData)); + test_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); + /* See if we should be selecting or deselecting */ if (test) { for (ale= anim_data.first; ale; ale= ale->next) { @@ -281,20 +282,23 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel) //} } else { - if (is_ipo_key_selected(ale->key_data)) { - sel= 0; + if (ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, test_cb, NULL)) { + sel= SELECT_SUBTRACT; break; } } } } - + + /* convert sel to selectmode, and use that to get editor */ + sel_cb= ANIM_editkeyframes_select(sel); + /* Now set the flags */ for (ale= anim_data.first; ale; ale= ale->next) { //if (ale->type == ACTTYPE_GPLAYER) // set_gplayer_frame_selection(ale->data, sel); //else - set_ipo_key_selection(ale->key_data, sel); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, sel_cb, NULL); } /* Cleanup */ @@ -313,9 +317,9 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op) /* 'standard' behaviour - check if selected, then apply relevant selection */ if (RNA_boolean_get(op->ptr, "invert")) - deselect_action_keys(&ac, 0, 2); + deselect_action_keys(&ac, 0, SELECT_INVERT); else - deselect_action_keys(&ac, 1, 1); + deselect_action_keys(&ac, 1, SELECT_ADD); /* set notifier tha things have changed */ ED_area_tag_redraw(CTX_wm_area(C)); // FIXME... should be updating 'keyframes' data context or so instead! @@ -413,22 +417,15 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short { /* loop over data selecting */ if (ale->key_data) { - if (ale->datatype == ALE_IPO) - ANIM_ipo_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); - else if (ale->datatype == ALE_ICU) - ANIM_icu_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + if (ale->datatype == ALE_FCURVE) + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); } else if (ale->type == ANIMTYPE_GROUP) { bActionGroup *agrp= ale->data; - bActionChannel *achan; - bConstraintChannel *conchan; + FCurve *fcu; - for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) { - ANIM_ipo_keys_bezier_loop(&bed, achan->ipo, ok_cb, select_cb, NULL); - - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) - ANIM_ipo_keys_bezier_loop(&bed, conchan->ipo, ok_cb, select_cb, NULL); - } + for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next) + ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL); } //else if (ale->type == ANIMTYPE_GPLAYER) { // borderselect_gplayer_frames(ale->data, rectf.xmin, rectf.xmax, selectmode); @@ -561,7 +558,7 @@ static void markers_selectkeys_between (bAnimContext *ac) bed.f2= max; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* select keys in-between */ @@ -569,12 +566,12 @@ static void markers_selectkeys_between (bAnimContext *ac) Object *nob= ANIM_nla_mapping_get(ac, ale); if (nob) { - ANIM_nla_mapping_apply_ipo(nob, ale->key_data, 0, 1); - ANIM_ipo_keys_bezier_loop(&bed, ale->key_data, NULL, select_cb, NULL); - ANIM_nla_mapping_apply_ipo(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, select_cb, NULL); + ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); } else { - ANIM_ipo_keys_bezier_loop(&bed, ale->key_data, NULL, select_cb, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, select_cb, NULL); } } @@ -624,11 +621,11 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) // gplayer_make_cfra_list(ale->data, &elems, 1); } else { - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) - ANIM_ipo_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_to_cfraelem, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_to_cfraelem, NULL); } BLI_freelistN(&anim_data); break; @@ -661,7 +658,7 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) if (ac->datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ONLYFCU); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -678,7 +675,7 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) bed.f1= ce->cfra; /* select elements with frame number matching cfraelem */ - ANIM_icu_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); #if 0 // XXX reenable when Grease Pencil stuff is back if (ale->type == ANIMTYPE_GPLAYER) { @@ -770,10 +767,7 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode) bDopeSheet *ads= NULL; bAction *act= NULL; bActionGroup *agrp= NULL; - bActionChannel *achan= NULL; - bConstraintChannel *conchan= NULL; - Ipo *ipo= NULL; - IpoCurve *icu= NULL; + FCurve *fcu= NULL; bGPdata *gpd = NULL; bGPDlayer *gpl = NULL; @@ -792,23 +786,18 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode) gpd= (bGPdata *)ac->data; /* get channel and selection info */ - anim_channel= get_nearest_action_key(ac, mval, &selx, &sel, &chan_type, &achan); + anim_channel= get_nearest_action_key(ac, mval, &selx, &sel, &chan_type, &agrp); // xxx... if (anim_channel == NULL) return; switch (chan_type) { - case ANIMTYPE_ICU: - icu= (IpoCurve *)anim_channel; - break; - case ANIMTYPE_CONCHAN: - conchan= (bConstraintChannel *)anim_channel; - break; - case ANIMTYPE_ACHAN: - achan= (bActionChannel *)anim_channel; + case ANIMTYPE_FCURVE: + fcu= (FCurve *)anim_channel; break; case ANIMTYPE_GROUP: agrp= (bActionGroup *)anim_channel; break; +#if 0 // XXX fixme case ANIMTYPE_DSMAT: ipo= ((Material *)anim_channel)->ipo; break; @@ -824,12 +813,10 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode) case ANIMTYPE_DSSKEY: ipo= ((Key *)anim_channel)->ipo; break; +#endif // XXX fixme case ANIMTYPE_FILLACTD: act= (bAction *)anim_channel; break; - case ANIMTYPE_FILLIPOD: - ipo= ((Object *)anim_channel)->ipo; - break; case ANIMTYPE_OBJECT: ob= ((Base *)anim_channel)->object; break; @@ -844,17 +831,13 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode) if (selectmode == SELECT_REPLACE) { selectmode = SELECT_ADD; - deselect_action_keys(ac, 0, 0); + deselect_action_keys(ac, 0, SELECT_SUBTRACT); if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)) { ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); - /* Highlight either an Action-Channel or Action-Group */ - if (achan) { - achan->flag |= ACHAN_SELECTED; - ANIM_action_set_active_channel(ac->data, ac->datatype, achan, ANIMTYPE_ACHAN); - } - else if (agrp) { + /* Highlight Action-Group? */ + if (agrp) { agrp->flag |= AGRP_SELECTED; ANIM_action_set_active_channel(ac->data, ac->datatype, agrp, ANIMTYPE_GROUP); } @@ -875,56 +858,33 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short selectmode) bed.f1= selx; /* apply selection to keyframes */ - if (icu) - ANIM_icu_keys_bezier_loop(&bed, icu, ok_cb, select_cb, NULL); - else if (ipo) - ANIM_ipo_keys_bezier_loop(&bed, ipo, ok_cb, select_cb, NULL); - else if (conchan) - ANIM_ipo_keys_bezier_loop(&bed, conchan->ipo, ok_cb, select_cb, NULL); - else if (achan) - ANIM_ipo_keys_bezier_loop(&bed, achan->ipo, ok_cb, select_cb, NULL); + // XXX use more generic code looper for this stuff... + if (fcu) + ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL); else if (agrp) { - for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) { - ANIM_ipo_keys_bezier_loop(&bed, achan->ipo, ok_cb, select_cb, NULL); - - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) - ANIM_ipo_keys_bezier_loop(&bed, conchan->ipo, ok_cb, select_cb, NULL); - } + for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next) + ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, select_cb, NULL); } else if (act) { - for (achan= act->chanbase.first; achan; achan= achan->next) { - ANIM_ipo_keys_bezier_loop(&bed, achan->ipo, ok_cb, select_cb, NULL); - - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) - ANIM_ipo_keys_bezier_loop(&bed, conchan->ipo, ok_cb, select_cb, NULL); - } + for (fcu= act->curves.first; fcu; fcu= fcu->next) + ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, select_cb, NULL); } else if (ob) { - if (ob->ipo) { - bed.f1= selx; - ANIM_ipo_keys_bezier_loop(&bed, ob->ipo, ok_cb, select_cb, NULL); - } + AnimData *adt; - if (ob->action) { - selxa= get_action_frame(ob, selx); - bed.f1= selxa; + /* Object's own animation */ + if (ob->adt && ob->adt->action) { + adt= ob->adt; - for (achan= ob->action->chanbase.first; achan; achan= achan->next) { - ANIM_ipo_keys_bezier_loop(&bed, achan->ipo, ok_cb, select_cb, NULL); - - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) - ANIM_ipo_keys_bezier_loop(&bed, conchan->ipo, ok_cb, select_cb, NULL); - } - } - - if (ob->constraintChannels.first) { - bed.f1= selx; + selxa= get_action_frame(ob, selx); // xxx + bed.f1= selxa; - for (conchan=ob->constraintChannels.first; conchan; conchan=conchan->next) - ANIM_ipo_keys_bezier_loop(&bed, conchan->ipo, ok_cb, select_cb, NULL); + for (fcu= act->curves.first; fcu; fcu= fcu->next) + ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, select_cb, NULL); } - // FIXME: add data ipos too... + /* 'Sub-Object' animation data */ + // TODO... } //else if (gpl) // select_gpencil_frame(gpl, (int)selx, selectmode); @@ -944,7 +904,7 @@ static void selectkeys_leftright (bAnimContext *ac, short leftright, short selec /* if select mode is replace, deselect all keyframes first */ if (select_mode==SELECT_REPLACE) { select_mode=SELECT_ADD; - deselect_action_keys(ac, 0, 0); + deselect_action_keys(ac, 0, SELECT_SUBTRACT); } /* set callbacks and editing data */ @@ -965,7 +925,7 @@ static void selectkeys_leftright (bAnimContext *ac, short leftright, short selec if (ac->datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_IPOKEYS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); /* select keys on the side where most data occurs */ @@ -973,14 +933,14 @@ static void selectkeys_leftright (bAnimContext *ac, short leftright, short selec Object *nob= ANIM_nla_mapping_get(ac, ale); if (nob) { - ANIM_nla_mapping_apply_ipo(nob, ale->key_data, 0, 1); - ANIM_ipo_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); - ANIM_nla_mapping_apply_ipo(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); } //else if (ale->type == ANIMTYPE_GPLAYER) // borderselect_gplayer_frames(ale->data, min, max, SELECT_ADD); else - ANIM_ipo_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); } /* Cleanup */ @@ -1010,7 +970,7 @@ static void mouse_columnselect_action_keys (bAnimContext *ac, float selx) if (ac->datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE); else - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ONLYFCU); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -1023,7 +983,7 @@ static void mouse_columnselect_action_keys (bAnimContext *ac, float selx) bed.f1= selx; /* select elements with frame number matching cfraelem */ - ANIM_icu_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); #if 0 // XXX reenable when Grease Pencil stuff is back if (ale->type == ANIMTYPE_GPLAYER) { |