style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jun 2012 19:59:02 +0000 (19:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jun 2012 19:59:02 +0000 (19:59 +0000)
29 files changed:
intern/itasc/kdl/frames.inl
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_tracking.h
source/blender/blenkernel/intern/tracking.c
source/blender/blenlib/BLI_pbvh.h
source/blender/blenlib/intern/pbvh.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_clip/clip_buttons.c
source/blender/editors/space_clip/clip_dopesheet_draw.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_graph_draw.c
source/blender/editors/space_clip/clip_graph_ops.c
source/blender/editors/space_clip/clip_intern.h
source/blender/editors/space_clip/clip_utils.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c
source/blender/makesdna/DNA_movieclip_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_tracking_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_tracking.c

index 65c6148..a09b532 100644 (file)
@@ -20,8 +20,8 @@
  *                                                                         *
  *   You should have received a copy of the GNU Lesser General Public      *
  *   License along with this library; if not, write to the Free Software   *
- *   Foundation, Inc., 51 Franklin Street,                                    *
- *   Fifth Floor, Boston, MA 02110-1301, USA.                               *
+ *   Foundation, Inc., 51 Franklin Street,                                 *
+ *   Fifth Floor, Boston, MA 02110-1301, USA.                              *
  *                                                                         *
  ***************************************************************************/
 
index b833bc4..faa996b 100644 (file)
@@ -49,7 +49,7 @@ extern "C" {
 
 /* used by packaging tools */
 /* can be left blank, otherwise a,b,c... etc with no quotes */
-#define BLENDER_VERSION_CHAR   a
+#define BLENDER_VERSION_CHAR    a
 /* alpha/beta/rc/release, docs use this */
 #define BLENDER_VERSION_CYCLE   alpha
 
index 8c28dd9..a13674c 100644 (file)
@@ -113,7 +113,7 @@ void BKE_tracking_clipboard_paste_tracks(struct MovieTracking *tracking, struct
 
 /* 2D tracking */
 struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user,
-                       short backwards, short sequence);
+                                                      short backwards, short sequence);
 void BKE_tracking_context_free(struct MovieTrackingContext *context);
 void BKE_tracking_sync(struct MovieTrackingContext *context);
 void BKE_tracking_sync_user(struct MovieClipUser *user, struct MovieTrackingContext *context);
@@ -123,15 +123,15 @@ int BKE_tracking_next(struct MovieTrackingContext *context);
 int BKE_tracking_can_reconstruct(struct MovieTracking *tracking, struct MovieTrackingObject *object,
                                  char *error_msg, int error_size);
 
-struct MovieReconstructContextBKE_tracking_reconstruction_context_new(struct MovieTracking *tracking,
-                       struct MovieTrackingObject *object, int keyframe1, int keyframe2, int width, int height);
+struct MovieReconstructContext *BKE_tracking_reconstruction_context_new(struct MovieTracking *tracking,
+                                                                        struct MovieTrackingObject *object, int keyframe1, int keyframe2, int width, int height);
 void BKE_tracking_reconstruction_context_free(struct MovieReconstructContext *context);
 void BKE_tracking_solve_reconstruction(struct MovieReconstructContext *context, short *stop, short *do_update,
                                        float *progress, char *stats_message, int message_size);
 int BKE_tracking_finish_reconstruction(struct MovieReconstructContext *context, struct MovieTracking *tracking);
 
 struct MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(struct MovieTracking *tracking,
-                       struct MovieTrackingObject *object, int framenr);
+                                                                       struct MovieTrackingObject *object, int framenr);
 void BKE_tracking_get_interpolated_camera(struct MovieTracking *tracking, struct MovieTrackingObject *object,
                                           int framenr, float mat[4][4]);
 
@@ -172,39 +172,39 @@ void BKE_tracking_deselect_track(struct MovieTrackingTrack *track, int area);
 void BKE_tracking_dopesheet_tag_update(struct MovieTracking *tracking);
 void BKE_tracking_dopesheet_update(struct MovieTracking *tracking, int sort_method, int inverse);
 
-#define TRACK_SELECTED(track)                          ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT)
+#define TRACK_SELECTED(track)               ((track)->flag & SELECT || (track)->pat_flag & SELECT || (track)->search_flag & SELECT)
 
-#define TRACK_AREA_SELECTED(track, area)       ((area)==TRACK_AREA_POINT ? (track)->flag&SELECT : \
-                                                                        ((area)==TRACK_AREA_PAT ? (track)->pat_flag&SELECT : \
-                                                                                                  (track)->search_flag&SELECT))
+#define TRACK_AREA_SELECTED(track, area)    ((area) == TRACK_AREA_POINT ? (track)->flag & SELECT : \
+                                             ((area) == TRACK_AREA_PAT ? (track)->pat_flag & SELECT : \
+                                              (track)->search_flag & SELECT))
 
-#define TRACK_VIEW_SELECTED(sc, track)         ((((track)->flag & TRACK_HIDDEN)==0) && \
-                                             (  TRACK_AREA_SELECTED(track, TRACK_AREA_POINT) || \
-                                                (((sc)->flag & SC_SHOW_MARKER_PATTERN) && TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) || \
-                                                (((sc)->flag & SC_SHOW_MARKER_SEARCH) && TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))))
+#define TRACK_VIEW_SELECTED(sc, track)      ((((track)->flag & TRACK_HIDDEN) == 0) && \
+                                             (TRACK_AREA_SELECTED(track, TRACK_AREA_POINT) || \
+                                              (((sc)->flag & SC_SHOW_MARKER_PATTERN) && TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) || \
+                                              (((sc)->flag & SC_SHOW_MARKER_SEARCH) && TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))))
 
-#define MARKER_VISIBLE(sc, track, marker)              (((marker)->flag & MARKER_DISABLED)==0 || ((sc)->flag & SC_HIDE_DISABLED)==0 || (sc->clip->tracking.act_track == track))
+#define MARKER_VISIBLE(sc, track, marker)       (((marker)->flag & MARKER_DISABLED) == 0 || ((sc)->flag & SC_HIDE_DISABLED) == 0 || (sc->clip->tracking.act_track == track))
 
-#define TRACK_CLEAR_UPTO               0
-#define TRACK_CLEAR_REMAINED   1
-#define TRACK_CLEAR_ALL                        2
+#define TRACK_CLEAR_UPTO        0
+#define TRACK_CLEAR_REMAINED    1
+#define TRACK_CLEAR_ALL         2
 
-#define CLAMP_PAT_DIM          1
-#define CLAMP_PAT_POS          2
-#define CLAMP_SEARCH_DIM       3
-#define CLAMP_SEARCH_POS       4
+#define CLAMP_PAT_DIM       1
+#define CLAMP_PAT_POS       2
+#define CLAMP_SEARCH_DIM    3
+#define CLAMP_SEARCH_POS    4
 
-#define TRACK_AREA_NONE                -1
-#define TRACK_AREA_POINT       1
-#define TRACK_AREA_PAT         2
-#define TRACK_AREA_SEARCH      4
+#define TRACK_AREA_NONE     -1
+#define TRACK_AREA_POINT    1
+#define TRACK_AREA_PAT      2
+#define TRACK_AREA_SEARCH   4
 
-#define TRACK_AREA_ALL         (TRACK_AREA_POINT|TRACK_AREA_PAT|TRACK_AREA_SEARCH)
+#define TRACK_AREA_ALL      (TRACK_AREA_POINT | TRACK_AREA_PAT | TRACK_AREA_SEARCH)
 
-#define TRACK_SORT_NONE                -1
-#define TRACK_SORT_NAME                0
-#define TRACK_SORT_LONGEST     1
-#define TRACK_SORT_TOTAL       2
-#define TRACK_SORT_AVERAGE_ERROR       3
+#define TRACK_SORT_NONE     -1
+#define TRACK_SORT_NAME     0
+#define TRACK_SORT_LONGEST  1
+#define TRACK_SORT_TOTAL    2
+#define TRACK_SORT_AVERAGE_ERROR    3
 
 #endif
index bbb70bb..b4ee4f7 100644 (file)
@@ -39,7 +39,7 @@
 #include "DNA_gpencil_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_movieclip_types.h"
-#include "DNA_object_types.h"  /* SELECT */
+#include "DNA_object_types.h"   /* SELECT */
 #include "DNA_scene_types.h"
 
 #include "BLI_utildefines.h"
@@ -401,7 +401,7 @@ MovieTrackingMarker *BKE_tracking_insert_marker(MovieTrackingTrack *track, Movie
                track->markersnr++;
 
                if (track->markers)
-                       track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
+                       track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr);
                else
                        track->markers = MEM_callocN(sizeof(MovieTrackingMarker), "MovieTracking markers");
 
@@ -567,7 +567,7 @@ void BKE_tracking_clear_path(MovieTrackingTrack *track, int ref_frame, int actio
                while (a < track->markersnr) {
                        if (track->markers[a].framenr > ref_frame) {
                                track->markersnr = a;
-                               track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
+                               track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr);
 
                                break;
                        }
@@ -586,7 +586,7 @@ void BKE_tracking_clear_path(MovieTrackingTrack *track, int ref_frame, int actio
                                memmove(track->markers, track->markers + a, (track->markersnr - a) * sizeof(MovieTrackingMarker));
 
                                track->markersnr = track->markersnr - a;
-                               track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
+                               track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr);
 
                                break;
                        }
@@ -707,8 +707,8 @@ void BKE_tracking_join_tracks(MovieTrackingTrack *dst_track, MovieTrackingTrack
 
        MEM_freeN(dst_track->markers);
 
-       dst_track->markers = MEM_callocN(i*sizeof(MovieTrackingMarker), "tracking joined tracks");
-       memcpy(dst_track->markers, markers, i*sizeof(MovieTrackingMarker));
+       dst_track->markers = MEM_callocN(i * sizeof(MovieTrackingMarker), "tracking joined tracks");
+       memcpy(dst_track->markers, markers, i * sizeof(MovieTrackingMarker));
 
        dst_track->markersnr = i;
 
@@ -877,10 +877,10 @@ static TracksMap *tracks_map_new(const char *object_name, int is_camera, int num
        map->num_tracks = num_tracks;
        map->customdata_size = customdata_size;
 
-       map->tracks = MEM_callocN(sizeof(MovieTrackingTrack)*num_tracks, "TrackingsMap tracks");
+       map->tracks = MEM_callocN(sizeof(MovieTrackingTrack) * num_tracks, "TrackingsMap tracks");
 
        if (customdata_size)
-               map->customdata = MEM_callocN(customdata_size*num_tracks, "TracksMap customdata");
+               map->customdata = MEM_callocN(customdata_size * num_tracks, "TracksMap customdata");
 
        map->hash = BLI_ghash_ptr_new("TracksMap hash");
 
@@ -897,7 +897,7 @@ static void tracks_map_get(TracksMap *map, int index, MovieTrackingTrack **track
        *track = &map->tracks[index];
 
        if (map->customdata)
-               *customdata = &map->customdata[index*map->customdata_size];
+               *customdata = &map->customdata[index * map->customdata_size];
 }
 
 static void tracks_map_insert(TracksMap *map, MovieTrackingTrack *track, void *customdata)
@@ -909,7 +909,7 @@ static void tracks_map_insert(TracksMap *map, MovieTrackingTrack *track, void *c
        map->tracks[map->ptr] = new_track;
 
        if (customdata)
-               memcpy(&map->customdata[map->ptr*map->customdata_size], customdata, map->customdata_size);
+               memcpy(&map->customdata[map->ptr * map->customdata_size], customdata, map->customdata_size);
 
        BLI_ghash_insert(map->hash, &map->tracks[map->ptr], track);
 
@@ -982,10 +982,10 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
                BLI_ghash_remove(map->hash, track, NULL, NULL); /* XXX: are we actually need this */
                BLI_ghash_insert(map->hash, track, new_track);
 
-               if (replace_sel)                /* update current selection in clip */
+               if (replace_sel)  /* update current selection in clip */
                        tracking->act_track = new_track;
 
-               if (replace_rot)                /* update track used for rotation stabilization */
+               if (replace_rot)  /* update track used for rotation stabilization */
                        tracking->stabilization.rot_track = new_track;
 
                BLI_addtail(&tracks, new_track);
@@ -1020,7 +1020,7 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
        *old_tracks = new_tracks;
 }
 
-static void tracks_map_free(TracksMap *map, void (*customdata_free) (void *customdata))
+static void tracks_map_free(TracksMap *map, void (*customdata_free)(void *customdata))
 {
        int i = 0;
 
@@ -1028,7 +1028,7 @@ static void tracks_map_free(TracksMap *map, void (*customdata_free) (void *custo
 
        for (i = 0; i < map->num_tracks; i++) {
                if (map->customdata && customdata_free)
-                       customdata_free(&map->customdata[i*map->customdata_size]);
+                       customdata_free(&map->customdata[i * map->customdata_size]);
 
                BKE_tracking_free_track(&map->tracks[i]);
        }
@@ -1159,7 +1159,7 @@ static void track_context_free(void *customdata)
                MEM_freeN(track_context->search_area);
 
 #else
-               (void) track_context;
+       (void)track_context;
 #endif
 }
 
@@ -1195,16 +1195,16 @@ void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disab
 
        for (y = 0; y < ibuf->y; y++) {
                for (x = 0; x < ibuf->x; x++) {
-                       int pixel = ibuf->x*y + x;
+                       int pixel = ibuf->x * y + x;
 
                        if (ibuf->rect_float) {
-                               float *rrgbf = ibuf->rect_float + pixel*4;
+                               float *rrgbf = ibuf->rect_float + pixel * 4;
                                float r = disable_red   ? 0.0f : rrgbf[0];
                                float g = disable_green ? 0.0f : rrgbf[1];
                                float b = disable_blue  ? 0.0f : rrgbf[2];
 
                                if (grayscale) {
-                                       float gray = (0.2126f*r + 0.7152f*g + 0.0722f*b) / scale;
+                                       float gray = (0.2126f * r + 0.7152f * g + 0.0722f * b) / scale;
 
                                        rrgbf[0] = rrgbf[1] = rrgbf[2] = gray;
                                }
@@ -1215,13 +1215,13 @@ void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disab
                                }
                        }
                        else {
-                               char *rrgb = (char*)ibuf->rect + pixel*4;
+                               char *rrgb = (char *)ibuf->rect + pixel * 4;
                                char r = disable_red   ? 0 : rrgb[0];
                                char g = disable_green ? 0 : rrgb[1];
                                char b = disable_blue  ? 0 : rrgb[2];
 
                                if (grayscale) {
-                                       float gray = (0.2126f*r + 0.7152f*g + 0.0722f*b) / scale;
+                                       float gray = (0.2126f * r + 0.7152f * g + 0.0722f * b) / scale;
 
                                        rrgb[0] = rrgb[1] = rrgb[2] = gray;
                                }
@@ -1241,7 +1241,7 @@ void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disab
 static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale)
 {
        BKE_tracking_disable_imbuf_channels(ibuf, track->flag & TRACK_DISABLE_RED,
-                       track->flag & TRACK_DISABLE_GREEN, track->flag & TRACK_DISABLE_BLUE, grayscale);
+                                           track->flag & TRACK_DISABLE_GREEN, track->flag & TRACK_DISABLE_BLUE, grayscale);
 }
 
 ImBuf *BKE_tracking_sample_pattern_imbuf(int frame_width, int frame_height,
@@ -1297,7 +1297,7 @@ ImBuf *BKE_tracking_sample_pattern_imbuf(int frame_width, int frame_height,
 }
 
 ImBuf *BKE_tracking_get_pattern_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
-                                                                         int anchored, int disable_channels)
+                                      int anchored, int disable_channels)
 {
        ImBuf *pattern_ibuf, *search_ibuf;
        float pat_min[2], pat_max[2];
@@ -1499,11 +1499,11 @@ static float *get_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieT
 
        if (searchibuf->rect_float) {
                float_rgba_to_gray(searchibuf->rect_float, gray_pixels, width * height,
-                           0.2126f, 0.7152f, 0.0722f);
+                                  0.2126f, 0.7152f, 0.0722f);
        }
        else {
                uint8_rgba_to_float_gray((unsigned char *)searchibuf->rect, gray_pixels, width * height,
-                                 0.2126f, 0.7152f, 0.0722f);
+                                        0.2126f, 0.7152f, 0.0722f);
        }
 
        IMB_freeImBuf(searchibuf);
@@ -1522,13 +1522,13 @@ static unsigned char *get_ucharbuf(ImBuf *ibuf)
                        int pixel = ibuf->x * y + x;
 
                        if (ibuf->rect_float) {
-                               const float *rrgbf = ibuf->rect_float + pixel*4;
+                               const float *rrgbf = ibuf->rect_float + pixel * 4;
                                const float grey_f = 0.2126f * rrgbf[0] + 0.7152f * rrgbf[1] + 0.0722f * rrgbf[2];
 
                                *cp = FTOCHAR(grey_f);
                        }
                        else {
-                               const unsigned char *rrgb = (unsigned char*)ibuf->rect + pixel * 4;
+                               const unsigned char *rrgb = (unsigned char *)ibuf->rect + pixel * 4;
 
                                *cp = 0.2126f * rrgb[0] + 0.7152f * rrgb[1] + 0.0722f * rrgb[2];
                        }
@@ -1737,10 +1737,10 @@ int BKE_tracking_next(MovieTrackingContext *context)
                                options.motion_model = track->motion_model;
 
                                options.use_brute =
-                                       ((track->algorithm_flag & TRACK_ALGORITHM_FLAG_USE_BRUTE) != 0);
+                                   ((track->algorithm_flag & TRACK_ALGORITHM_FLAG_USE_BRUTE) != 0);
 
                                options.use_normalization =
-                                       ((track->algorithm_flag & TRACK_ALGORITHM_FLAG_USE_NORMALIZATION) != 0);
+                                   ((track->algorithm_flag & TRACK_ALGORITHM_FLAG_USE_NORMALIZATION) != 0);
 
                                options.num_iterations = 50;
                                options.minimum_correlation = track->minimum_correlation;
@@ -1801,6 +1801,9 @@ int BKE_tracking_next(MovieTrackingContext *context)
                        }
 
                        ok = TRUE;
+#else
+                       (void)frame_height;
+                       (void)frame_width;
 #endif
                }
        }
@@ -1862,7 +1865,7 @@ static struct libmv_Tracks *create_libmv_tracks(ListBase *tracksbase, int width,
 
                        if ((marker->flag & MARKER_DISABLED) == 0) {
                                libmv_tracksInsert(tracks, marker->framenr, tracknr,
-                                                       marker->pos[0] * width, marker->pos[1] * height);
+                                                  marker->pos[0] * width, marker->pos[1] * height);
                        }
                }
 
@@ -2079,7 +2082,7 @@ int BKE_tracking_can_reconstruct(MovieTracking *tracking, MovieTrackingObject *o
 #endif
 }
 
