Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/animation/anim_draw.c')
-rw-r--r--source/blender/editors/animation/anim_draw.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 9e8800fd91e..4a8557a2b1f 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -389,76 +389,4 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short rest
return 1.0f;
}
-/* ----------------------- */
-
-/* helper function for ANIM_unit_mapping_apply_fcurve -> mapping callback for unit mapping */
-static short bezt_unit_mapping_apply(KeyframeEditData *ked, BezTriple *bezt)
-{
- /* mapping factor is stored in f1, flags are stored in i1 */
- const bool only_keys = (ked->i1 & ANIM_UNITCONV_ONLYKEYS) != 0;
- const bool sel_vs = (ked->i1 & ANIM_UNITCONV_SELVERTS) != 0;
- const bool skip_knot = (ked->i1 & ANIM_UNITCONV_SKIPKNOTS) != 0;
- float fac = ked->f1;
-
- /* adjust BezTriple handles only if allowed to */
- if (only_keys == false) {
- if ((sel_vs == false) || (bezt->f1 & SELECT))
- bezt->vec[0][1] *= fac;
- if ((sel_vs == false) || (bezt->f3 & SELECT))
- bezt->vec[2][1] *= fac;
- }
-
- if (skip_knot == false) {
- if ((sel_vs == false) || (bezt->f2 & SELECT))
- bezt->vec[1][1] *= fac;
- }
-
- return 0;
-}
-
-/* Apply/Unapply units conversions to keyframes */
-void ANIM_unit_mapping_apply_fcurve(Scene *scene, ID *id, FCurve *fcu, short flag)
-{
- KeyframeEditData ked;
- KeyframeEditFunc sel_cb;
- float fac;
-
- /* abort if rendering - we may get some race condition issues... */
- if (G.is_rendering) return;
-
- /* calculate mapping factor, and abort if nothing to change */
- fac = ANIM_unit_mapping_get_factor(scene, id, fcu, (flag & ANIM_UNITCONV_RESTORE));
- if (fac == 1.0f)
- return;
-
- /* init edit data
- * - mapping factor is stored in f1
- * - flags are stored in 'i1'
- */
- memset(&ked, 0, sizeof(KeyframeEditData));
- ked.f1 = (float)fac;
- ked.i1 = (int)flag;
-
- /* only selected? */
- if (flag & ANIM_UNITCONV_ONLYSEL)
- sel_cb = ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
- else
- sel_cb = NULL;
-
- /* apply to F-Curve */
- ANIM_fcurve_keyframes_loop(&ked, fcu, sel_cb, bezt_unit_mapping_apply, NULL);
-
- // FIXME: loop here for samples should be generalised
- // TODO: only sel?
- if (fcu->fpt) {
- FPoint *fpt;
- unsigned int i;
-
- for (i = 0, fpt = fcu->fpt; i < fcu->totvert; i++, fpt++) {
- /* apply unit mapping */
- fpt->vec[1] *= fac;
- }
- }
-}
-
/* *************************************************** */