converted more mixed tab/space indentations to tabs. only whitespace changes.
[blender.git] / source / blender / editors / transform / transform.c
index 97f4b47..c710312 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file blender/editors/transform/transform.c
+ *  \ingroup edtransform
+ */
+
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 
 #include "RNA_access.h"
 
-//#include "BIF_editview.h"            /* arrows_move_cursor   */
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
-//#include "BIF_mywindow.h"
-//#include "BIF_resources.h"
-//#include "BIF_screen.h"
-//#include "BIF_space.h"                       /* undo                                 */
-//#include "BIF_toets.h"                       /* persptoetsen                 */
-//#include "BIF_mywindow.h"            /* warp_pointer                 */
-//#include "BIF_toolbox.h"                     /* notice                               */
-//#include "BIF_editmesh.h"
-//#include "BIF_editsima.h"
-//#include "BIF_editparticle.h"
 
 #include "BKE_nla.h"
-//#include "BKE_bad_level_calls.h"/* popmenu and error */
 #include "BKE_bmesh.h"
 #include "BKE_context.h"
 #include "BKE_constraint.h"
@@ -73,8 +66,6 @@
 #include "BKE_pointcache.h"
 #include "BKE_unit.h"
 
-//#include "BSE_view.h"
-
 #include "ED_image.h"
 #include "ED_keyframing.h"
 #include "ED_screen.h"
@@ -546,9 +537,6 @@ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf)
        WM_modalkeymap_add_item(keymap, AKEY, KM_PRESS, 0, 0, TFM_MODAL_ADD_SNAP);
        WM_modalkeymap_add_item(keymap, AKEY, KM_PRESS, KM_ALT, 0, TFM_MODAL_REMOVE_SNAP);
 
-       WM_modalkeymap_add_item(keymap, UPARROWKEY, KM_PRESS, 0, 0, NUM_MODAL_INCREMENT_UP);
-       WM_modalkeymap_add_item(keymap, DOWNARROWKEY, KM_PRESS, 0, 0, NUM_MODAL_INCREMENT_DOWN);
-       
        WM_modalkeymap_add_item(keymap, PAGEUPKEY, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_UP);
        WM_modalkeymap_add_item(keymap, PAGEDOWNKEY, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_DOWN);
        WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_UP);
@@ -1065,7 +1053,6 @@ int transformEvent(TransInfo *t, wmEvent *event)
                // Snapping events
                t->redraw |= handleSnapping(t, event);
 