-MovieReconstructContextBKE_tracking_reconstruction_context_new(MovieTracking *tracking, MovieTrackingObject *object,
+MovieReconstructContext *BKE_tracking_reconstruction_context_new(MovieTracking *tracking, MovieTrackingObject *object,
                                                                  int keyframe1, int keyframe2, int width, int height)
 {
        MovieReconstructContext *context = MEM_callocN(sizeof(MovieReconstructContext), "MovieReconstructContext data");
@@ -2129,7 +2132,7 @@ MovieReconstructContext* BKE_tracking_reconstruction_context_new(MovieTracking *
        context->efra = efra;
 
 #ifdef WITH_LIBMV
-       context->tracks = create_libmv_tracks(tracksbase, width, height*aspy);
+       context->tracks = create_libmv_tracks(tracksbase, width, height * aspy);
        context->keyframe1 = keyframe1;
        context->keyframe2 = keyframe2;
        context->refine_flags = get_refine_intrinsics_flags(tracking, object);
@@ -2155,7 +2158,7 @@ void BKE_tracking_reconstruction_context_free(MovieReconstructContext *context)
 {
 #ifdef WITH_LIBMV
        if (context->reconstruction)
-                       libmv_destroyReconstruction(context->reconstruction);
+               libmv_destroyReconstruction(context->reconstruction);
 
        libmv_tracksDestroy(context->tracks);
 #endif
@@ -2207,19 +2210,19 @@ void BKE_tracking_solve_reconstruction(MovieReconstructContext *context, short *
 
        if (context->motion_flag & TRACKING_MOTION_MODAL) {
                context->reconstruction = libmv_solveModal(context->tracks,
-                       context->focal_length,
-                       context->principal_point[0], context->principal_point[1],
-                       context->k1, context->k2, context->k3,
-                       solve_reconstruction_update_cb, &progressdata);
+                                                          context->focal_length,
+                                                          context->principal_point[0], context->principal_point[1],
+                                                          context->k1, context->k2, context->k3,
+                                                          solve_reconstruction_update_cb, &progressdata);
        }
        else {
                context->reconstruction = libmv_solveReconstruction(context->tracks,
-                       context->keyframe1, context->keyframe2,
-                       context->refine_flags,
-                       context->focal_length,
-                       context->principal_point[0], context->principal_point[1],
-                       context->k1, context->k2, context->k3,
-                       solve_reconstruction_update_cb, &progressdata);
+                                                                   context->keyframe1, context->keyframe2,
+                                                                   context->refine_flags,
+                                                                   context->focal_length,
+                                                                   context->principal_point[0], context->principal_point[1],
+                                                                   context->k1, context->k2, context->k3,
+                                                                   solve_reconstruction_update_cb, &progressdata);
        }
 
        error = libmv_reprojectionError(context->reconstruction);
@@ -2362,7 +2365,7 @@ MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(MovieTracking *t
        reconstruction = BKE_tracking_object_reconstruction(tracking, object);
        a = reconstruction_camera_index(reconstruction, framenr, FALSE);
 
-       if (a ==-1)
+       if (a == -1)
                return NULL;
 
        return &reconstruction->cameras[a];
@@ -2766,8 +2769,8 @@ static void calculate_stabdata(MovieTracking *tracking, int framenr, float width
        *scale = (stab->scale - 1.0f) * stab->scaleinf + 1.0f;
        *angle = 0.0f;
 
-       loc[0] = (firstmedian[0] - median[0]) *width * (*scale);
-       loc[1] = (firstmedian[1] - median[1]) *height * (*scale);
+       loc[0] = (firstmedian[0] - median[0]) * width * (*scale);
+       loc[1] = (firstmedian[1] - median[1]) * height * (*scale);
 
        mul_v2_fl(loc, stab->locinf);
 
@@ -2815,7 +2818,7 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking, int width,
                track = tracking->tracks.first;
                while (track) {
                        if (track->flag & TRACK_USE_2D_STAB ||
-                          ((stab->flag & TRACKING_STABILIZE_ROTATION) && track == stab->rot_track))
+                           ((stab->flag & TRACKING_STABILIZE_ROTATION) && track == stab->rot_track))
                        {
                                sfra = MIN2(sfra, track->markers[0].framenr);
                                efra = MAX2(efra, track->markers[track->markersnr - 1].framenr);
@@ -2876,23 +2879,23 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking, int width,
                                                        h = (float)height / 2.0f;
                                                }
 
-                                               E = -w*co + h*si;
-                                               F = -h*co - w*si;
+                                               E = -w * co + h * si;
+                                               F = -h * co - w * si;
 
                                                if ((i % 2) == (j % 2)) {
-                                                       G = -w*co - h*si;
-                                                       H = h*co - w*si;
+                                                       G = -w * co - h * si;
+                                                       H = h * co - w * si;
                                                }
                                                else {
-                                                       G = w*co + h*si;
-                                                       H = -h*co + w*si;
+                                                       G = w * co + h * si;
+                                                       H = -h * co + w * si;
                                                }
 
                                                I = F - H;
                                                J = G - E;
-                                               K = G*F - E*H;
+                                               K = G * F - E * H;
 
-                                               S = (-w*I - h*J) / (dx*I + dy*J + K);
+                                               S = (-w * I - h * J) / (dx * I + dy * J + K);
 
                                                scale = MAX2(scale, S);
                                        }
@@ -2914,7 +2917,7 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking, int width,
        return stab->scale;
 }
 
-static ImBufstabilize_alloc_ibuf(ImBuf *cacheibuf, ImBuf *srcibuf, int fill)
+static ImBuf *stabilize_alloc_ibuf(ImBuf *cacheibuf, ImBuf *srcibuf, int fill)
 {
        int flags;
 
@@ -3021,7 +3024,7 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf,
                stab->scaleibuf = scaleibuf;
 
                IMB_rectcpy(scaleibuf, ibuf, 0, 0, 0, 0, ibuf->x, ibuf->y);
-               IMB_scalefastImBuf(scaleibuf, ibuf->x*tscale, ibuf->y*tscale);
+               IMB_scalefastImBuf(scaleibuf, ibuf->x * tscale, ibuf->y * tscale);
 
                ibuf = scaleibuf;
        }
@@ -3038,7 +3041,7 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf,
        else {
                float mat[4][4];
                int i, j, filter = tracking->stabilization.filter;
-               void (*interpolation) (struct ImBuf*, struct ImBuf*, float, float, int, int) = NULL;
+               void (*interpolation)(struct ImBuf *, struct ImBuf *, float, float, int, int) = NULL;
 
                BKE_tracking_stabdata_to_mat4(ibuf->x, ibuf->y, aspect, tloc, tscale, tangle, mat);
                invert_m4(mat);
@@ -3054,7 +3057,7 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf,
                        interpolation = neareast_interpolation;
 
                for (j = 0; j < tmpibuf->y; j++) {
-                       for (i = 0; i < tmpibuf->x;i++) {
+                       for (i = 0; i < tmpibuf->x; i++) {
                                float vec[3] = {i, j, 0};
 
                                mul_v3_m4v3(vec, mat, vec);
@@ -3102,9 +3105,9 @@ void BKE_tracking_stabdata_to_mat4(int width, int height, float aspect,
        cmat[3][1] = (float)height / 2.0f;
        invert_m4_m4(icmat, cmat);
 
-       size_to_mat4(smat, svec);               /* scale matrix */
-       add_v2_v2(lmat[3], loc);                /* translation matrix */
-       rotate_m4(rmat, 'Z', angle);    /* rotation matrix */
+       size_to_mat4(smat, svec);       /* scale matrix */
+       add_v2_v2(lmat[3], loc);        /* translation matrix */
+       rotate_m4(rmat, 'Z', angle);    /* rotation matrix */
 
        /* compose transformation matrix */
        mul_serie_m4(mat, lmat, cmat, amat, rmat, iamat, smat, icmat, NULL);
@@ -3142,13 +3145,13 @@ void BKE_tracking_distortion_update(MovieDistortion *distortion, MovieTracking *
 #ifdef WITH_LIBMV
        if (!distortion->intrinsics) {
                distortion->intrinsics = libmv_CameraIntrinsicsNew(camera->focal,
-                               camera->principal[0], camera->principal[1] * aspy,
-                               camera->k1, camera->k2, camera->k3, width, height * aspy);
+                                                                  camera->principal[0], camera->principal[1] * aspy,
+                                                                  camera->k1, camera->k2, camera->k3, width, height * aspy);
        }
        else {
                libmv_CameraIntrinsicsUpdate(distortion->intrinsics, camera->focal,
-                               camera->principal[0], camera->principal[1] * aspy,
-                               camera->k1, camera->k2, camera->k3, width, height * aspy);
+                                            camera->principal[0], camera->principal[1] * aspy,
+                                            camera->k1, camera->k2, camera->k3, width, height * aspy);
        }
 #else
        (void) distortion;
@@ -3172,13 +3175,13 @@ ImBuf *BKE_tracking_distortion_exec(MovieDistortion *distortion, MovieTracking *
 #ifdef WITH_LIBMV
                if (undistort) {
                        libmv_CameraIntrinsicsUndistortFloat(distortion->intrinsics,
-                                               ibuf->rect_float, resibuf->rect_float,
-                                               ibuf->x, ibuf->y, overscan, ibuf->channels);
+                                                            ibuf->rect_float, resibuf->rect_float,
+                                                            ibuf->x, ibuf->y, overscan, ibuf->channels);
                }
                else {
                        libmv_CameraIntrinsicsDistortFloat(distortion->intrinsics,
-                                               ibuf->rect_float, resibuf->rect_float,
-                                               ibuf->x, ibuf->y, overscan, ibuf->channels);
+                                                          ibuf->rect_float, resibuf->rect_float,
+                                                          ibuf->x, ibuf->y, overscan, ibuf->channels);
                }
 #endif
 
@@ -3187,14 +3190,14 @@ ImBuf *BKE_tracking_distortion_exec(MovieDistortion *distortion, MovieTracking *
        else {
 #ifdef WITH_LIBMV
                if (undistort) {
-                               libmv_CameraIntrinsicsUndistortByte(distortion->intrinsics,
-                                                       (unsigned char*)ibuf->rect, (unsigned char*)resibuf->rect,
-                                                       ibuf->x, ibuf->y, overscan, ibuf->channels);
+                       libmv_CameraIntrinsicsUndistortByte(distortion->intrinsics,
+                                                           (unsigned char *)ibuf->rect, (unsigned char *)resibuf->rect,
+                                                           ibuf->x, ibuf->y, overscan, ibuf->channels);
                }
                else {
                        libmv_CameraIntrinsicsDistortByte(distortion->intrinsics,
-                                               (unsigned char*)ibuf->rect, (unsigned char*)resibuf->rect,
-                                               ibuf->x, ibuf->y, overscan, ibuf->channels);
+                                                         (unsigned char *)ibuf->rect, (unsigned char *)resibuf->rect,
+                                                         ibuf->x, ibuf->y, overscan, ibuf->channels);
                }
 #endif
        }
index dbfa082..6c0d547 100644 (file)
@@ -82,13 +82,13 @@ void BLI_pbvh_search_gather(PBVH *bvh,
  * it's up to the callback to find the primitive within the leaves that is
  * hit first */
 
-void BLI_pbvh_raycast(PBVH * bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
+void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
                       const float ray_start[3], const float ray_normal[3],
-                                         int original);
+                      int original);
 
-int BLI_pbvh_node_raycast(PBVH * bvh, PBVHNode * node, float (*origco)[3],
+int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
                           const float ray_start[3], const float ray_normal[3],
-                                                 float *dist);
+                          float *dist);
 
 /* Drawing */
 
@@ -214,7 +214,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node,
 
 #define BLI_pbvh_vertex_iter_begin(bvh, node, vi, mode) \
        pbvh_vertex_iter_init(bvh, node, &vi, mode); \
-       \
+        \
        for (vi.i = 0, vi.g = 0; vi.g < vi.totgrid; vi.g++) { \
                if (vi.grids) { \
                        vi.width = vi.gridsize; \
index 5361682..409a9f8 100644 (file)
@@ -1140,17 +1140,17 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
                        switch (bvh->type) {
                                case PBVH_GRIDS:
                                        node->draw_buffers =
-                                               GPU_build_grid_buffers(node->prim_indices,
-                                                                                          node->totprim,
-                                                                                          bvh->grid_hidden,
-                                                                                          bvh->gridkey.grid_size);
+                                           GPU_build_grid_buffers(node->prim_indices,
+                                                                  node->totprim,
+                                                                  bvh->grid_hidden,
+                                                                  bvh->gridkey.grid_size);
                                        break;
                                case PBVH_FACES:
                                        node->draw_buffers =
-                                               GPU_build_mesh_buffers(node->face_vert_indices,
-                                                                                          bvh->faces, bvh->verts,
-                                                                                          node->prim_indices,
-                                                                                          node->totprim);
+                                           GPU_build_mesh_buffers(node->face_vert_indices,
+                                                                  bvh->faces, bvh->verts,
+                                                                  node->prim_indices,
+                                                                  node->totprim);
                                        break;
                        }
  
@@ -1478,7 +1478,7 @@ static int ray_aabb_intersect(PBVHNode *node, void *data_v)
 
 void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
                       const float ray_start[3], const float ray_normal[3],
-                                         int original)
+                      int original)
 {
        RaycastData rcd;
 
@@ -1495,9 +1495,9 @@ void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
 }
 
 static int ray_face_intersection(const float ray_start[3],
-                                                                const float ray_normal[3],
+                                 const float ray_normal[3],
                                  const float *t0, const float *t1,
-                                                                const float *t2, const float *t3,
+                                 const float *t2, const float *t3,
                                  float *fdist)
 {
        float dist;
@@ -1514,9 +1514,9 @@ static int ray_face_intersection(const float ray_start[3],
 }
 
 static int pbvh_faces_node_raycast(PBVH *bvh, const PBVHNode *node,
-                                                                  float (*origco)[3],
-                                                                  const float ray_start[3],
-                                                                  const float ray_normal[3], float *dist)
+                                   float (*origco)[3],
+                                   const float ray_start[3],
+                                   const float ray_normal[3], float *dist)
 {
        const MVert *vert = bvh->verts;
        const int *faces = node->prim_indices;
@@ -1532,20 +1532,20 @@ static int pbvh_faces_node_raycast(PBVH *bvh, const PBVHNode *node,
                if (origco) {
                        /* intersect with backuped original coordinates */
                        hit |= ray_face_intersection(ray_start, ray_normal,
-                                                                                origco[face_verts[0]],
-                                                                                origco[face_verts[1]],
-                                                                                origco[face_verts[2]],
-                                                                                f->v4 ? origco[face_verts[3]] : NULL,
-                                                                                dist);
+                                                    origco[face_verts[0]],
+                                                    origco[face_verts[1]],
+                                                    origco[face_verts[2]],
+                                                    f->v4 ? origco[face_verts[3]] : NULL,
+                                                    dist);
                }
                else {
                        /* intersect with current coordinates */
                        hit |= ray_face_intersection(ray_start, ray_normal,
-                                                                                vert[f->v1].co,
-                                                                                vert[f->v2].co,
-                                                                                vert[f->v3].co,
-                                                                                f->v4 ? vert[f->v4].co : NULL,
-                                                                                dist);
+                                                    vert[f->v1].co,
+                                                    vert[f->v2].co,
+                                                    vert[f->v3].co,
+                                                    f->v4 ? vert[f->v4].co : NULL,
+                                                    dist);
                }
        }
 
@@ -1553,9 +1553,9 @@ static int pbvh_faces_node_raycast(PBVH *bvh, const PBVHNode *node,
 }
 
 static int pbvh_grids_node_raycast(PBVH *bvh, PBVHNode *node,
-                                                                  float (*origco)[3],
-                                                                  const float ray_start[3],
-                                                                  const float ray_normal[3], float *dist)
+                                   float (*origco)[3],
+                                   const float ray_start[3],
+                                   const float ray_normal[3], float *dist)
 {
        int totgrid = node->totprim;
        int gridsize = bvh->gridkey.grid_size;
@@ -1580,19 +1580,19 @@ static int pbvh_grids_node_raycast(PBVH *bvh, PBVHNode *node,
 
                                if (origco) {
                                        hit |= ray_face_intersection(ray_start, ray_normal,
-                                                                                                origco[y * gridsize + x],
-                                                                                                origco[y * gridsize + x + 1],
-                                                                                                origco[(y + 1) * gridsize + x + 1],
-                                                                                                origco[(y + 1) * gridsize + x],
-                                                                                                dist);
+                                                                    origco[y * gridsize + x],
+                                                                    origco[y * gridsize + x + 1],
+                                                                    origco[(y + 1) * gridsize + x + 1],
+                                                                    origco[(y + 1) * gridsize + x],
+                                                                    dist);
                                }
                                else {
                                        hit |= ray_face_intersection(ray_start, ray_normal,
-                                                                                                CCG_grid_elem_co(&bvh->gridkey, grid, x, y),
-                                                                                                CCG_grid_elem_co(&bvh->gridkey, grid, x + 1, y),
-                                                                                                CCG_grid_elem_co(&bvh->gridkey, grid, x + 1, y + 1),
-                                                                                                CCG_grid_elem_co(&bvh->gridkey, grid, x, y + 1),
-                                                                                                dist);
+                                                                    CCG_grid_elem_co(&bvh->gridkey, grid, x, y),
+                                                                    CCG_grid_elem_co(&bvh->gridkey, grid, x + 1, y),
+                                                                    CCG_grid_elem_co(&bvh->gridkey, grid, x + 1, y + 1),
+                                                                    CCG_grid_elem_co(&bvh->gridkey, grid, x, y + 1),
+                                                                    dist);
                                }
                        }
                }
@@ -1606,7 +1606,7 @@ static int pbvh_grids_node_raycast(PBVH *bvh, PBVHNode *node,
 
 int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
                           const float ray_start[3], const float ray_normal[3],
-                                                 float *dist)
+                          float *dist)
 {
        int hit = 0;
 
@@ -1616,11 +1616,11 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
        switch (bvh->type) {
                case PBVH_FACES:
                        hit |= pbvh_faces_node_raycast(bvh, node, origco,
-                                                                                  ray_start, ray_normal, dist);
+                                                      ray_start, ray_normal, dist);
                        break;
                case PBVH_GRIDS:
                        hit |= pbvh_grids_node_raycast(bvh, node, origco,
-                                                                                  ray_start, ray_normal, dist);
+                                                      ray_start, ray_normal, dist);
                        break;
        }
 
index b59f375..c8d03bc 100644 (file)
@@ -237,7 +237,7 @@ static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, Poin
        PointerRNA gpd_ptr;
        bGPDlayer *gpl;
        uiLayout *col, *row;
-       SpaceClip *sc= CTX_wm_space_clip(C);
+       SpaceClip *sc = CTX_wm_space_clip(C);
        short v3d_stroke_opts = STROKE_OPTS_NORMAL;
        const short is_v3d = CTX_wm_view3d(C) != NULL;
        
index f368e7c..7b69e82 100644 (file)
@@ -1542,7 +1542,7 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wc
        }
        else if ((scopes->track_search) &&
                 ((!scopes->track_preview) ||
-                (scopes->track_preview->x != width || scopes->track_preview->y != height)))
+                 (scopes->track_preview->x != width || scopes->track_preview->y != height)))
        {
                ImBuf *tmpibuf;
 
@@ -1686,7 +1686,7 @@ void ui_dropshadow(rctf *rct, float radius, float aspect, float alpha, int UNUSE
        int i;
        float rad;
        float a;
-       float dalpha = alpha * 2.0f/255.0f, calpha;
+       float dalpha = alpha * 2.0f / 255.0f, calpha;
        
        glEnable(GL_BLEND);
        
index 66ad05a..9873513 100644 (file)
@@ -919,7 +919,7 @@ static void calc_area_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **nod
        /* Grab brush requires to test on original data (see r33888 and
         * bug #25371) */
        original = (paint_brush(&sd->paint)->sculpt_tool == SCULPT_TOOL_GRAB ?
-                               TRUE : ss->cache->original);
+                   TRUE : ss->cache->original);
 
        (void)sd; /* unused w/o openmp */
        
@@ -991,7 +991,7 @@ static void calc_sculpt_normal(Sculpt *sd, Object *ob,
                case SCULPT_DISP_DIR_VIEW:
                        ED_view3d_global_to_vector(ss->cache->vc->rv3d,
                                                   ss->cache->vc->rv3d->twmat[3],
-                               an);
+                                                  an);
                        break;
 
                case SCULPT_DISP_DIR_X:
@@ -1117,21 +1117,21 @@ static void update_brush_local_mat(Sculpt *sd, Object *ob)
 static int brush_needs_sculpt_normal(const Brush *brush)
 {
        return ((ELEM(brush->sculpt_tool,
-                                 SCULPT_TOOL_GRAB,
-                                 SCULPT_TOOL_SNAKE_HOOK) &&
-                        ((brush->normal_weight > 0) ||
-                         (brush->flag & BRUSH_FRONTFACE))) ||
-
-                       ELEM7(brush->sculpt_tool,
-                                 SCULPT_TOOL_BLOB,
-                                 SCULPT_TOOL_CREASE,
-                                 SCULPT_TOOL_DRAW,
-                                 SCULPT_TOOL_LAYER,
-                                 SCULPT_TOOL_NUDGE,
-                                 SCULPT_TOOL_ROTATE,
-                                 SCULPT_TOOL_THUMB) ||
-
-                       (brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA));
+                     SCULPT_TOOL_GRAB,
+                     SCULPT_TOOL_SNAKE_HOOK) &&
+                ((brush->normal_weight > 0) ||
+                 (brush->flag & BRUSH_FRONTFACE))) ||
+
+               ELEM7(brush->sculpt_tool,
+                     SCULPT_TOOL_BLOB,
+                     SCULPT_TOOL_CREASE,
+                     SCULPT_TOOL_DRAW,
+                     SCULPT_TOOL_LAYER,
+                     SCULPT_TOOL_NUDGE,
+                     SCULPT_TOOL_ROTATE,
+                     SCULPT_TOOL_THUMB) ||
+
+               (brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA));
 }
 
 /* For the smooth brush, uses the neighboring vertices around vert to calculate
@@ -1432,14 +1432,14 @@ static void smooth(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode,
 
                #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
                for (n = 0; n < totnode; n++) {
-                       switch(type) {
+                       switch (type) {
                                case PBVH_GRIDS:
                                        do_multires_smooth_brush(sd, ss, nodes[n], strength,
-                                                                                    smooth_mask);
+                                                                smooth_mask);
                                        break;
                                case PBVH_FACES:
                                        do_mesh_smooth_brush(sd, ss, nodes[n], strength,
-                                                    smooth_mask);
+                                                            smooth_mask);
                                        break;
                        }
                }
@@ -1532,7 +1532,7 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
                                /* offset vertex */
                                float fade = tex_strength(ss, brush, vd.co, test.dist,
                                                          ss->cache->sculpt_normal_symm, vd.no,
-                                                                                 vd.fno, *vd.mask);
+                                                         vd.fno, *vd.mask);
 
                                mul_v3_v3fl(proxy[vd.i], offset, fade);
 
@@ -1588,7 +1588,7 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
                                /* offset vertex */
                                const float fade = tex_strength(ss, brush, vd.co, test.dist,
                                                                ss->cache->sculpt_normal_symm,
-                                                                                               vd.no, vd.fno, *vd.mask);
+                                                               vd.no, vd.fno, *vd.mask);
                                float val1[3];
                                float val2[3];
 
@@ -1726,7 +1726,7 @@ static void do_nudge_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
                        if (sculpt_brush_test(&test, vd.co)) {
                                const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
                                                                            ss->cache->sculpt_normal_symm,
-                                                                                                                       vd.no, vd.fno, *vd.mask);
+                                                                           vd.no, vd.fno, *vd.mask);
 
                                mul_v3_v3fl(proxy[vd.i], cono, fade);
 
@@ -1775,7 +1775,7 @@ static void do_snake_hook_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
                        if (sculpt_brush_test(&test, vd.co)) {
                                const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
                                                                            ss->cache->sculpt_normal_symm,
-                                                                                                                   vd.no, vd.fno, *vd.mask);
+                                                                           vd.no, vd.fno, *vd.mask);
 
                                mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
 
@@ -1823,7 +1823,7 @@ static void do_thumb_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
                        if (sculpt_brush_test(&test, origco[vd.i])) {
                                const float fade = bstrength * tex_strength(ss, brush, origco[vd.i], test.dist,
                                                                            ss->cache->sculpt_normal_symm,
-                                                                                                                       origno[vd.i], NULL, *vd.mask);
+                                                                           origno[vd.i], NULL, *vd.mask);
 
                                mul_v3_v3fl(proxy[vd.i], cono, fade);
 
@@ -1876,7 +1876,7 @@ static void do_rotate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
                        if (sculpt_brush_test(&test, origco[vd.i])) {
                                const float fade = bstrength * tex_strength(ss, brush, origco[vd.i], test.dist,
                                                                            ss->cache->sculpt_normal_symm,
-                                                                                                                   origno[vd.i], NULL, *vd.mask);
+                                                                           origno[vd.i], NULL, *vd.mask);
 
                                mul_v3_m4v3(proxy[vd.i], m, origco[vd.i]);
                                sub_v3_v3(proxy[vd.i], origco[vd.i]);
@@ -1929,7 +1929,7 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
                        if (sculpt_brush_test(&test, origco[vd.i])) {
                                const float fade = bstrength * tex_strength(ss, brush, vd.co, test.dist,
                                                                            ss->cache->sculpt_normal_symm,
-                                                                                                                       vd.no, vd.fno, *vd.mask);
+                                                                           vd.no, vd.fno, *vd.mask);
                                float *disp = &layer_disp[vd.i];
                                float val[3];
 
@@ -3585,15 +3585,15 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
    one of smooth brush, autosmooth, mask smooth, or shift-key
    smooth) */
 static int sculpt_any_smooth_mode(const Brush *brush,
-                                                                 StrokeCache *cache,
-                                                                 int stroke_mode)
+                                  StrokeCache *cache,
+                                  int stroke_mode)
 {
        return ((stroke_mode == BRUSH_STROKE_SMOOTH) ||
-                       (cache && cache->alt_smooth) ||
-                       (brush->sculpt_tool == SCULPT_TOOL_SMOOTH) ||
-                       (brush->autosmooth_factor > 0) ||
-                       ((brush->sculpt_tool == SCULPT_TOOL_MASK) &&
-                        (brush->mask_tool == BRUSH_MASK_SMOOTH)));
+               (cache && cache->alt_smooth) ||
+               (brush->sculpt_tool == SCULPT_TOOL_SMOOTH) ||
+               (brush->autosmooth_factor > 0) ||
+               ((brush->sculpt_tool == SCULPT_TOOL_MASK) &&
+                (brush->mask_tool == BRUSH_MASK_SMOOTH)));
 }
 
 static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob)
@@ -3605,7 +3605,7 @@ static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob)
                Brush *brush = paint_brush(&sd->paint);
 
                sculpt_update_mesh_elements(CTX_data_scene(C), sd, ob,
-                                                                       sculpt_any_smooth_mode(brush, ss->cache, 0));
+                                           sculpt_any_smooth_mode(brush, ss->cache, 0));
        }
 }
 
index ca2ae6e..66fa2ae 100644 (file)
@@ -59,7 +59,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "clip_intern.h"       // own include
+#include "clip_intern.h"  /* own include */
 
 /* Panels */
 
@@ -165,7 +165,7 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
 
        block = uiLayoutAbsoluteBlock(layout);
 
-       scopes->track_preview_height = (scopes->track_preview_height <= UI_UNIT_Y)?UI_UNIT_Y : scopes->track_preview_height;
+       scopes->track_preview_height = (scopes->track_preview_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->track_preview_height;
 
        uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, rect.xmax - rect.xmin,
                 scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
@@ -173,27 +173,27 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
 
 /********************* Marker Template ************************/
 
-#define B_MARKER_POS                   3
-#define B_MARKER_OFFSET                        4
-#define B_MARKER_PAT_DIM               5
-#define B_MARKER_SEARCH_POS            6
-#define B_MARKER_SEARCH_DIM            7
-#define B_MARKER_FLAG                  8
+#define B_MARKER_POS            3
+#define B_MARKER_OFFSET         4
+#define B_MARKER_PAT_DIM        5
+#define B_MARKER_SEARCH_POS     6
+#define B_MARKER_SEARCH_DIM     7
+#define B_MARKER_FLAG           8
 
 typedef struct {
-       int compact;                                                            /* compact mode */
+       int compact;                                /* compact mode */
 
        MovieClip *clip;
-       MovieClipUser *user;                                            /* user of clip */
+       MovieClipUser *user;                        /* user of clip */
        MovieTrackingTrack *track;
        MovieTrackingMarker *marker;
 
-       int framenr;                                                            /* current frame number */
-       float marker_pos[2];                                            /* position of marker in pixel coords */
-       float marker_pat[2];                                                    /* position and dimensions of marker pattern in pixel coords */
-       float track_offset[2];                                          /* offset of "parenting" point */
-       float marker_search_pos[2], marker_search[2];   /* position and dimensions of marker search in pixel coords */
-       int marker_flag;                                                        /* marker's flags */
+       int framenr;                                    /* current frame number */
+       float marker_pos[2];                            /* position of marker in pixel coords */
+       float marker_pat[2];                            /* position and dimensions of marker pattern in pixel coords */
+       float track_offset[2];                          /* offset of "parenting" point */
+       float marker_search_pos[2], marker_search[2];   /* position and dimensions of marker search in pixel coords */
+       int marker_flag;                                /* marker's flags */
 } MarkerUpdateCb;
 
 static void to_pixel_space(float r[2], float a[2], int width, int height)
@@ -205,7 +205,7 @@ static void to_pixel_space(float r[2], float a[2], int width, int height)
 
 static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
 {
-       MarkerUpdateCb *cb = (MarkerUpdateCb*) arg_cb;
+       MarkerUpdateCb *cb = (MarkerUpdateCb *) arg_cb;
        MovieTrackingMarker *marker;
 
        if (!cb->compact)
@@ -220,7 +220,7 @@ static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
 
 static void marker_block_handler(bContext *C, void *arg_cb, int event)
 {
-       MarkerUpdateCb *cb = (MarkerUpdateCb*) arg_cb;
+       MarkerUpdateCb *cb = (MarkerUpdateCb *) arg_cb;
        MovieTrackingMarker *marker;
        int width, height, ok = FALSE;
 
@@ -431,7 +431,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
                        tip = "Marker is enabled at current frame";
 
                uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG,  "Enabled", 10, 190, 145, 19, &cb->marker_flag,
-                       0, 0, 0, 0, tip);
+                            0, 0, 0, 0, tip);
 
                col = uiLayoutColumn(layout, 1);
                uiLayoutSetActive(col, (cb->marker_flag & MARKER_DISABLED) == 0);
@@ -441,31 +441,31 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
 
                uiDefBut(block, LABEL, 0, "Position:", 0, 190, 300, 19, NULL, 0, 0, 0, 0, "");
                uiDefButF(block, NUM, B_MARKER_POS, "X:", 10, 171, 145, 19, &cb->marker_pos[0],
-                       -10*width, 10.0*width, step, digits, "X-position of marker at frame in screen coordinates");
+                         -10 * width, 10.0 * width, step, digits, "X-position of marker at frame in screen coordinates");
                uiDefButF(block, NUM, B_MARKER_POS, "Y:", 165, 171, 145, 19, &cb->marker_pos[1],
-                       -10*height, 10.0*height, step, digits, "Y-position of marker at frame in screen coordinates");
+                         -10 * height, 10.0 * height, step, digits, "Y-position of marker at frame in screen coordinates");
 
                uiDefBut(block, LABEL, 0, "Offset:", 0, 152, 300, 19, NULL, 0, 0, 0, 0, "");
                uiDefButF(block, NUM, B_MARKER_OFFSET, "X:", 10, 133, 145, 19, &cb->track_offset[0],
-                       -10*width, 10.0*width, step, digits, "X-offset to parenting point");
+                         -10 * width, 10.0 * width, step, digits, "X-offset to parenting point");
                uiDefButF(block, NUM, B_MARKER_OFFSET, "Y:", 165, 133, 145, 19, &cb->track_offset[1],
-                       -10*height, 10.0*height, step, digits, "Y-offset to parenting point");
+                         -10 * height, 10.0 * height, step, digits, "Y-offset to parenting point");
 
                uiDefBut(block, LABEL, 0, "Pattern Area:", 0, 114, 300, 19, NULL, 0, 0, 0, 0, "");
                uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Width:", 10, 95, 300, 19, &cb->marker_pat[0], 3.0f,
