Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sun, 15 Apr 2018 08:52:14 +0000 (10:52 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 15 Apr 2018 08:52:14 +0000 (10:52 +0200)
doc/python_api/rst/bge.constraints.rst
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/intern/text.c
source/blender/compositor/operations/COM_VectorBlurOperation.cpp
source/blender/makesrna/intern/rna_scene.c

index ed965c3dfc1d8bdfbfc21a7dd37e10204ac30636..3cca22e9cff4d5d236e28d273979282655cb4d79 100644 (file)
@@ -2,12 +2,33 @@
 Physics Constraints (bge.constraints)
 =====================================
 
+Bullet Physics provides collision detection
+and rigid body dynamics for the Blender Game Engine.
+
+Features:
+
+- Vehicle simulation.
+- Rigid body constraints: hinge and point to point (ball socket).
+- Access to internal physics settings,
+  like deactivation time, and debugging features
+
 .. module:: bge.constraints
 
+.. note:: Note about parameter settings
+
+   Since this API is not well documented, it can be unclear what kind of values to use for setting parameters.
+   In general, damping settings should be in the range of 0 to 1 and
+   stiffness settings should not be much higher than about 10.
+
 
 Examples
 --------
 
+.. seealso::
+
+   For more examples of Bullet physics and how to use them
+   see the `pybullet forum <https://pybullet.org/Bullet/phpBB3/viewforum.php?f=17>`__.
+
 .. include:: __/examples/bge.constraints.py
    :start-line: 1
    :end-line: 4
@@ -333,4 +354,3 @@ Constraint type to be used with :func:`createConstraint`.
 .. data:: GENERIC_6DOF_CONSTRAINT
 
    .. to do
-
index 98db06752c8ab0932b4cd9a8d125784e8ac365ee..b53af3cec53af5f5be97fa0906bc25fd1e0e7b71 100644 (file)
@@ -44,8 +44,6 @@ struct TextUndoBuf;
 
 void                   BKE_text_free_lines     (struct Text *text);
 void                   BKE_text_free           (struct Text *text);
-void                   txt_set_undostate       (int u);
-int                    txt_get_undostate       (void);
 void            BKE_text_init(struct Text *ta);
 struct Text    *BKE_text_add   (struct Main *bmain, const char *name);
 int                            txt_extended_ascii_as_utf8(char **str);
index cd9b8ae339d37f51b92f353beb64507b48f6d5fe..b1ff2724375aea24c426e6626ebedacf2b5d36f7 100644 (file)
@@ -174,18 +174,12 @@ static void txt_make_dirty(Text *text);
 
 /***/
 
-static unsigned char undoing;
-
-/* allow to switch off undoing externally */
-void txt_set_undostate(int u)
-{
-       undoing = u;
-}
-
-int txt_get_undostate(void)
-{
-       return undoing;
-}
+/**
+ * Set to true when undoing (so we don't generate undo steps while undoing).
+ *
+ * Also use to disable undo entirely.
+ */
+static bool undoing;
 
 /**
  * \note caller must handle `undo_buf` and `compiled` members.
@@ -525,29 +519,26 @@ void BKE_text_make_local(Main *bmain, Text *text, const bool lib_local)
 
 void BKE_text_clear(Text *text, TextUndoBuf *utxt) /* called directly from rna */
 {
-       int oldstate;
-
-       if (utxt) {
-               oldstate = txt_get_undostate();
-       }
-       txt_set_undostate(utxt != NULL);
+       const bool undoing_orig = undoing;
+       undoing = (utxt == NULL);
 
        txt_sel_all(text);
        txt_delete_sel(text, utxt);
 
-       txt_set_undostate(oldstate);
+       undoing = undoing_orig;
 
        txt_make_dirty(text);
 }
 
 void BKE_text_write(Text *text, TextUndoBuf *utxt, const char *str) /* called directly from rna */
 {
-       int oldstate;
+       const bool undoing_orig = undoing;
+       undoing = (utxt == NULL);
 
-       oldstate = txt_get_undostate();
        txt_insert_buf(text, utxt, str);
        txt_move_eof(text, 0);
-       txt_set_undostate(oldstate);
+
+       undoing = undoing_orig;
 
        txt_make_dirty(text);
 }
@@ -1395,7 +1386,8 @@ char *txt_sel_to_buf(Text *text)
 
 void txt_insert_buf(Text *text, TextUndoBuf *utxt, const char *in_buffer)
 {
-       int l = 0, u, len;
+       const bool undoing_orig = undoing;
+       int l = 0, len;
        size_t i = 0, j;
        TextLine *add;
        char *buffer;
@@ -1408,41 +1400,44 @@ void txt_insert_buf(Text *text, TextUndoBuf *utxt, const char *in_buffer)
        buffer = BLI_strdupn(in_buffer, len);
        len += txt_extended_ascii_as_utf8(&buffer);
        
-       if (!undoing) txt_undo_add_blockop(text, utxt, UNDO_IBLOCK, buffer);
-
-       u = undoing;
-       undoing = 1;
+       if (!undoing) {
+               txt_undo_add_blockop(text, utxt, UNDO_IBLOCK, buffer);
+       }
+       undoing = true;
 
        /* Read the first line (or as close as possible */
-       while (buffer[i] && buffer[i] != '\n')
+       while (buffer[i] && buffer[i] != '\n') {
                txt_add_raw_char(text, utxt, BLI_str_utf8_as_unicode_step(buffer, &i));
+       }
        
-       if (buffer[i] == '\n') txt_split_curline(text, utxt);
-       else { undoing = u; MEM_freeN(buffer); return; }
-       i++;
+       if (buffer[i] == '\n') {
+               txt_split_curline(text, utxt);
+               i++;
 
-       while (i < len) {
-               l = 0;
+               while (i < len) {
+                       l = 0;
 
-               while (buffer[i] && buffer[i] != '\n') {
-                       i++; l++;
-               }
-       
-               if (buffer[i] == '\n') {
-                       add = txt_new_linen(buffer + (i - l), l);
-                       BLI_insertlinkbefore(&text->lines, text->curl, add);
-                       i++;
-               }
-               else {
-                       for (j = i - l; j < i && j < len; )
-                               txt_add_raw_char(text, utxt, BLI_str_utf8_as_unicode_step(buffer, &j));
-                       break;
+                       while (buffer[i] && buffer[i] != '\n') {
+                               i++;
+                               l++;
+                       }
+
+                       if (buffer[i] == '\n') {
+                               add = txt_new_linen(buffer + (i - l), l);
+                               BLI_insertlinkbefore(&text->lines, text->curl, add);
+                               i++;
+                       }
+                       else {
+                               for (j = i - l; j < i && j < len; ) {
+                                       txt_add_raw_char(text, utxt, BLI_str_utf8_as_unicode_step(buffer, &j));
+                               }
+                               break;
+                       }
                }
        }
-       
-       MEM_freeN(buffer);
 
-       undoing = u;
+       MEM_freeN(buffer);
+       undoing = undoing_orig;
 }
 
 /******************/
index bccfe02508987a137e9a986d910c1461ce594d16..9c04e74a7da28297d9b184e2ff611cd4d9826a7a 100644 (file)
 #include "MEM_guardedalloc.h"
 #include "BLI_math.h"
 extern "C" {
-       #include "BLI_jitter_2d.h"
+#include "BLI_jitter_2d.h"
 }
 #include "COM_VectorBlurOperation.h"
 
 
 /* Defined */
-#define PASS_VECTOR_MAX        10000.0f
+#define PASS_VECTOR_MAX 10000.0f
 
 /* Forward declarations */
 struct ZSpan;
 struct DrawBufPixel;
 void zbuf_accumulate_vecblur(
-               NodeBlurData *nbd, int xsize, int ysize, float *newrect,
-               const float *imgrect, float *vecbufrect, const float *zbufrect);
+        NodeBlurData *nbd, int xsize, int ysize, float *newrect,
+        const float *imgrect, float *vecbufrect, const float *zbufrect);
 void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty, float clipcrop);
 void zbuf_free_span(ZSpan *zspan);
 void antialias_tagbuf(int xsize, int ysize, char *rectmove);
@@ -70,7 +70,7 @@ void VectorBlurOperation::initExecution()
 
 void VectorBlurOperation::executePixel(float output[4], int x, int y, void *data)
 {
-       float *buffer = (float *) data;
+       float *buffer = (float *)data;
        int index = (y * this->getWidth() + x) * COM_NUM_CHANNELS_COLOR;
        copy_v4_v4(output, &buffer[index]);
 }
@@ -148,7 +148,7 @@ typedef struct ZSpan {
        float zmulx, zmuly, zofsx, zofsy;
 
        int *rectz;
-       DrawBufPixelrectdraw;
+       DrawBufPixel *rectdraw;
        float clipcrop;
 
 } ZSpan;
@@ -158,13 +158,13 @@ void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty, float clipcrop)
 {
        memset(zspan, 0, sizeof(ZSpan));
 
-       zspan->rectx= rectx;
-       zspan->recty= recty;
+       zspan->rectx = rectx;
+       zspan->recty = recty;
 
-       zspan->span1= (float*)MEM_mallocN(recty*sizeof(float), "zspan");
-       zspan->span2= (float*)MEM_mallocN(recty*sizeof(float), "zspan");
+       zspan->span1 = (float *)MEM_mallocN(recty * sizeof(float), "zspan");
+       zspan->span2 = (float *)MEM_mallocN(recty * sizeof(float), "zspan");
 
-       zspan->clipcrop= clipcrop;
+       zspan->clipcrop = clipcrop;
 }
 
 void zbuf_free_span(ZSpan *zspan)