-               //arrows_move_cursor(event->type);
        }
        else if (event->val==KM_RELEASE) {
                switch (event->type){
@@ -1238,6 +1225,15 @@ static void drawArc(float size, float angle_start, float angle_end, int segments
        glEnd();
 }
 
+static int helpline_poll(bContext *C)
+{
+       ARegion *ar= CTX_wm_region(C);
+       
+       if(ar && ar->regiontype==RGN_TYPE_WINDOW)
+               return 1;
+       return 0;
+}
+
 static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
 {
        TransInfo *t = (TransInfo*)customdata;
@@ -1276,7 +1272,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
                                glEnd();
 
                                glTranslatef(mval[0], mval[1], 0);
-                               glRotatef(-180 / M_PI * atan2f(cent[0] - t->mval[0], cent[1] - t->mval[1]), 0, 0, 1);
+                               glRotatef(-RAD2DEGF(atan2f(cent[0] - t->mval[0], cent[1] - t->mval[1])), 0, 0, 1);
 
                                setlinestyle(0);
                                glLineWidth(3.0);
@@ -1310,8 +1306,8 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
                                        float dx = t->mval[0] - cent[0], dy = t->mval[1] - cent[1];
                                        float angle = atan2f(dy, dx);
                                        float dist = sqrtf(dx*dx + dy*dy);
-                                       float delta_angle = MIN2(15 / dist, M_PI/4);
-                                       float spacing_angle = MIN2(5 / dist, M_PI/12);
+                                       float delta_angle = MIN2(15.0f / dist, (float)M_PI/4.0f);
+                                       float spacing_angle = MIN2(5.0f / dist, (float)M_PI/12.0f);
                                        UI_ThemeColor(TH_WIRE);
 
                                        setlinestyle(3);
@@ -1330,14 +1326,14 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
                                        glPushMatrix();
 
                                        glTranslatef(cosf(angle - delta_angle) * dist, sinf(angle - delta_angle) * dist, 0);
-                                       glRotatef(180 / M_PI * (angle - delta_angle), 0, 0, 1);
+                                       glRotatef(RAD2DEGF(angle - delta_angle), 0, 0, 1);
 
                                        drawArrowHead(DOWN, 5);
 
                                        glPopMatrix();
 
                                        glTranslatef(cosf(angle + delta_angle) * dist, sinf(angle + delta_angle) * dist, 0);
-                                       glRotatef(180 / M_PI * (angle + delta_angle), 0, 0, 1);
+                                       glRotatef(RAD2DEGF(angle + delta_angle), 0, 0, 1);
 
                                        drawArrowHead(UP, 5);
 
@@ -1552,7 +1548,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
                t->draw_handle_apply = ED_region_draw_cb_activate(t->ar->type, drawTransformApply, t, REGION_DRAW_PRE_VIEW);
                t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW);
                //t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL);
-               t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), NULL, drawHelpline, t);
+               t->draw_handle_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), helpline_poll, drawHelpline, t);
        }
        else if(t->spacetype == SPACE_IMAGE) {
                unit_m3(t->spacemtx);
@@ -1654,11 +1650,6 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
                break;
        case TFM_EDGE_SLIDE:
                initEdgeSlide(t);
-               if(t->state == TRANS_CANCEL)
-               {
-                       postTrans(C, t);
-                       return 0;
-               }
                break;
        case TFM_BONE_ROLL:
                initBoneRoll(t);
@@ -1672,6 +1663,16 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
        case TFM_TIME_SCALE:
                initTimeScale(t);
                break;
+       case TFM_TIME_DUPLICATE:
+               /* same as TFM_TIME_EXTEND, but we need the mode info for later 
+                * so that duplicate-culling will work properly
+                */
+               if ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)
+                       initTranslation(t);
+               else
+                       initTimeTranslate(t);
+               t->mode = mode;
+               break;
        case TFM_TIME_EXTEND:
                /* now that transdata has been made, do like for TFM_TIME_TRANSLATE (for most Animation
                 * Editors because they have only 1D transforms for time values) or TFM_TRANSLATION
@@ -1703,6 +1704,13 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
                break;
        }
 
+       if(t->state == TRANS_CANCEL)
+       {
+               postTrans(C, t);
+               return 0;
+       }
+
+
        /* overwrite initial values if operator supplied a non-null vector */
        if (RNA_property_is_set(op->ptr, "value"))
        {
@@ -1913,7 +1921,7 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl
                eulO_to_axis_angle( axis, angle,eul, EULER_ORDER_DEFAULT);
                
                /* when converting to axis-angle, we need a special exception for the case when there is no axis */
-               if (IS_EQ(axis[0], axis[1]) && IS_EQ(axis[1], axis[2])) {
+               if (IS_EQF(axis[0], axis[1]) && IS_EQF(axis[1], axis[2])) {
                        /* for now, rotate around y-axis then (so that it simply becomes the roll) */
                        axis[1]= 1.0f;
                }
@@ -1974,7 +1982,7 @@ static void constraintTransLim(TransInfo *UNUSED(t), TransData *td)
 {
        if (td->con) {
                bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_LOCLIMIT);
-               bConstraintOb cob= {0};
+               bConstraintOb cob= {NULL};
                bConstraint *con;
                
                /* Make a temporary bConstraintOb for using these limit constraints
@@ -2130,7 +2138,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
 {
        if (td->con && td->ext) {
                bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_SIZELIMIT);
-               bConstraintOb cob= {0};
+               bConstraintOb cob= {NULL};
                bConstraint *con;
                
                /* Make a temporary bConstraintOb for using these limit constraints
@@ -2229,8 +2237,8 @@ void initWarp(TransInfo *t)
        t->idx_max = 0;
        t->num.idx_max = 0;
        t->snap[0] = 0.0f;
-       t->snap[1] = 5.0f / 180 * M_PI;
-       t->snap[2] = 1.0f / 180 * M_PI;
+       t->snap[1] = 5.0f / 180.0f * (float)M_PI;
+       t->snap[2] = 1.0f / 180.0f * (float)M_PI;
        
        t->num.increment = 1.0f;
 
@@ -2253,7 +2261,7 @@ void initWarp(TransInfo *t)
 
        mid_v3_v3v3(t->center, min, max);
 
-       if (max[0] == min[0]) max[0] += 0.1; /* not optimal, but flipping is better than invalid garbage (i.e. division by zero!) */
+       if (max[0] == min[0]) max[0] += 0.1f; /* not optimal, but flipping is better than invalid garbage (i.e. division by zero!) */
        t->val= (max[0]-min[0])/2.0f; /* t->val is X dimension projected boundbox */
 }
 
@@ -2264,10 +2272,10 @@ int handleEventWarp(TransInfo *t, wmEvent *event)
        if (event->type == MIDDLEMOUSE && event->val==KM_PRESS)
        {
                // Use customData pointer to signal warp direction
-               if      (t->customData == 0)
+               if      (t->customData == NULL)
                        t->customData = (void*)1;
                else
-                       t->customData = 0;
+                       t->customData = NULL;
                
                status = 1;
        }
@@ -2317,11 +2325,11 @@ int Warp(TransInfo *t, short UNUSED(mval[2]))
                
                sprintf(str, "Warp: %s", c);
 
-               circumfac = circumfac / 180 * M_PI;
+               circumfac = DEG2RADF(circumfac);
        }
        else {
                /* default header print */
-               sprintf(str, "Warp: %.3f", circumfac * 180 / M_PI);
+               sprintf(str, "Warp: %.3f", RAD2DEGF(circumfac));
        }
        
        t->values[0] = circumfac;
@@ -2405,7 +2413,7 @@ int handleEventShear(TransInfo *t, wmEvent *event)
        if (event->type == MIDDLEMOUSE && event->val==KM_PRESS)
        {
                // Use customData pointer to signal Shear direction
-               if      (t->customData == 0)
+               if      (t->customData == NULL)
                {
                        initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE);
                        t->customData = (void*)1;
@@ -2413,7 +2421,7 @@ int handleEventShear(TransInfo *t, wmEvent *event)
                else
                {
                        initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE);
-                       t->customData = 0;
+                       t->customData = NULL;
                }
                
                status = 1;
@@ -2457,7 +2465,7 @@ int Shear(TransInfo *t, short UNUSED(mval[2]))
        unit_m3(smat);
        
        // Custom data signals shear direction
-       if (t->customData == 0)
+       if (t->customData == NULL)
                smat[1][0] = value;
        else
                smat[0][1] = value;
@@ -3170,18 +3178,12 @@ int Rotation(TransInfo *t, short UNUSED(mval[2]))
                outputNumInput(&(t->num), c);
                
                sprintf(str, "Rot: %s %s %s", &c[0], t->con.text, t->proptext);
-               
+
                /* Clamp between -180 and 180 */
-               while (final >= 180.0)
-                       final -= 360.0;
-               
-               while (final <= -180.0)
-                       final += 360.0;
-               
-               final *= (float)(M_PI / 180.0);
+               final= angle_wrap_rad(DEG2RADF(final));
        }
        else {
-               sprintf(str, "Rot: %.2f%s %s", 180.0*final/M_PI, t->con.text, t->proptext);
+               sprintf(str, "Rot: %.2f%s %s", RAD2DEGF(final), t->con.text, t->proptext);
        }
        
        if (t->flag & (T_PROP_EDIT|T_PROP_CONNECTED))