-                       10.0*width, step, digits, "Width of marker's pattern in screen coordinates");
+                         10.0 * width, step, digits, "Width of marker's pattern in screen coordinates");
                uiDefButF(block, NUM, B_MARKER_PAT_DIM, "Height:", 10, 76, 300, 19, &cb->marker_pat[1], 3.0f,
-                       10.0*height, step, digits, "Height of marker's pattern in screen coordinates");
+                         10.0 * height, step, digits, "Height of marker's pattern in screen coordinates");
 
                uiDefBut(block, LABEL, 0, "Search Area:", 0, 57, 300, 19, NULL, 0, 0, 0, 0, "");
                uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "X:", 10, 38, 145, 19, &cb->marker_search_pos[0],
-                       -width, width, step, digits, "X-position of search at frame relative to marker's position");
+                         -width, width, step, digits, "X-position of search at frame relative to marker's position");
                uiDefButF(block, NUM, B_MARKER_SEARCH_POS, "Y:", 165, 38, 145, 19, &cb->marker_search_pos[1],
-                       -height, height, step, digits, "X-position of search at frame relative to marker's position");
+                         -height, height, step, digits, "X-position of search at frame relative to marker's position");
                uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Width:", 10, 19, 300, 19, &cb->marker_search[0], 3.0f,
-                       10.0*width, step, digits, "Width of marker's search in screen soordinates");
+                         10.0 * width, step, digits, "Width of marker's search in screen soordinates");
                uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, "Height:", 10, 0, 300, 19, &cb->marker_search[1], 3.0f,
-                       10.0*height, step, digits, "Height of marker's search in screen soordinates");
+                         10.0 * height, step, digits, "Height of marker's search in screen soordinates");
 
                uiBlockEndAlign(block);
        }
index 67609fe..e9ea70c 100644 (file)
@@ -30,7 +30,7 @@
  */
 
 #include "DNA_movieclip_types.h"
-#include "DNA_object_types.h"  /* SELECT */
+#include "DNA_object_types.h"   /* SELECT */
 #include "DNA_scene_types.h"
 
 #include "MEM_guardedalloc.h"
@@ -61,7 +61,7 @@
 
 #include "RNA_access.h"
 
-#include "clip_intern.h"       // own include
+#include "clip_intern.h"  /* own include */
 
 static void track_channel_color(MovieTrackingTrack *track, float default_color[3], float color[3])
 {
@@ -83,10 +83,10 @@ static void draw_keyframe_shape(float x, float y, float xscale, float yscale, sh
 {
        /* coordinates for diamond shape */
        static const float _unit_diamond_shape[4][2] = {
-               {0.0f, 1.0f},   /* top vert */
-               {1.0f, 0.0f},   /* mid-right */
-               {0.0f, -1.0f},  /* bottom vert */
-               {-1.0f, 0.0f}   /* mid-left */
+               {0.0f, 1.0f},   /* top vert */
+               {1.0f, 0.0f},   /* mid-right */
+               {0.0f, -1.0f},  /* bottom vert */
+               {-1.0f, 0.0f}   /* mid-left */
        };
        static GLuint displist1 = 0;
        static GLuint displist2 = 0;
@@ -95,26 +95,26 @@ static void draw_keyframe_shape(float x, float y, float xscale, float yscale, sh
        /* initialize 2 display lists for diamond shape - one empty, one filled */
        if (displist1 == 0) {
                displist1 = glGenLists(1);
-                       glNewList(displist1, GL_COMPILE);
-
-                       glBegin(GL_LINE_LOOP);
-                               glVertex2fv(_unit_diamond_shape[0]);
-                               glVertex2fv(_unit_diamond_shape[1]);
-                               glVertex2fv(_unit_diamond_shape[2]);
-                               glVertex2fv(_unit_diamond_shape[3]);
-                       glEnd();
+               glNewList(displist1, GL_COMPILE);
+
+               glBegin(GL_LINE_LOOP);
+               glVertex2fv(_unit_diamond_shape[0]);
+               glVertex2fv(_unit_diamond_shape[1]);
+               glVertex2fv(_unit_diamond_shape[2]);
+               glVertex2fv(_unit_diamond_shape[3]);
+               glEnd();
                glEndList();
        }
        if (displist2 == 0) {
                displist2 = glGenLists(1);
-                       glNewList(displist2, GL_COMPILE);
-
-                       glBegin(GL_QUADS);
-                               glVertex2fv(_unit_diamond_shape[0]);
-                               glVertex2fv(_unit_diamond_shape[1]);
-                               glVertex2fv(_unit_diamond_shape[2]);
-                               glVertex2fv(_unit_diamond_shape[3]);
-                       glEnd();
+               glNewList(displist2, GL_COMPILE);
+
+               glBegin(GL_QUADS);
+               glVertex2fv(_unit_diamond_shape[0]);
+               glVertex2fv(_unit_diamond_shape[1]);
+               glVertex2fv(_unit_diamond_shape[2]);
+               glVertex2fv(_unit_diamond_shape[3]);
+               glEnd();
                glEndList();
        }
 
@@ -210,7 +210,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
 
                                        if (start_frame != end_frame) {
                                                glRectf(start_frame, (float) y - STRIP_HEIGHT_HALF,
-                                                               end_frame, (float) y + STRIP_HEIGHT_HALF);
+                                                       end_frame, (float) y + STRIP_HEIGHT_HALF);
                                                draw_keyframe_shape(start_frame, y, xscale, yscale, sel, alpha);
                                                draw_keyframe_shape(end_frame, y, xscale, yscale, sel, alpha);
                                        }
@@ -309,7 +309,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
 
                        font_height = BLF_height(fontid, track->name);
                        BLF_position(fontid, v2d->cur.xmin + CHANNEL_PAD,
-                                            y - font_height / 2.0f, 0.0f);
+                                    y - font_height / 2.0f, 0.0f);
                        BLF_draw(fontid, track->name, strlen(track->name));
                }
 
index 2e16a90..a9b23d5 100644 (file)
@@ -32,7 +32,7 @@
 #include "DNA_gpencil_types.h"
 #include "DNA_movieclip_types.h"
 #include "DNA_scene_types.h"
-#include "DNA_object_types.h"  /* SELECT */
+#include "DNA_object_types.h"  /* SELECT */
 #include "DNA_mask_types.h"
 
 #include "MEM_guardedalloc.h"
@@ -69,7 +69,7 @@
 
 #include "BLF_api.h"
 
-#include "clip_intern.h"       // own include
+#include "clip_intern.h"    // own include
 
 /*********************** main area drawing *************************/
 
@@ -277,10 +277,10 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
                                        glScalef(zoomx, zoomy, 1.0f);
 
                                        glBegin(GL_QUADS);
-                                               glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f,  0.0f);
-                                               glTexCoord2f(1.0f, 0.0f); glVertex2f(width, 0.0f);
-                                               glTexCoord2f(1.0f, 1.0f); glVertex2f(width, height);
-                                               glTexCoord2f(0.0f, 1.0f); glVertex2f(0.0f,  height);
+                                       glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f,  0.0f);
+                                       glTexCoord2f(1.0f, 0.0f); glVertex2f(width, 0.0f);
+                                       glTexCoord2f(1.0f, 1.0f); glVertex2f(width, height);
+                                       glTexCoord2f(0.0f, 1.0f); glVertex2f(0.0f,  height);
                                        glEnd();
 
                                        glPopMatrix();
@@ -320,10 +320,10 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
                glMultMatrixf(sc->stabmat);
 
                glBegin(GL_LINE_LOOP);
-                       glVertex2f(0.0f, 0.0f);
-                       glVertex2f(width, 0.0f);
-                       glVertex2f(width, height);
-                       glVertex2f(0.0f, height);
+               glVertex2f(0.0f, 0.0f);
+               glVertex2f(width, 0.0f);
+               glVertex2f(width, height);
+               glVertex2f(0.0f, height);
                glEnd();
 
                glPopMatrix();
@@ -399,17 +399,17 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
                if (TRACK_VIEW_SELECTED(sc, track)) {
                        glPointSize(5.0f);
                        glBegin(GL_POINTS);
-                               for (i = a; i < b; i++) {
-                                       if (i != curindex)
-                                               glVertex2f(path[i][0], path[i][1]);
-                               }
+                       for (i = a; i < b; i++) {
+                               if (i != curindex)
+                                       glVertex2f(path[i][0], path[i][1]);
+                       }
                        glEnd();
                }
 
                glLineWidth(3.0f);
                glBegin(GL_LINE_STRIP);
-                       for (i = a; i < b; i++)
-                               glVertex2f(path[i][0], path[i][1]);
+               for (i = a; i < b; i++)
+                       glVertex2f(path[i][0], path[i][1]);
                glEnd();
                glLineWidth(1.0f);
        }
@@ -419,25 +419,25 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
        if (TRACK_VIEW_SELECTED(sc, track)) {
                glPointSize(3.0f);
                glBegin(GL_POINTS);
-                       for (i = a; i < b; i++) {
-                               if (i == count + 1)
-                                       UI_ThemeColor(TH_PATH_AFTER);
+               for (i = a; i < b; i++) {
+                       if (i == count + 1)
+                               UI_ThemeColor(TH_PATH_AFTER);
 
-                               if (i != curindex)
-                                       glVertex2f(path[i][0], path[i][1]);
-                       }
+                       if (i != curindex)
+                               glVertex2f(path[i][0], path[i][1]);
+               }
                glEnd();
        }
 
        UI_ThemeColor(TH_PATH_BEFORE);
 
        glBegin(GL_LINE_STRIP);
-               for (i = a; i < b; i++) {
-                       if (i == count + 1)
-                               UI_ThemeColor(TH_PATH_AFTER);
+       for (i = a; i < b; i++) {
+               if (i == count + 1)
+                       UI_ThemeColor(TH_PATH_AFTER);
 
-                       glVertex2f(path[i][0], path[i][1]);
-               }
+               glVertex2f(path[i][0], path[i][1]);
+       }
        glEnd();
        glPointSize(1.0f);
 }
@@ -470,24 +470,24 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
                        if (tiny) glPointSize(3.0f);
                        else glPointSize(4.0f);
                        glBegin(GL_POINTS);
-                               glVertex2f(pos[0], pos[1]);
+                       glVertex2f(pos[0], pos[1]);
                        glEnd();
                        glPointSize(1.0f);
                }
                else {
                        if (!tiny) glLineWidth(3.0f);
                        glBegin(GL_LINES);
-                               glVertex2f(pos[0] + px[0]*2, pos[1]);
-                               glVertex2f(pos[0] + px[0]*8, pos[1]);
+                       glVertex2f(pos[0] + px[0] * 2, pos[1]);
+                       glVertex2f(pos[0] + px[0] * 8, pos[1]);
 
-                               glVertex2f(pos[0] - px[0]*2, pos[1]);
-                               glVertex2f(pos[0] - px[0]*8, pos[1]);
+                       glVertex2f(pos[0] - px[0] * 2, pos[1]);
+                       glVertex2f(pos[0] - px[0] * 8, pos[1]);
 
-                               glVertex2f(pos[0], pos[1] - px[1]*2);
-                               glVertex2f(pos[0], pos[1] - px[1]*8);
+                       glVertex2f(pos[0], pos[1] - px[1] * 2);
+                       glVertex2f(pos[0], pos[1] - px[1] * 8);
 
-                               glVertex2f(pos[0], pos[1] + px[1]*2);
-                               glVertex2f(pos[0], pos[1] + px[1]*8);
+                       glVertex2f(pos[0], pos[1] + px[1] * 2);
+                       glVertex2f(pos[0], pos[1] + px[1] * 8);
                        glEnd();
                        if (!tiny) glLineWidth(1.0f);
                }
@@ -502,10 +502,10 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
 
        if (sc->flag & SC_SHOW_MARKER_PATTERN) {
                glBegin(GL_LINE_LOOP);
-                       glVertex2fv(marker->pattern_corners[0]);
-                       glVertex2fv(marker->pattern_corners[1]);
-                       glVertex2fv(marker->pattern_corners[2]);
-                       glVertex2fv(marker->pattern_corners[3]);
+               glVertex2fv(marker->pattern_corners[0]);
+               glVertex2fv(marker->pattern_corners[1]);
+               glVertex2fv(marker->pattern_corners[2]);
+               glVertex2fv(marker->pattern_corners[3]);
                glEnd();
        }
 
@@ -513,10 +513,10 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
                      ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0);
        if (sc->flag & SC_SHOW_MARKER_SEARCH && show_search) {
                glBegin(GL_LINE_LOOP);
-                       glVertex2f(marker->search_min[0], marker->search_min[1]);
-                       glVertex2f(marker->search_max[0], marker->search_min[1]);
-                       glVertex2f(marker->search_max[0], marker->search_max[1]);
-                       glVertex2f(marker->search_min[0], marker->search_max[1]);
+               glVertex2f(marker->search_min[0], marker->search_min[1]);
+               glVertex2f(marker->search_max[0], marker->search_min[1]);
+               glVertex2f(marker->search_max[0], marker->search_max[1]);
+               glVertex2f(marker->search_min[0], marker->search_max[1]);
                glEnd();
        }
        glPopMatrix();
@@ -546,7 +546,7 @@ static void track_colors(MovieTrackingTrack *track, int act, float col[3], float
 }
 
 static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
-                             float marker_pos[2], int width, int height, int act, int sel)
+                              float marker_pos[2], int width, int height, int act, int sel)
 {
        int tiny = sc->flag & SC_SHOW_TINY_MARKER;
        int show_search = 0;
@@ -588,7 +588,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
                                glPointSize(2.0f);
 
                        glBegin(GL_POINTS);
-                               glVertex2f(pos[0], pos[1]);
+                       glVertex2f(pos[0], pos[1]);
                        glEnd();
 
                        if (!tiny)
@@ -596,17 +596,17 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
                }
                else {
                        glBegin(GL_LINES);
-                               glVertex2f(pos[0] + px[0]*3, pos[1]);
-                               glVertex2f(pos[0] + px[0]*7, pos[1]);
+                       glVertex2f(pos[0] + px[0] * 3, pos[1]);
+                       glVertex2f(pos[0] + px[0] * 7, pos[1]);
 
-                               glVertex2f(pos[0] - px[0]*3, pos[1]);
-                               glVertex2f(pos[0] - px[0]*7, pos[1]);
+                       glVertex2f(pos[0] - px[0] * 3, pos[1]);
+                       glVertex2f(pos[0] - px[0] * 7, pos[1]);
 
-                               glVertex2f(pos[0], pos[1] - px[1]*3);
-                               glVertex2f(pos[0], pos[1] - px[1]*7);
+                       glVertex2f(pos[0], pos[1] - px[1] * 3);
+                       glVertex2f(pos[0], pos[1] - px[1] * 7);
 
-                               glVertex2f(pos[0], pos[1] + px[1]*3);
-                               glVertex2f(pos[0], pos[1] + px[1]*7);
+                       glVertex2f(pos[0], pos[1] + px[1] * 3);
+                       glVertex2f(pos[0], pos[1] + px[1] * 7);
                        glEnd();
 
                        glColor3f(0.0f, 0.0f, 0.0f);
@@ -616,8 +616,8 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
                        glLogicOp(GL_NOR);
 
                        glBegin(GL_LINES);
-                               glVertex2fv(pos);
-                               glVertex2fv(marker_pos);
+                       glVertex2fv(pos);
+                       glVertex2fv(marker_pos);
                        glEnd();
 
                        glDisable(GL_COLOR_LOGIC_OP);
@@ -656,16 +656,16 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
                }
 
                glBegin(GL_LINE_LOOP);
-                       glVertex2fv(marker->pattern_corners[0]);
-                       glVertex2fv(marker->pattern_corners[1]);
-                       glVertex2fv(marker->pattern_corners[2]);
-                       glVertex2fv(marker->pattern_corners[3]);
+               glVertex2fv(marker->pattern_corners[0]);
+               glVertex2fv(marker->pattern_corners[1]);
+               glVertex2fv(marker->pattern_corners[2]);
+               glVertex2fv(marker->pattern_corners[3]);
                glEnd();
        }
 
        /* search */
        show_search = TRACK_VIEW_SELECTED(sc, track) &&
-                    ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0);
+                     ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0);
        if ((track->search_flag & SELECT) == sel && (sc->flag & SC_SHOW_MARKER_SEARCH) && show_search) {
                if (track->flag & TRACK_LOCKED) {
                        if (act)
@@ -689,10 +689,10 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
                }
 
                glBegin(GL_LINE_LOOP);
-                       glVertex2f(marker->search_min[0], marker->search_min[1]);
-                       glVertex2f(marker->search_max[0], marker->search_min[1]);
-                       glVertex2f(marker->search_max[0], marker->search_max[1]);
-                       glVertex2f(marker->search_min[0], marker->search_max[1]);
+               glVertex2f(marker->search_min[0], marker->search_min[1]);
+               glVertex2f(marker->search_max[0], marker->search_min[1]);
+               glVertex2f(marker->search_max[0], marker->search_max[1]);
+               glVertex2f(marker->search_min[0], marker->search_max[1]);
                glEnd();
        }
 
@@ -733,10 +733,10 @@ static void draw_marker_slide_square(float x, float y, float dx, float dy, int o
        }
 
        glBegin(GL_QUADS);
-               glVertex3f(x - tdx, y + tdy, 0.0f);
-               glVertex3f(x + tdx, y + tdy, 0.0f);
-               glVertex3f(x + tdx, y - tdy, 0.0f);
-               glVertex3f(x - tdx, y - tdy, 0.0f);
+       glVertex3f(x - tdx, y + tdy, 0.0f);
+       glVertex3f(x + tdx, y + tdy, 0.0f);
+       glVertex3f(x + tdx, y - tdy, 0.0f);
+       glVertex3f(x - tdx, y - tdy, 0.0f);
        glEnd();
 }
 
@@ -753,9 +753,9 @@ static void draw_marker_slide_triangle(float x, float y, float dx, float dy, int
        }
 
        glBegin(GL_TRIANGLES);
-               glVertex3f(x,       y,       0.0f);
-               glVertex3f(x - tdx, y,       0.0f);
-               glVertex3f(x,       y + tdy, 0.0f);
+       glVertex3f(x,       y,       0.0f);
+       glVertex3f(x - tdx, y,       0.0f);
+       glVertex3f(x,       y + tdy, 0.0f);
        glEnd();
 }
 
@@ -874,7 +874,7 @@ static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
        }
 
        if ((sc->flag & SC_SHOW_MARKER_SEARCH) &&
-          ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0))
+           ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0))
        {
                dx = marker->search_min[0];
                dy = marker->search_min[1];
@@ -893,8 +893,8 @@ static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
 
        mul_m4_v3(sc->stabmat, pos);
 
-       pos[0] = pos[0]*zoomx;
-       pos[1] = pos[1]*zoomy - fontsize;
+       pos[0] = pos[0] * zoomx;
+       pos[1] = pos[1] * zoomy - fontsize;
 
        if (marker->flag & MARKER_DISABLED)
                strcpy(state, "disabled");
@@ -934,8 +934,8 @@ static void view2d_to_region_float(View2D *v2d, float x, float y, float *regionx
        y = -v2d->cur.ymin / (v2d->cur.ymax - v2d->cur.ymin);
 
        /* convert proportional distances to screen coordinates */
-       *regionx = v2d->mask.xmin + x*(v2d->mask.xmax - v2d->mask.xmin);
-       *regiony = v2d->mask.ymin + y*(v2d->mask.ymax - v2d->mask.ymin);
+       *regionx = v2d->mask.xmin + x * (v2d->mask.xmax - v2d->mask.xmin);
+       *regiony = v2d->mask.ymin + y * (v2d->mask.ymax - v2d->mask.ymin);
 }
 
 static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
@@ -987,7 +987,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
 
                /* undistort */
                if (count) {
-                       marker_pos = MEM_callocN(2*sizeof(float)*count, "draw_tracking_tracks marker_pos");
+                       marker_pos = MEM_callocN(2 * sizeof(float) * count, "draw_tracking_tracks marker_pos");
 
                        track = tracksbase->first;
                        fp = marker_pos;
@@ -1121,10 +1121,10 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                                                        glColor3f(1.0f, 0.0f, 0.0f);
 
                                                glBegin(GL_POINTS);
-                                                       if (undistort)
-                                                               glVertex3f(pos[0] / width, pos[1] / (height * aspy), 0);
-                                                       else
-                                                               glVertex3f(npos[0] / width, npos[1] / (height * aspy), 0);
+                                               if (undistort)
+                                                       glVertex3f(pos[0] / width, pos[1] / (height * aspy), 0);
+                                               else
+                                                       glVertex3f(npos[0] / width, npos[1] / (height * aspy), 0);
                                                glEnd();
                                        }
                                }
@@ -1260,7 +1260,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                                BKE_tracking_apply_intrinsics(tracking, pos, grid[i][j]);
 
                                grid[i][j][0] /= width;
-                               grid[i][j][1] /= height*aspy;
+                               grid[i][j][1] /= height * aspy;
 
                                pos[0] += dx;
                        }
@@ -1273,17 +1273,17 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
 
                for (i = 0; i <= n; i++) {
                        glBegin(GL_LINE_STRIP);
-                               for (j = 0; j <= n; j++) {
-                                       glVertex2fv(grid[i][j]);
-                               }
+                       for (j = 0; j <= n; j++) {
+                               glVertex2fv(grid[i][j]);
+                       }
                        glEnd();
                }
 
                for (j = 0; j <= n; j++) {
                        glBegin(GL_LINE_STRIP);
-                               for (i = 0; i <= n; i++) {
-                                       glVertex2fv(grid[i][j]);
-                               }
+                       for (i = 0; i <= n; i++) {
+                               glVertex2fv(grid[i][j]);
+                       }
                        glEnd();
                }
        }
