diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-04-02 16:02:39 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-04-02 16:02:39 +0400 |
commit | 341843bc54119e5bc9563a02f332ce228da161bc (patch) | |
tree | 7fa13010f2abd0091b1551bb78ae9b72e54e9fa9 /source/blender | |
parent | fb4b16b799ca514a9cc30d19f8e2274bf912246d (diff) |
Batch renaming some keyframe editing internals in preparation for more generic keyframe editing API, allowing more niceties...
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 44 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_edit.c | 272 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 2 | ||||
-rw-r--r-- | source/blender/editors/armature/poselib.c | 12 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframes_edit.h | 42 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 64 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 122 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 64 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 126 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 14 |
10 files changed, 381 insertions, 381 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 8ac64a78d18..62f421de71c 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -307,11 +307,11 @@ AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale) /* ------------------- */ /* helper function for ANIM_nla_mapping_apply_fcurve() -> "restore", i.e. mapping points back to action-time */ -static short bezt_nlamapping_restore(BeztEditData *bed, BezTriple *bezt) +static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt) { /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */ - AnimData *adt= (AnimData *)bed->data; - short only_keys= (short)bed->i1; + AnimData *adt= (AnimData *)ked->data; + short only_keys= (short)ked->i1; /* adjust BezTriple handles only if allowed to */ if (only_keys == 0) { @@ -325,11 +325,11 @@ static short bezt_nlamapping_restore(BeztEditData *bed, BezTriple *bezt) } /* helper function for ANIM_nla_mapping_apply_fcurve() -> "apply", i.e. mapping points to NLA-mapped global time */ -static short bezt_nlamapping_apply(BeztEditData *bed, BezTriple *bezt) +static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt) { /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */ - AnimData *adt= (AnimData*)bed->data; - short only_keys= (short)bed->i1; + AnimData *adt= (AnimData*)ked->data; + short only_keys= (short)ked->i1; /* adjust BezTriple handles only if allowed to */ if (only_keys == 0) { @@ -349,16 +349,16 @@ static short bezt_nlamapping_apply(BeztEditData *bed, BezTriple *bezt) */ void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, short only_keys) { - BeztEditData bed; - BeztEditFunc map_cb; + KeyframeEditData ked; + KeyframeEditFunc map_cb; /* init edit data * - AnimData is stored in 'data' * - only_keys is stored in 'i1' */ - memset(&bed, 0, sizeof(BeztEditData)); - bed.data= (void *)adt; - bed.i1= (int)only_keys; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.data= (void *)adt; + ked.i1= (int)only_keys; /* get editing callback */ if (restore) @@ -367,7 +367,7 @@ void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, s map_cb= bezt_nlamapping_apply; /* apply to F-Curve */ - ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, map_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, map_cb, NULL); } /* *************************************************** */ @@ -409,12 +409,12 @@ float ANIM_unit_mapping_get_factor (Scene *scene, ID *id, FCurve *fcu, short res /* ----------------------- */ /* helper function for ANIM_unit_mapping_apply_fcurve -> mapping callback for unit mapping */ -static short bezt_unit_mapping_apply (BeztEditData *bed, BezTriple *bezt) +static short bezt_unit_mapping_apply (KeyframeEditData *ked, BezTriple *bezt) { /* mapping factor is stored in f1, flags are stored in i1 */ - short only_keys= (bed->i1 & ANIM_UNITCONV_ONLYKEYS); - short sel_vs= (bed->i1 & ANIM_UNITCONV_SELVERTS); - float fac= bed->f1; + short only_keys= (ked->i1 & ANIM_UNITCONV_ONLYKEYS); + short sel_vs= (ked->i1 & ANIM_UNITCONV_SELVERTS); + float fac= ked->f1; /* adjust BezTriple handles only if allowed to */ if (only_keys == 0) { @@ -433,8 +433,8 @@ static short bezt_unit_mapping_apply (BeztEditData *bed, BezTriple *bezt) /* Apply/Unapply units conversions to keyframes */ void ANIM_unit_mapping_apply_fcurve (Scene *scene, ID *id, FCurve *fcu, short flag) { - BeztEditData bed; - BeztEditFunc sel_cb; + KeyframeEditData ked; + KeyframeEditFunc sel_cb; float fac; /* calculate mapping factor, and abort if nothing to change */ @@ -446,9 +446,9 @@ void ANIM_unit_mapping_apply_fcurve (Scene *scene, ID *id, FCurve *fcu, short fl * - mapping factor is stored in f1 * - flags are stored in 'i1' */ - memset(&bed, 0, sizeof(BeztEditData)); - bed.f1= (float)fac; - bed.i1= (int)flag; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.f1= (float)fac; + ked.i1= (int)flag; /* only selected? */ if (flag & ANIM_UNITCONV_ONLYSEL) @@ -457,7 +457,7 @@ void ANIM_unit_mapping_apply_fcurve (Scene *scene, ID *id, FCurve *fcu, short fl sel_cb= NULL; /* apply to F-Curve */ - ANIM_fcurve_keys_bezier_loop(&bed, fcu, sel_cb, bezt_unit_mapping_apply, NULL); + ANIM_fcurve_keyframes_loop(&ked, fcu, sel_cb, bezt_unit_mapping_apply, NULL); // FIXME: loop here for samples should be generalised // TODO: only sel? diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index ee3018ce150..629161defee 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -61,7 +61,7 @@ /* This file defines an API and set of callback-operators for non-destructive editing of keyframe data. * * Two API functions are defined for actually performing the operations on the data: - * ANIM_fcurve_keys_bezier_loop() + * ANIM_fcurve_keyframes_loop() * which take the data they operate on, a few callbacks defining what operations to perform. * * As operators which work on keyframes usually apply the same operation on all BezTriples in @@ -84,56 +84,56 @@ /* This function is used to loop over BezTriples in the given F-Curve, applying a given * operation on them, and optionally applies an F-Curve validation function afterwards. */ -short ANIM_fcurve_keys_bezier_loop(BeztEditData *bed, FCurve *fcu, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb) +short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb) { - BezTriple *bezt; - int i; - + BezTriple *bezt; + int i; + /* sanity check */ if (ELEM(NULL, fcu, fcu->bezt)) return 0; - + /* set the F-Curve into the editdata so that it can be accessed */ - if (bed) { - bed->fcu= fcu; - bed->curIndex= 0; - } - + if (ked) { + ked->fcu= fcu; + ked->curIndex= 0; + } + /* if function to apply to bezier curves is set, then loop through executing it on beztriples */ - if (bezt_cb) { + if (bezt_cb) { /* if there's a validation func, include that check in the loop * (this is should be more efficient than checking for it in every loop) */ if (bezt_ok) { for (bezt=fcu->bezt, i=0; i < fcu->totvert; bezt++, i++) { - if (bed) bed->curIndex= i; + if (ked) ked->curIndex= i; /* Only operate on this BezTriple if it fullfills the criteria of the validation func */ - if (bezt_ok(bed, bezt)) { + if (bezt_ok(ked, bezt)) { /* Exit with return-code '1' if function returns positive * This is useful if finding if some BezTriple satisfies a condition. */ - if (bezt_cb(bed, bezt)) return 1; + if (bezt_cb(ked, bezt)) return 1; } } } else { for (bezt=fcu->bezt, i=0; i < fcu->totvert; bezt++, i++) { - if (bed) bed->curIndex= i; + if (ked) ked->curIndex= i; /* Exit with return-code '1' if function returns positive - * This is useful if finding if some BezTriple satisfies a condition. - */ - if (bezt_cb(bed, bezt)) return 1; + * This is useful if finding if some BezTriple satisfies a condition. + */ + if (bezt_cb(ked, bezt)) return 1; } } - } + } /* unset the F-Curve from the editdata now that it's done */ - if (bed) { - bed->fcu= NULL; - bed->curIndex= 0; - } + if (ked) { + ked->fcu= NULL; + ked->curIndex= 0; + } /* if fcu_cb (F-Curve post-editing callback) has been specified then execute it */ if (fcu_cb) @@ -146,7 +146,7 @@ short ANIM_fcurve_keys_bezier_loop(BeztEditData *bed, FCurve *fcu, BeztEditFunc /* -------------------------------- Further Abstracted (Not Exposed Directly) ----------------------------- */ /* This function is used to loop over the keyframe data in an Action Group */ -static short agrp_keys_bezier_loop(BeztEditData *bed, bActionGroup *agrp, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb) +static short agrp_keyframes_loop(KeyframeEditData *ked, bActionGroup *agrp, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb) { FCurve *fcu; @@ -156,7 +156,7 @@ static short agrp_keys_bezier_loop(BeztEditData *bed, bActionGroup *agrp, BeztEd /* only iterate over the F-Curves that are in this group */ for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next) { - if (ANIM_fcurve_keys_bezier_loop(bed, fcu, bezt_ok, bezt_cb, fcu_cb)) + if (ANIM_fcurve_keyframes_loop(ked, fcu, bezt_ok, bezt_cb, fcu_cb)) return 1; } @@ -164,7 +164,7 @@ static short agrp_keys_bezier_loop(BeztEditData *bed, bActionGroup *agrp, BeztEd } /* This function is used to loop over the keyframe data in an Action */ -static short act_keys_bezier_loop(BeztEditData *bed, bAction *act, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb) +static short act_keyframes_loop(KeyframeEditData *ked, bAction *act, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb) { FCurve *fcu; @@ -174,7 +174,7 @@ static short act_keys_bezier_loop(BeztEditData *bed, bAction *act, BeztEditFunc /* just loop through all F-Curves */ for (fcu= act->curves.first; fcu; fcu= fcu->next) { - if (ANIM_fcurve_keys_bezier_loop(bed, fcu, bezt_ok, bezt_cb, fcu_cb)) + if (ANIM_fcurve_keyframes_loop(ked, fcu, bezt_ok, bezt_cb, fcu_cb)) return 1; } @@ -182,7 +182,7 @@ static short act_keys_bezier_loop(BeztEditData *bed, bAction *act, BeztEditFunc } /* This function is used to loop over the keyframe data of an AnimData block */ -static short adt_keys_bezier_loop(BeztEditData *bed, AnimData *adt, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) +static short adt_keyframes_loop(KeyframeEditData *ked, AnimData *adt, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) { /* sanity check */ if (adt == NULL) @@ -194,13 +194,13 @@ static short adt_keys_bezier_loop(BeztEditData *bed, AnimData *adt, BeztEditFunc /* just loop through all F-Curves acting as Drivers */ for (fcu= adt->drivers.first; fcu; fcu= fcu->next) { - if (ANIM_fcurve_keys_bezier_loop(bed, fcu, bezt_ok, bezt_cb, fcu_cb)) + if (ANIM_fcurve_keyframes_loop(ked, fcu, bezt_ok, bezt_cb, fcu_cb)) return 1; } } else if (adt->action) { /* call the function for actions */ - if (act_keys_bezier_loop(bed, adt->action, bezt_ok, bezt_cb, fcu_cb)) + if (act_keyframes_loop(ked, adt->action, bezt_ok, bezt_cb, fcu_cb)) return 1; } @@ -208,7 +208,7 @@ static short adt_keys_bezier_loop(BeztEditData *bed, AnimData *adt, BeztEditFunc } /* This function is used to loop over the keyframe data in an Object */ -static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) +static short ob_keyframes_loop(KeyframeEditData *ked, Object *ob, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) { Key *key= ob_get_key(ob); @@ -218,13 +218,13 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez /* firstly, Object's own AnimData */ if (ob->adt) { - if (adt_keys_bezier_loop(bed, ob->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, ob->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } /* shapekeys */ if ((key && key->adt) && !(filterflag & ADS_FILTER_NOSHAPEKEYS)) { - if (adt_keys_bezier_loop(bed, key->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, key->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } @@ -240,7 +240,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez continue; /* add material's data */ - if (adt_keys_bezier_loop(bed, ma->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, ma->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } } @@ -252,7 +252,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez Camera *ca= (Camera *)ob->data; if ((ca->adt) && !(filterflag & ADS_FILTER_NOCAM)) { - if (adt_keys_bezier_loop(bed, ca->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, ca->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } } @@ -262,7 +262,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez Lamp *la= (Lamp *)ob->data; if ((la->adt) && !(filterflag & ADS_FILTER_NOLAM)) { - if (adt_keys_bezier_loop(bed, la->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, la->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } } @@ -274,7 +274,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez Curve *cu= (Curve *)ob->data; if ((cu->adt) && !(filterflag & ADS_FILTER_NOCUR)) { - if (adt_keys_bezier_loop(bed, cu->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, cu->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } } @@ -284,7 +284,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez MetaBall *mb= (MetaBall *)ob->data; if ((mb->adt) && !(filterflag & ADS_FILTER_NOMBA)) { - if (adt_keys_bezier_loop(bed, mb->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, mb->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } } @@ -294,7 +294,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez bArmature *arm= (bArmature *)ob->data; if ((arm->adt) && !(filterflag & ADS_FILTER_NOARM)) { - if (adt_keys_bezier_loop(bed, arm->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, arm->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } } @@ -304,7 +304,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez Mesh *me= (Mesh *)ob->data; if ((me->adt) && !(filterflag & ADS_FILTER_NOMESH)) { - if (adt_keys_bezier_loop(bed, me->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, me->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } } @@ -319,7 +319,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez if (ELEM(NULL, psys->part, psys->part->adt)) continue; - if (adt_keys_bezier_loop(bed, psys->part->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, psys->part->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } } @@ -328,7 +328,7 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez } /* This function is used to loop over the keyframe data in a Scene */ -static short scene_keys_bezier_loop(BeztEditData *bed, Scene *sce, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) +static short scene_keyframes_loop(KeyframeEditData *ked, Scene *sce, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) { World *wo= (sce) ? sce->world : NULL; bNodeTree *ntree= (sce) ? sce->nodetree : NULL; @@ -339,19 +339,19 @@ static short scene_keys_bezier_loop(BeztEditData *bed, Scene *sce, BeztEditFunc /* Scene's own animation */ if (sce->adt) { - if (adt_keys_bezier_loop(bed, sce->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, sce->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } /* World */ if (wo && wo->adt) { - if (adt_keys_bezier_loop(bed, wo->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, wo->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } /* NodeTree */ if (ntree && ntree->adt) { - if (adt_keys_bezier_loop(bed, ntree->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) + if (adt_keyframes_loop(ked, ntree->adt, bezt_ok, bezt_cb, fcu_cb, filterflag)) return 1; } @@ -360,7 +360,7 @@ static short scene_keys_bezier_loop(BeztEditData *bed, Scene *sce, BeztEditFunc } /* This function is used to loop over the keyframe data in a DopeSheet summary */ -static short summary_keys_bezier_loop(BeztEditData *bed, bAnimContext *ac, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) +static short summary_keyframes_loop(KeyframeEditData *ked, bAnimContext *ac, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; @@ -376,7 +376,7 @@ static short summary_keys_bezier_loop(BeztEditData *bed, bAnimContext *ac, BeztE /* loop through each F-Curve, working on the keyframes until the first curve aborts */ for (ale= anim_data.first; ale; ale= ale->next) { - ret_code= ANIM_fcurve_keys_bezier_loop(bed, ale->data, bezt_ok, bezt_cb, fcu_cb); + ret_code= ANIM_fcurve_keyframes_loop(ked, ale->data, bezt_ok, bezt_cb, fcu_cb); if (ret_code) break; @@ -390,7 +390,7 @@ static short summary_keys_bezier_loop(BeztEditData *bed, bAnimContext *ac, BeztE /* --- */ /* This function is used to apply operation to all keyframes, regardless of the type */ -short ANIM_animchannel_keys_bezier_loop(BeztEditData *bed, bAnimListElem *ale, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) +short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, bAnimListElem *ale, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) { /* sanity checks */ if (ale == NULL) @@ -400,29 +400,29 @@ short ANIM_animchannel_keys_bezier_loop(BeztEditData *bed, bAnimListElem *ale, B switch (ale->datatype) { /* direct keyframe data (these loops are exposed) */ case ALE_FCURVE: /* F-Curve */ - return ANIM_fcurve_keys_bezier_loop(bed, ale->key_data, bezt_ok, bezt_cb, fcu_cb); + return ANIM_fcurve_keyframes_loop(ked, ale->key_data, bezt_ok, bezt_cb, fcu_cb); /* indirect 'summaries' (these are not exposed directly) * NOTE: must keep this code in sync with the drawing code and also the filtering code! */ case ALE_GROUP: /* action group */ - return agrp_keys_bezier_loop(bed, (bActionGroup *)ale->data, bezt_ok, bezt_cb, fcu_cb); + return agrp_keyframes_loop(ked, (bActionGroup *)ale->data, bezt_ok, bezt_cb, fcu_cb); case ALE_ACT: /* action */ - return act_keys_bezier_loop(bed, (bAction *)ale->key_data, bezt_ok, bezt_cb, fcu_cb); + return act_keyframes_loop(ked, (bAction *)ale->key_data, bezt_ok, bezt_cb, fcu_cb); case ALE_OB: /* object */ - return ob_keys_bezier_loop(bed, (Object *)ale->key_data, bezt_ok, bezt_cb, fcu_cb, filterflag); + return ob_keyframes_loop(ked, (Object *)ale->key_data, bezt_ok, bezt_cb, fcu_cb, filterflag); case ALE_SCE: /* scene */ - return scene_keys_bezier_loop(bed, (Scene *)ale->data, bezt_ok, bezt_cb, fcu_cb, filterflag); + return scene_keyframes_loop(ked, (Scene *)ale->data, bezt_ok, bezt_cb, fcu_cb, filterflag); case ALE_ALL: /* 'all' (DopeSheet summary) */ - return summary_keys_bezier_loop(bed, (bAnimContext *)ale->data, bezt_ok, bezt_cb, fcu_cb, filterflag); + return summary_keyframes_loop(ked, (bAnimContext *)ale->data, bezt_ok, bezt_cb, fcu_cb, filterflag); } return 0; } /* This function is used to apply operation to all keyframes, regardless of the type without needed an AnimListElem wrapper */ -short ANIM_animchanneldata_keys_bezier_loop(BeztEditData *bed, void *data, int keytype, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) +short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, void *data, int keytype, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) { /* sanity checks */ if (data == NULL) @@ -432,22 +432,22 @@ short ANIM_animchanneldata_keys_bezier_loop(BeztEditData *bed, void *data, int k switch (keytype) { /* direct keyframe data (these loops are exposed) */ case ALE_FCURVE: /* F-Curve */ - return ANIM_fcurve_keys_bezier_loop(bed, data, bezt_ok, bezt_cb, fcu_cb); + return ANIM_fcurve_keyframes_loop(ked, data, bezt_ok, bezt_cb, fcu_cb); /* indirect 'summaries' (these are not exposed directly) * NOTE: must keep this code in sync with the drawing code and also the filtering code! */ case ALE_GROUP: /* action group */ - return agrp_keys_bezier_loop(bed, (bActionGroup *)data, bezt_ok, bezt_cb, fcu_cb); + return agrp_keyframes_loop(ked, (bActionGroup *)data, bezt_ok, bezt_cb, fcu_cb); case ALE_ACT: /* action */ - return act_keys_bezier_loop(bed, (bAction *)data, bezt_ok, bezt_cb, fcu_cb); + return act_keyframes_loop(ked, (bAction *)data, bezt_ok, bezt_cb, fcu_cb); case ALE_OB: /* object */ - return ob_keys_bezier_loop(bed, (Object *)data, bezt_ok, bezt_cb, fcu_cb, filterflag); + return ob_keyframes_loop(ked, (Object *)data, bezt_ok, bezt_cb, fcu_cb, filterflag); case ALE_SCE: /* scene */ - return scene_keys_bezier_loop(bed, (Scene *)data, bezt_ok, bezt_cb, fcu_cb, filterflag); + return scene_keyframes_loop(ked, (Scene *)data, bezt_ok, bezt_cb, fcu_cb, filterflag); case ALE_ALL: /* 'all' (DopeSheet summary) */ - return summary_keys_bezier_loop(bed, (bAnimContext *)data, bezt_ok, bezt_cb, fcu_cb, filterflag); + return summary_keyframes_loop(ked, (bAnimContext *)data, bezt_ok, bezt_cb, fcu_cb, filterflag); } return 0; @@ -484,50 +484,50 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac) /* ************************************************************************** */ /* BezTriple Validation Callbacks */ -static short ok_bezier_frame(BeztEditData *bed, BezTriple *bezt) +static short ok_bezier_frame(KeyframeEditData *ked, BezTriple *bezt) { /* frame is stored in f1 property (this float accuracy check may need to be dropped?) */ - return IS_EQ(bezt->vec[1][0], bed->f1); + return IS_EQ(bezt->vec[1][0], ked->f1); } -static short ok_bezier_framerange(BeztEditData *bed, BezTriple *bezt) +static short ok_bezier_framerange(KeyframeEditData *ked, BezTriple *bezt) { /* frame range is stored in float properties */ - return ((bezt->vec[1][0] > bed->f1) && (bezt->vec[1][0] < bed->f2)); + return ((bezt->vec[1][0] > ked->f1) && (bezt->vec[1][0] < ked->f2)); } -static short ok_bezier_selected(BeztEditData *bed, BezTriple *bezt) +static short ok_bezier_selected(KeyframeEditData *ked, BezTriple *bezt) { /* this macro checks all beztriple handles for selection... */ return BEZSELECTED(bezt); } -static short ok_bezier_value(BeztEditData *bed, BezTriple *bezt) +static short ok_bezier_value(KeyframeEditData *ked, BezTriple *bezt) { /* value is stored in f1 property * - this float accuracy check may need to be dropped? * - should value be stored in f2 instead so that we won't have conflicts when using f1 for frames too? */ - return IS_EQ(bezt->vec[1][1], bed->f1); + return IS_EQ(bezt->vec[1][1], ked->f1); } -static short ok_bezier_valuerange(BeztEditData *bed, BezTriple *bezt) +static short ok_bezier_valuerange(KeyframeEditData *ked, BezTriple *bezt) { /* value range is stored in float properties */ - return ((bezt->vec[1][1] > bed->f1) && (bezt->vec[1][1] < bed->f2)); + return ((bezt->vec[1][1] > ked->f1) && (bezt->vec[1][1] < ked->f2)); } -static short ok_bezier_region(BeztEditData *bed, BezTriple *bezt) +static short ok_bezier_region(KeyframeEditData *ked, BezTriple *bezt) { /* rect is stored in data property (it's of type rectf, but may not be set) */ - if (bed->data) - return BLI_in_rctf(bed->data, bezt->vec[1][0], bezt->vec[1][1]); + if (ked->data) + return BLI_in_rctf(ked->data, bezt->vec[1][0], bezt->vec[1][1]); else return 0; } -BeztEditFunc ANIM_editkeyframes_ok(short mode) +KeyframeEditFunc ANIM_editkeyframes_ok(short mode) { /* eEditKeyframes_Validate */ switch (mode) { @@ -552,32 +552,32 @@ BeztEditFunc ANIM_editkeyframes_ok(short mode) /* Assorted Utility Functions */ /* helper callback for <animeditor>_cfrasnap_exec() -> used to help get the average time of all selected beztriples */ -short bezt_calc_average(BeztEditData *bed, BezTriple *bezt) +short bezt_calc_average(KeyframeEditData *ked, BezTriple *bezt) { /* only if selected */ if (bezt->f2 & SELECT) { /* store average time in float 1 (only do rounding at last step) */ - bed->f1 += bezt->vec[1][0]; + ked->f1 += bezt->vec[1][0]; /* store average value in float 2 (only do rounding at last step) * - this isn't always needed, but some operators may also require this */ - bed->f2 += bezt->vec[1][1]; + ked->f2 += bezt->vec[1][1]; /* increment number of items */ - bed->i1++; + ked->i1++; } return 0; } /* helper callback for columnselect_<animeditor>_keys() -> populate list CfraElems with frame numbers from selected beztriples */ -short bezt_to_cfraelem(BeztEditData *bed, BezTriple *bezt) +short bezt_to_cfraelem(KeyframeEditData *ked, BezTriple *bezt) { /* only if selected */ if (bezt->f2 & SELECT) { CfraElem *ce= MEM_callocN(sizeof(CfraElem), "cfraElem"); - BLI_addtail(&bed->list, ce); + BLI_addtail(&ked->list, ce); ce->cfra= bezt->vec[1][0]; } @@ -586,11 +586,11 @@ short bezt_to_cfraelem(BeztEditData *bed, BezTriple *bezt) } /* used to remap times from one range to another - * requires: bed->data = BeztEditCD_Remap + * requires: ked->data = BeztEditCD_Remap */ -void bezt_remap_times(BeztEditData *bed, BezTriple *bezt) +void bezt_remap_times(KeyframeEditData *ked, BezTriple *bezt) { - BeztEditCD_Remap *rmap= (BeztEditCD_Remap*)bed->data; + BeztEditCD_Remap *rmap= (BeztEditCD_Remap*)ked->data; const float scale = (rmap->newMax - rmap->newMin) / (rmap->oldMax - rmap->oldMin); /* perform transform on all three handles unless indicated otherwise */ @@ -605,7 +605,7 @@ void bezt_remap_times(BeztEditData *bed, BezTriple *bezt) /* Transform */ /* snaps the keyframe to the nearest frame */ -static short snap_bezier_nearest(BeztEditData *bed, BezTriple *bezt) +static short snap_bezier_nearest(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]+0.5)); @@ -613,9 +613,9 @@ static short snap_bezier_nearest(BeztEditData *bed, BezTriple *bezt) } /* snaps the keyframe to the neares second */ -static short snap_bezier_nearestsec(BeztEditData *bed, BezTriple *bezt) +static short snap_bezier_nearestsec(KeyframeEditData *ked, BezTriple *bezt) { - const Scene *scene= bed->scene; + const Scene *scene= ked->scene; const float secf = (float)FPS; if (bezt->f2 & SELECT) @@ -624,24 +624,24 @@ static short snap_bezier_nearestsec(BeztEditData *bed, BezTriple *bezt) } /* snaps the keyframe to the current frame */ -static short snap_bezier_cframe(BeztEditData *bed, BezTriple *bezt) +static short snap_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt) { - const Scene *scene= bed->scene; + const Scene *scene= ked->scene; if (bezt->f2 & SELECT) bezt->vec[1][0]= (float)CFRA; return 0; } /* snaps the keyframe time to the nearest marker's frame */ -static short snap_bezier_nearmarker(BeztEditData *bed, BezTriple *bezt) +static short snap_bezier_nearmarker(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) - bezt->vec[1][0]= (float)ED_markers_find_nearest_marker_time(&bed->list, bezt->vec[1][0]); + bezt->vec[1][0]= (float)ED_markers_find_nearest_marker_time(&ked->list, bezt->vec[1][0]); return 0; } /* make the handles have the same value as the key */ -static short snap_bezier_horizontal(BeztEditData *bed, BezTriple *bezt) +static short snap_bezier_horizontal(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) { bezt->vec[0][1]= bezt->vec[2][1]= bezt->vec[1][1]; @@ -653,14 +653,14 @@ static short snap_bezier_horizontal(BeztEditData *bed, BezTriple *bezt) } /* value to snap to is stored in the custom data -> first float value slot */ -static short snap_bezier_value(BeztEditData *bed, BezTriple *bezt) +static short snap_bezier_value(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) - bezt->vec[1][1]= bed->f1; + bezt->vec[1][1]= ked->f1; return 0; } -BeztEditFunc ANIM_editkeyframes_snap(short type) +KeyframeEditFunc ANIM_editkeyframes_snap(short type) { /* eEditKeyframes_Snap */ switch (type) { @@ -683,9 +683,9 @@ BeztEditFunc ANIM_editkeyframes_snap(short type) /* --------- */ -static short mirror_bezier_cframe(BeztEditData *bed, BezTriple *bezt) +static short mirror_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt) { - const Scene *scene= bed->scene; + const Scene *scene= ked->scene; float diff; if (bezt->f2 & SELECT) { @@ -696,7 +696,7 @@ static short mirror_bezier_cframe(BeztEditData *bed, BezTriple *bezt) return 0; } -static short mirror_bezier_yaxis(BeztEditData *bed, BezTriple *bezt) +static short mirror_bezier_yaxis(KeyframeEditData *ked, BezTriple *bezt) { float diff; @@ -708,7 +708,7 @@ static short mirror_bezier_yaxis(BeztEditData *bed, BezTriple *bezt) return 0; } -static short mirror_bezier_xaxis(BeztEditData *bed, BezTriple *bezt) +static short mirror_bezier_xaxis(KeyframeEditData *ked, BezTriple *bezt) { float diff; @@ -720,25 +720,25 @@ static short mirror_bezier_xaxis(BeztEditData *bed, BezTriple *bezt) return 0; } -static short mirror_bezier_marker(BeztEditData *bed, BezTriple *bezt) +static short mirror_bezier_marker(KeyframeEditData *ked, BezTriple *bezt) { /* mirroring time stored in f1 */ if (bezt->f2 & SELECT) { - const float diff= (bed->f1 - bezt->vec[1][0]); - bezt->vec[1][0]= (bed->f1 + diff); + const float diff= (ked->f1 - bezt->vec[1][0]); + bezt->vec[1][0]= (ked->f1 + diff); } return 0; } -static short mirror_bezier_value(BeztEditData *bed, BezTriple *bezt) +static short mirror_bezier_value(KeyframeEditData *ked, BezTriple *bezt) { float diff; /* value to mirror over is stored in the custom data -> first float value slot */ if (bezt->f2 & SELECT) { - diff= (bed->f1 - bezt->vec[1][1]); - bezt->vec[1][1]= (bed->f1 + diff); + diff= (ked->f1 - bezt->vec[1][1]); + bezt->vec[1][1]= (ked->f1 + diff); } return 0; @@ -746,7 +746,7 @@ static short mirror_bezier_value(BeztEditData *bed, BezTriple *bezt) /* Note: for markers and 'value', the values to use must be supplied as the first float value */ // calchandles_fcurve -BeztEditFunc ANIM_editkeyframes_mirror(short type) +KeyframeEditFunc ANIM_editkeyframes_mirror(short type) { switch (type) { case MIRROR_KEYS_CURFRAME: /* mirror over current frame */ @@ -769,7 +769,7 @@ BeztEditFunc ANIM_editkeyframes_mirror(short type) /* Settings */ /* Sets the selected bezier handles to type 'auto' */ -static short set_bezier_auto(BeztEditData *bed, BezTriple *bezt) +static short set_bezier_auto(KeyframeEditData *ked, BezTriple *bezt) { if((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) { if (bezt->f1 & SELECT) bezt->h1= HD_AUTO; /* the secret code for auto */ @@ -787,7 +787,7 @@ static short set_bezier_auto(BeztEditData *bed, BezTriple *bezt) } /* Sets the selected bezier handles to type 'vector' */ -static short set_bezier_vector(BeztEditData *bed, BezTriple *bezt) +static short set_bezier_vector(KeyframeEditData *ked, BezTriple *bezt) { if ((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) { if (bezt->f1 & SELECT) bezt->h1= HD_VECT; @@ -807,7 +807,7 @@ static short set_bezier_vector(BeztEditData *bed, BezTriple *bezt) /* Queries if the handle should be set to 'free' or 'align' */ // NOTE: this was used for the 'toggle free/align' option // currently this isn't used, but may be restored later -static short bezier_isfree(BeztEditData *bed, BezTriple *bezt) +static short bezier_isfree(KeyframeEditData *ked, BezTriple *bezt) { if ((bezt->f1 & SELECT) && (bezt->h1)) return 1; if ((bezt->f3 & SELECT) && (bezt->h2)) return 1; @@ -815,7 +815,7 @@ static short bezier_isfree(BeztEditData *bed, BezTriple *bezt) } /* Sets selected bezier handles to type 'align' */ -static short set_bezier_align(BeztEditData *bed, BezTriple *bezt) +static short set_bezier_align(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f1 & SELECT) bezt->h1= HD_ALIGN; if (bezt->f3 & SELECT) bezt->h2= HD_ALIGN; @@ -823,7 +823,7 @@ static short set_bezier_align(BeztEditData *bed, BezTriple *bezt) } /* Sets selected bezier handles to type 'free' */ -static short set_bezier_free(BeztEditData *bed, BezTriple *bezt) +static short set_bezier_free(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f1 & SELECT) bezt->h1= HD_FREE; if (bezt->f3 & SELECT) bezt->h2= HD_FREE; @@ -832,7 +832,7 @@ static short set_bezier_free(BeztEditData *bed, BezTriple *bezt) /* Set all selected Bezier Handles to a single type */ // calchandles_fcurve -BeztEditFunc ANIM_editkeyframes_handles(short code) +KeyframeEditFunc ANIM_editkeyframes_handles(short code) { switch (code) { case HD_AUTO: /* auto */ @@ -853,21 +853,21 @@ BeztEditFunc ANIM_editkeyframes_handles(short code) /* ------- */ -static short set_bezt_constant(BeztEditData *bed, BezTriple *bezt) +static short set_bezt_constant(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) bezt->ipo= BEZT_IPO_CONST; return 0; } -static short set_bezt_linear(BeztEditData *bed, BezTriple *bezt) +static short set_bezt_linear(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) bezt->ipo= BEZT_IPO_LIN; return 0; } -static short set_bezt_bezier(BeztEditData *bed, BezTriple *bezt) +static short set_bezt_bezier(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) bezt->ipo= BEZT_IPO_BEZ; @@ -876,7 +876,7 @@ static short set_bezt_bezier(BeztEditData *bed, BezTriple *bezt) /* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */ // ANIM_editkeyframes_ipocurve_ipotype() ! -BeztEditFunc ANIM_editkeyframes_ipo(short code) +KeyframeEditFunc ANIM_editkeyframes_ipo(short code) { switch (code) { case BEZT_IPO_CONST: /* constant */ @@ -890,21 +890,21 @@ BeztEditFunc ANIM_editkeyframes_ipo(short code) /* ------- */ -static short set_keytype_keyframe(BeztEditData *bed, BezTriple *bezt) +static short set_keytype_keyframe(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) BEZKEYTYPE(bezt)= BEZT_KEYTYPE_KEYFRAME; return 0; } -static short set_keytype_breakdown(BeztEditData *bed, BezTriple *bezt) +static short set_keytype_breakdown(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) BEZKEYTYPE(bezt)= BEZT_KEYTYPE_BREAKDOWN; return 0; } -static short set_keytype_extreme(BeztEditData *bed, BezTriple *bezt) +static short set_keytype_extreme(KeyframeEditData *ked, BezTriple *bezt) { if (bezt->f2 & SELECT) BEZKEYTYPE(bezt)= BEZT_KEYTYPE_EXTREME; @@ -912,7 +912,7 @@ static short set_keytype_extreme(BeztEditData *bed, BezTriple *bezt) } /* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */ -BeztEditFunc ANIM_editkeyframes_keytype(short code) +KeyframeEditFunc ANIM_editkeyframes_keytype(short code) { switch (code) { case BEZT_KEYTYPE_BREAKDOWN: /* breakdown */ @@ -930,21 +930,21 @@ BeztEditFunc ANIM_editkeyframes_keytype(short code) /* ******************************************* */ /* Selection */ -static short select_bezier_add(BeztEditData *bed, BezTriple *bezt) +static short select_bezier_add(KeyframeEditData *ked, BezTriple *bezt) { /* Select the bezier triple */ BEZ_SEL(bezt); return 0; } -static short select_bezier_subtract(BeztEditData *bed, BezTriple *bezt) +static short select_bezier_subtract(KeyframeEditData *ked, BezTriple *bezt) { /* Deselect the bezier triple */ BEZ_DESEL(bezt); return 0; } -static short select_bezier_invert(BeztEditData *bed, BezTriple *bezt) +static short select_bezier_invert(KeyframeEditData *ked, BezTriple *bezt) { /* Invert the selection for the bezier triple */ bezt->f2 ^= SELECT; @@ -959,7 +959,7 @@ static short select_bezier_invert(BeztEditData *bed, BezTriple *bezt) return 0; } -BeztEditFunc ANIM_editkeyframes_select(short selectmode) +KeyframeEditFunc ANIM_editkeyframes_select(short selectmode) { switch (selectmode) { case SELECT_ADD: /* add */ @@ -984,11 +984,11 @@ BeztEditFunc ANIM_editkeyframes_select(short selectmode) /* ----------- */ -static short selmap_build_bezier_more(BeztEditData *bed, BezTriple *bezt) +static short selmap_build_bezier_more(KeyframeEditData *ked, BezTriple *bezt) { - FCurve *fcu= bed->fcu; - char *map= bed->data; - int i= bed->curIndex; + FCurve *fcu= ked->fcu; + char *map= ked->data; + int i= ked->curIndex; /* if current is selected, just make sure it stays this way */ if (BEZSELECTED(bezt)) { @@ -1019,11 +1019,11 @@ static short selmap_build_bezier_more(BeztEditData *bed, BezTriple *bezt) return 0; } -static short selmap_build_bezier_less(BeztEditData *bed, BezTriple *bezt) +static short selmap_build_bezier_less(KeyframeEditData *ked, BezTriple *bezt) { - FCurve *fcu= bed->fcu; - char *map= bed->data; - int i= bed->curIndex; + FCurve *fcu= ked->fcu; + char *map= ked->data; + int i= ked->curIndex; /* if current is selected, check the left/right keyframes * since it might need to be deselected (but otherwise no) @@ -1061,7 +1061,7 @@ static short selmap_build_bezier_less(BeztEditData *bed, BezTriple *bezt) } /* Get callback for building selection map */ -BeztEditFunc ANIM_editkeyframes_buildselmap(short mode) +KeyframeEditFunc ANIM_editkeyframes_buildselmap(short mode) { switch (mode) { case SELMAP_LESS: /* less */ @@ -1076,10 +1076,10 @@ BeztEditFunc ANIM_editkeyframes_buildselmap(short mode) /* ----------- */ /* flush selection map values to the given beztriple */ -short bezt_selmap_flush(BeztEditData *bed, BezTriple *bezt) +short bezt_selmap_flush(KeyframeEditData *ked, BezTriple *bezt) { - char *map= bed->data; - short on= map[bed->curIndex]; + char *map= ked->data; + short on= map[ked->curIndex]; /* select or deselect based on whether the map allows it or not */ if (on) { diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 91a8b7047c4..abced485769 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -500,7 +500,7 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data) * - skip if no selected keyframes found (so no need to create unnecessary copy-buffer data) * - this check should also eliminate any problems associated with using sample-data */ - if (ANIM_fcurve_keys_bezier_loop(NULL, fcu, NULL, ANIM_editkeyframes_ok(BEZT_OK_SELECTED), NULL) == 0) + if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, ANIM_editkeyframes_ok(BEZT_OK_SELECTED), NULL) == 0) continue; /* init copybuf item info */ diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index efc76105083..e2ceb534066 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -704,8 +704,8 @@ static void poselib_apply_pose (tPoseLib_PreviewData *pld) bAction *act= pld->act; bActionGroup *agrp; - BeztEditData bed; - BeztEditFunc group_ok_cb; + KeyframeEditData ked; + KeyframeEditFunc group_ok_cb; int frame= 1; /* get the frame */ @@ -717,15 +717,15 @@ static void poselib_apply_pose (tPoseLib_PreviewData *pld) /* init settings for testing groups for keyframes */ group_ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE); - memset(&bed, 0, sizeof(BeztEditData)); - bed.f1= ((float)frame) - 0.5f; - bed.f2= ((float)frame) + 0.5f; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.f1= ((float)frame) - 0.5f; + ked.f2= ((float)frame) + 0.5f; /* start applying - only those channels which have a key at this point in time! */ for (agrp= act->groups.first; agrp; agrp= agrp->next) { /* check if group has any keyframes */ - if (ANIM_animchanneldata_keys_bezier_loop(&bed, agrp, ALE_GROUP, NULL, group_ok_cb, NULL, 0)) { + if (ANIM_animchanneldata_keyframes_loop(&ked, agrp, ALE_GROUP, NULL, group_ok_cb, NULL, 0)) { /* has keyframe on this frame, so try to get a PoseChannel with this name */ pchan= get_pose_channel(pose, agrp->name); diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index 805b86ea534..29f92fff001 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -96,7 +96,7 @@ typedef enum eEditKeyframes_Mirror { /* --- Generic Properties for Bezier Edit Tools ----- */ -typedef struct BeztEditData { +typedef struct KeyframeEditData { /* generic properties/data access */ ListBase list; /* temp list for storing custom list of data to check */ struct Scene *scene; /* pointer to current scene - many tools need access to cfra/etc. */ @@ -107,14 +107,14 @@ typedef struct BeztEditData { /* current iteration data */ struct FCurve *fcu; /* F-Curve that is being iterated over */ int curIndex; /* index of current keyframe being iterated over */ -} BeztEditData; +} KeyframeEditData; /* ------- Function Pointer Typedefs ---------------- */ /* callback function that refreshes the F-Curve after use */ typedef void (*FcuEditFunc)(struct FCurve *fcu); /* callback function that operates on the given BezTriple */ -typedef short (*BeztEditFunc)(BeztEditData *bed, struct BezTriple *bezt); +typedef short (*KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt); /* ------- Custom Data Type Defines ------------------ */ @@ -128,15 +128,15 @@ typedef struct BeztEditCD_Remap { /* functions for looping over keyframes */ /* function for working with F-Curve data only (i.e. when filters have been chosen to explicitly use this) */ -short ANIM_fcurve_keys_bezier_loop(BeztEditData *bed, struct FCurve *fcu, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb); +short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, struct FCurve *fcu, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb); /* function for working with any type (i.e. one of the known types) of animation channel * - filterflag is bDopeSheet->flag (DOPESHEET_FILTERFLAG) */ -short ANIM_animchannel_keys_bezier_loop(BeztEditData *bed, struct bAnimListElem *ale, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag); +short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, struct bAnimListElem *ale, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag); /* same as above, except bAnimListElem wrapper is not needed... * - keytype is eAnim_KeyType */ -short ANIM_animchanneldata_keys_bezier_loop(BeztEditData *bed, void *data, int keytype, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag); +short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, void *data, int keytype, KeyframeEditFunc bezt_ok, KeyframeEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag); /* functions for making sure all keyframes are in good order */ void ANIM_editkeyframes_refresh(struct bAnimContext *ac); @@ -144,40 +144,40 @@ void ANIM_editkeyframes_refresh(struct bAnimContext *ac); /* ----------- BezTriple Callback Getters ---------- */ /* accessories */ -BeztEditFunc ANIM_editkeyframes_ok(short mode); +KeyframeEditFunc ANIM_editkeyframes_ok(short mode); /* edit */ -BeztEditFunc ANIM_editkeyframes_snap(short mode); -BeztEditFunc ANIM_editkeyframes_mirror(short mode); -BeztEditFunc ANIM_editkeyframes_select(short mode); -BeztEditFunc ANIM_editkeyframes_handles(short mode); -BeztEditFunc ANIM_editkeyframes_ipo(short mode); -BeztEditFunc ANIM_editkeyframes_keytype(short mode); +KeyframeEditFunc ANIM_editkeyframes_snap(short mode); +KeyframeEditFunc ANIM_editkeyframes_mirror(short mode); +KeyframeEditFunc ANIM_editkeyframes_select(short mode); +KeyframeEditFunc ANIM_editkeyframes_handles(short mode); +KeyframeEditFunc ANIM_editkeyframes_ipo(short mode); +KeyframeEditFunc ANIM_editkeyframes_keytype(short mode); /* -------- BezTriple Callbacks (Selection Map) ---------- */ /* Get a callback to populate the selection settings map - * requires: bed->custom = char[] of length fcurve->totvert + * requires: ked->custom = char[] of length fcurve->totvert */ -BeztEditFunc ANIM_editkeyframes_buildselmap(short mode); +KeyframeEditFunc ANIM_editkeyframes_buildselmap(short mode); /* Change the selection status of the keyframe based on the map entry for this vert - * requires: bed->custom = char[] of length fcurve->totvert + * requires: ked->custom = char[] of length fcurve->totvert */ -short bezt_selmap_flush(BeztEditData *bed, struct BezTriple *bezt); +short bezt_selmap_flush(KeyframeEditData *ked, struct BezTriple *bezt); /* ----------- BezTriple Callback (Assorted Utilities) ---------- */ /* used to calculate the the average location of all relevant BezTriples by summing their locations */ -short bezt_calc_average(BeztEditData *bed, struct BezTriple *bezt); +short bezt_calc_average(KeyframeEditData *ked, struct BezTriple *bezt); /* used to extract a set of cfra-elems from the keyframes */ -short bezt_to_cfraelem(BeztEditData *bed, struct BezTriple *bezt); +short bezt_to_cfraelem(KeyframeEditData *ked, struct BezTriple *bezt); /* used to remap times from one range to another - * requires: bed->custom = BeztEditCD_Remap + * requires: ked->custom = BeztEditCD_Remap */ -void bezt_remap_times(BeztEditData *bed, struct BezTriple *bezt); +void bezt_remap_times(KeyframeEditData *ked, struct BezTriple *bezt); /* ************************************************ */ /* Destructive Editing API (keyframes_general.c) */ diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index b71781f18e5..7e392f2d335 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -869,17 +869,17 @@ static void setipo_action_keys(bAnimContext *ac, short mode) ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - BeztEditFunc set_cb= ANIM_editkeyframes_ipo(mode); + KeyframeEditFunc set_cb= ANIM_editkeyframes_ipo(mode); /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &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... + * Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here... */ for (ale= anim_data.first; ale; ale= ale->next) - ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); /* cleanup */ BLI_freelistN(&anim_data); @@ -952,21 +952,21 @@ static void sethandles_action_keys(bAnimContext *ac, short mode) bAnimListElem *ale; int filter; - BeztEditFunc edit_cb= ANIM_editkeyframes_handles(mode); - BeztEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); + KeyframeEditFunc edit_cb= ANIM_editkeyframes_handles(mode); + KeyframeEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting flags for handles - * Note: we do not supply BeztEditData to the looper yet. Currently that's not necessary here... + * Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here... */ for (ale= anim_data.first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; /* any selected keyframes for editing? */ - if (ANIM_fcurve_keys_bezier_loop(NULL, fcu, NULL, sel_cb, NULL)) { + if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL)) { /* for auto/auto-clamped, toggle the auto-handles flag on the F-Curve */ if (mode == HD_AUTO_ANIM) fcu->flag |= FCURVE_AUTO_HANDLES; @@ -974,7 +974,7 @@ static void sethandles_action_keys(bAnimContext *ac, short mode) fcu->flag &= ~FCURVE_AUTO_HANDLES; /* change type of selected handles */ - ANIM_fcurve_keys_bezier_loop(NULL, fcu, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, edit_cb, calchandles_fcurve); } } @@ -1037,17 +1037,17 @@ static void setkeytype_action_keys(bAnimContext *ac, short mode) ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - BeztEditFunc set_cb= ANIM_editkeyframes_keytype(mode); + KeyframeEditFunc set_cb= ANIM_editkeyframes_keytype(mode); /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &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... + * Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here... */ for (ale= anim_data.first; ale; ale= ale->next) - ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, NULL); + ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, NULL); /* cleanup */ BLI_freelistN(&anim_data); @@ -1112,14 +1112,14 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *op) ListBase anim_data= {NULL, NULL}; bAnimListElem *ale; int filter; - BeztEditData bed; + KeyframeEditData ked; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; /* init edit data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* loop over action data, averaging values */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); @@ -1129,19 +1129,19 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *op) AnimData *adt= ANIM_nla_mapping_get(&ac, ale); if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_calc_average, NULL); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_calc_average, NULL); } BLI_freelistN(&anim_data); /* set the new current frame value, based on the average time */ - if (bed.i1) { + if (ked.i1) { Scene *scene= ac.scene; - CFRA= (int)floor((bed.f1 / bed.i1) + 0.5f); + CFRA= (int)floor((ked.f1 / ked.i1) + 0.5f); } /* set notifier that things have changed */ @@ -1183,8 +1183,8 @@ static void snap_action_keys(bAnimContext *ac, short mode) bAnimListElem *ale; int filter; - BeztEditData bed; - BeztEditFunc edit_cb; + KeyframeEditData ked; + KeyframeEditFunc edit_cb; /* filter data */ if (ac->datatype == ANIMCONT_GPENCIL) @@ -1196,11 +1196,11 @@ static void snap_action_keys(bAnimContext *ac, short mode) /* get beztriple editing callbacks */ edit_cb= ANIM_editkeyframes_snap(mode); - memset(&bed, 0, sizeof(BeztEditData)); - bed.scene= ac->scene; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.scene= ac->scene; if (mode == ACTKEYS_SNAP_NEAREST_MARKER) { - bed.list.first= (ac->markers) ? ac->markers->first : NULL; - bed.list.last= (ac->markers) ? ac->markers->last : NULL; + ked.list.first= (ac->markers) ? ac->markers->first : NULL; + ked.list.last= (ac->markers) ? ac->markers->last : NULL; } /* snap keyframes */ @@ -1209,13 +1209,13 @@ static void snap_action_keys(bAnimContext *ac, short mode) if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } //else if (ale->type == ACTTYPE_GPLAYER) // snap_gplayer_frames(ale->data, mode); else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); } BLI_freelistN(&anim_data); @@ -1283,14 +1283,14 @@ static void mirror_action_keys(bAnimContext *ac, short mode) bAnimListElem *ale; int filter; - BeztEditData bed; - BeztEditFunc edit_cb; + KeyframeEditData ked; + KeyframeEditFunc edit_cb; /* get beztriple editing callbacks */ edit_cb= ANIM_editkeyframes_mirror(mode); - memset(&bed, 0, sizeof(BeztEditData)); - bed.scene= ac->scene; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.scene= ac->scene; /* for 'first selected marker' mode, need to find first selected marker first! */ // XXX should this be made into a helper func in the API? @@ -1308,7 +1308,7 @@ static void mirror_action_keys(bAnimContext *ac, short mode) /* store marker's time (if available) */ if (marker) - bed.f1= (float)marker->frame; + ked.f1= (float)marker->frame; else return; } @@ -1326,13 +1326,13 @@ static void mirror_action_keys(bAnimContext *ac, short mode) if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } //else if (ale->type == ACTTYPE_GPLAYER) // snap_gplayer_frames(ale->data, mode); else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); } BLI_freelistN(&anim_data); diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 257d22e17b6..877b40c5cb1 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -94,8 +94,8 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel) bAnimListElem *ale; int filter; - BeztEditData bed; - BeztEditFunc test_cb, sel_cb; + KeyframeEditData ked; + KeyframeEditFunc test_cb, sel_cb; /* determine type-based settings */ if (ac->datatype == ANIMCONT_GPENCIL) @@ -107,7 +107,7 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* init BezTriple looping data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); test_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); /* See if we should be selecting or deselecting */ @@ -120,7 +120,7 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel) //} } else { - if (ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, test_cb, NULL)) { + if (ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, test_cb, NULL)) { sel= SELECT_SUBTRACT; break; } @@ -136,7 +136,7 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel) //if (ale->type == ACTTYPE_GPLAYER) // set_gplayer_frame_selection(ale->data, sel); //else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, sel_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, sel_cb, NULL); } /* Cleanup */ @@ -205,8 +205,8 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short bAnimListElem *ale; int filter, filterflag; - BeztEditData bed; - BeztEditFunc ok_cb, select_cb; + KeyframeEditData ked; + KeyframeEditFunc ok_cb, select_cb; View2D *v2d= &ac->ar->v2d; rctf rectf; float ymin=0, ymax=(float)(-ACHANNEL_HEIGHT_HALF); @@ -236,7 +236,7 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short ok_cb= NULL; /* init editing data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* loop over data, doing border select */ for (ale= anim_data.first; ale; ale= ale->next) { @@ -249,12 +249,12 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short if (ELEM(mode, ACTKEYS_BORDERSEL_FRAMERANGE, ACTKEYS_BORDERSEL_ALLKEYS)) { /* if channel is mapped in NLA, apply correction */ if (adt) { - bed.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP); - bed.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP); + ked.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP); + ked.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP); } else { - bed.f1= rectf.xmin; - bed.f2= rectf.xmax; + ked.f1= rectf.xmin; + ked.f2= rectf.xmax; } } @@ -266,7 +266,7 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short //if (ale->type == ANIMTYPE_GPLAYER) // borderselect_gplayer_frames(ale->data, rectf.xmin, rectf.xmax, selectmode); //else - ANIM_animchannel_keys_bezier_loop(&bed, ale, ok_cb, select_cb, NULL, filterflag); + ANIM_animchannel_keyframes_loop(&ked, ale, ok_cb, select_cb, NULL, filterflag); } /* set minimum extent to be the maximum of the next channel */ @@ -375,8 +375,8 @@ static void markers_selectkeys_between (bAnimContext *ac) bAnimListElem *ale; int filter; - BeztEditFunc ok_cb, select_cb; - BeztEditData bed; + KeyframeEditFunc ok_cb, select_cb; + KeyframeEditData ked; float min, max; /* get extreme markers */ @@ -388,9 +388,9 @@ static void markers_selectkeys_between (bAnimContext *ac) ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE); select_cb= ANIM_editkeyframes_select(SELECT_ADD); - memset(&bed, 0, sizeof(BeztEditData)); - bed.f1= min; - bed.f2= max; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.f1= min; + ked.f2= max; /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); @@ -402,11 +402,11 @@ static void markers_selectkeys_between (bAnimContext *ac) if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else { - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); } } @@ -424,11 +424,11 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) Scene *scene= ac->scene; CfraElem *ce; - BeztEditFunc select_cb, ok_cb; - BeztEditData bed; + KeyframeEditFunc select_cb, ok_cb; + KeyframeEditData ked; /* initialise keyframe editing data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* build list of columns */ switch (mode) { @@ -445,7 +445,7 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_to_cfraelem, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_to_cfraelem, NULL); } BLI_freelistN(&anim_data); break; @@ -453,13 +453,13 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) case ACTKEYS_COLUMNSEL_CFRA: /* current frame */ /* make a single CfraElem for storing this */ ce= MEM_callocN(sizeof(CfraElem), "cfraElem"); - BLI_addtail(&bed.list, ce); + BLI_addtail(&ked.list, ce); ce->cfra= (float)CFRA; break; case ACTKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */ - ED_markers_make_cfra_list(ac->markers, &bed.list, 1); + ED_markers_make_cfra_list(ac->markers, &ked.list, 1); break; default: /* invalid option */ @@ -482,18 +482,18 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(ac, ale); - /* loop over cfraelems (stored in the BeztEditData->list) + /* loop over cfraelems (stored in the KeyframeEditData->list) * - we need to do this here, as we can apply fewer NLA-mapping conversions */ - for (ce= bed.list.first; ce; ce= ce->next) { + for (ce= ked.list.first; ce; ce= ce->next) { /* set frame for validation callback to refer to */ if (adt) - bed.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, NLATIME_CONVERT_UNMAP); + ked.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, NLATIME_CONVERT_UNMAP); else - bed.f1= ce->cfra; + ked.f1= ce->cfra; /* select elements with frame number matching cfraelem */ - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); #if 0 // XXX reenable when Grease Pencil stuff is back if (ale->type == ANIMTYPE_GPLAYER) { @@ -511,7 +511,7 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) } /* free elements */ - BLI_freelistN(&bed.list); + BLI_freelistN(&ked.list); BLI_freelistN(&anim_data); } @@ -567,13 +567,13 @@ static void select_moreless_action_keys (bAnimContext *ac, short mode) bAnimListElem *ale; int filter; - BeztEditData bed; - BeztEditFunc build_cb; + KeyframeEditData ked; + KeyframeEditFunc build_cb; /* init selmap building data */ build_cb= ANIM_editkeyframes_buildselmap(mode); - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* loop through all of the keys and select additional keyframes based on these */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); @@ -587,15 +587,15 @@ static void select_moreless_action_keys (bAnimContext *ac, short mode) continue; /* build up map of whether F-Curve's keyframes should be selected or not */ - bed.data= MEM_callocN(fcu->totvert, "selmap actEdit more"); - ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, build_cb, NULL); + ked.data= MEM_callocN(fcu->totvert, "selmap actEdit more"); + ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, build_cb, NULL); /* based on this map, adjust the selection status of the keyframes */ - ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, bezt_selmap_flush, NULL); + ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, bezt_selmap_flush, NULL); /* free the selmap used here */ - MEM_freeN(bed.data); - bed.data= NULL; + MEM_freeN(ked.data); + ked.data= NULL; } /* Cleanup */ @@ -700,17 +700,17 @@ static void actkeys_mselect_single (bAnimContext *ac, bAnimListElem *ale, short bDopeSheet *ads= (ac->datatype == ANIMCONT_DOPESHEET) ? ac->data : NULL; int ds_filter = ((ads) ? (ads->filterflag) : (0)); - BeztEditData bed; - BeztEditFunc select_cb, ok_cb; + KeyframeEditData ked; + KeyframeEditFunc select_cb, ok_cb; /* get functions for selecting keyframes */ select_cb= ANIM_editkeyframes_select(select_mode); ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAME); - memset(&bed, 0, sizeof(BeztEditData)); - bed.f1= selx; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.f1= selx; /* select the nominated keyframe on the given frame */ - ANIM_animchannel_keys_bezier_loop(&bed, ale, ok_cb, select_cb, NULL, ds_filter); + ANIM_animchannel_keyframes_loop(&ked, ale, ok_cb, select_cb, NULL, ds_filter); } /* Option 2) Selects all the keyframes on either side of the current frame (depends on which side the mouse is on) */ @@ -720,8 +720,8 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short bAnimListElem *ale; int filter; - BeztEditFunc ok_cb, select_cb; - BeztEditData bed; + KeyframeEditFunc ok_cb, select_cb; + KeyframeEditData ked; Scene *scene= ac->scene; /* if select mode is replace, deselect all keyframes (and channels) first */ @@ -737,14 +737,14 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE); select_cb= ANIM_editkeyframes_select(select_mode); - memset(&bed, 0, sizeof(BeztEditFunc)); + memset(&ked, 0, sizeof(KeyframeEditFunc)); if (leftright == ACTKEYS_LRSEL_LEFT) { - bed.f1 = MINAFRAMEF; - bed.f2 = (float)(CFRA + FRAME_CLICK_THRESH); + ked.f1 = MINAFRAMEF; + ked.f2 = (float)(CFRA + FRAME_CLICK_THRESH); } else { - bed.f1 = (float)(CFRA - FRAME_CLICK_THRESH); - bed.f2 = MAXFRAMEF; + ked.f1 = (float)(CFRA - FRAME_CLICK_THRESH); + ked.f2 = MAXFRAMEF; } /* filter data */ @@ -760,13 +760,13 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } //else if (ale->type == ANIMTYPE_GPLAYER) // borderselect_gplayer_frames(ale->data, min, max, SELECT_ADD); else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); } /* Sync marker support */ @@ -799,11 +799,11 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se bAnimListElem *ale; int filter; - BeztEditFunc select_cb, ok_cb; - BeztEditData bed; + KeyframeEditFunc select_cb, ok_cb; + KeyframeEditData ked; /* initialise keyframe editing data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* set up BezTriple edit callbacks */ select_cb= ANIM_editkeyframes_select(select_mode); @@ -823,12 +823,12 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se /* set frame for validation callback to refer to */ if (adt) - bed.f1= BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP); + ked.f1= BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP); else - bed.f1= selx; + ked.f1= selx; /* select elements with frame number matching cfra */ - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); #if 0 // XXX reenable when Grease Pencil stuff is back if (ale->type == ANIMTYPE_GPLAYER) { @@ -845,7 +845,7 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se } /* free elements */ - BLI_freelistN(&bed.list); + BLI_freelistN(&ked.list); BLI_freelistN(&anim_data); } diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index fe7168240f8..66eb8d8d546 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1283,17 +1283,17 @@ static void setipo_graph_keys(bAnimContext *ac, short mode) ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - BeztEditFunc set_cb= ANIM_editkeyframes_ipo(mode); + KeyframeEditFunc set_cb= ANIM_editkeyframes_ipo(mode); /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &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... + * Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here... */ for (ale= anim_data.first; ale; ale= ale->next) - ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); /* cleanup */ BLI_freelistN(&anim_data); @@ -1364,21 +1364,21 @@ static void sethandles_graph_keys(bAnimContext *ac, short mode) bAnimListElem *ale; int filter; - BeztEditFunc edit_cb= ANIM_editkeyframes_handles(mode); - BeztEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); + KeyframeEditFunc edit_cb= ANIM_editkeyframes_handles(mode); + KeyframeEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting flags for handles - * Note: we do not supply BeztEditData to the looper yet. Currently that's not necessary here... + * Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here... */ for (ale= anim_data.first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; /* any selected keyframes for editing? */ - if (ANIM_fcurve_keys_bezier_loop(NULL, fcu, NULL, sel_cb, NULL)) { + if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL)) { /* for auto/auto-clamped, toggle the auto-handles flag on the F-Curve */ if (mode == HD_AUTO_ANIM) fcu->flag |= FCURVE_AUTO_HANDLES; @@ -1386,7 +1386,7 @@ static void sethandles_graph_keys(bAnimContext *ac, short mode) fcu->flag &= ~FCURVE_AUTO_HANDLES; /* change type of selected handles */ - ANIM_fcurve_keys_bezier_loop(NULL, fcu, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, edit_cb, calchandles_fcurve); } } @@ -1548,14 +1548,14 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *op) ListBase anim_data= {NULL, NULL}; bAnimListElem *ale; int filter; - BeztEditData bed; + KeyframeEditData ked; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; /* init edit data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* loop over action data, averaging values */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); @@ -1569,11 +1569,11 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *op) if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_calc_average, NULL); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_calc_average, NULL); /* unapply unit corrections */ ANIM_unit_mapping_apply_fcurve(ac.scene, ale->id, ale->key_data, ANIM_UNITCONV_RESTORE|ANIM_UNITCONV_ONLYKEYS); @@ -1582,13 +1582,13 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set the new current frame and cursor values, based on the average time and value */ - if (bed.i1) { + if (ked.i1) { SpaceIpo *sipo= ac.sa->spacedata.first; Scene *scene= ac.scene; /* take the average values, rounding to the nearest int for the current frame */ - CFRA= (int)floor((bed.f1 / bed.i1) + 0.5f); - sipo->cursorVal= bed.f2 / (float)bed.i1; + CFRA= (int)floor((ked.f1 / ked.i1) + 0.5f); + sipo->cursorVal= ked.f2 / (float)ked.i1; } /* set notifier that things have changed */ @@ -1632,8 +1632,8 @@ static void snap_graph_keys(bAnimContext *ac, short mode) bAnimListElem *ale; int filter; - BeztEditData bed; - BeztEditFunc edit_cb; + KeyframeEditData ked; + KeyframeEditFunc edit_cb; /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); @@ -1642,15 +1642,15 @@ static void snap_graph_keys(bAnimContext *ac, short mode) /* get beztriple editing callbacks */ edit_cb= ANIM_editkeyframes_snap(mode); - memset(&bed, 0, sizeof(BeztEditData)); - bed.scene= ac->scene; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.scene= ac->scene; if (mode == GRAPHKEYS_SNAP_NEAREST_MARKER) { - bed.list.first= (ac->markers) ? ac->markers->first : NULL; - bed.list.last= (ac->markers) ? ac->markers->last : NULL; + ked.list.first= (ac->markers) ? ac->markers->first : NULL; + ked.list.last= (ac->markers) ? ac->markers->last : NULL; } else if (mode == GRAPHKEYS_SNAP_VALUE) { SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; - bed.f1= (sipo) ? sipo->cursorVal : 0.0f; + ked.f1= (sipo) ? sipo->cursorVal : 0.0f; } /* snap keyframes */ @@ -1662,11 +1662,11 @@ static void snap_graph_keys(bAnimContext *ac, short mode) if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); /* apply unit corrections */ ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, ANIM_UNITCONV_RESTORE); @@ -1739,14 +1739,14 @@ static void mirror_graph_keys(bAnimContext *ac, short mode) bAnimListElem *ale; int filter; - BeztEditData bed; - BeztEditFunc edit_cb; + KeyframeEditData ked; + KeyframeEditFunc edit_cb; /* get beztriple editing callbacks */ edit_cb= ANIM_editkeyframes_mirror(mode); - memset(&bed, 0, sizeof(BeztEditData)); - bed.scene= ac->scene; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.scene= ac->scene; /* for 'first selected marker' mode, need to find first selected marker first! */ // XXX should this be made into a helper func in the API? @@ -1764,13 +1764,13 @@ static void mirror_graph_keys(bAnimContext *ac, short mode) /* store marker's time (if available) */ if (marker) - bed.f1= (float)marker->frame; + ked.f1= (float)marker->frame; else return; } else if (mode == GRAPHKEYS_MIRROR_VALUE) { SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; - bed.f1= (sipo) ? sipo->cursorVal : 0.0f; + ked.f1= (sipo) ? sipo->cursorVal : 0.0f; } /* filter data */ @@ -1786,11 +1786,11 @@ static void mirror_graph_keys(bAnimContext *ac, short mode) if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve); /* unapply unit corrections */ ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, ANIM_UNITCONV_ONLYKEYS|ANIM_UNITCONV_RESTORE); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 8cb124422cb..e15dc797186 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -95,8 +95,8 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel) int filter; SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; - BeztEditData bed; - BeztEditFunc test_cb, sel_cb; + KeyframeEditData ked; + KeyframeEditFunc test_cb, sel_cb; /* determine type-based settings */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); @@ -105,13 +105,13 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* init BezTriple looping data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); 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) { - if (ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, test_cb, NULL)) { + if (ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, test_cb, NULL)) { sel= SELECT_SUBTRACT; break; } @@ -126,7 +126,7 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel) FCurve *fcu= (FCurve *)ale->key_data; /* Keyframes First */ - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, sel_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, sel_cb, NULL); /* only change selection of channel when the visibility of keyframes doesn't depend on this */ if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) { @@ -206,8 +206,8 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho int filter; SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; - BeztEditData bed; - BeztEditFunc ok_cb, select_cb; + KeyframeEditData ked; + KeyframeEditFunc ok_cb, select_cb; View2D *v2d= &ac->ar->v2d; rctf rectf; @@ -224,8 +224,8 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho ok_cb= ANIM_editkeyframes_ok(mode); /* init editing data */ - memset(&bed, 0, sizeof(BeztEditData)); - bed.data= &rectf; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.data= &rectf; /* loop over data, doing border select */ for (ale= anim_data.first; ale; ale= ale->next) { @@ -243,21 +243,21 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho /* set horizontal range (if applicable) * NOTE: these values are only used for x-range and y-range but not region - * (which uses bed.data, i.e. rectf) + * (which uses ked.data, i.e. rectf) */ if (mode != BEZT_OK_VALUERANGE) { - bed.f1= rectf.xmin; - bed.f2= rectf.xmax; + ked.f1= rectf.xmin; + ked.f2= rectf.xmax; } else { - bed.f1= rectf.ymin; - bed.f2= rectf.ymax; + ked.f1= rectf.ymin; + ked.f2= rectf.ymax; } /* firstly, check if any keyframes will be hit by this */ - if (ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, ok_cb, NULL)) { + if (ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, ok_cb, NULL)) { /* select keyframes that are in the appropriate places */ - ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, fcu, ok_cb, select_cb, NULL); /* only change selection of channel when the visibility of keyframes doesn't depend on this */ if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) { @@ -375,8 +375,8 @@ static void markers_selectkeys_between (bAnimContext *ac) bAnimListElem *ale; int filter; - BeztEditFunc ok_cb, select_cb; - BeztEditData bed; + KeyframeEditFunc ok_cb, select_cb; + KeyframeEditData ked; float min, max; /* get extreme markers */ @@ -388,9 +388,9 @@ static void markers_selectkeys_between (bAnimContext *ac) ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE); select_cb= ANIM_editkeyframes_select(SELECT_ADD); - memset(&bed, 0, sizeof(BeztEditData)); - bed.f1= min; - bed.f2= max; + memset(&ked, 0, sizeof(KeyframeEditData)); + ked.f1= min; + ked.f2= max; /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); @@ -402,11 +402,11 @@ static void markers_selectkeys_between (bAnimContext *ac) if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else { - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); } } @@ -424,11 +424,11 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) Scene *scene= ac->scene; CfraElem *ce; - BeztEditFunc select_cb, ok_cb; - BeztEditData bed; + KeyframeEditFunc select_cb, ok_cb; + KeyframeEditData ked; /* initialise keyframe editing data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* build list of columns */ switch (mode) { @@ -437,7 +437,7 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_to_cfraelem, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_to_cfraelem, NULL); BLI_freelistN(&anim_data); break; @@ -445,13 +445,13 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) case GRAPHKEYS_COLUMNSEL_CFRA: /* current frame */ /* make a single CfraElem for storing this */ ce= MEM_callocN(sizeof(CfraElem), "cfraElem"); - BLI_addtail(&bed.list, ce); + BLI_addtail(&ked.list, ce); ce->cfra= (float)CFRA; break; case GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */ - ED_markers_make_cfra_list(ac->markers, &bed.list, 1); + ED_markers_make_cfra_list(ac->markers, &ked.list, 1); break; default: /* invalid option */ @@ -471,23 +471,23 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(ac, ale); - /* loop over cfraelems (stored in the BeztEditData->list) + /* loop over cfraelems (stored in the KeyframeEditData->list) * - we need to do this here, as we can apply fewer NLA-mapping conversions */ - for (ce= bed.list.first; ce; ce= ce->next) { + for (ce= ked.list.first; ce; ce= ce->next) { /* set frame for validation callback to refer to */ if (ale) - bed.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, NLATIME_CONVERT_UNMAP); + ked.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, NLATIME_CONVERT_UNMAP); else - bed.f1= ce->cfra; + ked.f1= ce->cfra; /* select elements with frame number matching cfraelem */ - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); } } /* free elements */ - BLI_freelistN(&bed.list); + BLI_freelistN(&ked.list); BLI_freelistN(&anim_data); } @@ -543,13 +543,13 @@ static void select_moreless_graph_keys (bAnimContext *ac, short mode) bAnimListElem *ale; int filter; - BeztEditData bed; - BeztEditFunc build_cb; + KeyframeEditData ked; + KeyframeEditFunc build_cb; /* init selmap building data */ build_cb= ANIM_editkeyframes_buildselmap(mode); - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* loop through all of the keys and select additional keyframes based on these */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); @@ -563,15 +563,15 @@ static void select_moreless_graph_keys (bAnimContext *ac, short mode) continue; /* build up map of whether F-Curve's keyframes should be selected or not */ - bed.data= MEM_callocN(fcu->totvert, "selmap graphEdit"); - ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, build_cb, NULL); + ked.data= MEM_callocN(fcu->totvert, "selmap graphEdit"); + ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, build_cb, NULL); /* based on this map, adjust the selection status of the keyframes */ - ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, bezt_selmap_flush, NULL); + ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, bezt_selmap_flush, NULL); /* free the selmap used here */ - MEM_freeN(bed.data); - bed.data= NULL; + MEM_freeN(ked.data); + ked.data= NULL; } /* Cleanup */ @@ -968,17 +968,17 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s } } else { - BeztEditFunc select_cb; - BeztEditData bed; + KeyframeEditFunc select_cb; + KeyframeEditData ked; /* initialise keyframe editing data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* set up BezTriple edit callbacks */ select_cb= ANIM_editkeyframes_select(select_mode); /* select all keyframes */ - ANIM_fcurve_keys_bezier_loop(&bed, nvi->fcu, NULL, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, nvi->fcu, NULL, select_cb, NULL); } /* only change selection of channel when the visibility of keyframes doesn't depend on this */ @@ -1008,8 +1008,8 @@ static void graphkeys_mselect_leftright (bAnimContext *ac, short leftright, shor int filter; SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; - BeztEditFunc ok_cb, select_cb; - BeztEditData bed; + KeyframeEditFunc ok_cb, select_cb; + KeyframeEditData ked; Scene *scene= ac->scene; /* if select mode is replace, deselect all keyframes (and channels) first */ @@ -1032,14 +1032,14 @@ static void graphkeys_mselect_leftright (bAnimContext *ac, short leftright, shor ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE); select_cb= ANIM_editkeyframes_select(select_mode); - memset(&bed, 0, sizeof(BeztEditFunc)); + memset(&ked, 0, sizeof(KeyframeEditFunc)); if (leftright == GRAPHKEYS_LRSEL_LEFT) { - bed.f1 = MINAFRAMEF; - bed.f2 = (float)(CFRA + 0.1f); + ked.f1 = MINAFRAMEF; + ked.f2 = (float)(CFRA + 0.1f); } else { - bed.f1 = (float)(CFRA - 0.1f); - bed.f2 = MAXFRAMEF; + ked.f1 = (float)(CFRA - 0.1f); + ked.f2 = MAXFRAMEF; } /* filter data */ @@ -1052,11 +1052,11 @@ static void graphkeys_mselect_leftright (bAnimContext *ac, short leftright, shor if (adt) { ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); } /* Cleanup */ @@ -1071,8 +1071,8 @@ static void graphkeys_mselect_column (bAnimContext *ac, int mval[2], short selec int filter; SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; - BeztEditFunc select_cb, ok_cb; - BeztEditData bed; + KeyframeEditFunc select_cb, ok_cb; + KeyframeEditData ked; tNearestVertInfo *nvi; float selx = (float)ac->scene->r.cfra; @@ -1107,7 +1107,7 @@ static void graphkeys_mselect_column (bAnimContext *ac, int mval[2], short selec } /* initialise keyframe editing data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* set up BezTriple edit callbacks */ select_cb= ANIM_editkeyframes_select(select_mode); @@ -1124,17 +1124,17 @@ static void graphkeys_mselect_column (bAnimContext *ac, int mval[2], short selec /* set frame for validation callback to refer to */ if (adt) - bed.f1= BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP); + ked.f1= BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP); else - bed.f1= selx; + ked.f1= selx; /* select elements with frame number matching cfra */ - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); + ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL); } /* free elements */ MEM_freeN(nvi); - BLI_freelistN(&bed.list); + BLI_freelistN(&ked.list); BLI_freelistN(&anim_data); } diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 706dcf49c4f..eeb8fc5e696 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1239,10 +1239,10 @@ void NLA_OT_action_sync_length (wmOperatorType *ot) /* Reset the scaling of the selected strips to 1.0f */ /* apply scaling to keyframe */ -static short bezt_apply_nlamapping (BeztEditData *bed, BezTriple *bezt) +static short bezt_apply_nlamapping (KeyframeEditData *ked, BezTriple *bezt) { - /* NLA-strip which has this scaling is stored in bed->data */ - NlaStrip *strip= (NlaStrip *)bed->data; + /* NLA-strip which has this scaling is stored in ked->data */ + NlaStrip *strip= (NlaStrip *)ked->data; /* adjust all the times */ bezt->vec[0][0]= nlastrip_get_frame(strip, bezt->vec[0][0], NLATIME_CONVERT_MAP); @@ -1261,7 +1261,7 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) bAnimListElem *ale; int filter; - BeztEditData bed; + KeyframeEditData ked; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -1272,7 +1272,7 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* init the editing data */ - memset(&bed, 0, sizeof(BeztEditData)); + memset(&ked, 0, sizeof(KeyframeEditData)); /* for each NLA-Track, apply scale of all selected strips */ for (ale= anim_data.first; ale; ale= ale->next) { @@ -1295,8 +1295,8 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) } /* setup iterator, and iterate over all the keyframes in the action, applying this scaling */ - bed.data= strip; - ANIM_animchanneldata_keys_bezier_loop(&bed, strip->act, ALE_ACT, NULL, bezt_apply_nlamapping, calchandles_fcurve, 0); + ked.data= strip; + ANIM_animchanneldata_keyframes_loop(&ked, strip->act, ALE_ACT, NULL, bezt_apply_nlamapping, calchandles_fcurve, 0); /* clear scale of strip now that it has been applied, * and recalculate the extents of the action now that it has been scaled |