@@ -3281,11 +3283,11 @@ int Trackball(TransInfo *t, short UNUSED(mval[2]))
 
                sprintf(str, "Trackball: %s %s %s", &c[0], &c[20], t->proptext);
 
-               phi[0] *= (float)(M_PI / 180.0);
-               phi[1] *= (float)(M_PI / 180.0);
+               phi[0] = DEG2RADF(phi[0]);
+               phi[1] = DEG2RADF(phi[1]);
        }
        else {
-               sprintf(str, "Trackball: %.2f %.2f %s", 180.0*phi[0]/M_PI, 180.0*phi[1]/M_PI, t->proptext);
+               sprintf(str, "Trackball: %.2f %.2f %s", RAD2DEGF(phi[0]), RAD2DEGF(phi[1]), t->proptext);
        }
 
        vec_rot_to_mat3( smat,axis1, phi[0]);
@@ -3374,7 +3376,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) {
 
        if(!(t->flag & T_2D_EDIT) && t->scene->unit.system)
                bUnit_AsString(distvec, sizeof(distvec), dist*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, t->scene->unit.flag & USER_UNIT_OPT_SPLIT, 0);
-       else if( dist > 1e10 || dist < -1e10 )  /* prevent string buffer overflow */
+       else if( dist > 1e10f || dist < -1e10f )        /* prevent string buffer overflow */
                sprintf(distvec, "%.4e", dist);
        else
                sprintf(distvec, "%.4f", dist);
@@ -3640,10 +3642,10 @@ int Tilt(TransInfo *t, short UNUSED(mval[2]))
 
                sprintf(str, "Tilt: %s %s", &c[0], t->proptext);
 
-               final *= (float)(M_PI / 180.0);
+               final = DEG2RADF(final);
        }
        else {
-               sprintf(str, "Tilt: %.2f %s", 180.0*final/M_PI, t->proptext);
+               sprintf(str, "Tilt: %.2f %s", RAD2DEGF(final), t->proptext);
        }
 
        for(i = 0 ; i < t->total; i++, td++) {
@@ -4099,6 +4101,7 @@ void initBoneSize(TransInfo *t)
        t->idx_max = 2;
        t->num.idx_max = 2;
        t->num.flag |= NUM_NULL_ONE;
+       t->num.flag |= NUM_AFFECT_ALL;
        t->snap[0] = 0.0f;
        t->snap[1] = 0.1f;
        t->snap[2] = t->snap[1] * 0.1f;
@@ -4292,7 +4295,7 @@ static int createSlideVerts(TransInfo *t)
        int  uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
        int uvlay_idx;
        TransDataSlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL;
-       RegionView3D *v3d = t->ar->regiondata;
+       RegionView3D *v3d = t->ar ? t->ar->regiondata : NULL; /* background mode support */
        float projectMat[4][4];
        float start[3] = {0.0f, 0.0f, 0.0f}, end[3] = {0.0f, 0.0f, 0.0f};
        float vec[3];
@@ -4482,11 +4485,11 @@ static int createSlideVerts(TransInfo *t)
                        for(eed=em->edges.first;eed;eed=eed->next) {
                                if(editedge_containsVert(eed, ev)) {
                                        if(!(eed->f & SELECT)) {
-                                                if(!tempsv->up) {
-                                                        tempsv->up = eed;
-                                                } else if (!(tempsv->down)) {
-                                                        tempsv->down = eed;
-                                                }
+                                               if(!tempsv->up) {
+                                                       tempsv->up = eed;
+                                               } else if (!(tempsv->down)) {
+                                                       tempsv->down = eed;
+                                               }
                                        }
                                }
                        }
@@ -4498,33 +4501,33 @@ static int createSlideVerts(TransInfo *t)
                                        for(efa = em->faces.first;efa;efa=efa->next) {
                                                if(editface_containsEdge(efa, eed)) {
                                                        if(editedge_containsVert(efa->e1, ev) && efa->e1 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e1;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e1;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e1;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e1;
+                                                               }
                                                        }
                                                        if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e2;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e2;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e2;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e2;
+                                                               }
                                                        }
                                                        if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e3;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e3;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e3;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e3;