@@ -1328,40 +1328,40 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                                        if (stroke->flag & GP_STROKE_2DSPACE) {
                                                if (stroke->totpoints > 1) {
                                                        glBegin(GL_LINE_STRIP);
-                                                               for (i = 0; i < stroke->totpoints - 1; i++) {
-                                                                       float npos[2], dpos[2], len;
-                                                                       int steps;
+                                                       for (i = 0; i < stroke->totpoints - 1; i++) {
+                                                               float npos[2], dpos[2], len;
+                                                               int steps;
 
-                                                                       pos[0] = (stroke->points[i].x + offsx) * width;
-                                                                       pos[1] = (stroke->points[i].y + offsy) * height * aspy;
+                                                               pos[0] = (stroke->points[i].x + offsx) * width;
+                                                               pos[1] = (stroke->points[i].y + offsy) * height * aspy;
 
-                                                                       npos[0] = (stroke->points[i + 1].x + offsx) * width;
-                                                                       npos[1] = (stroke->points[i + 1].y + offsy) * height * aspy;
+                                                               npos[0] = (stroke->points[i + 1].x + offsx) * width;
+                                                               npos[1] = (stroke->points[i + 1].y + offsy) * height * aspy;
 
-                                                                       len = len_v2v2(pos, npos);
-                                                                       steps = ceil(len / 5.0f);
+                                                               len = len_v2v2(pos, npos);
+                                                               steps = ceil(len / 5.0f);
 
-                                                                       /* we want to distort only long straight lines */
-                                                                       if (stroke->totpoints == 2) {
-                                                                               BKE_tracking_invert_intrinsics(tracking, pos, pos);
-                                                                               BKE_tracking_invert_intrinsics(tracking, npos, npos);
-                                                                       }
+                                                               /* we want to distort only long straight lines */
+                                                               if (stroke->totpoints == 2) {
+                                                                       BKE_tracking_invert_intrinsics(tracking, pos, pos);
+                                                                       BKE_tracking_invert_intrinsics(tracking, npos, npos);
+                                                               }
 
-                                                                       sub_v2_v2v2(dpos, npos, pos);
-                                                                       mul_v2_fl(dpos, 1.0f / steps);
+                                                               sub_v2_v2v2(dpos, npos, pos);
+                                                               mul_v2_fl(dpos, 1.0f / steps);
 
-                                                                       for (j = 0; j <= steps; j++) {
-                                                                               BKE_tracking_apply_intrinsics(tracking, pos, tpos);
-                                                                               glVertex2f(tpos[0] / width, tpos[1] / (height*aspy));
+                                                               for (j = 0; j <= steps; j++) {
+                                                                       BKE_tracking_apply_intrinsics(tracking, pos, tpos);
+                                                                       glVertex2f(tpos[0] / width, tpos[1] / (height * aspy));
 
-                                                                               add_v2_v2(pos, dpos);
-                                                                       }
+                                                                       add_v2_v2(pos, dpos);
                                                                }
+                                                       }
                                                        glEnd();
                                                }
                                                else if (stroke->totpoints == 1) {
                                                        glBegin(GL_POINTS);
-                                                               glVertex2f(stroke->points[0].x + offsx, stroke->points[0].y + offsy);
+                                                       glVertex2f(stroke->points[0].x + offsx, stroke->points[0].y + offsy);
                                                        glEnd();
                                                }
                                        }
index 8d30242..7da5dae 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "DNA_movieclip_types.h"
 #include "DNA_scene_types.h"
-#include "DNA_object_types.h"  /* SELECT */
+#include "DNA_object_types.h"   /* SELECT */
 
 #include "MEM_guardedalloc.h"
 
@@ -57,7 +57,7 @@
 
 #include "BLF_api.h"
 
-#include "clip_intern.h"       // own include
+#include "clip_intern.h"    // own include
 
 static void draw_curve_knot(float x, float y, float xscale, float yscale, float hsize)
 {
@@ -88,7 +88,7 @@ static void draw_curve_knot(float x, float y, float xscale, float yscale, float
 }
 
 static void tracking_segment_point_cb(void *UNUSED(userdata), MovieTrackingTrack *UNUSED(track),
-                       MovieTrackingMarker *UNUSED(marker), int UNUSED(coord), int scene_framenr, float val)
+                                      MovieTrackingMarker *UNUSED(marker), int UNUSED(coord), int scene_framenr, float val)
 {
        glVertex2f(scene_framenr, val);
 }
@@ -123,7 +123,7 @@ void tracking_segment_end_cb(void *UNUSED(userdata))
 }
 
 static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track,
-                       MovieTrackingMarker *marker, int coord, int scene_framenr, float val)
+                                     MovieTrackingMarker *marker, int coord, int scene_framenr, float val)
 {
        struct { MovieTrackingTrack *act_track; int sel; float xscale, yscale, hsize; } *data = userdata;
        int sel = 0, sel_flag;
@@ -167,7 +167,7 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc)
        /* draw graph lines */
        glEnable(GL_BLEND);
        clip_graph_tracking_values_iterate(sc, act_track, tracking_segment_point_cb,
-                                       tracking_segment_start_cb, tracking_segment_end_cb);
+                                          tracking_segment_start_cb, tracking_segment_end_cb);
        glDisable(GL_BLEND);
 
        /* selected knot handles on top of curves */
index 79e199a..9af67a2 100644 (file)
@@ -29,7 +29,7 @@
  *  \ingroup spclip
  */
 
-#include "DNA_object_types.h"  /* SELECT */
+#include "DNA_object_types.h"  /* SELECT */
 #include "DNA_scene_types.h"
 
 #include "MEM_guardedalloc.h"
@@ -57,7 +57,7 @@
 
 #include "UI_view2d.h"
 
-#include "clip_intern.h"       // own include
+#include "clip_intern.h"    // own include
 
 /******************** common graph-editing utilities ********************/
 
@@ -96,16 +96,16 @@ static void toggle_selection_cb(void *userdata, MovieTrackingMarker *marker)
 /******************** mouse select operator ********************/
 
 typedef struct {
-       int coord,              /* coordinate index of found entuty (0 = X-axis, 1 = Y-axis) */
-           has_prev;           /* if there's valid coordinate of previous point of curve segment */
+       int coord,          /* coordinate index of found entuty (0 = X-axis, 1 = Y-axis) */
+           has_prev;       /* if there's valid coordinate of previous point of curve segment */
 
-       float min_dist,         /* minimal distance between mouse and currently found entuty */
-             mouse_co[2],      /* mouse coordinate */
-             prev_co[2],       /* coordinate of previeous point of segment */
-             min_co[2];        /* coordinate of entity with minimal distance */
+       float min_dist,     /* minimal distance between mouse and currently found entuty */
+             mouse_co[2],  /* mouse coordinate */
+             prev_co[2],   /* coordinate of previeous point of segment */
+             min_co[2];    /* coordinate of entity with minimal distance */
 
-       MovieTrackingTrack *track;      /* nearest found track */
-       MovieTrackingMarker *marker;    /* nearest found marker */
+       MovieTrackingTrack *track;      /* nearest found track */
+       MovieTrackingMarker *marker;    /* nearest found marker */
 } MouseSelectUserData;
 
 static void find_nearest_tracking_segment_cb(void *userdata, MovieTrackingTrack *track,
@@ -261,7 +261,7 @@ static int mouse_select(bContext *C, float co[2], int extend)
 static int select_exec(bContext *C, wmOperator *op)
 {
        float co[2];
-       int  extend = RNA_boolean_get(op->ptr, "extend");
+       int extend = RNA_boolean_get(op->ptr, "extend");
 
        RNA_float_get_array(op->ptr, "location", co);
 
@@ -296,9 +296,9 @@ void CLIP_OT_graph_select(wmOperatorType *ot)
 
        /* properties */
        RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
-               "Location", "Mouse location to select nearest entity", -100.0f, 100.0f);
+                            "Location", "Mouse location to select nearest entity", -100.0f, 100.0f);
        RNA_def_boolean(ot->srna, "extend", 0,
-               "Extend", "Extend selection rather than clearing the existing selection");
+                       "Extend", "Extend selection rather than clearing the existing selection");
 }
 
 /********************** border select operator *********************/
@@ -671,10 +671,10 @@ static int graph_disable_markers_exec(bContext *C, wmOperator *op)
 void CLIP_OT_graph_disable_markers(wmOperatorType *ot)
 {
        static EnumPropertyItem actions_items[] = {
-                       {0, "DISABLE", 0, "Disable", "Disable selected markers"},
-                       {1, "ENABLE", 0, "Enable", "Enable selected markers"},
-                       {2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
-                       {0, NULL, 0, NULL, NULL}
+               {0, "DISABLE", 0, "Disable", "Disable selected markers"},
+               {1, "ENABLE", 0, "Enable", "Enable selected markers"},
+               {2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
index 6908e48..dd1addd 100644 (file)
@@ -43,18 +43,18 @@ struct SpaceClip;
 struct wmOperatorType;
 
 /* channel heights */
-#define CHANNEL_FIRST                  -UI_UNIT_Y
-#define CHANNEL_HEIGHT                 UI_UNIT_Y
-#define CHANNEL_HEIGHT_HALF            (UI_UNIT_Y / 2.0f)
-#define CHANNEL_SKIP                   2
-#define CHANNEL_STEP                   (CHANNEL_HEIGHT + CHANNEL_SKIP)
+#define CHANNEL_FIRST           -UI_UNIT_Y
+#define CHANNEL_HEIGHT          UI_UNIT_Y
+#define CHANNEL_HEIGHT_HALF     (UI_UNIT_Y / 2.0f)
+#define CHANNEL_SKIP            2
+#define CHANNEL_STEP            (CHANNEL_HEIGHT + CHANNEL_SKIP)
 
-#define CHANNEL_PAD                            4
+#define CHANNEL_PAD             4
 
 /* extra padding for lengths (to go under scrollers) */
-#define EXTRA_SCROLL_PAD               100.0f
+#define EXTRA_SCROLL_PAD        100.0f
 
-#define STRIP_HEIGHT_HALF              5
+#define STRIP_HEIGHT_HALF       5
 
 /* internal exports only */
 
@@ -110,17 +110,17 @@ void ED_clip_tool_props_register(struct ARegionType *art);
 
 /* clip_utils.c */
 void clip_graph_tracking_values_iterate_track(struct SpaceClip *sc, struct MovieTrackingTrack *track, void *userdata,
-                       void (*func) (void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
-                       void (*segment_start) (void *userdata, struct MovieTrackingTrack *track, int coord),
-                       void (*segment_end) (void *userdata));
+                                              void (*func)(void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
+                                              void (*segment_start)(void *userdata, struct MovieTrackingTrack *track, int coord),
+                                              void (*segment_end)(void *userdata));
 
 void clip_graph_tracking_values_iterate(struct SpaceClip *sc, void *userdata,
-                       void (*func) (void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
-                       void (*segment_start) (void *userdata, struct MovieTrackingTrack *track, int coord),
-                       void (*segment_end) (void *userdata));
+                                        void (*func)(void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
+                                        void (*segment_start)(void *userdata, struct MovieTrackingTrack *track, int coord),
+                                        void (*segment_end)(void *userdata));
 
 void clip_graph_tracking_iterate(struct SpaceClip *sc, void *userdata,
-                                 void (*func) (void *userdata, struct MovieTrackingMarker *marker));
+                                 void (*func)(void *userdata, struct MovieTrackingMarker *marker));
 
 void clip_delete_track(struct bContext *C, struct MovieClip *clip, struct ListBase *tracksbase, struct MovieTrackingTrack *track);
 void clip_delete_marker(struct bContext *C, struct MovieClip *clip, struct ListBase *tracksbase, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker);
index 6b69f31..8175a84 100644 (file)
@@ -30,7 +30,7 @@
  */
 
 #include "DNA_scene_types.h"
-#include "DNA_object_types.h"  /* SELECT */
+#include "DNA_object_types.h"   /* SELECT */
 
 #include "MEM_guardedalloc.h"
 
 #include "UI_resources.h"
 #include "UI_view2d.h"
 
-#include "clip_intern.h"       // own include
+#include "clip_intern.h"    // own include
 
 void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack *track, void *userdata,
-                       void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
-                       void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord),
-                       void (*segment_end) (void *userdata))
+                                              void (*func)(void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
+                                              void (*segment_start)(void *userdata, MovieTrackingTrack *track, int coord),
+                                              void (*segment_end)(void *userdata))
 {
        MovieClip *clip = ED_space_clip(sc);
        int width, height, coord;
@@ -122,9 +122,9 @@ void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack
 }
 
 void clip_graph_tracking_values_iterate(SpaceClip *sc, void *userdata,
-                       void (*func) (void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
-                       void (*segment_start) (void *userdata, MovieTrackingTrack *track, int coord),
-                       void (*segment_end) (void *userdata))
+                                        void (*func)(void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, int coord, int scene_framenr, float val),
+                                        void (*segment_start)(void *userdata, MovieTrackingTrack *track, int coord),
+                                        void (*segment_end)(void *userdata))
 {
        MovieClip *clip = ED_space_clip(sc);
        MovieTracking *tracking = &clip->tracking;
@@ -142,7 +142,7 @@ void clip_graph_tracking_values_iterate(SpaceClip *sc, void *userdata,
 }
 
 void clip_graph_tracking_iterate(SpaceClip *sc, void *userdata,
-                       void (*func) (void *userdata, MovieTrackingMarker *marker))
+                                 void (*func)(void *userdata, MovieTrackingMarker *marker))
 {
        MovieClip *clip = ED_space_clip(sc);
        MovieTracking *tracking = &clip->tracking;
@@ -244,11 +244,11 @@ void clip_draw_cfra(SpaceClip *sc, ARegion *ar, Scene *scene)
        glLineWidth(2.0);
 
        glBegin(GL_LINE_STRIP);
-               vec[1] = v2d->cur.ymin;
-               glVertex2fv(vec);
+       vec[1] = v2d->cur.ymin;
+       glVertex2fv(vec);
 
-               vec[1] = v2d->cur.ymax;
-               glVertex2fv(vec);
+       vec[1] = v2d->cur.ymax;
+       glVertex2fv(vec);
        glEnd();
 
        glLineWidth(1.0);
@@ -272,10 +272,10 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene)
        /* currently clip editor supposes that editing clip length is equal to scene frame range */
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glEnable(GL_BLEND);
-               glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
+       glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
 
-               glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)SFRA, v2d->cur.ymax);
-               glRectf((float)EFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
+       glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)SFRA, v2d->cur.ymax);
+       glRectf((float)EFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
        glDisable(GL_BLEND);
 
        UI_ThemeColorShade(TH_BACK, -60);
index 5472488..6409ad6 100644 (file)
@@ -35,7 +35,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_mask_types.h"
 #include "DNA_movieclip_types.h"
-#include "DNA_view3d_types.h"  /* for pivot point */
+#include "DNA_view3d_types.h"  /* for pivot point */
 
 #include "MEM_guardedalloc.h"
 
@@ -71,7 +71,7 @@
 #include "RNA_access.h"
 
 
-#include "clip_intern.h"       // own include
+#include "clip_intern.h"  /* own include */
 
 static void init_preview_region(const bContext *C, ARegion *ar)
 {
@@ -299,7 +299,7 @@ static SpaceLink *clip_new(const bContext *C)
 /* not spacelink itself */
 static void clip_free(SpaceLink *sl)
 {
-       SpaceClip *sc = (SpaceClip*) sl;
+       SpaceClip *sc = (SpaceClip *) sl;
 
        sc->clip = NULL;
 
@@ -397,7 +397,7 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn)
                        }
                        break;
                case NC_SCREEN:
-                        switch (wmn->data) {
+                       switch (wmn->data) {
                                case ND_ANIMPLAY:
                                case ND_GPENCIL:
                                        ED_area_tag_redraw(sa);
@@ -634,17 +634,17 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "CLIP_OT_slide_marker", LEFTMOUSE, KM_PRESS, 0, 0);
 
        kmi = WM_keymap_add_item(keymap, "CLIP_OT_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_enum_set(kmi->ptr, "action", 2);    /* toggle */
+       RNA_enum_set(kmi->ptr, "action", 2);    /* toggle */
 
        /* tracks */
        WM_keymap_add_item(keymap, "CLIP_OT_delete_track", DELKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "CLIP_OT_delete_track", XKEY, KM_PRESS, 0, 0);
 
        kmi = WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_CTRL, 0);
-       RNA_enum_set(kmi->ptr, "action", 0);    /* lock */
+       RNA_enum_set(kmi->ptr, "action", 0);    /* lock */
 
        kmi = WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_ALT, 0);
-       RNA_enum_set(kmi->ptr, "action", 1);    /* unlock */
+       RNA_enum_set(kmi->ptr, "action", 1);    /* unlock */
 
        kmi = WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0);
        RNA_boolean_set(kmi->ptr, "unselected", FALSE);
@@ -733,7 +733,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
 
        /* tracks */
        kmi = WM_keymap_add_item(keymap, "CLIP_OT_graph_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0);
-       RNA_enum_set(kmi->ptr, "action", 2);    /* toggle */
+       RNA_enum_set(kmi->ptr, "action", 2);    /* toggle */
 
        transform_keymap_for_space(keyconf, keymap, SPACE_CLIP);
 
@@ -742,7 +742,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
        keymap = WM_keymap_find(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
 
        kmi = WM_keymap_add_item(keymap, "CLIP_OT_dopesheet_select_channel", ACTIONMOUSE, KM_PRESS, 0, 0);
-       RNA_boolean_set(kmi->ptr, "extend", TRUE);      /* toggle */
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);  /* toggle */
 }
 
 const char *clip_context_dir[] = {"edit_movieclip", "edit_mask", NULL};
@@ -1161,7 +1161,7 @@ static void clip_main_area_listener(ARegion *ar, wmNotifier *wmn)
                case NC_SCREEN:
                        if (wmn->data == ND_GPENCIL)
                                ED_region_tag_redraw(ar);
-               break;
+                       break;
        }
 }
 
@@ -1205,7 +1205,7 @@ static void graph_area_draw(const bContext *C, ARegion *ar)
        UI_view2d_view_restore(C);
 
        /* scrollers */
-       unitx = (sc->flag & SC_SHOW_SECONDS)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
+       unitx = (sc->flag & SC_SHOW_SECONDS) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
        unity = V2D_UNIT_VALUES;
        scrollers = UI_view2d_scrollers_calc(C, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP);
        UI_view2d_scrollers_draw(C, v2d, scrollers);
@@ -1232,7 +1232,7 @@ static void dopesheet_area_draw(const bContext *C, ARegion *ar)
        UI_view2d_view_ortho(v2d);
 
        /* time grid */
-       unit = (sc->flag & SC_SHOW_SECONDS)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
+       unit = (sc->flag & SC_SHOW_SECONDS) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
        grid = UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP,
                                   V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy);
        UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
@@ -1331,10 +1331,10 @@ static void clip_header_area_listener(ARegion *ar, wmNotifier *wmn)
                                case ND_TOOLSETTINGS:
                                        /* TODO - should do this when in mask mode only but no datas available */
                                        // if (sc->mode == SC_MODE_MASKEDIT)
-                                       {
-                                               ED_region_tag_redraw(ar);
-                                       }
-                                       break;
+                               {
+                                       ED_region_tag_redraw(ar);
+                               }
+                               break;
                        }
                        break;
        }
index f6e9622..3a19580 100644 (file)
@@ -35,7 +35,7 @@
 #include "DNA_constraint_types.h"
 #include "DNA_gpencil_types.h"
 #include "DNA_movieclip_types.h"
-#include "DNA_object_types.h"  /* SELECT */
+#include "DNA_object_types.h"   /* SELECT */
 #include "DNA_scene_types.h"
 
 #include "BLI_utildefines.h"
@@ -77,7 +77,7 @@
 
 #include "UI_view2d.h"
 
-#include "clip_intern.h"       // own include
+#include "clip_intern.h"    // own include
 
 static float dist_to_crns(float co[2], float pos[2], float crns[4][2]);
 
@@ -154,7 +154,7 @@ void CLIP_OT_add_marker(wmOperatorType *ot)
 
        /* properties */
        RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MIN, FLT_MAX,
-               "Location", "Location of marker on frame", -1.0f, 1.0f);
+                            "Location", "Location of marker on frame", -1.0f, 1.0f);
 }
 
 /********************** delete track operator *********************/
@@ -251,9 +251,9 @@ void CLIP_OT_delete_marker(wmOperatorType *ot)
 
 /********************** slide marker operator *********************/
 
-#define SLIDE_ACTION_POS       0
-#define SLIDE_ACTION_SIZE      1
-#define SLIDE_ACTION_OFFSET    2
+#define SLIDE_ACTION_POS    0
+#define SLIDE_ACTION_SIZE   1
+#define SLIDE_ACTION_OFFSET 2
 
 typedef struct {
        int area, action;
@@ -271,7 +271,7 @@ typedef struct {
 
 static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTrack *track,
                                                  MovieTrackingMarker *marker, wmEvent *event,
-                                                                                                int area, int corner, int action, int width, int height)
+                                                 int area, int corner, int action, int width, int height)
 {
        SlideMarkerData *data = MEM_callocN(sizeof(SlideMarkerData), "slide marker data");
        int framenr = ED_space_clip_clip_framenr(sc);
@@ -301,7 +301,7 @@ static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTra
 
                        copy_v2_v2(data->soff, track->offset);
 
-                       data->smarkers = MEM_callocN(sizeof(*data->smarkers)*track->markersnr, "slide marekrs");
+                       data->smarkers = MEM_callocN(sizeof(*data->smarkers) * track->markersnr, "slide marekrs");
                        for (a = 0; a < track->markersnr; a++)
                                copy_v2_v2(data->smarkers[a], track->markers[a].pos);
                }
@@ -318,7 +318,7 @@ static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTra
        }
 
        if ((area == TRACK_AREA_SEARCH) ||
-               (area == TRACK_AREA_PAT && action != SLIDE_ACTION_OFFSET))
+           (area == TRACK_AREA_PAT && action != SLIDE_ACTION_OFFSET))
        {
                if (data->corners) {
                        memcpy(data->scorners, data->corners, sizeof(data->scorners));
@@ -647,7 +647,7 @@ static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event)
                        if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY))
                                data->accurate = event->val == KM_PRESS;
 
-                       /* no break! update area size */
+               /* no break! update area size */
 
                case MOUSEMOVE:
                        mdelta[0] = event->mval[0] - data->mval[0];
@@ -807,7 +807,7 @@ void CLIP_OT_slide_marker(wmOperatorType *ot)
 
        /* properties */
        RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX,
-               "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX);
+                            "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX);
 }
 
 /********************** mouse select operator *********************/
@@ -901,8 +901,8 @@ static float dist_to_crns(float co[2], float pos[2], float crns[4][2])
 {
        float d1, d2, d3, d4;
        float p[2] = {co[0] - pos[0], co[1] - pos[1]};
-       float *v1 = crns[0], *v2 = crns[1],
-             *v3 = crns[2], *v4 = crns[3];
+       float *v1 = crns[0], *v2 = crns[1];
+       float *v3 = crns[2], *v4 = crns[3];
 
        d1 = dist_to_line_segment_v2(p, v1, v2);
        d2 = dist_to_line_segment_v2(p, v2, v3);
@@ -927,7 +927,7 @@ static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, ListBase *tracksbas
 
                        /* distance to marker point */
                        d1 = sqrtf((co[0] - marker->pos[0] - cur->offset[0]) * (co[0] - marker->pos[0] - cur->offset[0]) +
-                                          (co[1] - marker->pos[1] - cur->offset[1]) * (co[1] - marker->pos[1] - cur->offset[1]));
+                                  (co[1] - marker->pos[1] - cur->offset[1]) * (co[1] - marker->pos[1] - cur->offset[1]));
 
                        /* distance to pattern boundbox */
                        if (sc->flag & SC_SHOW_MARKER_PATTERN)
@@ -959,7 +959,7 @@ static int mouse_select(bContext *C, float co[2], int extend)
        MovieTracking *tracking = &clip->tracking;
        ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
        MovieTrackingTrack *act_track = BKE_tracking_active_track(tracking);
-       MovieTrackingTrack *track = NULL;       /* selected marker */
+       MovieTrackingTrack *track = NULL;   /* selected marker */
 
        track = find_nearest_track(sc, tracksbase, co);
 
@@ -1053,9 +1053,9 @@ void CLIP_OT_select(wmOperatorType *ot)
 
        /* properties */
        RNA_def_boolean(ot->srna, "extend", 0,
-               "Extend", "Extend selection rather than clearing the existing selection");
+                       "Extend", "Extend selection rather than clearing the existing selection");
        RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
-               "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f);
+                            "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f);
 }
 
 /********************** border select operator *********************/