@@ -172,16 +172,16 @@ void zbuf_free_span(ZSpan *zspan)
        if (zspan) {
                if (zspan->span1) MEM_freeN(zspan->span1);
                if (zspan->span2) MEM_freeN(zspan->span2);
-               zspan->span1= zspan->span2= NULL;
+               zspan->span1 = zspan->span2 = NULL;
        }
 }
 
 /* reset range for clipping */
 static void zbuf_init_span(ZSpan *zspan)
 {
-       zspan->miny1= zspan->miny2= zspan->recty+1;
-       zspan->maxy1= zspan->maxy2= -1;
-       zspan->minp1= zspan->maxp1= zspan->minp2= zspan->maxp2= NULL;
+       zspan->miny1 = zspan->miny2 = zspan->recty + 1;
+       zspan->maxy1 = zspan->maxy2 = -1;
+       zspan->minp1 = zspan->maxp1 = zspan->minp2 = zspan->maxp2 = NULL;
 }
 
 static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2])
@@ -191,30 +191,30 @@ static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2])
        float xx1, dx0, xs0;
        int y, my0, my2;
 
-       if (v1[1]<v2[1]) {
-               minv= v1; maxv= v2;
+       if (v1[1] < v2[1]) {
+               minv = v1; maxv = v2;
        }
        else {
-               minv= v2; maxv= v1;
+               minv = v2; maxv = v1;
        }
 
-       my0= ceil(minv[1]);
-       my2= floor(maxv[1]);
+       my0 = ceil(minv[1]);
+       my2 = floor(maxv[1]);
 
-       if (my2<0 || my0>= zspan->recty) return;
+       if (my2 < 0 || my0 >= zspan->recty) return;
 
        /* clip top */
-       if (my2>=zspan->recty) my2= zspan->recty-1;
+       if (my2 >= zspan->recty) my2 = zspan->recty - 1;
        /* clip bottom */
-       if (my0<0) my0= 0;
+       if (my0 < 0) my0 = 0;
 
-       if (my0>my2) return;
+       if (my0 > my2) return;
        /* if (my0>my2) should still fill in, that way we get spans that skip nicely */
 
-       xx1= maxv[1]-minv[1];
-       if (xx1>FLT_EPSILON) {
-               dx0= (minv[0]-maxv[0])/xx1;
-               xs0= dx0*(minv[1]-my2) + minv[0];
+       xx1 = maxv[1] - minv[1];
+       if (xx1 > FLT_EPSILON) {
+               dx0 = (minv[0] - maxv[0]) / xx1;
+               xs0 = dx0 * (minv[1] - my2) + minv[0];
        }
        else {
                dx0 = 0.0f;
@@ -223,43 +223,43 @@ static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2])
 
        /* empty span */
        if (zspan->maxp1 == NULL) {
-               span= zspan->span1;
+               span = zspan->span1;
        }
-       else {  /* does it complete left span? */
-               if ( maxv == zspan->minp1 || minv==zspan->maxp1) {
-                       span= zspan->span1;
+       else {  /* does it complete left span? */
+               if (maxv == zspan->minp1 || minv == zspan->maxp1) {
+                       span = zspan->span1;
                }
                else {
-                       span= zspan->span2;
+                       span = zspan->span2;
                }
        }
 
-       if (span==zspan->span1) {
+       if (span == zspan->span1) {
 //             printf("left span my0 %d my2 %d\n", my0, my2);
-               if (zspan->minp1==NULL || zspan->minp1[1] > minv[1] ) {
-                       zspan->minp1= minv;
+               if (zspan->minp1 == NULL || zspan->minp1[1] > minv[1]) {
+                       zspan->minp1 = minv;
                }
-               if (zspan->maxp1==NULL || zspan->maxp1[1] < maxv[1] ) {
-                       zspan->maxp1= maxv;
+               if (zspan->maxp1 == NULL || zspan->maxp1[1] < maxv[1]) {
+                       zspan->maxp1 = maxv;
                }
-               if (my0<zspan->miny1) zspan->miny1= my0;
-               if (my2>zspan->maxy1) zspan->maxy1= my2;
+               if (my0 < zspan->miny1) zspan->miny1 = my0;
+               if (my2 > zspan->maxy1) zspan->maxy1 = my2;
        }
        else {
 //             printf("right span my0 %d my2 %d\n", my0, my2);
-               if (zspan->minp2==NULL || zspan->minp2[1] > minv[1] ) {
-                       zspan->minp2= minv;
+               if (zspan->minp2 == NULL || zspan->minp2[1] > minv[1]) {
+                       zspan->minp2 = minv;
                }
-               if (zspan->maxp2==NULL || zspan->maxp2[1] < maxv[1] ) {
-                       zspan->maxp2= maxv;
+               if (zspan->maxp2 == NULL || zspan->maxp2[1] < maxv[1]) {
+                       zspan->maxp2 = maxv;
                }
-               if (my0<zspan->miny2) zspan->miny2= my0;
-               if (my2>zspan->maxy2) zspan->maxy2= my2;
+               if (my0 < zspan->miny2) zspan->miny2 = my0;
+               if (my2 > zspan->maxy2) zspan->maxy2 = my2;
        }
 
-       for (y=my2; y>=my0; y--, xs0+= dx0) {
+       for (y = my2; y >= my0; y--, xs0 += dx0) {
                /* xs0 is the xcoord! */
-               span[y]= xs0;
+               span[y] = xs0;
        }
 }
 
@@ -292,79 +292,79 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
        zbuf_add_to_span(zspan, v4, v1);
 
        /* clipped */
-       if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
+       if (zspan->minp2 == NULL || zspan->maxp2 == NULL) return;
 
        my0 = max_ii(zspan->miny1, zspan->miny2);
        my2 = min_ii(zspan->maxy1, zspan->maxy2);
 
        //      printf("my %d %d\n", my0, my2);
-       if (my2<my0) return;
+       if (my2 < my0) return;
 
        /* ZBUF DX DY, in floats still */
-       x1= v1[0]- v2[0];
-       x2= v2[0]- v3[0];
-       y1= v1[1]- v2[1];
-       y2= v2[1]- v3[1];
-       z1= v1[2]- v2[2];
-       z2= v2[2]- v3[2];
-       x0= y1*z2-z1*y2;
-       y0= z1*x2-x1*z2;
-       z0= x1*y2-y1*x2;
+       x1 = v1[0] - v2[0];
+       x2 = v2[0] - v3[0];
+       y1 = v1[1] - v2[1];
+       y2 = v2[1] - v3[1];
+       z1 = v1[2] - v2[2];
+       z2 = v2[2] - v3[2];
+       x0 = y1 * z2 - z1 * y2;
+       y0 = z1 * x2 - x1 * z2;
+       z0 = x1 * y2 - y1 * x2;
 
-       if (z0==0.0f) return;
+       if (z0 == 0.0f) return;
 
-       xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
+       xx1 = (x0 * v1[0] + y0 * v1[1]) / z0 + v1[2];
 
-       zxd= -(double)x0/(double)z0;
-       zyd= -(double)y0/(double)z0;
-       zy0= ((double)my2)*zyd + (double)xx1;
+       zxd = -(double)x0 / (double)z0;
+       zyd = -(double)y0 / (double)z0;
+       zy0 = ((double)my2) * zyd + (double)xx1;
 
        /* start-offset in rect */
-       rectx= zspan->rectx;
-       rectzofs= (float *)(zspan->rectz + rectx*my2);
-       rectpofs= ((DrawBufPixel *)zspan->rectdraw) + rectx*my2;
+       rectx = zspan->rectx;
+       rectzofs = (float *)(zspan->rectz + rectx * my2);
+       rectpofs = ((DrawBufPixel *)zspan->rectdraw) + rectx * my2;
 
        /* correct span */
-       sn1= (my0 + my2)/2;
+       sn1 = (my0 + my2) / 2;
        if (zspan->span1[sn1] < zspan->span2[sn1]) {
-               span1= zspan->span1+my2;
-               span2= zspan->span2+my2;
+               span1 = zspan->span1 + my2;
+               span2 = zspan->span2 + my2;
        }
        else {
-               span1= zspan->span2+my2;
-               span2= zspan->span1+my2;
+               span1 = zspan->span2 + my2;
+               span2 = zspan->span1 + my2;
        }
 
-       for (y=my2; y>=my0; y--, span1--, span2--) {
+       for (y = my2; y >= my0; y--, span1--, span2--) {
 
-               sn1= floor(*span1);
-               sn2= floor(*span2);
+               sn1 = floor(*span1);
+               sn2 = floor(*span2);
                sn1++;
 
-               if (sn2>=rectx) sn2= rectx-1;
-               if (sn1<0) sn1= 0;
+               if (sn2 >= rectx) sn2 = rectx - 1;
+               if (sn1 < 0) sn1 = 0;
 
-               if (sn2>=sn1) {
-                       zverg= (double)sn1*zxd + zy0;
-                       rz= rectzofs+sn1;
-                       rp= rectpofs+sn1;
-                       x= sn2-sn1;
+               if (sn2 >= sn1) {
+                       zverg = (double)sn1 * zxd + zy0;
+                       rz = rectzofs + sn1;
+                       rp = rectpofs + sn1;
+                       x = sn2 - sn1;
 
-                       while (x>=0) {
+                       while (x >= 0) {
                                if (zverg < (double)*rz) {
-                                       *rz= zverg;
-                                       *rp= *col;
+                                       *rz = zverg;
+                                       *rp = *col;
                                }
-                               zverg+= zxd;
+                               zverg += zxd;
                                rz++;
                                rp++;
                                x--;
                        }
                }
 
-               zy0-=zyd;
-               rectzofs-= rectx;
-               rectpofs-= rectx;
+               zy0 -= zyd;
+               rectzofs -= rectx;
+               rectpofs -= rectx;
        }
 }
 
@@ -377,43 +377,43 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
        int a, x, y, step;
 
        /* 1: tag pixels to be candidate for AA */
-       for (y=2; y<ysize; y++) {
+       for (y = 2; y < ysize; y++) {
                /* setup rows */
-               row1= rectmove + (y-2)*xsize;
-               row2= row1 + xsize;
-               row3= row2 + xsize;
-               for (x=2; x<xsize; x++, row1++, row2++, row3++) {
+               row1 = rectmove + (y - 2) * xsize;
+               row2 = row1 + xsize;
+               row3 = row2 + xsize;
+               for (x = 2; x < xsize; x++, row1++, row2++, row3++) {
                        if (row2[1]) {
-                               if (row2[0]==0 || row2[2]==0 || row1[1]==0 || row3[1]==0)
-                                       row2[1]= 128;
+                               if (row2[0] == 0 || row2[2] == 0 || row1[1] == 0 || row3[1] == 0)
+                                       row2[1] = 128;
                        }
                }
        }
 
        /* 2: evaluate horizontal scanlines and calculate alphas */
-       row1= rectmove;
-       for (y=0; y<ysize; y++) {
+       row1 = rectmove;
+       for (y = 0; y < ysize; y++) {
                row1++;
-               for (x=1; x<xsize; x++, row1++) {
-                       if (row1[0]==128 && row1[1]==128) {
+               for (x = 1; x < xsize; x++, row1++) {
+                       if (row1[0] == 128 && row1[1] == 128) {
                                /* find previous color and next color and amount of steps to blend */
-                               prev= row1[-1];
-                               step= 1;
-                               while (x+step<xsize && row1[step]==128)
+                               prev = row1[-1];
+                               step = 1;
+                               while (x + step < xsize && row1[step] == 128)
                                        step++;
 
-                               if (x+step!=xsize) {
+                               if (x + step != xsize) {
                                        /* now we can blend values */
-                                       next= row1[step];
+                                       next = row1[step];
 
                                        /* note, prev value can be next value, but we do this loop to clear 128 then */
-                                       for (a=0; a<step; a++) {
+                                       for (a = 0; a < step; a++) {
                                                int fac, mfac;
 
-                                               fac= ((a+1)<<8)/(step+1);
-                                               mfac= 255-fac;
+                                               fac = ((a + 1) << 8) / (step + 1);
+                                               mfac = 255 - fac;
 
-                                               row1[a]= (prev*mfac + next*fac)>>8;
+                                               row1[a] = (prev * mfac + next * fac) >> 8;
                                        }
                                }
                        }
@@ -422,28 +422,28 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
 
        /* 3: evaluate vertical scanlines and calculate alphas */
        /*    use for reading a copy of the original tagged buffer */
-       for (x=0; x<xsize; x++) {
-               row1= rectmove + x+xsize;
+       for (x = 0; x < xsize; x++) {
+               row1 = rectmove + x + xsize;
 
-               for (y=1; y<ysize; y++, row1+=xsize) {
-                       if (row1[0]==128 && row1[xsize]==128) {
+               for (y = 1; y < ysize; y++, row1 += xsize) {
+                       if (row1[0] == 128 && row1[xsize] == 128) {
                                /* find previous color and next color and amount of steps to blend */
-                               prev= row1[-xsize];
-                               step= 1;
-                               while (y+step<ysize && row1[step*xsize]==128)
+                               prev = row1[-xsize];
+                               step = 1;
+                               while (y + step < ysize && row1[step * xsize] == 128)
                                        step++;
 
-                               if (y+step!=ysize) {
+                               if (y + step != ysize) {
                                        /* now we can blend values */
-                                       next= row1[step*xsize];
+                                       next = row1[step * xsize];
                                        /* note, prev value can be next value, but we do this loop to clear 128 then */
-                                       for (a=0; a<step; a++) {
+                                       for (a = 0; a < step; a++) {
                                                int fac, mfac;
 
-                                               fac= ((a+1)<<8)/(step+1);
-                                               mfac= 255-fac;
+                                               fac = ((a + 1) << 8) / (step + 1);
+                                               mfac = 255 - fac;
 
-                                               row1[a*xsize]= (prev*mfac + next*fac)>>8;
+                                               row1[a * xsize] = (prev * mfac + next * fac) >> 8;
                                        }
                                }
                        }
@@ -451,15 +451,15 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
        }
 
        /* last: pixels with 0 we fill in zbuffer, with 1 we skip for mask */
-       for (y=2; y<ysize; y++) {
+       for (y = 2; y < ysize; y++) {
                /* setup rows */
-               row1= rectmove + (y-2)*xsize;
-               row2= row1 + xsize;
-               row3= row2 + xsize;
-               for (x=2; x<xsize; x++, row1++, row2++, row3++) {
-                       if (row2[1]==0) {
-                               if (row2[0]>1 || row2[2]>1 || row1[1]>1 || row3[1]>1)
-                                       row2[1]= 1;
+               row1 = rectmove + (y - 2) * xsize;
+               row2 = row1 + xsize;
+               row3 = row2 + xsize;
+               for (x = 2; x < xsize; x++, row1++, row2++, row3++) {
+                       if (row2[1] == 0) {
+                               if (row2[0] > 1 || row2[2] > 1 || row1[1] > 1 || row3[1] > 1)
+                                       row2[1] = 1;
                        }
                }
        }
@@ -473,32 +473,32 @@ static void quad_bezier_2d(float *result, float *v1, float *v2, float *ipodata)
 {
        float p1[2], p2[2], p3[2];
 
-       p3[0]= -v2[0];
-       p3[1]= -v2[1];
+       p3[0] = -v2[0];
+       p3[1] = -v2[1];
 
-       p1[0]= v1[0];
-       p1[1]= v1[1];
+       p1[0] = v1[0];
+       p1[1] = v1[1];
 
        /* official formula 2*p2 - 0.5*p1 - 0.5*p3 */
-       p2[0]= -0.5f*p1[0] - 0.5f*p3[0];
-       p2[1]= -0.5f*p1[1] - 0.5f*p3[1];
+       p2[0] = -0.5f * p1[0] - 0.5f * p3[0];
+       p2[1] = -0.5f * p1[1] - 0.5f * p3[1];
 
-       result[0]= ipodata[0]*p1[0] + ipodata[1]*p2[0] + ipodata[2]*p3[0];
-       result[1]= ipodata[0]*p1[1] + ipodata[1]*p2[1] + ipodata[2]*p3[1];
+       result[0] = ipodata[0] * p1[0] + ipodata[1] * p2[0] + ipodata[2] * p3[0];
+       result[1] = ipodata[0] * p1[1] + ipodata[1] * p2[1] + ipodata[2] * p3[1];
 }
 
 static void set_quad_bezier_ipo(float fac, float *data)
 {
-       float mfac= (1.0f-fac);
+       float mfac = (1.0f - fac);
 
-       data[0]= mfac*mfac;
-       data[1]= 2.0f*mfac*fac;
-       data[2]= fac*fac;
+       data[0] = mfac * mfac;
+       data[1] = 2.0f * mfac * fac;
+       data[2] = fac * fac;
 }
 
 void zbuf_accumulate_vecblur(
-        NodeBlurData *nbd, int xsize, int ysize, float *newrect,
-        const float *imgrect, float *vecbufrect, const float *zbufrect)
+       NodeBlurData *nbd, int xsize, int ysize, float *newrect,
+       const float *imgrect, float *vecbufrect, const float *zbufrect)
 {
        ZSpan zspan;
        DrawBufPixel *rectdraw, *dr;
@@ -506,64 +506,64 @@ void zbuf_accumulate_vecblur(
        float v1[3], v2[3], v3[3], v4[3], fx, fy;
        const float *dimg, *dz, *ro;
        float *rectvz, *dvz, *dvec1, *dvec2, *dz1, *dz2, *rectz;
-       float *minvecbufrect= NULL, *rectweight, *rw, *rectmax, *rm;
-       float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed;
-       int y, x, step, maxspeed=nbd->maxspeed, samples= nbd->samples;
-       int tsktsk= 0;
-       static int firsttime= 1;
+       float *minvecbufrect = NULL, *rectweight, *rw, *rectmax, *rm;
+       float maxspeedsq = (float)nbd->maxspeed * nbd->maxspeed;
+       int y, x, step, maxspeed = nbd->maxspeed, samples = nbd->samples;
+       int tsktsk = 0;
+       static int firsttime = 1;
        char *rectmove, *dm;
 
        zbuf_alloc_span(&zspan, xsize, ysize, 1.0f);
-       zspan.zmulx=  ((float)xsize)/2.0f;
-       zspan.zmuly=  ((float)ysize)/2.0f;
-       zspan.zofsx= 0.0f;
-       zspan.zofsy= 0.0f;
+       zspan.zmulx =  ((float)xsize) / 2.0f;
+       zspan.zmuly =  ((float)ysize) / 2.0f;
+       zspan.zofsx = 0.0f;
+       zspan.zofsy = 0.0f;
 
        /* the buffers */
-       rectz= (float*)MEM_mapallocN(sizeof(float)*xsize*ysize, "zbuf accum");
-       zspan.rectz= (int *)rectz;
+       rectz = (float *)MEM_mapallocN(sizeof(float) * xsize * ysize, "zbuf accum");
+       zspan.rectz = (int *)rectz;
 
-       rectmove= (char*)MEM_mapallocN(xsize*ysize, "rectmove");
-       rectdraw= (DrawBufPixel*)MEM_mapallocN(sizeof(DrawBufPixel)*xsize*ysize, "rect draw");
-       zspan.rectdraw= rectdraw;
+       rectmove = (char *)MEM_mapallocN(xsize * ysize, "rectmove");
+       rectdraw = (DrawBufPixel *)MEM_mapallocN(sizeof(DrawBufPixel) * xsize * ysize, "rect draw");
+       zspan.rectdraw = rectdraw;
 
-       rectweight= (float*)MEM_mapallocN(sizeof(float)*xsize*ysize, "rect weight");
-       rectmax= (float*)MEM_mapallocN(sizeof(float)*xsize*ysize, "rect max");
+       rectweight = (float *)MEM_mapallocN(sizeof(float) * xsize * ysize, "rect weight");
+       rectmax = (float *)MEM_mapallocN(sizeof(float) * xsize * ysize, "rect max");
 
        /* debug... check if PASS_VECTOR_MAX still is in buffers */
-       dvec1= vecbufrect;
-       for (x= 4*xsize*ysize; x>0; x--, dvec1++) {
-               if (dvec1[0]==PASS_VECTOR_MAX) {
-                       dvec1[0]= 0.0f;
-                       tsktsk= 1;
+       dvec1 = vecbufrect;
+       for (x = 4 * xsize * ysize; x > 0; x--, dvec1++) {
+               if (dvec1[0] == PASS_VECTOR_MAX) {
+                       dvec1[0] = 0.0f;
+                       tsktsk = 1;
                }
        }
        if (tsktsk) printf("Found uninitialized speed in vector buffer... fixed.\n");
 
        /* min speed? then copy speedbuffer to recalculate speed vectors */
        if (nbd->minspeed) {
-               float minspeed= (float)nbd->minspeed;
-               float minspeedsq= minspeed*minspeed;
+               float minspeed = (float)nbd->minspeed;
+               float minspeedsq = minspeed * minspeed;
 
-               minvecbufrect= (float*)MEM_mapallocN(4*sizeof(float)*xsize*ysize, "minspeed buf");
+               minvecbufrect = (float *)MEM_mapallocN(4 * sizeof(float) * xsize * ysize, "minspeed buf");
 
-               dvec1= vecbufrect;
-               dvec2= minvecbufrect;
-               for (x= 2*xsize*ysize; x>0; x--, dvec1+=2, dvec2+=2) {
-                       if (dvec1[0]==0.0f && dvec1[1]==0.0f) {
-                               dvec2[0]= dvec1[0];
-                               dvec2[1]= dvec1[1];
+               dvec1 = vecbufrect;
+               dvec2 = minvecbufrect;
+               for (x = 2 * xsize * ysize; x > 0; x--, dvec1 += 2, dvec2 += 2) {
+                       if (dvec1[0] == 0.0f && dvec1[1] == 0.0f) {
+                               dvec2[0] = dvec1[0];
+                               dvec2[1] = dvec1[1];
                        }
                        else {
-                               float speedsq= dvec1[0]*dvec1[0] + dvec1[1]*dvec1[1];
+                               float speedsq = dvec1[0] * dvec1[0] + dvec1[1] * dvec1[1];
                                if (speedsq <= minspeedsq) {
-                                       dvec2[0]= 0.0f;
-                                       dvec2[1]= 0.0f;
+                                       dvec2[0] = 0.0f;
+                                       dvec2[1] = 0.0f;
                                }
                                else {
                                        speedsq = 1.0f - minspeed / sqrtf(speedsq);
-                                       dvec2[0]= speedsq*dvec1[0];
-                                       dvec2[1]= speedsq*dvec1[1];
+                                       dvec2[0] = speedsq * dvec1[0];
+                                       dvec2[1] = speedsq * dvec1[1];
                                }
                        }
                }
@@ -571,75 +571,75 @@ void zbuf_accumulate_vecblur(
        }
 
        /* make vertex buffer with averaged speed and zvalues */
-       rectvz= (float*)MEM_mapallocN(4*sizeof(float)*(xsize+1)*(ysize+1), "vertices");
-       dvz= rectvz;
-       for (y=0; y<=ysize; y++) {
+       rectvz = (float *)MEM_mapallocN(4 * sizeof(float) * (xsize + 1) * (ysize + 1), "vertices");
+       dvz = rectvz;
+       for (y = 0; y <= ysize; y++) {
 
-               if (y==0)
-                       dvec1= vecbufrect + 4*y*xsize;
+               if (y == 0)
+                       dvec1 = vecbufrect + 4 * y * xsize;
                else
-                       dvec1= vecbufrect + 4*(y-1)*xsize;
+                       dvec1 = vecbufrect + 4 * (y - 1) * xsize;
 
-               if (y==ysize)
-                       dvec2= vecbufrect + 4*(y-1)*xsize;
+               if (y == ysize)
+                       dvec2 = vecbufrect + 4 * (y - 1) * xsize;
                else
-                       dvec2= vecbufrect + 4*y*xsize;
+                       dvec2 = vecbufrect + 4 * y * xsize;
 
-               for (x=0; x<=xsize; x++) {
+               for (x = 0; x <= xsize; x++) {
 
                        /* two vectors, so a step loop */
-                       for (step=0; step<2; step++, dvec1+=2, dvec2+=2, dvz+=2) {
+                       for (step = 0; step < 2; step++, dvec1 += 2, dvec2 += 2, dvz += 2) {
                                /* average on minimal speed */
-                               int div= 0;
+                               int div = 0;
 
-                               if (x!=0) {
-                                       if (dvec1[-4]!=0.0f || dvec1[-3]!=0.0f) {
-                                               dvz[0]= dvec1[-4];
-                                               dvz[1]= dvec1[-3];
+                               if (x != 0) {
+                                       if (dvec1[-4] != 0.0f || dvec1[-3] != 0.0f) {
+                                               dvz[0] = dvec1[-4];
+                                               dvz[1] = dvec1[-3];
                                                div++;
                                        }
-                                       if (dvec2[-4]!=0.0f || dvec2[-3]!=0.0f) {
-                                               if (div==0) {
-                                                       dvz[0]= dvec2[-4];
-                                                       dvz[1]= dvec2[-3];
+                                       if (dvec2[-4] != 0.0f || dvec2[-3] != 0.0f) {
+                                               if (div == 0) {
+                                                       dvz[0] = dvec2[-4];
+                                                       dvz[1] = dvec2[-3];
                                                        div++;
                                                }
-                                               else if ( (ABS(dvec2[-4]) + ABS(dvec2[-3]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
-                                                       dvz[0]= dvec2[-4];
-                                                       dvz[1]= dvec2[-3];
+                                               else if ( (ABS(dvec2[-4]) + ABS(dvec2[-3])) < (ABS(dvz[0]) + ABS(dvz[1])) ) {
+                                                       dvz[0] = dvec2[-4];
+                                                       dvz[1] = dvec2[-3];
                                                }
                                        }
                                }
 
-                               if (x!=xsize) {
-                                       if (dvec1[0]!=0.0f || dvec1[1]!=0.0f) {
-                                               if (div==0) {
-                                                       dvz[0]= dvec1[0];
-                                                       dvz[1]= dvec1[1];
+                               if (x != xsize) {
+                                       if (dvec1[0] != 0.0f || dvec1[1] != 0.0f) {
+                                               if (div == 0) {
+                                                       dvz[0] = dvec1[0];
+                                                       dvz[1] = dvec1[1];
                                                        div++;
                                                }
-                                               else if ( (ABS(dvec1[0]) + ABS(dvec1[1]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
-                                                       dvz[0]= dvec1[0];
-                                                       dvz[1]= dvec1[1];
+                                               else if ( (ABS(dvec1[0]) + ABS(dvec1[1])) < (ABS(dvz[0]) + ABS(dvz[1])) ) {
+                                                       dvz[0] = dvec1[0];
+                                                       dvz[1] = dvec1[1];
                                                }
                                        }
-                                       if (dvec2[0]!=0.0f || dvec2[1]!=0.0f) {
-                                               if (div==0) {
-                                                       dvz[0]= dvec2[0];
-                                                       dvz[1]= dvec2[1];
+                                       if (dvec2[0] != 0.0f || dvec2[1] != 0.0f) {
+                                               if (div == 0) {
+                                                       dvz[0] = dvec2[0];
+                                                       dvz[1] = dvec2[1];
                                                }
-                                               else if ( (ABS(dvec2[0]) + ABS(dvec2[1]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
-                                                       dvz[0]= dvec2[0];
-                                                       dvz[1]= dvec2[1];
+                                               else if ( (ABS(dvec2[0]) + ABS(dvec2[1])) < (ABS(dvz[0]) + ABS(dvz[1])) ) {
+                                                       dvz[0] = dvec2[0];
+                                                       dvz[1] = dvec2[1];
                                                }
                                        }
                                }
                                if (maxspeed) {
-                                       float speedsq= dvz[0]*dvz[0] + dvz[1]*dvz[1];
+                                       float speedsq = dvz[0] * dvz[0] + dvz[1] * dvz[1];
                                        if (speedsq > maxspeedsq) {
                                                speedsq = (float)maxspeed / sqrtf(speedsq);
-                                               dvz[0]*= speedsq;
-                                               dvz[1]*= speedsq;
+                                               dvz[0] *= speedsq;
+                                               dvz[1] *= speedsq;
                                        }
                                }
                        }
@@ -647,117 +647,117 @@ void zbuf_accumulate_vecblur(
        }
 
        /* set border speeds to keep border speeds on border */
-       dz1= rectvz;
-       dz2= rectvz+4*(ysize)*(xsize+1);
-       for (x=0; x<=xsize; x++, dz1+=4, dz2+=4) {
-               dz1[1]= 0.0f;
-               dz2[1]= 0.0f;
-               dz1[3]= 0.0f;
-               dz2[3]= 0.0f;
+       dz1 = rectvz;
+       dz2 = rectvz + 4 * (ysize) * (xsize + 1);
+       for (x = 0; x <= xsize; x++, dz1 += 4, dz2 += 4) {
+               dz1[1] = 0.0f;
+               dz2[1] = 0.0f;
+               dz1[3] = 0.0f;
+               dz2[3] = 0.0f;
        }
-       dz1= rectvz;
-       dz2= rectvz+4*(xsize);
-       for (y=0; y<=ysize; y++, dz1+=4*(xsize+1), dz2+=4*(xsize+1)) {
-               dz1[0]= 0.0f;
-               dz2[0]= 0.0f;
-               dz1[2]= 0.0f;
-               dz2[2]= 0.0f;
+       dz1 = rectvz;
+       dz2 = rectvz + 4 * (xsize);
+       for (y = 0; y <= ysize; y++, dz1 += 4 * (xsize + 1), dz2 += 4 * (xsize + 1)) {
+               dz1[0] = 0.0f;
+               dz2[0] = 0.0f;
+               dz1[2] = 0.0f;
+               dz2[2] = 0.0f;
        }
 
        /* tag moving pixels, only these faces we draw */
-       dm= rectmove;
-       dvec1= vecbufrect;
-       for (x=xsize*ysize; x>0; x--, dm++, dvec1+=4) {
-               if ((dvec1[0]!=0.0f || dvec1[1]!=0.0f || dvec1[2]!=0.0f || dvec1[3]!=0.0f))
-                       *dm= 255;
+       dm = rectmove;
+       dvec1 = vecbufrect;
+       for (x = xsize * ysize; x > 0; x--, dm++, dvec1 += 4) {
+               if ((dvec1[0] != 0.0f || dvec1[1] != 0.0f || dvec1[2] != 0.0f || dvec1[3] != 0.0f))
+                       *dm = 255;
        }
 
        antialias_tagbuf(xsize, ysize, rectmove);
 
        /* has to become static, the init-jit calls a random-seed, screwing up texture noise node */
        if (firsttime) {
-               firsttime= 0;
+               firsttime = 0;
                BLI_jitter_init(jit, 256);
        }
 
-       memset(newrect, 0, sizeof(float)*xsize*ysize*4);
+       memset(newrect, 0, sizeof(float) * xsize * ysize * 4);
 
        /* accumulate */
-       samples/= 2;
-       for (step= 1; step<=samples; step++) {
-               float speedfac= 0.5f*nbd->fac*(float)step/(float)(samples+1);
+       samples /= 2;
+       for (step = 1; step <= samples; step++) {
+               float speedfac = 0.5f * nbd->fac * (float)step / (float)(samples + 1);
                int side;
 
-               for (side=0; side<2; side++) {
+               for (side = 0; side < 2; side++) {
                        float blendfac, ipodata[4];
 
                        /* clear zbuf, if we draw future we fill in not moving pixels */
                        if (0)
-                               for (x= xsize*ysize-1; x>=0; x--) rectz[x]= 10e16;
+                               for (x = xsize * ysize - 1; x >= 0; x--) rectz[x] = 10e16;
                        else
-                               for (x= xsize*ysize-1; x>=0; x--) {
-                                       if (rectmove[x]==0)
-                                               rectz[x]= zbufrect[x];
+                               for (x = xsize * ysize - 1; x >= 0; x--) {
+                                       if (rectmove[x] == 0)
+                                               rectz[x] = zbufrect[x];
                                        else
-                                               rectz[x]= 10e16;
+                                               rectz[x] = 10e16;
                                }
 
                        /* clear drawing buffer */
-                       for (x= xsize*ysize-1; x>=0; x--) rectdraw[x].colpoin= NULL;
+                       for (x = xsize * ysize - 1; x >= 0; x--) rectdraw[x].colpoin = NULL;
 
-                       dimg= imgrect;
-                       dm= rectmove;
-                       dz= zbufrect;
-                       dz1= rectvz;
-                       dz2= rectvz + 4*(xsize + 1);
+                       dimg = imgrect;
+                       dm = rectmove;
+                       dz = zbufrect;
+                       dz1 = rectvz;
+                       dz2 = rectvz + 4 * (xsize + 1);
 
                        if (side) {
-                               if (nbd->curved==0) {
-                                       dz1+= 2;
-                                       dz2+= 2;
+                               if (nbd->curved == 0) {
+                                       dz1 += 2;
+                                       dz2 += 2;
                                }
-                               speedfac= -speedfac;
+                               speedfac = -speedfac;
                        }
 
-                       set_quad_bezier_ipo(0.5f + 0.5f*speedfac, ipodata);
+                       set_quad_bezier_ipo(0.5f + 0.5f * speedfac, ipodata);
 
-                       for (fy= -0.5f+jit[step & 255][0], y=0; y<ysize; y++, fy+=1.0f) {
-                               for (fx= -0.5f+jit[step & 255][1], x=0; x<xsize; x++, fx+=1.0f, dimg+=4, dz1+=4, dz2+=4, dm++, dz++) {
-                                       if (*dm>1) {
+                       for (fy = -0.5f + jit[step & 255][0], y = 0; y < ysize; y++, fy += 1.0f) {
+                               for (fx = -0.5f + jit[step & 255][1], x = 0; x < xsize; x++, fx += 1.0f, dimg += 4, dz1 += 4, dz2 += 4, dm++, dz++) {
+                                       if (*dm > 1) {
                                                float jfx = fx + 0.5f;
                                                float jfy = fy + 0.5f;
                                                DrawBufPixel col;
 
                                                /* make vertices */
-                                               if (nbd->curved) {      /* curved */
-                                                       quad_bezier_2d(v1, dz1, dz1+2, ipodata);
-                                                       v1[0]+= jfx; v1[1]+= jfy; v1[2]= *dz;
+                                               if (nbd->curved) {  /* curved */
+                                                       quad_bezier_2d(v1, dz1, dz1 + 2, ipodata);
+                                                       v1[0] += jfx; v1[1] += jfy; v1[2] = *dz;
 
-                                                       quad_bezier_2d(v2, dz1+4, dz1+4+2, ipodata);
-                                                       v2[0]+= jfx+1.0f; v2[1]+= jfy; v2[2]= *dz;
+                                                       quad_bezier_2d(v2, dz1 + 4, dz1 + 4 + 2, ipodata);
+                                                       v2[0] += jfx + 1.0f; v2[1] += jfy; v2[2] = *dz;
 
-                                                       quad_bezier_2d(v3, dz2+4, dz2+4+2, ipodata);
-                                                       v3[0]+= jfx+1.0f; v3[1]+= jfy+1.0f; v3[2]= *dz;
+                                                       quad_bezier_2d(v3, dz2 + 4, dz2 + 4 + 2, ipodata);
+                                                       v3[0] += jfx + 1.0f; v3[1] += jfy + 1.0f; v3[2] = *dz;
 
-                                                       quad_bezier_2d(v4, dz2, dz2+2, ipodata);
-                                                       v4[0]+= jfx; v4[1]+= jfy+1.0f; v4[2]= *dz;
+                                                       quad_bezier_2d(v4, dz2, dz2 + 2, ipodata);
+                                                       v4[0] += jfx; v4[1] += jfy + 1.0f; v4[2] = *dz;
                                                }
                                                else {
-                                                       v1[0]= speedfac*dz1[0]+jfx;      v1[1]= speedfac*dz1[1]+jfy;      v1[2]= *dz;
-                                                       v2[0]= speedfac*dz1[4]+jfx+1.0f; v2[1]= speedfac*dz1[5]+jfy;      v2[2]= *dz;
-                                                       v3[0]= speedfac*dz2[4]+jfx+1.0f; v3[1]= speedfac*dz2[5]+jfy+1.0f; v3[2]= *dz;
-                                                       v4[0]= speedfac*dz2[0]+jfx;      v4[1]= speedfac*dz2[1]+jfy+1.0f; v4[2]= *dz;
+                                                       ARRAY_SET_ITEMS(v1, speedfac * dz1[0] + jfx,        speedfac * dz1[1] + jfy,        *dz);
+                                                       ARRAY_SET_ITEMS(v2, speedfac * dz1[4] + jfx + 1.0f, speedfac * dz1[5] + jfy,        *dz);
+                                                       ARRAY_SET_ITEMS(v3, speedfac * dz2[4] + jfx + 1.0f, speedfac * dz2[5] + jfy + 1.0f, *dz);
+                                                       ARRAY_SET_ITEMS(v4, speedfac * dz2[0] + jfx,        speedfac * dz2[1] + jfy + 1.0f, *dz);
                                                }
-                                               if (*dm==255) col.alpha= 1.0f;
-                                               else if (*dm<2) col.alpha= 0.0f;
-                                               else col.alpha= ((float)*dm)/255.0f;
-                                               col.colpoin= dimg;
+                                               if (*dm == 255) col.alpha = 1.0f;
+                                               else if (*dm < 2) col.alpha = 0.0f;
+                                               else col.alpha = ((float)*dm) / 255.0f;
+                                               col.colpoin = dimg;
 
                                                zbuf_fill_in_rgba(&zspan, &col, v1, v2, v3, v4);
                                        }
                                }
-                               dz1+=4;
-                               dz2+=4;
+                               dz1 += 4;
+                               dz2 += 4;
                        }
 
                        /* blend with a falloff. this fixes the ugly effect you get with
@@ -767,43 +767,43 @@ void zbuf_accumulate_vecblur(
                         * we don't know what is behind it so we don't do that. this hack
                         * overestimates the contribution of foreground pixels but looks a
                         * bit better without a sudden cutoff. */
-                       blendfac= ((samples - step)/(float)samples);
+                       blendfac = ((samples - step) / (float)samples);
                        /* smoothstep to make it look a bit nicer as well */
-                       blendfac= 3.0f*pow(blendfac, 2.0f) - 2.0f*pow(blendfac, 3.0f);
+                       blendfac = 3.0f * pow(blendfac, 2.0f) - 2.0f * pow(blendfac, 3.0f);
 
                        /* accum */
-                       rw= rectweight;
-                       rm= rectmax;
-                       for (dr= rectdraw, dz2=newrect, x= xsize*ysize-1; x>=0; x--, dr++, dz2+=4, rw++, rm++) {
+                       rw = rectweight;
+                       rm = rectmax;
+                       for (dr = rectdraw, dz2 = newrect, x = xsize * ysize - 1; x >= 0; x--, dr++, dz2 += 4, rw++, rm++) {
                                if (dr->colpoin) {
-                                       float bfac= dr->alpha*blendfac;
+                                       float bfac = dr->alpha * blendfac;
 
-                                       dz2[0] += bfac*dr->colpoin[0];
-                                       dz2[1] += bfac*dr->colpoin[1];
-                                       dz2[2] += bfac*dr->colpoin[2];
-                                       dz2[3] += bfac*dr->colpoin[3];
+                                       dz2[0] += bfac * dr->colpoin[0];
+                                       dz2[1] += bfac * dr->colpoin[1];
+                                       dz2[2] += bfac * dr->colpoin[2];
+                                       dz2[3] += bfac * dr->colpoin[3];
 
                                        *rw += bfac;
-                                       *rm= MAX2(*rm, bfac);
+                                       *rm = MAX2(*rm, bfac);
                                }
                        }
                }
        }
 
        /* blend between original images and accumulated image */
-       rw= rectweight;
-       rm= rectmax;
-       ro= imgrect;
-       dm= rectmove;
-       for (dz2=newrect, x= xsize*ysize-1; x>=0; x--, dz2+=4, ro+=4, rw++, rm++, dm++) {
+       rw = rectweight;
+       rm = rectmax;
+       ro = imgrect;
+       dm = rectmove;
+       for (dz2 = newrect, x = xsize * ysize - 1; x >= 0; x--, dz2 += 4, ro += 4, rw++, rm++, dm++) {
                float mfac = *rm;
-               float fac = (*rw == 0.0f)? 0.0f: mfac/(*rw);
+               float fac = (*rw == 0.0f) ? 0.0f : mfac / (*rw);
                float nfac = 1.0f - mfac;
 
-               dz2[0]= fac*dz2[0] + nfac*ro[0];
-               dz2[1]= fac*dz2[1] + nfac*ro[1];
-               dz2[2]= fac*dz2[2] + nfac*ro[2];
-               dz2[3]= fac*dz2[3] + nfac*ro[3];
+               dz2[0] = fac * dz2[0] + nfac * ro[0];
+               dz2[1] = fac * dz2[1] + nfac * ro[1];
+               dz2[2] = fac * dz2[2] + nfac * ro[2];
+               dz2[3] = fac * dz2[3] + nfac * ro[3];
        }
 
        MEM_freeN(rectz);
index 3c600f6e367369a1ebdc2429861772f38259b662..1032acbae67aadc3c4488476ebcf7cc5884b421e 100644 (file)
@@ -112,7 +112,7 @@ const EnumPropertyItem rna_enum_uv_sculpt_tool_items[] = {
 
 const EnumPropertyItem rna_enum_snap_target_items[] = {
        {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
-       {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
+       {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap transormation center onto target"},
        {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
        {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
        {0, NULL, 0, NULL, NULL}