+                                                               }
                                                        }
                                                        if(efa->e4) {
                                                                if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) {
-                                                                        if(!tempsv->up) {
-                                                                                tempsv->up = efa->e4;
-                                                                        } else if (!(tempsv->down)) {
-                                                                                tempsv->down = efa->e4;
-                                                                        }
+                                                                       if(!tempsv->up) {
+                                                                               tempsv->up = efa->e4;
+                                                                       } else if (!(tempsv->down)) {
+                                                                               tempsv->down = efa->e4;
+                                                                       }
                                                                }
                                                        }
 
@@ -4631,7 +4634,7 @@ static int createSlideVerts(TransInfo *t)
        }
 
        add_v3_v3(start, end);
-       mul_v3_fl(start, 0.5*(1.0/totvec));
+       mul_v3_fl(start, 0.5f*(1.0f/totvec));
        VECCOPY(vec, start);
        start[0] = t->mval[0];
        start[1] = t->mval[1];
@@ -4915,8 +4918,8 @@ int doEdgeSlide(TransInfo *t, float perc)
                        tempsv = BLI_ghash_lookup(vertgh,ev);
                        edgelen = len_v3v3(editedge_getOtherVert(tempsv->up,ev)->co,editedge_getOtherVert(tempsv->down,ev)->co);
                        newlen = (edgelen != 0.0f)? (len / edgelen): 0.0f;