@@ -1234,10 +1234,10 @@ static int marker_inside_ellipse(MovieTrackingMarker *marker, float offset[2], f
        /* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
        float x, y;
 
-       x = (marker->pos[0] - offset[0])*ellipse[0];
-       y = (marker->pos[1] - offset[1])*ellipse[1];
+       x = (marker->pos[0] - offset[0]) * ellipse[0];
+       y = (marker->pos[1] - offset[1]) * ellipse[1];
 
-       return x*x + y*y < 1.0f;
+       return x * x + y * y < 1.0f;
 }
 
 static int circle_select_exec(bContext *C, wmOperator *op)
@@ -1325,7 +1325,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
        MovieTracking *tracking = &clip->tracking;
-       MovieTrackingTrack *track = NULL;       /* selected track */
+       MovieTrackingTrack *track = NULL;   /* selected track */
        MovieTrackingMarker *marker;
        ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
        int action = RNA_enum_get(op->ptr, "action");
@@ -1477,14 +1477,14 @@ static int select_groped_exec(bContext *C, wmOperator *op)
 void CLIP_OT_select_grouped(wmOperatorType *ot)
 {
        static EnumPropertyItem select_group_items[] = {
-                       {0, "KEYFRAMED", 0, "Keyframed tracks", "Select all keyframed tracks"},
-                       {1, "ESTIMATED", 0, "Estimated tracks", "Select all estimated tracks"},
-                       {2, "TRACKED", 0, "Tracked tracks", "Select all tracked tracks"},
-                       {3, "LOCKED", 0, "Locked tracks", "Select all locked tracks"},
-                       {4, "DISABLED", 0, "Disabled tracks", "Select all disabled tracks"},
-                       {5, "COLOR", 0, "Tracks with same color", "Select all tracks with same color as active track"},
-                       {6, "FAILED", 0, "Failed Tracks", "Select all tracks which failed to be reconstructed"},
-                       {0, NULL, 0, NULL, NULL}
+               {0, "KEYFRAMED", 0, "Keyframed tracks", "Select all keyframed tracks"},
+               {1, "ESTIMATED", 0, "Estimated tracks", "Select all estimated tracks"},
+               {2, "TRACKED", 0, "Tracked tracks", "Select all tracked tracks"},
+               {3, "LOCKED", 0, "Locked tracks", "Select all locked tracks"},
+               {4, "DISABLED", 0, "Disabled tracks", "Select all disabled tracks"},
+               {5, "COLOR", 0, "Tracks with same color", "Select all tracks with same color as active track"},
+               {6, "FAILED", 0, "Failed Tracks", "Select all tracks which failed to be reconstructed"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
@@ -1506,11 +1506,11 @@ void CLIP_OT_select_grouped(wmOperatorType *ot)
 /********************** track operator *********************/
 
 typedef struct TrackMarkersJob {
-       struct MovieTrackingContext *context;   /* tracking context */
-       int sfra, efra, lastfra;        /* Start, end and recently tracked frames */
-       int backwards;                          /* Backwards tracking flag */
-       MovieClip *clip;                        /* Clip which is tracking */
-       float delay;                            /* Delay in milliseconds to allow tracking at fixed FPS */
+       struct MovieTrackingContext *context;   /* tracking context */
+       int sfra, efra, lastfra;    /* Start, end and recently tracked frames */
+       int backwards;              /* Backwards tracking flag */
+       MovieClip *clip;            /* Clip which is tracking */
+       float delay;                /* Delay in milliseconds to allow tracking at fixed FPS */
 
        struct Main *main;
        struct Scene *scene;
@@ -1693,7 +1693,7 @@ static void track_markers_startjob(void *tmv, short *stop, short *do_update, flo
                                PIL_sleep_ms(tmj->delay - (float)exec_time);
                }
                else if (!BKE_tracking_next(tmj->context))
-                               break;
+                       break;
 
                *do_update = TRUE;
                *progress = (float)(framenr - tmj->sfra) / (tmj->efra - tmj->sfra);
@@ -1926,7 +1926,7 @@ static int solve_camera_initjob(bContext *C, SolveCameraJob *scj, wmOperator *op
        scj->user = sc->user;
 
        scj->context = BKE_tracking_reconstruction_context_new(tracking, object,
-                       settings->keyframe1, settings->keyframe2, width, height);
+                                                              settings->keyframe1, settings->keyframe2, width, height);
 
        tracking->stats = MEM_callocN(sizeof(MovieTrackingStats), "solve camera stats");
 
@@ -1946,7 +1946,7 @@ static void solve_camera_startjob(void *scv, short *stop, short *do_update, floa
        SolveCameraJob *scj = (SolveCameraJob *)scv;
 
        BKE_tracking_solve_reconstruction(scj->context, stop, do_update, progress,
-                       scj->stats_message, sizeof(scj->stats_message));
+                                         scj->stats_message, sizeof(scj->stats_message));
 }
 
 static void solve_camera_freejob(void *scv)
@@ -1979,7 +1979,7 @@ static void solve_camera_freejob(void *scv)
 
        /* set blender camera focal length so result would look fine there */
        if (scene->camera) {
-               Camera *camera = (Camera*)scene->camera->data;
+               Camera *camera = (Camera *)scene->camera->data;
                int width, height;
 
                BKE_movieclip_get_size(clip, &scj->user, &width, &height);
@@ -2190,10 +2190,10 @@ static int clear_track_path_exec(bContext *C, wmOperator *op)
 void CLIP_OT_clear_track_path(wmOperatorType *ot)
 {
        static EnumPropertyItem clear_path_actions[] = {
-                       {TRACK_CLEAR_UPTO, "UPTO", 0, "Clear up-to", "Clear path up to current frame"},
-                       {TRACK_CLEAR_REMAINED, "REMAINED", 0, "Clear remained", "Clear path at remaining frames (after current)"},
-                       {TRACK_CLEAR_ALL, "ALL", 0, "Clear all", "Clear the whole path"},
-                       {0, NULL, 0, NULL, NULL}
+               {TRACK_CLEAR_UPTO, "UPTO", 0, "Clear up-to", "Clear path up to current frame"},
+               {TRACK_CLEAR_REMAINED, "REMAINED", 0, "Clear remained", "Clear path at remaining frames (after current)"},
+               {TRACK_CLEAR_ALL, "ALL", 0, "Clear all", "Clear the whole path"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
@@ -2249,10 +2249,10 @@ static int disable_markers_exec(bContext *C, wmOperator *op)
 void CLIP_OT_disable_markers(wmOperatorType *ot)
 {
        static EnumPropertyItem actions_items[] = {
-                       {0, "DISABLE", 0, "Disable", "Disable selected markers"},
-                       {1, "ENABLE", 0, "Enable", "Enable selected markers"},
-                       {2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
-                       {0, NULL, 0, NULL, NULL}
+               {0, "DISABLE", 0, "Disable", "Disable selected markers"},
+               {1, "ENABLE", 0, "Enable", "Enable selected markers"},
+               {2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
@@ -2498,11 +2498,11 @@ void CLIP_OT_set_origin(wmOperatorType *ot)
 /********************** set floor operator *********************/
 
 static void set_axis(Scene *scene,  Object *ob, MovieClip *clip, MovieTrackingObject *tracking_object,
-                       MovieTrackingTrack *track, char axis)
+                     MovieTrackingTrack *track, char axis)
 {
        Object *camera = get_camera_with_movieclip(scene, clip);
        int is_camera = tracking_object->flag & TRACKING_OBJECT_CAMERA;
-       int  flip = FALSE;
+       int flip = FALSE;
        float mat[4][4], vec[3], obmat[4][4], dvec[3];
 
        BKE_object_to_mat4(ob, obmat);
@@ -2625,7 +2625,7 @@ static int set_plane_exec(bContext *C, wmOperator *op)
        float rot[4][4] = {{0.0f, 0.0f, -1.0f, 0.0f},
                           {0.0f, 1.0f, 0.0f, 0.0f},
                           {1.0f, 0.0f, 0.0f, 0.0f},
-                          {0.0f, 0.0f, 0.0f, 1.0f}};   /* 90 degrees Y-axis rotation matrix */
+                          {0.0f, 0.0f, 0.0f, 1.0f}};  /* 90 degrees Y-axis rotation matrix */
 
        if (count_selected_bundles(C) != 3) {
                BKE_report(op->reports, RPT_ERROR, "Three tracks with bundles are needed to orient the floor");
@@ -2723,9 +2723,9 @@ static int set_plane_exec(bContext *C, wmOperator *op)
 void CLIP_OT_set_plane(wmOperatorType *ot)
 {
        static EnumPropertyItem plane_items[] = {
-                       {0, "FLOOR", 0, "Floor", "Set floor plane"},
-                       {1, "WALL", 0, "Wall", "Set wall plane"},
-                       {0, NULL, 0, NULL, NULL}
+               {0, "FLOOR", 0, "Floor", "Set floor plane"},
+               {1, "WALL", 0, "Wall", "Set wall plane"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
@@ -2795,9 +2795,9 @@ static int set_axis_exec(bContext *C, wmOperator *op)
 void CLIP_OT_set_axis(wmOperatorType *ot)
 {
        static EnumPropertyItem axis_actions[] = {
-                       {0, "X", 0, "X", "Align bundle align X axis"},
-                       {1, "Y", 0, "Y", "Align bundle align Y axis"},
-                       {0, NULL, 0, NULL, NULL}
+               {0, "X", 0, "X", "Align bundle align X axis"},
+               {1, "Y", 0, "Y", "Align bundle align Y axis"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
@@ -2927,7 +2927,7 @@ void CLIP_OT_set_scale(wmOperatorType *ot)
 
        /* properties */
        RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX,
-               "Distance", "Distance between selected tracks", -100.0f, 100.0f);
+                     "Distance", "Distance between selected tracks", -100.0f, 100.0f);
 }
 
 /********************** set solution scale operator *********************/
@@ -2983,7 +2983,7 @@ void CLIP_OT_set_solution_scale(wmOperatorType *ot)
 
        /* properties */
        RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX,
-               "Distance", "Distance between selected tracks", -100.0f, 100.0f);
+                     "Distance", "Distance between selected tracks", -100.0f, 100.0f);
 }
 
 /********************** set principal center operator *********************/
@@ -3177,7 +3177,7 @@ static int detect_features_exec(bContext *C, wmOperator *op)
        }
 
        BKE_tracking_detect_fast(tracking, tracksbase, ibuf, framenr, margin,
-                               min_trackability, min_distance, layer, place_outside_layer);
+                                min_trackability, min_distance, layer, place_outside_layer);
 
        IMB_freeImBuf(ibuf);
 
@@ -3189,10 +3189,10 @@ static int detect_features_exec(bContext *C, wmOperator *op)
 void CLIP_OT_detect_features(wmOperatorType *ot)
 {
        static EnumPropertyItem placement_items[] = {
-                       {0, "FRAME",                    0, "Whole Frame",                       "Place markers across the whole frame"},
-                       {1, "INSIDE_GPENCIL",   0, "Inside grease pencil",      "Place markers only inside areas outlined with grease pencil"},
-                       {2, "OUTSIDE_GPENCIL",  0, "Outside grease pencil",     "Place markers only outside areas outlined with grease pencil"},
-                       {0, NULL, 0, NULL, NULL}
+               {0, "FRAME",            0, "Whole Frame",           "Place markers across the whole frame"},
+               {1, "INSIDE_GPENCIL",   0, "Inside grease pencil",  "Place markers only inside areas outlined with grease pencil"},
+               {2, "OUTSIDE_GPENCIL",  0, "Outside grease pencil", "Place markers only outside areas outlined with grease pencil"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
@@ -3225,7 +3225,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
        int pos = RNA_enum_get(op->ptr, "position");
        int delta;
 
-       if (pos <= 1) { /* jump to path */
+       if (pos <= 1) { /* jump to path */
                track = BKE_tracking_active_track(&clip->tracking);
 
                if (!track)
@@ -3243,7 +3243,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
                        sc->user.framenr += delta;
                }
        }
-       else {  /* to to failed frame */
+       else {  /* to to failed frame */
                if (clip->tracking.reconstruction.flag & TRACKING_RECONSTRUCTED) {
                        int a = ED_space_clip_clip_framenr(sc);
                        MovieTracking *tracking = &clip->tracking;
@@ -3284,11 +3284,11 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
 void CLIP_OT_frame_jump(wmOperatorType *ot)
 {
        static EnumPropertyItem position_items[] = {
-                       {0, "PATHSTART",        0, "Path Start",                "Jump to start of current path"},
-                       {1, "PATHEND",          0, "Path End",                  "Jump to end of current path"},
-                       {2, "FAILEDPREV",       0, "Previous Failed",   "Jump to previous failed frame"},
-                       {2, "FAILNEXT",         0, "Next Failed",               "Jump to next failed frame"},
-                       {0, NULL, 0, NULL, NULL}
+               {0, "PATHSTART",    0, "Path Start",        "Jump to start of current path"},
+               {1, "PATHEND",      0, "Path End",          "Jump to end of current path"},
+               {2, "FAILEDPREV",   0, "Previous Failed",   "Jump to previous failed frame"},
+               {2, "FAILNEXT",     0, "Next Failed",       "Jump to next failed frame"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
@@ -3392,10 +3392,10 @@ static int lock_tracks_exec(bContext *C, wmOperator *op)
 void CLIP_OT_lock_tracks(wmOperatorType *ot)
 {
        static EnumPropertyItem actions_items[] = {
-                       {0, "LOCK", 0, "Lock", "Lock selected tracks"},
-                       {1, "UNLOCK", 0, "Unlock", "Unlock selected tracks"},
-                       {2, "TOGGLE", 0, "Toggle", "Toggle locked flag for selected tracks"},
-                       {0, NULL, 0, NULL, NULL}
+               {0, "LOCK", 0, "Lock", "Lock selected tracks"},
+               {1, "UNLOCK", 0, "Unlock", "Unlock selected tracks"},
+               {2, "TOGGLE", 0, "Toggle", "Toggle locked flag for selected tracks"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
@@ -3660,7 +3660,7 @@ static int is_track_clean(MovieTrackingTrack *track, int frames, int del)
        int markersnr = track->markersnr;
 
        if (del)
-               new_markers = MEM_callocN(markersnr*sizeof(MovieTrackingMarker), "track cleaned markers");
+               new_markers = MEM_callocN(markersnr * sizeof(MovieTrackingMarker), "track cleaned markers");
 
        for (a = 0; a < markersnr; a++) {
                int end = 0;
@@ -3767,7 +3767,7 @@ static int clean_tracks_exec(bContext *C, wmOperator *op)
                        int ok = 1;
 
                        ok = (is_track_clean(track, frames, action == TRACKING_CLEAN_DELETE_SEGMENT)) &&
-                           (error == 0.0f || (track->flag & TRACK_HAS_BUNDLE) == 0  || track->error < error);
+                            (error == 0.0f || (track->flag & TRACK_HAS_BUNDLE) == 0  || track->error < error);
 
                        if (!ok) {
                                if (action == TRACKING_CLEAN_SELECT) {
@@ -3821,10 +3821,10 @@ static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
 void CLIP_OT_clean_tracks(wmOperatorType *ot)
 {
        static EnumPropertyItem actions_items[] = {
-                       {TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select unclean tracks"},
-                       {TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete unclean tracks"},
-                       {TRACKING_CLEAN_DELETE_SEGMENT, "DELETE_SEGMENTS", 0, "Delete Segments", "Delete unclean segments of tracks"},
-                       {0, NULL, 0, NULL, NULL}
+               {TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select unclean tracks"},
+               {TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete unclean tracks"},
+               {TRACKING_CLEAN_DELETE_SEGMENT, "DELETE_SEGMENTS", 0, "Delete Segments", "Delete unclean segments of tracks"},
+               {0, NULL, 0, NULL, NULL}
        };
 
        /* identifiers */
index d41294c..3710ef1 100644 (file)
@@ -51,7 +51,7 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_mask_types.h"
 #include "DNA_movieclip_types.h"
-#include "DNA_scene_types.h"           /* PET modes                    */
+#include "DNA_scene_types.h"  /* PET modes */
 
 #include "RNA_access.h"
 
@@ -105,7 +105,7 @@ static int doEdgeSlide(TransInfo *t, float perc);
 
 void setTransformViewMatrices(TransInfo *t)
 {
-       if (t->spacetype==SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) {
+       if (t->spacetype == SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) {
                RegionView3D *rv3d = t->ar->regiondata;
 
                copy_m4_m4(t->viewmat, rv3d->viewmat);
@@ -129,12 +129,12 @@ static void convertViewVec2D(View2D *v2d, float vec[3], int dx, int dy)
 {
        float divx, divy;
        
-       divx= v2d->mask.xmax - v2d->mask.xmin;
-       divy= v2d->mask.ymax - v2d->mask.ymin;
+       divx = v2d->mask.xmax - v2d->mask.xmin;
+       divy = v2d->mask.ymax - v2d->mask.ymin;
 
-       vec[0]= (v2d->cur.xmax - v2d->cur.xmin) * dx / divx;
-       vec[1]= (v2d->cur.ymax - v2d->cur.ymin) * dy / divy;
-       vec[2]= 0.0f;
+       vec[0] = (v2d->cur.xmax - v2d->cur.xmin) * dx / divx;
+       vec[1] = (v2d->cur.ymax - v2d->cur.ymin) * dy / divy;
+       vec[2] = 0.0f;
 }
 
 void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy)
@@ -145,7 +145,7 @@ void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy)
                mval_f[1] = dy;
                ED_view3d_win_to_delta(t->ar, mval_f, r_vec);
        }
-       else if (t->spacetype==SPACE_IMAGE) {
+       else if (t->spacetype == SPACE_IMAGE) {
                float aspx, aspy;
 
                convertViewVec2D(t->view, r_vec, dx, dy);
@@ -160,17 +160,17 @@ void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy)
        else if (ELEM(t->spacetype, SPACE_NODE, SPACE_SEQ)) {
                convertViewVec2D(&t->ar->v2d, r_vec, dx, dy);
        }
-       else if (t->spacetype==SPACE_CLIP) {
+       else if (t->spacetype == SPACE_CLIP) {
                View2D *v2d = t->view;
                float divx, divy;
                float mulx, muly;
                float aspx = 1.0f, aspy = 1.0f;
 
-               divx = v2d->mask.xmax-v2d->mask.xmin;
-               divy = v2d->mask.ymax-v2d->mask.ymin;
+               divx = v2d->mask.xmax - v2d->mask.xmin;
+               divy = v2d->mask.ymax - v2d->mask.ymin;
 
-               mulx = (v2d->cur.xmax-v2d->cur.xmin);
-               muly = (v2d->cur.ymax-v2d->cur.ymin);
+               mulx = (v2d->cur.xmax - v2d->cur.xmin);
+               muly = (v2d->cur.ymax - v2d->cur.ymin);
 
                if (t->options & CTX_MASK) {
                        /* clamp w/h, mask only */
@@ -201,18 +201,18 @@ void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy)
 
 void projectIntView(TransInfo *t, const float vec[3], int adr[2])
 {
-       if (t->spacetype==SPACE_VIEW3D) {
+       if (t->spacetype == SPACE_VIEW3D) {
                if (t->ar->regiontype == RGN_TYPE_WINDOW)
                        project_int_noclip(t->ar, vec, adr);
        }
-       else if (t->spacetype==SPACE_IMAGE) {
+       else if (t->spacetype == SPACE_IMAGE) {
                float aspx, aspy, v[2];
 
                ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
-               v[0]= vec[0]/aspx;
-               v[1]= vec[1]/aspy;
+               v[0] = vec[0] / aspx;
+               v[1] = vec[1] / aspy;
 
-               UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr+1);
+               UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr + 1);
        }
        else if (t->spacetype == SPACE_ACTION) {
                int out[2] = {0, 0};
@@ -222,32 +222,32 @@ void projectIntView(TransInfo *t, const float vec[3], int adr[2])
                if (sact->flag & SACTION_DRAWTIME) {
                        //vec[0] = vec[0]/((t->scene->r.frs_sec / t->scene->r.frs_sec_base));
                        /* same as below */
-                       UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out+1);
+                       UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out + 1);
                } 
                else
 #endif
                {
-                       UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out+1);
+                       UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out + 1);
                }
 
-               adr[0]= out[0];
-               adr[1]= out[1];
+               adr[0] = out[0];
+               adr[1] = out[1];
        }
        else if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) {
                int out[2] = {0, 0};
 
-               UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out+1);
-               adr[0]= out[0];
-               adr[1]= out[1];
+               UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out + 1);
+               adr[0] = out[0];
+               adr[1] = out[1];
        }
-       else if (t->spacetype==SPACE_SEQ) { /* XXX not tested yet, but should work */
+       else if (t->spacetype == SPACE_SEQ) { /* XXX not tested yet, but should work */
                int out[2] = {0, 0};
 
-               UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out+1);
-               adr[0]= out[0];
-               adr[1]= out[1];
+               UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], out, out + 1);
+               adr[0] = out[0];
+               adr[1] = out[1];
        }
-       else if (t->spacetype==SPACE_CLIP) {
+       else if (t->spacetype == SPACE_CLIP) {
                float v[2];
                float aspx = 1.0f, aspy = 1.0f;
 
@@ -261,7 +261,7 @@ void projectIntView(TransInfo *t, const float vec[3], int adr[2])
                v[0] /= aspx;
                v[1] /= aspy;
 
-               UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr+1);
+               UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr + 1);
        }
 }
 
@@ -294,11 +294,11 @@ void projectFloatView(TransInfo *t, const float vec[3], float adr[2])
 
 void applyAspectRatio(TransInfo *t, float vec[2])
 {
-       if ((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) {
-               SpaceImage *sima= t->sa->spacedata.first;
+       if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION)) {
+               SpaceImage *sima = t->sa->spacedata.first;
                float aspx, aspy;
 
-               if ((sima->flag & SI_COORDFLOATS)==0) {
+               if ((sima->flag & SI_COORDFLOATS) == 0) {
                        int width, height;
                        ED_space_image_size(sima, &width, &height);
 
@@ -310,7 +310,7 @@ void applyAspectRatio(TransInfo *t, float vec[2])
                vec[0] /= aspx;
                vec[1] /= aspy;
        }
-       else if ((t->spacetype==SPACE_CLIP) && (t->mode==TFM_TRANSLATION)) {
+       else if ((t->spacetype == SPACE_CLIP) && (t->mode == TFM_TRANSLATION)) {
                if (t->options & (CTX_MOVIECLIP | CTX_MASK)) {
                        SpaceClip *sc = t->sa->spacedata.first;
                        float aspx, aspy;
@@ -334,11 +334,11 @@ void applyAspectRatio(TransInfo *t, float vec[2])
 
 void removeAspectRatio(TransInfo *t, float vec[2])
 {
-       if ((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) {
-               SpaceImage *sima= t->sa->spacedata.first;
+       if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION)) {
+               SpaceImage *sima = t->sa->spacedata.first;
                float aspx, aspy;
 
-               if ((sima->flag & SI_COORDFLOATS)==0) {
+               if ((sima->flag & SI_COORDFLOATS) == 0) {
                        int width, height;
                        ED_space_image_size(sima, &width, &height);
 
@@ -350,7 +350,7 @@ void removeAspectRatio(TransInfo *t, float vec[2])
                vec[0] *= aspx;
                vec[1] *= aspy;
        }
-       else if ((t->spacetype==SPACE_CLIP) && (t->mode==TFM_TRANSLATION)) {
+       else if ((t->spacetype == SPACE_CLIP) && (t->mode == TFM_TRANSLATION)) {
                if (t->options & (CTX_MOVIECLIP | CTX_MASK)) {
                        SpaceClip *sc = t->sa->spacedata.first;
                        float aspx = 1.0f, aspy = 1.0f;
@@ -373,55 +373,55 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
        if (t->spacetype == SPACE_VIEW3D) {
                /* Do we need more refined tags? */
                if (t->flag & T_POSE)
-                       WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
+                       WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
                else
-                       WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
+                       WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
                
                /* for realtime animation record - send notifiers recognised by animation editors */
                // XXX: is this notifier a lame duck?
                if ((t->animtimer) && IS_AUTOKEY_ON(t->scene))
-                       WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, NULL);
+                       WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
                
        }
        else if (t->spacetype == SPACE_ACTION) {
                //SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
-               WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
+               WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
        }
        else if (t->spacetype == SPACE_IPO) {
                //SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
-               WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
+               WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
        }
        else if (t->spacetype == SPACE_NLA) {
-               WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
+               WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL);
        }
        else if (t->spacetype == SPACE_NODE) {
                //ED_area_tag_redraw(t->sa);
-               WM_event_add_notifier(C, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
+               WM_event_add_notifier(C, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
        }
        else if (t->spacetype == SPACE_SEQ) {
-               WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, NULL);
+               WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, NULL);
        }
-       else if (t->spacetype==SPACE_IMAGE) {
+       else if (t->spacetype == SPACE_IMAGE) {
                // XXX how to deal with lock?
-               SpaceImage *sima= (SpaceImage*)t->sa->spacedata.first;
-               if (sima->lock) WM_event_add_notifier(C, NC_GEOM|ND_DATA, t->obedit->data);
+               SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first;
+               if (sima->lock) WM_event_add_notifier(C, NC_GEOM | ND_DATA, t->obedit->data);
                else ED_area_tag_redraw(t->sa);
        }
-       else if (t->spacetype==SPACE_CLIP) {
-               SpaceClip *sc = (SpaceClip*)t->sa->spacedata.first;
+       else if (t->spacetype == SPACE_CLIP) {
+               SpaceClip *sc = (SpaceClip *)t->sa->spacedata.first;
 
                if (ED_space_clip_show_trackedit(sc)) {
                        MovieClip *clip = ED_space_clip(sc);
 
                        /* objects could be parented to tracking data, so send this for viewport refresh */
-                       WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
+                       WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
 
-                       WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip);
+                       WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip);
                }
                else if (ED_space_clip_show_maskedit(sc)) {
                        Mask *mask = ED_space_clip_mask(sc);
 
-                       WM_event_add_notifier(C, NC_MASK|NA_EDITED, mask);
+                       WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
                }
        }
 }
@@ -433,19 +433,19 @@ static void viewRedrawPost(bContext *C, TransInfo *t)
        if (t->spacetype == SPACE_VIEW3D) {
                /* if autokeying is enabled, send notifiers that keyframes were added */
                if (IS_AUTOKEY_ON(t->scene))
-                       WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
+                       WM_main_add_notifier(NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
                
                /* XXX temp, first hack to get auto-render in compositor work (ton) */
-               WM_event_add_notifier(C, NC_SCENE|ND_TRANSFORM_DONE, CTX_data_scene(C));
+               WM_event_add_notifier(C, NC_SCENE | ND_TRANSFORM_DONE, CTX_data_scene(C));
 
        }
        
 #if 0 // TRANSFORM_FIX_ME
-       if (t->spacetype==SPACE_VIEW3D) {
+       if (t->spacetype == SPACE_VIEW3D) {
                allqueue(REDRAWBUTSOBJECT, 0);
                allqueue(REDRAWVIEW3D, 0);
        }
-       else if (t->spacetype==SPACE_IMAGE) {
+       else if (t->spacetype == SPACE_IMAGE) {
                allqueue(REDRAWIMAGE, 0);
                allqueue(REDRAWVIEW3D, 0);
        }
@@ -469,7 +469,7 @@ void BIF_selectOrientation(void)
 #if 0 // TRANSFORM_FIX_ME
        short val;
        char *str_menu = BIF_menustringTransformOrientation("Orientation");
-       val= pupmenu(str_menu);
+       val = pupmenu(str_menu);
        MEM_freeN(str_menu);
 
        if (val >= 0) {
@@ -497,8 +497,8 @@ static void view_editmove(unsigned short UNUSED(event))
        switch (event) {
                case WHEELUPMOUSE:
 
-                       if ( G.qual & LR_SHIFTKEY ) {
-                               if ( G.qual & LR_ALTKEY ) {
+                       if (G.qual & LR_SHIFTKEY) {
+                               if (G.qual & LR_ALTKEY) {
                                        G.qual &= ~LR_SHIFTKEY;
                                        persptoetsen(PAD2);
                                        G.qual |= LR_SHIFTKEY;
@@ -507,8 +507,8 @@ static void view_editmove(unsigned short UNUSED(event))
                                        persptoetsen(PAD2);
                                }
                        }
-                       else if ( G.qual & LR_CTRLKEY ) {
-                               if ( G.qual & LR_ALTKEY ) {
+                       else if (G.qual & LR_CTRLKEY) {
+                               if (G.qual & LR_ALTKEY) {
                                        G.qual &= ~LR_CTRLKEY;
                                        persptoetsen(PAD4);
                                        G.qual |= LR_CTRLKEY;
@@ -525,8 +525,8 @@ static void view_editmove(unsigned short UNUSED(event))
                        refresh = 1;
                        break;
                case WHEELDOWNMOUSE:
-                       if ( G.qual & LR_SHIFTKEY ) {
-                               if ( G.qual & LR_ALTKEY ) {
+                       if (G.qual & LR_SHIFTKEY) {
+                               if (G.qual & LR_ALTKEY) {
                                        G.qual &= ~LR_SHIFTKEY;
                                        persptoetsen(PAD8);
                                        G.qual |= LR_SHIFTKEY;
@@ -535,8 +535,8 @@ static void view_editmove(unsigned short UNUSED(event))
                                        persptoetsen(PAD8);
                                }
                        }
-                       else if ( G.qual & LR_CTRLKEY ) {
-                               if ( G.qual & LR_ALTKEY ) {
+                       else if (G.qual & LR_CTRLKEY) {
+                               if (G.qual & LR_ALTKEY) {
                                        G.qual &= ~LR_CTRLKEY;
                                        persptoetsen(PAD6);
                                        G.qual |= LR_CTRLKEY;
@@ -562,27 +562,27 @@ static void view_editmove(unsigned short UNUSED(event))
 /* ************************************************* */
 
 /* NOTE: these defines are saved in keymap files, do not change values but just add new ones */
-#define TFM_MODAL_CANCEL               1
-#define TFM_MODAL_CONFIRM              2
-#define TFM_MODAL_TRANSLATE            3
-#define TFM_MODAL_ROTATE               4
-#define TFM_MODAL_RESIZE               5
-#define TFM_MODAL_SNAP_INV_ON  6
-#define TFM_MODAL_SNAP_INV_OFF 7
-#define TFM_MODAL_SNAP_TOGGLE  8
-#define TFM_MODAL_AXIS_X               9
-#define TFM_MODAL_AXIS_Y               10
-#define TFM_MODAL_AXIS_Z               11
-#define TFM_MODAL_PLANE_X              12
-#define TFM_MODAL_PLANE_Y              13
-#define TFM_MODAL_PLANE_Z              14
-#define TFM_MODAL_CONS_OFF             15
-#define TFM_MODAL_ADD_SNAP             16
-#define TFM_MODAL_REMOVE_SNAP  17
+#define TFM_MODAL_CANCEL        1
+#define TFM_MODAL_CONFIRM       2
+#define TFM_MODAL_TRANSLATE     3
+#define TFM_MODAL_ROTATE        4
+#define TFM_MODAL_RESIZE        5
+#define TFM_MODAL_SNAP_INV_ON   6
+#define TFM_MODAL_SNAP_INV_OFF  7
+#define TFM_MODAL_SNAP_TOGGLE   8
+#define TFM_MODAL_AXIS_X        9
+#define TFM_MODAL_AXIS_Y        10
+#define TFM_MODAL_AXIS_Z        11
+#define TFM_MODAL_PLANE_X       12
+#define TFM_MODAL_PLANE_Y       13
+#define TFM_MODAL_PLANE_Z       14
+#define TFM_MODAL_CONS_OFF      15
+#define TFM_MODAL_ADD_SNAP      16
+#define TFM_MODAL_REMOVE_SNAP   17
 /*     18 and 19 used by numinput, defined in transform.h
  * */
-#define TFM_MODAL_PROPSIZE_UP  20
-#define TFM_MODAL_PROPSIZE_DOWN        21
+#define TFM_MODAL_PROPSIZE_UP   20
+#define TFM_MODAL_PROPSIZE_DOWN 21
 #define TFM_MODAL_AUTOIK_LEN_INC 22
 #define TFM_MODAL_AUTOIK_LEN_DEC 23
 
@@ -590,42 +590,43 @@ static void view_editmove(unsigned short UNUSED(event))
 #define TFM_MODAL_EDGESLIDE_DOWN 25
 
 /* called in transform_ops.c, on each regeneration of keymaps */
-wmKeyMaptransform_modal_keymap(wmKeyConfig *keyconf)
+wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf)
 {
        static EnumPropertyItem modal_items[] = {
-       {TFM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
-       {TFM_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
-       {TFM_MODAL_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
-       {TFM_MODAL_ROTATE, "ROTATE", 0, "Rotate", ""},
-       {TFM_MODAL_RESIZE, "RESIZE", 0, "Resize", ""},
-       {TFM_MODAL_SNAP_INV_ON, "SNAP_INV_ON", 0, "Invert Snap On", ""},
-       {TFM_MODAL_SNAP_INV_OFF, "SNAP_INV_OFF", 0, "Invert Snap Off", ""},
-       {TFM_MODAL_SNAP_TOGGLE, "SNAP_TOGGLE", 0, "Snap Toggle", ""},
-       {TFM_MODAL_AXIS_X, "AXIS_X", 0, "Orientation X axis", ""},
-       {TFM_MODAL_AXIS_Y, "AXIS_Y", 0, "Orientation Y axis", ""},
-       {TFM_MODAL_AXIS_Z, "AXIS_Z", 0, "Orientation Z axis", ""},
-       {TFM_MODAL_PLANE_X, "PLANE_X", 0, "Orientation X plane", ""},
-       {TFM_MODAL_PLANE_Y, "PLANE_Y", 0, "Orientation Y plane", ""},
-       {TFM_MODAL_PLANE_Z, "PLANE_Z", 0, "Orientation Z plane", ""},
-       {TFM_MODAL_CONS_OFF, "CONS_OFF", 0, "Remove Constraints", ""},
-       {TFM_MODAL_ADD_SNAP, "ADD_SNAP", 0, "Add Snap Point", ""},
-       {TFM_MODAL_REMOVE_SNAP, "REMOVE_SNAP", 0, "Remove Last Snap Point", ""},
-       {NUM_MODAL_INCREMENT_UP, "INCREMENT_UP", 0, "Numinput Increment Up", ""},
-       {NUM_MODAL_INCREMENT_DOWN, "INCREMENT_DOWN", 0, "Numinput Increment Down", ""},
-       {TFM_MODAL_PROPSIZE_UP, "PROPORTIONAL_SIZE_UP", 0, "Increase Proportional Influence", ""},
-       {TFM_MODAL_PROPSIZE_DOWN, "PROPORTIONAL_SIZE_DOWN", 0, "Decrease Proportional Influence", ""},
-       {TFM_MODAL_AUTOIK_LEN_INC, "AUTOIK_CHAIN_LEN_UP", 0, "Increase Max AutoIK Chain Length", ""},
-       {TFM_MODAL_AUTOIK_LEN_DEC, "AUTOIK_CHAIN_LEN_DOWN", 0, "Decrease Max AutoIK Chain Length", ""},
-       {TFM_MODAL_EDGESLIDE_UP, "EDGESLIDE_EDGE_NEXT", 0, "Select next Edge Slide Edge", ""},
-       {TFM_MODAL_EDGESLIDE_DOWN, "EDGESLIDE_PREV_NEXT", 0, "Select previous Edge Slide Edge", ""},
-       {0, NULL, 0, NULL, NULL}};
-       
-       wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Transform Modal Map");
+               {TFM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
+               {TFM_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+               {TFM_MODAL_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
+               {TFM_MODAL_ROTATE, "ROTATE", 0, "Rotate", ""},
+               {TFM_MODAL_RESIZE, "RESIZE", 0, "Resize", ""},
+               {TFM_MODAL_SNAP_INV_ON, "SNAP_INV_ON", 0, "Invert Snap On", ""},
+               {TFM_MODAL_SNAP_INV_OFF, "SNAP_INV_OFF", 0, "Invert Snap Off", ""},
+               {TFM_MODAL_SNAP_TOGGLE, "SNAP_TOGGLE", 0, "Snap Toggle", ""},
+               {TFM_MODAL_AXIS_X, "AXIS_X", 0, "Orientation X axis", ""},
+               {TFM_MODAL_AXIS_Y, "AXIS_Y", 0, "Orientation Y axis", ""},
+               {TFM_MODAL_AXIS_Z, "AXIS_Z", 0, "Orientation Z axis", ""},
+               {TFM_MODAL_PLANE_X, "PLANE_X", 0, "Orientation X plane", ""},
+               {TFM_MODAL_PLANE_Y, "PLANE_Y", 0, "Orientation Y plane", ""},
+               {TFM_MODAL_PLANE_Z, "PLANE_Z", 0, "Orientation Z plane", ""},
+               {TFM_MODAL_CONS_OFF, "CONS_OFF", 0, "Remove Constraints", ""},
+               {TFM_MODAL_ADD_SNAP, "ADD_SNAP", 0, "Add Snap Point", ""},
+               {TFM_MODAL_REMOVE_SNAP, "REMOVE_SNAP", 0, "Remove Last Snap Point", ""},
+               {NUM_MODAL_INCREMENT_UP, "INCREMENT_UP", 0, "Numinput Increment Up", ""},
+               {NUM_MODAL_INCREMENT_DOWN, "INCREMENT_DOWN", 0, "Numinput Increment Down", ""},
+               {TFM_MODAL_PROPSIZE_UP, "PROPORTIONAL_SIZE_UP", 0, "Increase Proportional Influence", ""},
+               {TFM_MODAL_PROPSIZE_DOWN, "PROPORTIONAL_SIZE_DOWN", 0, "Decrease Proportional Influence", ""},
+               {TFM_MODAL_AUTOIK_LEN_INC, "AUTOIK_CHAIN_LEN_UP", 0, "Increase Max AutoIK Chain Length", ""},
+               {TFM_MODAL_AUTOIK_LEN_DEC, "AUTOIK_CHAIN_LEN_DOWN", 0, "Decrease Max AutoIK Chain Length", ""},
+               {TFM_MODAL_EDGESLIDE_UP, "EDGESLIDE_EDGE_NEXT", 0, "Select next Edge Slide Edge", ""},
+               {TFM_MODAL_EDGESLIDE_DOWN, "EDGESLIDE_PREV_NEXT", 0, "Select previous Edge Slide Edge", ""},
+               {0, NULL, 0, NULL, NULL}
+       };
+       
+       wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Transform Modal Map");
        
        /* this function is called for each spacetype, only needs to add map once */
        if (keymap && keymap->modal_items) return NULL;
        
-       keymap= WM_modalkeymap_add(keyconf, "Transform Modal Map", modal_items);
+       keymap = WM_modalkeymap_add(keyconf, "Transform Modal Map", modal_items);
        
        /* items for modal map */
        WM_modalkeymap_add_item(keymap, ESCKEY,    KM_PRESS, KM_ANY, 0, TFM_MODAL_CANCEL);
@@ -695,8 +696,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
                msg1[sizeof(msg1) - 2] = axis;
                msg2[sizeof(msg2) - 2] = axis;
                msg3[sizeof(msg3) - 2] = axis;
-               constraint_plane = ((CON_AXIS0 | CON_AXIS1 | CON_AXIS2) &
-                                                       (~constraint_axis));
+               constraint_plane = ((CON_AXIS0 | CON_AXIS1 | CON_AXIS2) & (~constraint_axis));
 
                if (edit_2d && (key_type != ZKEY)) {
                        if (cmode == axis) {
@@ -733,7 +733,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
 
 int transformEvent(TransInfo *t, wmEvent *event)
 {
-       float mati[3][3]= MAT3_UNITY;
+       float mati[3][3] = MAT3_UNITY;
        char cmode = constraintModeToChar(t);
        int handled = 1;
 
@@ -770,7 +770,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                break;
                        case TFM_MODAL_TRANSLATE:
                                /* only switch when... */
-                               if ( ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
+                               if (ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
                                        resetTransRestrictions(t);
                                        restoreTransObjects(t);
                                        initTranslation(t);
@@ -789,7 +789,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                        case TFM_MODAL_ROTATE:
                                /* only switch when... */
                                if (!(t->options & CTX_TEXTURE) && !(t->options & (CTX_MOVIECLIP | CTX_MASK))) {
-                                       if ( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
+                                       if (ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
                                                
                                                resetTransRestrictions(t);
                                                
@@ -808,7 +808,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                break;
                        case TFM_MODAL_RESIZE:
                                /* only switch when... */
-                               if ( ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
+                               if (ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
                                        resetTransRestrictions(t);
                                        restoreTransObjects(t);
                                        initResize(t);
@@ -838,7 +838,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                t->redraw |= TREDRAW_HARD;
                                break;
                        case TFM_MODAL_AXIS_X:
-                               if ((t->flag & T_NO_CONSTRAINT)==0) {
+                               if ((t->flag & T_NO_CONSTRAINT) == 0) {
                                        if (cmode == 'X') {
                                                stopConstraint(t);
                                        }
@@ -854,7 +854,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                }
                                break;
                        case TFM_MODAL_AXIS_Y:
-                               if ((t->flag & T_NO_CONSTRAINT)==0) {
+                               if ((t->flag & T_NO_CONSTRAINT) == 0) {
                                        if (cmode == 'Y') {
                                                stopConstraint(t);
                                        }
@@ -870,7 +870,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                }
                                break;
                        case TFM_MODAL_AXIS_Z:
-                               if ((t->flag & (T_NO_CONSTRAINT|T_2D_EDIT))== 0) {
+                               if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
                                        if (cmode == 'Z') {
                                                stopConstraint(t);
                                        }
@@ -881,40 +881,40 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                }
                                break;
                        case TFM_MODAL_PLANE_X:
-                               if ((t->flag & (T_NO_CONSTRAINT|T_2D_EDIT))== 0) {
+                               if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
                                        if (cmode == 'X') {
                                                stopConstraint(t);
                                        }
                                        else {
-                                               setUserConstraint(t, t->current_orientation, (CON_AXIS1|CON_AXIS2), "locking %s X");
+                                               setUserConstraint(t, t->current_orientation, (CON_AXIS1 | CON_AXIS2), "locking %s X");
                                        }
                                        t->redraw |= TREDRAW_HARD;
                                }
                                break;
                        case TFM_MODAL_PLANE_Y:
-                               if ((t->flag & (T_NO_CONSTRAINT|T_2D_EDIT))== 0) {
+                               if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
                                        if (cmode == 'Y') {
                                                stopConstraint(t);
                                        }
                                        else {
-                                               setUserConstraint(t, t->current_orientation, (CON_AXIS0|CON_AXIS2), "locking %s Y");
+                                               setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS2), "locking %s Y");
                                        }
                                        t->redraw |= TREDRAW_HARD;
                                }
                                break;
                        case TFM_MODAL_PLANE_Z:
-                               if ((t->flag & (T_NO_CONSTRAINT|T_2D_EDIT))== 0) {
+                               if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
                                        if (cmode == 'Z') {
                                                stopConstraint(t);
                                        }
                                        else {
-                                               setUserConstraint(t, t->current_orientation, (CON_AXIS0|CON_AXIS1), "locking %s Z");
+                                               setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS1), "locking %s Z");
                                        }
                                        t->redraw |= TREDRAW_HARD;
                                }
                                break;
                        case TFM_MODAL_CONS_OFF:
-                               if ((t->flag & T_NO_CONSTRAINT)==0) {
+                               if ((t->flag & T_NO_CONSTRAINT) == 0) {
                                        stopConstraint(t);
                                        t->redraw |= TREDRAW_HARD;
                                }
@@ -929,16 +929,16 @@ int transformEvent(TransInfo *t, wmEvent *event)
                                break;
                        case TFM_MODAL_PROPSIZE_UP:
                                if (t->flag & T_PROP_EDIT) {
-                                       t->prop_size*= 1.1f;
-                                       if (t->spacetype==SPACE_VIEW3D && t->persp != RV3D_ORTHO)
-                                               t->prop_size= MIN2(t->prop_size, ((View3D *)t->view)->far);
+                                       t->prop_size *= 1.1f;
+                                       if (t->spacetype == SPACE_VIEW3D && t->persp != RV3D_ORTHO)
+                                               t->prop_size = MIN2(t->prop_size, ((View3D *)t->view)->far);
                                        calculatePropRatio(t);
                                }
                                t->redraw |= TREDRAW_HARD;
                                break;
                        case TFM_MODAL_PROPSIZE_DOWN:
                                if (t->flag & T_PROP_EDIT) {
-                                       t->prop_size*= 0.90909090f;
+                                       t->prop_size *= 0.90909090f;
                                        calculatePropRatio(t);
                                }
                                t->redraw |= TREDRAW_HARD;
@@ -968,170 +968,170 @@ int transformEvent(TransInfo *t, wmEvent *event)
        /* else do non-mapped events */
        else if (event->val == KM_PRESS) {
                switch (event->type) {
-               case RIGHTMOUSE:
-                       t->state = TRANS_CANCEL;
-                       break;
-               /* enforce redraw of transform when modifiers are used */
-               case LEFTSHIFTKEY:
-               case RIGHTSHIFTKEY:
-                       t->modifiers |= MOD_CONSTRAINT_PLANE;
-                       t->redraw |= TREDRAW_HARD;
-                       break;
+                       case RIGHTMOUSE:
+                               t->state = TRANS_CANCEL;
+                               break;
+                       /* enforce redraw of transform when modifiers are used */
+                       case LEFTSHIFTKEY:
+                       case RIGHTSHIFTKEY:
+                               t->modifiers |= MOD_CONSTRAINT_PLANE;
+                               t->redraw |= TREDRAW_HARD;
+                               break;
 
-               case SPACEKEY:
-                       if ((t->spacetype==SPACE_VIEW3D) && event->alt) {
+                       case SPACEKEY:
+                               if ((t->spacetype == SPACE_VIEW3D) && event->alt) {
 #if 0 // TRANSFORM_FIX_ME
-                               int mval[2];
+                                       int mval[2];
 
-                               getmouseco_sc(mval);
-                               BIF_selectOrientation();
-                               calc_manipulator_stats(curarea);
-                               copy_m3_m4(t->spacemtx, G.vd->twmat);
-                               warp_pointer(mval[0], mval[1]);
+                                       getmouseco_sc(mval);
+                                       BIF_selectOrientation();
+                                       calc_manipulator_stats(curarea);
+                                       copy_m3_m4(t->spacemtx, G.vd->twmat);
+                                       warp_pointer(mval[0], mval[1]);
 #endif
-                       }
-                       else {
-                               t->state = TRANS_CONFIRM;
-                       }
-                       break;
-
-               case MIDDLEMOUSE:
-                       if ((t->flag & T_NO_CONSTRAINT)==0) {
-                               /* exception for switching to dolly, or trackball, in camera view */
-                               if (t->flag & T_CAMERA) {
-                                       if (t->mode==TFM_TRANSLATION)
-                                               setLocalConstraint(t, (CON_AXIS2), "along local Z");
-                                       else if (t->mode==TFM_ROTATION) {
-                                               restoreTransObjects(t);
-                                               initTrackball(t);
-                                       }
                                }
                                else {
-                                       t->modifiers |= MOD_CONSTRAINT_SELECT;
-                                       if (t->con.mode & CON_APPLY) {
-                                               stopConstraint(t);
+                                       t->state = TRANS_CONFIRM;
+                               }
+                               break;
+
+                       case MIDDLEMOUSE:
+                               if ((t->flag & T_NO_CONSTRAINT) == 0) {
+                                       /* exception for switching to dolly, or trackball, in camera view */
+                                       if (t->flag & T_CAMERA) {
+                                               if (t->mode == TFM_TRANSLATION)
+                                                       setLocalConstraint(t, (CON_AXIS2), "along local Z");
+                                               else if (t->mode == TFM_ROTATION) {
+                                                       restoreTransObjects(t);
+                                                       initTrackball(t);
+                                               }
                                        }
                                        else {
-                                               if (event->shift) {
-                                                       initSelectConstraint(t, t->spacemtx);
+                                               t->modifiers |= MOD_CONSTRAINT_SELECT;
+                                               if (t->con.mode & CON_APPLY) {
+                                                       stopConstraint(t);
                                                }
                                                else {
-                                                       /* bit hackish... but it prevents mmb select to print the orientation from menu */
-                                                       strcpy(t->spacename, "global");
-                                                       initSelectConstraint(t, mati);
+                                                       if (event->shift) {
+                                                               initSelectConstraint(t, t->spacemtx);
+                                                       }
+                                                       else {
+                                                               /* bit hackish... but it prevents mmb select to print the orientation from menu */
+                                                               strcpy(t->spacename, "global");
+                                                               initSelectConstraint(t, mati);
+                                                       }
+                                                       postSelectConstraint(t);
                                                }
-                                               postSelectConstraint(t);
                                        }
+                                       t->redraw |= TREDRAW_HARD;
                                }
-                               t->redraw |= TREDRAW_HARD;
-                       }
-                       break;
-               case ESCKEY:
-                       t->state = TRANS_CANCEL;
-                       break;
-               case PADENTER:
-               case RETKEY:
-                       t->state = TRANS_CONFIRM;
-                       break;
-               case GKEY:
-                       /* only switch when... */
-                       if ( ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
-                               resetTransRestrictions(t);
-                               restoreTransObjects(t);
-                               initTranslation(t);
-                               initSnapping(t, NULL); // need to reinit after mode change
-                               t->redraw |= TREDRAW_HARD;
-                       }
-                       break;
-               case SKEY:
-                       /* only switch when... */
-                       if ( ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
-                               resetTransRestrictions(t);
-                               restoreTransObjects(t);
-                               initResize(t);
-                               initSnapping(t, NULL); // need to reinit after mode change
-                               t->redraw |= TREDRAW_HARD;
-                       }
-                       break;
-               case RKEY:
-                       /* only switch when... */
-                       if (!(t->options & CTX_TEXTURE)) {
-                               if ( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
-
+                               break;
+                       case ESCKEY:
+                               t->state = TRANS_CANCEL;
+                               break;
+                       case PADENTER:
+                       case RETKEY:
+                               t->state = TRANS_CONFIRM;
+                               break;
+                       case GKEY:
+                               /* only switch when... */
+                               if (ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
+                                       resetTransRestrictions(t);
+                                       restoreTransObjects(t);
+                                       initTranslation(t);
+                                       initSnapping(t, NULL); // need to reinit after mode change
+                                       t->redraw |= TREDRAW_HARD;
+                               }
+                               break;
+                       case SKEY:
+                               /* only switch when... */
+                               if (ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
                                        resetTransRestrictions(t);
+                                       restoreTransObjects(t);
+                                       initResize(t);
+                                       initSnapping(t, NULL); // need to reinit after mode change
+                                       t->redraw |= TREDRAW_HARD;
+                               }
+                               break;
+                       case RKEY:
+                               /* only switch when... */
+                               if (!(t->options & CTX_TEXTURE)) {
+                                       if (ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
 
-                                       if (t->mode == TFM_ROTATION) {
-                                               restoreTransObjects(t);
-                                               initTrackball(t);
-                                       }
-                                       else {
-                                               restoreTransObjects(t);
-                                               initRotation(t);
+                                               resetTransRestrictions(t);
+
+                                               if (t->mode == TFM_ROTATION) {
+                                                       restoreTransObjects(t);
+                                                       initTrackball(t);
+                                               }
+                                               else {
+                                                       restoreTransObjects(t);
+                                                       initRotation(t);
+                                               }
+                                               initSnapping(t, NULL); // need to reinit after mode change
+                                               t->redraw |= TREDRAW_HARD;
                                        }
-                                       initSnapping(t, NULL); // need to reinit after mode change
+                               }
+                               break;
+                       case CKEY:
+                               if (event->alt) {
+                                       t->flag ^= T_PROP_CONNECTED;
+                                       sort_trans_data_dist(t);
+                                       calculatePropRatio(t);
+                                       t->redraw = 1;
+                               }
+                               else {
+                                       stopConstraint(t);
                                        t->redraw |= TREDRAW_HARD;
                                }
-                       }
-                       break;
-               case CKEY:
-                       if (event->alt) {
-                               t->flag ^= T_PROP_CONNECTED;
-                               sort_trans_data_dist(t);
-                               calculatePropRatio(t);
-                               t->redraw= 1;
-                       }
-                       else {
-                               stopConstraint(t);
-                               t->redraw |= TREDRAW_HARD;
-                       }
-                       break;
-               case XKEY:
-               case YKEY:
-               case ZKEY:
-                       transform_event_xyz_constraint(t, event->type, cmode);
-                       break;
-               case OKEY:
-                       if (t->flag & T_PROP_EDIT && event->shift) {
-                               t->prop_mode = (t->prop_mode + 1) % PROP_MODE_MAX;
-                               calculatePropRatio(t);
-                               t->redraw |= TREDRAW_HARD;
-                       }
-                       break;
-               case PADPLUSKEY:
-                       if (event->alt && t->flag & T_PROP_EDIT) {
-                               t->prop_size *= 1.1f;
-                               if (t->spacetype==SPACE_VIEW3D && t->persp != RV3D_ORTHO)
-                                       t->prop_size= MIN2(t->prop_size, ((View3D *)t->view)->far);
-                               calculatePropRatio(t);
-                       }
-                       t->redraw= 1;
-                       break;
-               case PAGEUPKEY:
-               case WHEELDOWNMOUSE:
-                       if (t->flag & T_AUTOIK) {
-                               transform_autoik_update(t, 1);
-                       }
-                       else view_editmove(event->type);
-                       t->redraw= 1;
-                       break;
-               case PADMINUS:
-                       if (event->alt && t->flag & T_PROP_EDIT) {
-                               t->prop_size*= 0.90909090f;
-                               calculatePropRatio(t);
-                       }
-                       t->redraw= 1;
-                       break;
-               case PAGEDOWNKEY:
-               case WHEELUPMOUSE:
-                       if (t->flag & T_AUTOIK) {
-                               transform_autoik_update(t, -1);
-                       }
-                       else view_editmove(event->type);
-                       t->redraw= 1;
-                       break;
-               default:
-                       handled = 0;
-                       break;
+                               break;
+                       case XKEY:
+                       case YKEY:
+                       case ZKEY:
+                               transform_event_xyz_constraint(t, event->type, cmode);
+                               break;
+                       case OKEY:
+                               if (t->flag & T_PROP_EDIT && event->shift) {
+                                       t->prop_mode = (t->prop_mode + 1) % PROP_MODE_MAX;
+                                       calculatePropRatio(t);
+                                       t->redraw |= TREDRAW_HARD;
+                               }
+                               break;
+                       case PADPLUSKEY:
+                               if (event->alt && t->flag & T_PROP_EDIT) {
+                                       t->prop_size *= 1.1f;
+                                       if (t->spacetype == SPACE_VIEW3D && t->persp != RV3D_ORTHO)
+                                               t->prop_size = MIN2(t->prop_size, ((View3D *)t->view)->far);
+                                       calculatePropRatio(t);
+                               }
+                               t->redraw = 1;
+                               break;
+                       case PAGEUPKEY:
+                       case WHEELDOWNMOUSE:
+                               if (t->flag & T_AUTOIK) {
+                                       transform_autoik_update(t, 1);
+                               }
+                               else view_editmove(event->type);
+                               t->redraw = 1;
+                               break;
+                       case PADMINUS:
+                               if (event->alt && t->flag & T_PROP_EDIT) {
+                                       t->prop_size *= 0.90909090f;
+                                       calculatePropRatio(t);
+                               }
+                               t->redraw = 1;
+                               break;
+                       case PAGEDOWNKEY:
+                       case WHEELUPMOUSE:
+                               if (t->flag & T_AUTOIK) {
+                                       transform_autoik_update(t, -1);
+                               }
+                               else view_editmove(event->type);
+                               t->redraw = 1;
+                               break;
+                       default:
+                               handled = 0;
+                               break;
                }
 
                // Numerical input events
@@ -1141,30 +1141,30 @@ int transformEvent(TransInfo *t, wmEvent *event)
                t->redraw |= handleSnapping(t, event);
 
        }
-       else if (event->val==KM_RELEASE) {
+       else if (event->val == KM_RELEASE) {
                switch (event->type) {
-               case LEFTSHIFTKEY:
-               case RIGHTSHIFTKEY:
-                       t->modifiers &= ~MOD_CONSTRAINT_PLANE;
-                       t->redraw |= TREDRAW_HARD;
-                       break;
-
-               case MIDDLEMOUSE:
-                       if ((t->flag & T_NO_CONSTRAINT)==0) {
-                               t->modifiers &= ~MOD_CONSTRAINT_SELECT;
-                               postSelectConstraint(t);
+                       case LEFTSHIFTKEY:
+                       case RIGHTSHIFTKEY:
+                               t->modifiers &= ~MOD_CONSTRAINT_PLANE;
                                t->redraw |= TREDRAW_HARD;
-                       }
-                       break;
+                               break;
+
+                       case MIDDLEMOUSE:
+                               if ((t->flag & T_NO_CONSTRAINT) == 0) {
+                                       t->modifiers &= ~MOD_CONSTRAINT_SELECT;
+                                       postSelectConstraint(t);
+                                       t->redraw |= TREDRAW_HARD;
+                               }
+                               break;
 //             case LEFTMOUSE:
 //             case RIGHTMOUSE:
 //                     if (WM_modal_tweak_exit(event, t->event_type))
 ////                   if (t->options & CTX_TWEAK)
 //                             t->state = TRANS_CONFIRM;
 //                     break;
-               default:
-                       handled = 0;
-                       break;
+                       default:
+                               handled = 0;
+                               break;
                }
 
                /* confirm transform if launch key is released after mouse move */
@@ -1197,11 +1197,11 @@ int calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], int c
 
        t->mode = TFM_DUMMY;
 
-       initTransInfo(C, t, NULL, NULL);        // internal data, mouse, vectors
+       initTransInfo(C, t, NULL, NULL);    // internal data, mouse, vectors
 
-       createTransData(C, t);                          // make TransData structs from selection
+       createTransData(C, t);              // make TransData structs from selection
 
-       t->around = centerMode;                         // override userdefined mode
+       t->around = centerMode;             // override userdefined mode
 
        if (t->total == 0) {
                success = FALSE;
@@ -1305,7 +1305,7 @@ static void drawArc(float size, float angle_start, float angle_end, int segments
 
        glBegin(GL_LINE_STRIP);
 
-       for ( angle = angle_start; angle < angle_end; angle += delta) {
+       for (angle = angle_start; angle < angle_end; angle += delta) {
                glVertex2f(cosf(angle) * size, sinf(angle) * size);
        }
        glVertex2f(cosf(angle_end) * size, sinf(angle_end) * size);
@@ -1315,35 +1315,35 @@ static void drawArc(float size, float angle_start, float angle_end, int segments
 
 static int helpline_poll(bContext *C)
 {
-       ARegion *ar= CTX_wm_region(C);
+       ARegion *ar = CTX_wm_region(C);
        
-       if (ar && ar->regiontype==RGN_TYPE_WINDOW)
+       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;
+       TransInfo *t = (TransInfo *)customdata;
 
        if (t->helpline != HLP_NONE && !(t->flag & T_USES_MANIPULATOR)) {
                float vecrot[3], cent[2];
                int mval[2];
 
-               mval[0]= x;
-               mval[1]= y;
+               mval[0] = x;
+               mval[1] = y;
 
                copy_v3_v3(vecrot, t->center);
                if (t->flag & T_EDIT) {
-                       Object *ob= t->obedit;
+                       Object *ob = t->obedit;
                        if (ob) mul_m4_v3(ob->obmat, vecrot);
                }
                else if (t->flag & T_POSE) {
-                       Object *ob=t->poseobj;
+                       Object *ob = t->poseobj;
                        if (ob) mul_m4_v3(ob->obmat, vecrot);
                }
 
-               projectFloatView(t, vecrot, cent);      // no overflow in extreme cases
+               projectFloatView(t, vecrot, cent);  // no overflow in extreme cases
 
                glPushMatrix();
 
@@ -1388,67 +1388,67 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
                                glLineWidth(1.0);
                                break;
                        case HLP_ANGLE:
-                               {
-                                       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.0f / dist, (float)M_PI/4.0f);
-                                       float spacing_angle = MIN2(5.0f / dist, (float)M_PI/12.0f);
-                                       UI_ThemeColor(TH_WIRE);
+                       {
+                               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.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);
-                                       glBegin(GL_LINE_STRIP);
-                                       glVertex2iv(t->mval);
-                                       glVertex2fv(cent);
-                                       glEnd();
+                               setlinestyle(3);
+                               glBegin(GL_LINE_STRIP);
+                               glVertex2iv(t->mval);
+                               glVertex2fv(cent);
+                               glEnd();
 
-                                       glTranslatef(cent[0] - t->mval[0] + mval[0], cent[1] - t->mval[1] + mval[1], 0);
+                               glTranslatef(cent[0] - t->mval[0] + mval[0], cent[1] - t->mval[1] + mval[1], 0);
 
-                                       setlinestyle(0);
-                                       glLineWidth(3.0);
-                                       drawArc(dist, angle - delta_angle, angle - spacing_angle, 10);
-                                       drawArc(dist, angle + spacing_angle, angle + delta_angle, 10);
+                               setlinestyle(0);
+                               glLineWidth(3.0);
+                               drawArc(dist, angle - delta_angle, angle - spacing_angle, 10);
+                               drawArc(dist, angle + spacing_angle, angle + delta_angle, 10);
 
-                                       glPushMatrix();
+                               glPushMatrix();
 
-                                       glTranslatef(cosf(angle - delta_angle) * dist, sinf(angle - delta_angle) * dist, 0);
-                                       glRotatef(RAD2DEGF(angle - delta_angle), 0, 0, 1);
+                               glTranslatef(cosf(angle - delta_angle) * dist, sinf(angle - delta_angle) * dist, 0);
+                               glRotatef(RAD2DEGF(angle - delta_angle), 0, 0, 1);
 
-                                       drawArrowHead(DOWN, 5);
+                               drawArrowHead(DOWN, 5);
 
-                                       glPopMatrix();
+                               glPopMatrix();
 
-                                       glTranslatef(cosf(angle + delta_angle) * dist, sinf(angle + delta_angle) * dist, 0);
-                                       glRotatef(RAD2DEGF(angle + delta_angle), 0, 0, 1);
+                               glTranslatef(cosf(angle + delta_angle) * dist, sinf(angle + delta_angle) * dist, 0);
+                               glRotatef(RAD2DEGF(angle + delta_angle), 0, 0, 1);
 
-                                       drawArrowHead(UP, 5);
+                               drawArrowHead(UP, 5);
 
-                                       glLineWidth(1.0);
-                                       break;
-                               }
-                               case HLP_TRACKBALL:
-                               {
-                                       unsigned char col[3], col2[3];
-                                       UI_GetThemeColor3ubv(TH_GRID, col);
+                               glLineWidth(1.0);
+                               break;
+                       }
+                       case HLP_TRACKBALL:
+                       {
+                               unsigned char col[3], col2[3];
+                               UI_GetThemeColor3ubv(TH_GRID, col);
 
-                                       glTranslatef(mval[0], mval[1], 0);
+                               glTranslatef(mval[0], mval[1], 0);
 
-                                       glLineWidth(3.0);
+                               glLineWidth(3.0);
 
-                                       UI_make_axis_color(col, col2, 'X');
-                                       glColor3ubv((GLubyte *)col2);
+                               UI_make_axis_color(col, col2, 'X');
+                               glColor3ubv((GLubyte *)col2);
 
-                                       drawArrow(RIGHT, 5, 10, 5);
-                                       drawArrow(LEFT, 5, 10, 5);
+                               drawArrow(RIGHT, 5, 10, 5);
+                               drawArrow(LEFT, 5, 10, 5);
 
-                                       UI_make_axis_color(col, col2, 'Y');
-                                       glColor3ubv((GLubyte *)col2);
+                               UI_make_axis_color(col, col2, 'Y');
+                               glColor3ubv((GLubyte *)col2);
 
-                                       drawArrow(UP, 5, 10, 5);
-                                       drawArrow(DOWN, 5, 10, 5);
-                                       glLineWidth(1.0);
-                                       break;
-                               }
+                               drawArrow(UP, 5, 10, 5);
+                               drawArrow(DOWN, 5, 10, 5);
+                               glLineWidth(1.0);
+                               break;
+                       }
                }
 
                glPopMatrix();
@@ -1482,12 +1482,12 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
        PropertyRNA *prop;
 
        // Save back mode in case we're in the generic operator
-       if ((prop= RNA_struct_find_property(op->ptr, "mode"))) {
+       if ((prop = RNA_struct_find_property(op->ptr, "mode"))) {
                RNA_property_enum_set(op->ptr, prop, t->mode);
        }
 
-       if ((prop= RNA_struct_find_property(op->ptr, "value"))) {
-               float *values= (t->flag & T_AUTOVALUES) ? t->auto_values : t->values;
+       if ((prop = RNA_struct_find_property(op->ptr, "value"))) {
+               float *values = (t->flag & T_AUTOVALUES) ? t->auto_values : t->values;
                if (RNA_property_array_check(prop)) {
                        RNA_property_float_set_array(op->ptr, prop, values);
                }
@@ -1497,8 +1497,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
        }
 
        /* convert flag to enum */
-       switch (t->flag & (T_PROP_EDIT|T_PROP_CONNECTED)) {
-               case (T_PROP_EDIT|T_PROP_CONNECTED):
+       switch (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
+               case (T_PROP_EDIT | T_PROP_CONNECTED):
                        proportional = PROP_EDIT_CONNECTED;
                        break;
                case T_PROP_EDIT:
@@ -1658,7 +1658,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
        else
                unit_m3(t->spacemtx);
 
-       createTransData(C, t);                  // make TransData structs from selection
+       createTransData(C, t);          // make TransData structs from selection
 
        if (t->total == 0) {
                postTrans(C, t);
@@ -1698,114 +1698,114 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
        initMouseInput(t, &t->mouse, t->center2d, t->imval);
 
        switch (mode) {
-       case TFM_TRANSLATION:
-               initTranslation(t);
-               break;
-       case TFM_ROTATION:
-               initRotation(t);
-               break;
-       case TFM_RESIZE:
-               initResize(t);
-               break;
-       case TFM_SKIN_RESIZE:
-               initSkinResize(t);
-               break;
-       case TFM_TOSPHERE:
-               initToSphere(t);
-               break;
-       case TFM_SHEAR:
-               initShear(t);
-               break;
-       case TFM_WARP:
-               initWarp(t);
-               break;
-       case TFM_SHRINKFATTEN:
-               initShrinkFatten(t);
-               break;
-       case TFM_TILT:
-               initTilt(t);
-               break;
-       case TFM_CURVE_SHRINKFATTEN:
-               initCurveShrinkFatten(t);
-               break;
-       case TFM_MASK_SHRINKFATTEN:
-               initMaskShrinkFatten(t);
-               break;
-       case TFM_TRACKBALL:
-               initTrackball(t);
-               break;
-       case TFM_PUSHPULL:
-               initPushPull(t);
-               break;
-       case TFM_CREASE:
-               initCrease(t);
-               break;
-       case TFM_BONESIZE:
-               {       /* used for both B-Bone width (bonesize) as for deform-dist (envelope) */
-                       bArmature *arm= t->poseobj->data;
-                       if (arm->drawtype==ARM_ENVELOPE)
+               case TFM_TRANSLATION:
+                       initTranslation(t);
+                       break;
+               case TFM_ROTATION:
+                       initRotation(t);
+                       break;
+               case TFM_RESIZE:
+                       initResize(t);
+                       break;
+               case TFM_SKIN_RESIZE:
+                       initSkinResize(t);
+                       break;
+               case TFM_TOSPHERE:
+                       initToSphere(t);
+                       break;
+               case TFM_SHEAR:
+                       initShear(t);
+                       break;
+               case TFM_WARP:
+                       initWarp(t);
+                       break;
+               case TFM_SHRINKFATTEN:
+                       initShrinkFatten(t);
+                       break;
+               case TFM_TILT:
+                       initTilt(t);
+                       break;
+               case TFM_CURVE_SHRINKFATTEN:
+                       initCurveShrinkFatten(t);
+                       break;
+               case TFM_MASK_SHRINKFATTEN:
+                       initMaskShrinkFatten(t);
+                       break;
+               case TFM_TRACKBALL:
+                       initTrackball(t);
+                       break;
+               case TFM_PUSHPULL:
+                       initPushPull(t);
+                       break;
+               case TFM_CREASE:
+                       initCrease(t);
+                       break;
+               case TFM_BONESIZE:
+               {   /* used for both B-Bone width (bonesize) as for deform-dist (envelope) */
+                       bArmature *arm = t->poseobj->data;
+                       if (arm->drawtype == ARM_ENVELOPE)
                                initBoneEnvelope(t);
                        else
                                initBoneSize(t);
                }
                break;
-       case TFM_BONE_ENVELOPE:
-               initBoneEnvelope(t);
-               break;
-       case TFM_EDGE_SLIDE:
-               initEdgeSlide(t);
-               break;
-       case TFM_BONE_ROLL:
-               initBoneRoll(t);
-               break;
-       case TFM_TIME_TRANSLATE:
-               initTimeTranslate(t);
-               break;
-       case TFM_TIME_SLIDE:
-               initTimeSlide(t);
-               break;
-       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
-                * (for Graph/NLA Editors only since they uses 'standard' transforms to get 2D movement)
-                * depending on which editor this was called from
-                */
-               if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA))
-                       initTranslation(t);
-               else
+               case TFM_BONE_ENVELOPE:
+                       initBoneEnvelope(t);
+                       break;
+               case TFM_EDGE_SLIDE:
+                       initEdgeSlide(t);
+                       break;
+               case TFM_BONE_ROLL:
+                       initBoneRoll(t);
+                       break;
+               case TFM_TIME_TRANSLATE:
                        initTimeTranslate(t);
-               break;
-       case TFM_BAKE_TIME:
-               initBakeTime(t);
-               break;
-       case TFM_MIRROR:
-               initMirror(t);
-               break;
-       case TFM_BEVEL:
-               initBevel(t);
-               break;
-       case TFM_BWEIGHT:
-               initBevelWeight(t);
-               break;
-       case TFM_ALIGN:
-               initAlign(t);
-               break;
-       case TFM_SEQ_SLIDE:
-               initSeqSlide(t);
-               break;
+                       break;
+               case TFM_TIME_SLIDE:
+                       initTimeSlide(t);
+                       break;
+               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
+                        * (for Graph/NLA Editors only since they uses 'standard' transforms to get 2D movement)
+                        * depending on which editor this was called from
+                        */
+                       if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA))
+                               initTranslation(t);
+                       else
+                               initTimeTranslate(t);
+                       break;
+               case TFM_BAKE_TIME:
+                       initBakeTime(t);
+                       break;
+               case TFM_MIRROR:
+                       initMirror(t);
+                       break;
+               case TFM_BEVEL:
+                       initBevel(t);
+                       break;
+               case TFM_BWEIGHT:
+                       initBevelWeight(t);
+                       break;
+               case TFM_ALIGN:
+                       initAlign(t);
+                       break;
+               case TFM_SEQ_SLIDE:
+                       initSeqSlide(t);
+                       break;
        }
 
        if (t->state == TRANS_CANCEL) {
@@ -1816,13 +1816,13 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
 
        /* overwrite initial values if operator supplied a non-null vector */
        if ((prop = RNA_struct_find_property(op->ptr, "value")) && RNA_property_is_set(op->ptr, prop)) {
-               float values[4]= {0}; /* in case value isn't length 4, avoid uninitialized memory  */
+               float values[4] = {0}; /* in case value isn't length 4, avoid uninitialized memory  */
 
                if (RNA_property_array_check(prop)) {
                        RNA_float_get_array(op->ptr, "value", values);
                }
                else {
-                       values[0]= RNA_float_get(op->ptr, "value");
+                       values[0] = RNA_float_get(op->ptr, "value");
                }
 
                copy_v4_v4(t->values, values);
@@ -1915,11 +1915,11 @@ int transformEnd(bContext *C, TransInfo *t)
                /* handle restoring objects */
                if (t->state == TRANS_CANCEL) {
                        /* exception, edge slide transformed UVs too */
-                       if (t->mode==TFM_EDGE_SLIDE)
+                       if (t->mode == TFM_EDGE_SLIDE)
                                doEdgeSlide(t, 0.0f);
                        
                        exit_code = OPERATOR_CANCELLED;
-                       restoreTransObjects(t); // calls recalcData()
+                       restoreTransObjects(t); // calls recalcData()
                }
                else {
                        exit_code = OPERATOR_FINISHED;
@@ -1943,7 +1943,7 @@ int transformEnd(bContext *C, TransInfo *t)
 //                     if (t->undostr) ED_undo_push(C, t->undostr);
 //                     else ED_undo_push(C, transform_to_undostr(t));
                }
-               t->undostr= NULL;
+               t->undostr = NULL;
 
                viewRedrawForce(C, t);
        }
@@ -1958,31 +1958,31 @@ int transformEnd(bContext *C, TransInfo *t)
 static void protectedTransBits(short protectflag, float *vec)
 {
        if (protectflag & OB_LOCK_LOCX)
-               vec[0]= 0.0f;
+               vec[0] = 0.0f;
        if (protectflag & OB_LOCK_LOCY)
-               vec[1]= 0.0f;
+               vec[1] = 0.0f;
        if (protectflag & OB_LOCK_LOCZ)
-               vec[2]= 0.0f;
+               vec[2] = 0.0f;
 }
 
 static void protectedSizeBits(short protectflag, float *size)
 {
        if (protectflag & OB_LOCK_SCALEX)
-               size[0]= 1.0f;
+               size[0] = 1.0f;
        if (protectflag & OB_LOCK_SCALEY)
-               size[1]= 1.0f;
+               size[1] = 1.0f;
        if (protectflag & OB_LOCK_SCALEZ)
-               size[2]= 1.0f;
+               size[2] = 1.0f;
 }
 
 static void protectedRotateBits(short protectflag, float *eul, float *oldeul)
 {
        if (protectflag & OB_LOCK_ROTX)
-               eul[0]= oldeul[0];
+               eul[0] = oldeul[0];
        if (protectflag & OB_LOCK_ROTY)
-               eul[1]= oldeul[1];
+               eul[1] = oldeul[1];
        if (protectflag & OB_LOCK_ROTZ)
-               eul[2]= oldeul[2];
+               eul[2] = oldeul[2];
 }
 
 
@@ -1991,19 +1991,19 @@ static void protectedRotateBits(short protectflag, float *eul, float *oldeul)
 static void protectedAxisAngleBits(short protectflag, float axis[3], float *angle, float oldAxis[3], float oldAngle)
 {
        /* check that protection flags are set */
-       if ((protectflag & (OB_LOCK_ROTX|OB_LOCK_ROTY|OB_LOCK_ROTZ|OB_LOCK_ROTW)) == 0)
+       if ((protectflag & (OB_LOCK_ROTX | OB_LOCK_ROTY | OB_LOCK_ROTZ | OB_LOCK_ROTW)) == 0)
                return;
        
        if (protectflag & OB_LOCK_ROT4D) {
                /* axis-angle getting limited as 4D entities that they are... */
                if (protectflag & OB_LOCK_ROTW)
-                       *angle= oldAngle;
+                       *angle = oldAngle;
                if (protectflag & OB_LOCK_ROTX)
-                       axis[0]= oldAxis[0];
+                       axis[0] = oldAxis[0];
                if (protectflag & OB_LOCK_ROTY)
-                       axis[1]= oldAxis[1];
+                       axis[1] = oldAxis[1];
                if (protectflag & OB_LOCK_ROTZ)
-                       axis[2]= oldAxis[2];
+                       axis[2] = oldAxis[2];
        }
        else {
                /* axis-angle get limited with euler... */
@@ -2013,18 +2013,18 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl
                axis_angle_to_eulO(oldeul, EULER_ORDER_DEFAULT, oldAxis, oldAngle);
                
                if (protectflag & OB_LOCK_ROTX)
-                       eul[0]= oldeul[0];
+                       eul[0] = oldeul[0];
                if (protectflag & OB_LOCK_ROTY)
-                       eul[1]= oldeul[1];
+                       eul[1] = oldeul[1];
                if (protectflag & OB_LOCK_ROTZ)
-                       eul[2]= oldeul[2];
+                       eul[2] = oldeul[2];
                
                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_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;
+                       axis[1] = 1.0f;
                }
        }
 }
@@ -2033,37 +2033,37 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl
 static void protectedQuaternionBits(short protectflag, float *quat, float *oldquat)
 {
        /* check that protection flags are set */
-       if ((protectflag & (OB_LOCK_ROTX|OB_LOCK_ROTY|OB_LOCK_ROTZ|OB_LOCK_ROTW)) == 0)
+       if ((protectflag & (OB_LOCK_ROTX | OB_LOCK_ROTY | OB_LOCK_ROTZ | OB_LOCK_ROTW)) == 0)
                return;
        
        if (protectflag & OB_LOCK_ROT4D) {
                /* quaternions getting limited as 4D entities that they are... */
                if (protectflag & OB_LOCK_ROTW)
-                       quat[0]= oldquat[0];
+                       quat[0] = oldquat[0];
                if (protectflag & OB_LOCK_ROTX)
-                       quat[1]= oldquat[1];
+                       quat[1] = oldquat[1];
                if (protectflag & OB_LOCK_ROTY)
-                       quat[2]= oldquat[2];
+                       quat[2] = oldquat[2];
                if (protectflag & OB_LOCK_ROTZ)
-                       quat[3]= oldquat[3];
+                       quat[3] = oldquat[3];
        }
        else {
                /* quaternions get limited with euler... (compatibility mode) */
                float eul[3], oldeul[3], nquat[4], noldquat[4];
                float qlen;
 
-               qlen= normalize_qt_qt(nquat, quat);
+               qlen = normalize_qt_qt(nquat, quat);
                normalize_qt_qt(noldquat, oldquat);
 
                quat_to_eul(eul, nquat);
                quat_to_eul(oldeul, noldquat);
 
                if (protectflag & OB_LOCK_ROTX)
-                       eul[0]= oldeul[0];
+                       eul[0] = oldeul[0];
                if (protectflag & OB_LOCK_ROTY)
-                       eul[1]= oldeul[1];
+                       eul[1] = oldeul[1];
                if (protectflag & OB_LOCK_ROTZ)
-                       eul[2]= oldeul[2];
+                       eul[2] = oldeul[2];
 
                eul_to_quat(quat, eul);
 
@@ -2071,7 +2071,7 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu
                mul_qt_fl(quat, qlen);
                
                /* quaternions flip w sign to accumulate rotations correctly */
-               if ( (nquat[0]<0.0f && quat[0]>0.0f) || (nquat[0]>0.0f && quat[0]<0.0f) ) {
+               if ( (nquat[0] < 0.0f && quat[0] > 0.0f) || (nquat[0] > 0.0f && quat[0] < 0.0f) ) {
                        mul_qt_fl(quat, -1.0f);
                }
        }
@@ -2082,22 +2082,22 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu
 static void constraintTransLim(TransInfo *t, TransData *td)
 {
        if (td->con) {
-               bConstraintTypeInfo *ctiLoc= get_constraint_typeinfo(CONSTRAINT_TYPE_LOCLIMIT);
-               bConstraintTypeInfo *ctiDist= get_constraint_typeinfo(CONSTRAINT_TYPE_DISTLIMIT);
+               bConstraintTypeInfo *ctiLoc = get_constraint_typeinfo(CONSTRAINT_TYPE_LOCLIMIT);
+               bConstraintTypeInfo *ctiDist = get_constraint_typeinfo(CONSTRAINT_TYPE_DISTLIMIT);
                
-               bConstraintOb cob= {NULL};
+               bConstraintOb cob = {NULL};
                bConstraint *con;
                float ctime = (float)(t->scene->r.cfra);
                
                /* Make a temporary bConstraintOb for using these limit constraints
-                *      - they only care that cob->matrix is correctly set ;-)
+                *  - they only care that cob->matrix is correctly set ;-)
                 *      - current space should be local
                 */
                unit_m4(cob.matrix);
                copy_v3_v3(cob.matrix[3], td->loc);
                
                /* Evaluate valid constraints */
-               for (con= td->con; con; con= con->next) {
+               for (con = td->con; con; con = con->next) {
                        bConstraintTypeInfo *cti = NULL;
                        ListBase targets = {NULL, NULL};
                        float tmat[4][4];
@@ -2108,16 +2108,16 @@ static void constraintTransLim(TransInfo *t, TransData *td)
                        
                        /* only use it if it's tagged for this purpose (and the right type) */
                        if (con->type == CONSTRAINT_TYPE_LOCLIMIT) {
-                               bLocLimitConstraint *data= con->data;
+                               bLocLimitConstraint *data = con->data;
                                
-                               if ((data->flag2 & LIMIT_TRANSFORM)==0)
+                               if ((data->flag2 & LIMIT_TRANSFORM) == 0)
                                        continue;
                                cti = ctiLoc;
                        }
                        else if (con->type == CONSTRAINT_TYPE_DISTLIMIT) {
-                               bDistLimitConstraint *data= con->data;
+                               bDistLimitConstraint *data = con->data;
                                
-                               if ((data->flag & LIMITDIST_TRANSFORM)==0)
+                               if ((data->flag & LIMITDIST_TRANSFORM) == 0)
                                        continue;
                                cti = ctiDist;
                        }
@@ -2160,7 +2160,7 @@ static void constraintTransLim(TransInfo *t, TransData *td)
 static void constraintob_from_transdata(bConstraintOb *cob, TransData *td)
 {
        /* Make a temporary bConstraintOb for use by limit constraints
-        *      - they only care that cob->matrix is correctly set ;-)
+        *  - they only care that cob->matrix is correctly set ;-)
         *      - current space should be local
         */
        memset(cob, 0, sizeof(bConstraintOb));
@@ -2168,8 +2168,8 @@ static void constraintob_from_transdata(bConstraintOb *cob, TransData *td)
                if (td->ext->rotOrder == ROT_MODE_QUAT) {
                        /* quats */
                        /* objects and bones do normalization first too, otherwise
-                        * we don't necessarily end up with a rotation matrix, and
-                        * then conversion back to quat gives a different result */
+                       * we don't necessarily end up with a rotation matrix, and
+                       * then conversion back to quat gives a different result */
                        float quat[4];
                        normalize_qt_qt(quat, td->ext->quat);
                        quat_to_mat4(cob->matrix, quat);
@@ -2188,24 +2188,24 @@ static void constraintob_from_transdata(bConstraintOb *cob, TransData *td)
 static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
 {
        if (td->con) {
-               bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT);
+               bConstraintTypeInfo *cti = get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT);
                bConstraintOb cob;
                bConstraint *con;
                int do_limit = FALSE;
                
                /* Evaluate valid constraints */
-               for (con= td->con; con; con= con->next) {
+               for (con = td->con; con; con = con->next) {
                        /* only consider constraint if enabled */
                        if (con->flag & CONSTRAINT_DISABLE) continue;
                        if (con->enforce == 0.0f) continue;
                        
                        /* we're only interested in Limit-Rotation constraints */
                        if (con->type == CONSTRAINT_TYPE_ROTLIMIT) {
-                               bRotLimitConstraint *data= con->data;
+                               bRotLimitConstraint *data = con->data;
                                float tmat[4][4];
                                
                                /* only use it if it's tagged for this purpose */
-                               if ((data->flag2 & LIMIT_TRANSFORM)==0)
+                               if ((data->flag2 & LIMIT_TRANSFORM) == 0)
                                        continue;
 
                                /* skip incompatable spacetypes */
@@ -2258,12 +2258,12 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
 static void constraintSizeLim(TransInfo *t, TransData *td)
 {
        if (td->con && td->ext) {
-               bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_SIZELIMIT);
-               bConstraintOb cob= {NULL};
+               bConstraintTypeInfo *cti = get_constraint_typeinfo(CONSTRAINT_TYPE_SIZELIMIT);
+               bConstraintOb cob = {NULL};
                bConstraint *con;
                
                /* Make a temporary bConstraintOb for using these limit constraints
-                *      - they only care that cob->matrix is correctly set ;-)
+                *  - they only care that cob->matrix is correctly set ;-)
                 *      - current space should be local
                 */
                if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) {
@@ -2279,18 +2279,18 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
                }
                
                /* Evaluate valid constraints */
-               for (con= td->con; con; con= con->next) {
+               for (con = td->con; con; con = con->next) {
                        /* only consider constraint if enabled */
                        if (con->flag & CONSTRAINT_DISABLE) continue;
                        if (con->enforce == 0.0f) continue;
                        
                        /* we're only interested in Limit-Scale constraints */
                        if (con->type == CONSTRAINT_TYPE_SIZELIMIT) {
-                               bSizeLimitConstraint *data= con->data;
+                               bSizeLimitConstraint *data = con->data;
                                float tmat[4][4];
                                
                                /* only use it if it's tagged for this purpose */
-                               if ((data->flag2 & LIMIT_TRANSFORM)==0)
+                               if ((data->flag2 & LIMIT_TRANSFORM) == 0)
                                        continue;
                                
                                /* do space conversions */
@@ -2381,8 +2381,8 @@ void initWarp(TransInfo *t)
 
        mid_v3_v3v3(t->center, min, max);
 
-       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 */
+       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 */
 }
 
 int handleEventWarp(TransInfo *t, wmEvent *event)
@@ -2409,7 +2409,7 @@ int Warp(TransInfo *t, const int UNUSED(mval[2]))
        int i;
        char str[50];
        
-       curs= give_cursor(t->scene, t->view);
+       curs = give_cursor(t->scene, t->view);
        /*
         * gcursor is the one used for helpline.
         * It has to be in the same space as the drawing loop
@@ -2469,18 +2469,18 @@ int Warp(TransInfo *t, const int UNUSED(mval[2]))
                mul_m4_v3(t->viewmat, vec);
                sub_v3_v3(vec, t->viewmat[3]);
                
-               dist= vec[0]-cursor[0];
+               dist = vec[0] - cursor[0];
                
                /* t->val is X dimension projected boundbox */
-               phi0= (circumfac*dist/t->val);
+               phi0 = (circumfac * dist / t->val);
                
-               vec[1]= (vec[1]-cursor[1]);
+               vec[1] = (vec[1] - cursor[1]);
                
-               co= (float)cos(phi0);
-               si= (float)sin(phi0);
-               loc[0]= -si*vec[1]+cursor[0];
-               loc[1]= co*vec[1]+cursor[1];
-               loc[2]= vec[2];
+               co = (float)cos(phi0);
+               si = (float)sin(phi0);
+               loc[0] = -si * vec[1] + cursor[0];
+               loc[1] = co * vec[1] + cursor[1];
+               loc[2] = vec[2];
                
                mul_m4_v3(t->viewinv, loc);
                sub_v3_v3(loc, t->viewinv[3]);
@@ -2533,7 +2533,7 @@ int handleEventShear(TransInfo *t, wmEvent *event)
                // Use customData pointer to signal Shear direction
                if (t->customData == NULL) {
                        initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE);
-                       t->customData = (void*)1;
+                       t->customData = (void *)1;
                }
                else {
                        initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE);
@@ -2591,7 +2591,7 @@ int Shear(TransInfo *t, const int UNUSED(mval[2]))
        mul_m3_m3m3(tmat, smat, persmat);
        mul_m3_m3m3(totmat, persinv, tmat);
        
-       for (i = 0 ; i < t->total; i++, td++) {
+       for (i = 0; i < t->total; i++, td++) {
                if (td->flag & TD_NOACTION)
                        break;
                
@@ -2654,7 +2654,7 @@ void initResize(TransInfo *t)
 static void headerResize(TransInfo *t, float vec[3], char *str)
 {
        char tvec[60];
-       char *spos= str;
+       char *spos = str;
        if (hasNumInput(&t->num)) {
                outputNumInput(&(t->num), tvec);
        }
@@ -2666,14 +2666,14 @@ static void headerResize(TransInfo *t, float vec[3], char *str)
        
        if (t->con.mode & CON_APPLY) {
                switch (t->num.idx_max) {
-               case 0:
-                       spos += sprintf(spos, "Scale: %s%s %s", &tvec[0], t->con.text, t->proptext);
-                       break;
-               case 1:
-                       spos += sprintf(spos, "Scale: %s : %s%s %s", &tvec[0], &tvec[20], t->con.text, t->proptext);
-                       break;
-               case 2:
-                       spos += sprintf(spos, "Scale: %s : %s : %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext);
+                       case 0:
+                               spos += sprintf(spos, "Scale: %s%s %s", &tvec[0], t->con.text, t->proptext);
+                               break;
+                       case 1:
+                               spos += sprintf(spos, "Scale: %s : %s%s %s", &tvec[0], &tvec[20], t->con.text, t->proptext);
+                               break;
+                       case 2:
+                               spos += sprintf(spos, "Scale: %s : %s : %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext);
                }
        }
        else {
@@ -2683,15 +2683,15 @@ static void headerResize(TransInfo *t, float vec[3], char *str)
                        spos += sprintf(spos, "Scale X: %s   Y: %s  Z: %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext);
        }
        
-       if (t->flag & (T_PROP_EDIT|T_PROP_CONNECTED)) {
+       if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
                spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
        }
 
        (void)spos;
 }
 
-#define SIGN(a)                (a<-FLT_EPSILON?1:a>FLT_EPSILON?2:3)
-#define VECSIGNFLIP(a, b) ((SIGN(a[0]) & SIGN(b[0]))==0 || (SIGN(a[1]) & SIGN(b[1]))==0 || (SIGN(a[2]) & SIGN(b[2]))==0)
+#define SIGN(a)     (a<-FLT_EPSILON ? 1 : a>FLT_EPSILON ? 2 : 3)
+#define VECSIGNFLIP(a, b) ((SIGN(a[0]) & SIGN(b[0])) == 0 || (SIGN(a[1]) & SIGN(b[1])) == 0 || (SIGN(a[2]) & SIGN(b[2])) == 0)
 
 /* smat is reference matrix, only scaled */
 static void TransMat3ToSize(float mat[][3], float smat[][3], float *size)
@@ -2699,16 +2699,16 @@ static void TransMat3ToSize(float mat[][3], float smat[][3], float *size)
        float vec[3];
        
        copy_v3_v3(vec, mat[0]);
-       size[0]= normalize_v3(vec);
+       size[0] = normalize_v3(vec);
        copy_v3_v3(vec, mat[1]);
-       size[1]= normalize_v3(vec);
+       size[1] = normalize_v3(vec);
        copy_v3_v3(vec, mat[2]);
-       size[2]= normalize_v3(vec);
+       size[2] = normalize_v3(vec);
        
        /* first tried with dotproduct... but the sign flip is crucial */
-       if ( VECSIGNFLIP(mat[0], smat[0]) ) size[0]= -size[0];
-       if ( VECSIGNFLIP(mat[1], smat[1]) ) size[1]= -size[1];
-       if ( VECSIGNFLIP(mat[2], smat[2]) ) size[2]= -size[2];
+       if (VECSIGNFLIP(mat[0], smat[0]) ) size[0] = -size[0];
+       if (VECSIGNFLIP(mat[1], smat[1]) ) size[1] = -size[1];
+       if (VECSIGNFLIP(mat[2], smat[2]) ) size[2] = -size[2];
 }
 
 
@@ -2731,10 +2731,10 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
        
        /* local constraint shouldn't alter center */
        if ((t->around == V3D_LOCAL) &&
-               (   (t->flag & (T_OBJECT|T_POSE)) ||
-                   ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE))) ||
-                   (t->obedit && t->obedit->type == OB_ARMATURE))
-               )
+           (   (t->flag & (T_OBJECT | T_POSE)) ||
+               ((t->flag & T_EDIT) && (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE))) ||
+               (t->obedit && t->obedit->type == OB_ARMATURE))
+           )
        {
                copy_v3_v3(center, td->center);
        }
@@ -2748,7 +2748,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
        if (td->ext) {
                float fsize[3];
                
-               if (t->flag & (T_OBJECT|T_TEXTURE|T_POSE)) {
+               if (t->flag & (T_OBJECT | T_TEXTURE | T_POSE)) {
                        float obsizemat[3][3];
                        // Reorient the size mat to fit the oriented object.
                        mul_m3_m3m3(obsizemat, tmat, td->axismtx);
@@ -2762,19 +2762,19 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
                
                protectedSizeBits(td->protectflag, fsize);
                
-               if ((t->flag & T_V3D_ALIGN)==0) {       // align mode doesn't resize objects itself
+               if ((t->flag & T_V3D_ALIGN) == 0) {   // align mode doesn't resize objects itself
                        if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) {
                                /* scale val and reset size */
-                                *td->val = td->ival * (1 + (fsize[0] - 1) * td->factor);
+                               *td->val = td->ival * (1 + (fsize[0] - 1) * td->factor);
                                
                                td->ext->size[0] = td->ext->isize[0];
                                td->ext->size[1] = td->ext->isize[1];
                                td->ext->size[2] = td->ext->isize[2];
-                        }
+                       }
                        else {
                                /* Reset val if SINGLESIZE but using a constraint */
                                if (td->flag & TD_SINGLESIZE)
-                                        *td->val = td->ival;
+                                       *td->val = td->ival;
                                
                                td->ext->size[0] = td->ext->isize[0] * (1 + (fsize[0] - 1) * td->factor);
                                td->ext->size[1] = td->ext->isize[1] * (1 + (fsize[1] - 1) * td->factor);
@@ -2801,7 +2801,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3])
        
        mul_v3_fl(vec, td->factor);
        
-       if (t->flag & (T_OBJECT|T_POSE)) {
+       if (t->flag & (T_OBJECT | T_POSE)) {
                mul_m3_v3(td->smtx, vec);
        }
        
@@ -2820,8 +2820,8 @@ int Resize(TransInfo *t, const int mval[2])
        char str[200];
        
        /* for manipulator, center handle, the scaling can't be done relative to center */
-       if ( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0) {
-               ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f;
+       if ( (t->flag & T_USES_MANIPULATOR) && t->con.mode == 0) {
+               ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1])) / 100.0f;
        }
        else {
                ratio = t->values[0];
@@ -2850,11 +2850,11 @@ int Resize(TransInfo *t, const int mval[2])
                t->con.applySize(t, NULL, mat);
        }
        
-       copy_m3_m3(t->mat, mat);        // used in manipulator
+       copy_m3_m3(t->mat, mat);    // used in manipulator
        
        headerResize(t, size, str);
        
-       for (i = 0, td=t->data; i < t->total; i++, td++) {
+       for (i = 0, td = t->data; i < t->total; i++, td++) {
                if (td->flag & TD_NOACTION)
                        break;
                
@@ -2871,7 +2871,7 @@ int Resize(TransInfo *t, const int mval[2])
                if (t->con.applySize)
                        t->con.applySize(t, NULL, mat);
                
-               for (i = 0, td=t->data; i < t->total; i++, td++)
+               for (i = 0, td = t->data; i < t->total; i++, td++)
                        ElementResize(t, td, mat);
        }
        
@@ -2996,7 +2996,7 @@ void initToSphere(TransInfo *t)
        t->flag |= T_NO_CONSTRAINT;
        
        // Calculate average radius
-       for (i = 0 ; i < t->total; i++, td++) {
+       for (i = 0; i < t->total; i++, td++) {
                t->val += len_v3v3(t->center, td->iloc);
        }
        
@@ -3038,7 +3038,7 @@ int ToSphere(TransInfo *t, const int UNUSED(mval[2]))
        }
        
        
-       for (i = 0 ; i < t->total; i++, td++) {
+       for (i = 0; i < t->total; i++, td++) {
                float tratio;
                if (td->flag & TD_NOACTION)
                        break;
@@ -3086,7 +3086,7 @@ void initRotation(TransInfo *t)
        t->idx_max = 0;
        t->num.idx_max = 0;
        t->snap[0] = 0.0f;
-       t->snap[1] = (float)((5.0/180)*M_PI);
+       t->snap[1] = (float)((5.0 / 180) * M_PI);
        t->snap[2] = t->snap[1] * 0.2f;
        
        t->num.increment = 1.0f;
@@ -3108,8 +3108,8 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
 
        /* local constraint shouldn't alter center */
        if (around == V3D_LOCAL) {
-               if (    (t->flag & (T_OBJECT|T_POSE)) ||
-                   (t->settings->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE)) ||
+               if (    (t->flag & (T_OBJECT | T_POSE)) ||
+                       (t->settings->selectmode & (SCE_SELECT_EDGE | SCE_SELECT_FACE)) ||
                        (t->obedit && t->obedit->type == OB_ARMATURE))
                {
                        center = td->center;
@@ -3136,7 +3136,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
                
                if (td->flag & TD_USEQUAT) {
                        mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
-                       mat3_to_quat(quat, fmat);       // Actual transform
+                       mat3_to_quat(quat, fmat);   // Actual transform
                        
                        if (td->ext->quat) {
                                mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
@@ -3168,9 +3168,9 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
                if ((td->flag & TD_NO_LOC) == 0) {
                        sub_v3_v3v3(vec, td->center, center);
                        
-                       mul_m3_v3(pmtx, vec);   // To Global space
-                       mul_m3_v3(mat, vec);            // Applying rotation
-                       mul_m3_v3(imtx, vec);   // To Local space
+                       mul_m3_v3(pmtx, vec);   // To Global space
+                       mul_m3_v3(mat, vec);        // Applying rotation
+                       mul_m3_v3(imtx, vec);   // To Local space
                        
                        add_v3_v3(vec, center);
                        /* vec now is the location where the object has to be */
@@ -3182,12 +3182,12 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
                                /* do nothing */
                        }
                        else if (td->flag & TD_PBONE_LOCAL_MTX_C) {
-                               mul_m3_v3(pmtx, vec);   // To Global space
-                               mul_m3_v3(td->ext->l_smtx, vec);// To Pose space (Local Location)
+                               mul_m3_v3(pmtx, vec);   // To Global space
+                               mul_m3_v3(td->ext->l_smtx, vec); // To Pose space (Local Location)
                        }
                        else {
-                               mul_m3_v3(pmtx, vec);   // To Global space
-                               mul_m3_v3(td->smtx, vec);// To Pose space
+                               mul_m3_v3(pmtx, vec);   // To Global space
+                               mul_m3_v3(td->smtx, vec); // To Pose space
                        }
 
                        protectedTransBits(td->protectflag, vec);
@@ -3202,7 +3202,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
                 * and ElementRotation() might be called in Translation context (with align snapping),
                 * we need to be sure to actually use the *rotation* matrix here...
                 * So no other way than storing it in some dedicated members of td->ext! */
-               if ((t->flag & T_V3D_ALIGN)==0) { /* align mode doesn't rotate objects itself */
+               if ((t->flag & T_V3D_ALIGN) == 0) { /* align mode doesn't rotate objects itself */
                        /* euler or quaternion/axis-angle? */
                        if (td->ext->rotOrder == ROT_MODE_QUAT) {
                                mul_serie_m3(fmat, td->ext->r_mtx, mat, td->ext->r_smtx, NULL, NULL, NULL, NULL, NULL);
@@ -3271,11 +3271,11 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
                constraintTransLim(t, td);
                
                /* rotation */
-               if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
+               if ((t->flag & T_V3D_ALIGN) == 0) { // align mode doesn't rotate objects itself
                        /* euler or quaternion? */
                        if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) {
                                mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
-                               mat3_to_quat(quat, fmat);       // Actual transform
+                               mat3_to_quat(quat, fmat);   // Actual transform
                                
                                mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
                                /* this function works on end result */
@@ -3288,7 +3288,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
                                axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
                                
                                mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
-                               mat3_to_quat(quat, fmat);       // Actual transform
+                               mat3_to_quat(quat, fmat);   // Actual transform
                                mul_qt_qtqt(tquat, quat, iquat);
                                
                                quat_to_axis_angle(td->ext->rotAxis, td->ext->rotAngle, tquat);
@@ -3331,7 +3331,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
        
        vec_rot_to_mat3(mat, axis, angle);
        
-       for (i = 0 ; i < t->total; i++, td++) {
+       for (i = 0; i < t->total; i++, td++) {
                
                if (td->flag & TD_NOACTION)
                        break;
@@ -3353,7 +3353,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
 
 int Rotation(TransInfo *t, const int UNUSED(mval[2]))
 {
-       char str[128], *spos= str;
+       char str[128], *spos = str;
        
        float final;
 
@@ -3378,16 +3378,16 @@ int Rotation(TransInfo *t, const int UNUSED(mval[2]))
                
                outputNumInput(&(t->num), c);
                
-               spos+= sprintf(spos, "Rot: %s %s %s", &c[0], t->con.text, t->proptext);
+               spos += sprintf(spos, "Rot: %s %s %s", &c[0], t->con.text, t->proptext);
 
                /* Clamp between -180 and 180 */
-               final= angle_wrap_rad(DEG2RADF(final));
+               final = angle_wrap_rad(DEG2RADF(final));
        }
        else {
                spos += sprintf(spos, "Rot: %.2f%s %s", RAD2DEGF(final), t->con.text, t->proptext);
        }
        
-       if (t->flag & (T_PROP_EDIT|T_PROP_CONNECTED)) {
+       if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
                spos += sprintf(spos, " Proportional size: %.2f", t->prop_size);
        }
        (void)spos;
@@ -3416,7 +3416,7 @@ void initTrackball(TransInfo *t)
        t->idx_max = 1;
        t->num.idx_max = 1;
        t->snap[0] = 0.0f;
-       t->snap[1] = (float)((5.0/180)*M_PI);
+       t->snap[1] = (float)((5.0 / 180) * M_PI);
        t->snap[2] = t->snap[1] * 0.2f;
 
        t->num.increment = 1.0f;
@@ -3435,7 +3435,7 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a
 
        mul_m3_m3m3(mat, smat, totmat);
 
-       for (i = 0 ; i < t->total; i++, td++) {
+