-                       if(newlen > 1.0) {newlen = 1.0;}
-                       if(newlen < 0.0) {newlen = 0.0;}
+                       if(newlen > 1.0f) {newlen = 1.0;}
+                       if(newlen < 0.0f) {newlen = 0.0;}
                        if(flip == 0) {
                                interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen));
                                if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
@@ -5039,10 +5042,10 @@ int BoneRoll(TransInfo *t, short UNUSED(mval[2]))
 
                sprintf(str, "Roll: %s", &c[0]);
 
-               final *= (float)(M_PI / 180.0);
+               final = DEG2RADF(final);
        }
        else {
-               sprintf(str, "Roll: %.2f", 180.0*final/M_PI);
+               sprintf(str, "Roll: %.2f", RAD2DEGF(final));
        }
 
        /* set roll values */
@@ -5350,8 +5353,8 @@ int SeqSlide(TransInfo *t, short UNUSED(mval[2]))
                applyNumInput(&t->num, t->values);
        }
 
-       t->values[0] = floor(t->values[0] + 0.5);
-       t->values[1] = floor(t->values[1] + 0.5);
+       t->values[0] = floor(t->values[0] + 0.5f);
+       t->values[1] = floor(t->values[1] + 0.5f);
 
        headerSeqSlide(t, t->values, str);
        applySeqSlide(t, t->values);
@@ -5450,7 +5453,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d,
        /* snap key to nearest frame? */
        if (autosnap == SACTSNAP_FRAME) {
                const Scene *scene= t->scene;
-               const short doTime= 0; //XXX doesn't work - getAnimEdit_DrawTime(t);
+               const short doTime= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behaviour given the option's label, hence disabled
                const double secf= FPS;
                double val;
                
@@ -5509,6 +5512,11 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d,
 
 void initTimeTranslate(TransInfo *t)
 {
+       /* this tool is only really available in the Action Editor... */
+       if (t->spacetype != SPACE_ACTION) {
+               t->state = TRANS_CANCEL;
+       }
+
        t->mode = TFM_TIME_TRANSLATE;
        t->transform = TimeTranslate;
 
@@ -5657,8 +5665,11 @@ void initTimeSlide(TransInfo *t)
 
                /* set flag for drawing stuff */
                saction->flag |= SACTION_MOVING;
+       } else {
+               t->state = TRANS_CANCEL;
        }
 
+
        t->mode = TFM_TIME_SLIDE;
        t->transform = TimeSlide;
        t->flag |= T_FREE_CUSTOMDATA;
@@ -5765,7 +5776,7 @@ int TimeSlide(TransInfo *t, short mval[2])
        /* handle numeric-input stuff */
        t->vec[0] = 2.0f*(cval[0]-sval[0]) / (maxx-minx);
        applyNumInput(&t->num, &t->vec[0]);
-       t->values[0] = (maxx-minx) * t->vec[0] / 2.0 + sval[0];
+       t->values[0] = (maxx-minx) * t->vec[0] / 2.0f + sval[0];
 
        headerTimeSlide(t, sval[0], str);
        applyTimeSlide(t, sval[0]);
@@ -5783,6 +5794,13 @@ void initTimeScale(TransInfo *t)
 {
        int center[2];
 
+       /* this tool is only really available in the Action Editor
+        * AND NLA Editor (for strip scaling)
+        */
+       if (ELEM(t->spacetype, SPACE_ACTION, SPACE_NLA) == 0) {
+               t->state = TRANS_CANCEL;
+       }
+
        t->mode = TFM_TIME_SCALE;
        t->transform = TimeScale;