converted more mixed tab/space indentations to tabs. only whitespace changes.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 21 Apr 2011 15:53:30 +0000 (15:53 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 21 Apr 2011 15:53:30 +0000 (15:53 +0000)
117 files changed:
intern/guardedalloc/intern/mallocn.c
intern/guardedalloc/test/simpletest/memtest.c
release/plugins/sequence/blur.c
release/plugins/sequence/gamma.c
source/blender/avi/intern/options.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/boxpack2d.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/noise.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/winstuff.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/editcurve.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_constraints.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/scaling.c
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/tiff.c
source/blender/makesdna/intern/dna_genfile.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_controller.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_particle.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c
source/blender/nodes/intern/CMP_nodes/CMP_blur.c
source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c
source/blender/nodes/intern/CMP_nodes/CMP_crop.c
source/blender/nodes/intern/CMP_nodes/CMP_curves.c
source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c
source/blender/nodes/intern/CMP_nodes/CMP_image.c
source/blender/nodes/intern/CMP_nodes/CMP_invert.c
source/blender/nodes/intern/CMP_nodes/CMP_levels.c
source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c
source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c
source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c
source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c
source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c
source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c
source/blender/nodes/intern/CMP_nodes/CMP_viewer.c
source/blender/nodes/intern/CMP_util.c
source/blender/nodes/intern/SHD_nodes/SHD_curves.c
source/blender/nodes/intern/SHD_nodes/SHD_geom.c
source/blender/nodes/intern/SHD_nodes/SHD_mapping.c
source/blender/nodes/intern/SHD_nodes/SHD_material.c
source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c
source/blender/nodes/intern/TEX_nodes/TEX_curves.c
source/blender/nodes/intern/TEX_nodes/TEX_image.c
source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
source/blender/python/generic/IDProp.c
source/blender/python/generic/bgl.c
source/blender/python/generic/mathutils_geometry.c
source/blender/python/intern/bpy_props.c
source/blender/python/intern/bpy_rna.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/pixelblending.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_jobs.c
source/creator/creator.c

index caf551c84d829dd3410332219092152ae16aa3c7..55340d6011d9ea73954140761c6cc42c4b2c2361 100644 (file)
@@ -369,16 +369,16 @@ void *MEM_mapallocN(size_t len, const char *str)
        {
 #include <fcntl.h>
 
-         int fd;
-         fd = open("/dev/zero", O_RDWR);
+               int fd;
+               fd = open("/dev/zero", O_RDWR);
 
-         memh= mmap(0, len+sizeof(MemHead)+sizeof(MemTail),
-                       PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
-         close(fd);
+               memh= mmap(0, len+sizeof(MemHead)+sizeof(MemTail),
+                               PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+               close(fd);
        }
 #else
        memh= mmap(NULL, len+sizeof(MemHead)+sizeof(MemTail),
-                  PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANON, -1, 0);
+                       PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANON, -1, 0);
 #endif
 
        if(memh!=(MemHead *)-1) {
@@ -792,7 +792,7 @@ static const char *check_memlist(MemHead *memh)
                                forwok->nextname = backok->name;
                        } else{
                                forwok->next = NULL;
-                               membase->last = (struct localLink *) &forwok->next; 
+                               membase->last = (struct localLink *) &forwok->next;
 /*                             membase->last = (struct Link *) &forwok->next; */
                        }
                } else{
index 98f943f0d7d8d086442e82245f0b92014370048c..6b3af8b310c2d6fa88b43c4934519a5c1d0362c9 100644 (file)
@@ -60,7 +60,7 @@ int main (int argc, char *argv[])
        int i = 0;
 
        /* ----------------------------------------------------------------- */
-       switch (argc) {
+       switch (argc) {
        case 2:         
                verbose = atoi(argv[1]);
                if (verbose < 0) verbose = 0;
index c23a924ac6508f06274ad3cf8bc4c122e78f2b58..cec3351e976d753515bd088928a7dfa5a928035e 100644 (file)
@@ -41,7 +41,7 @@ char name[24]= "Blur";
 
 VarStruct varstr[]= {
        LABEL,                  "Input: 1 strip", 0.0, 0.0, 0.0, "", 
-       NUMSLI|FLO,             "Blur",         0.5,    0.0,    10.0, "Maximum filtersize", 
+       NUMSLI|FLO,             "Blur",         0.5,    0.0,    10.0, "Maximum filtersize",
        NUMSLI|FLO,             "Gamma",        1.0,    0.4,    2.0, "Gamma correction", 
        TOG|INT,                "Animated",     0.0,    0.0,    1.0, "For (Ipo) animated blur", 
        NUM|INT,                "debug",        0.0,    0.0,    2.0,
index e1380746cea6338c1988775bad00a56422d35ee5..7ce86fff34747fd30619a78fc0bd9b72850033c7 100644 (file)
@@ -85,7 +85,7 @@ static void make_gamma_table(float setup, float gain, float gamma,
        int y;
 
        for (y = 0; y < 256; y++) {
-               float v = 1.0 * y / 255;
+               float v = 1.0 * y / 255;
                v += setup;
                v *= gain;
                v = pow(v, gamma);
index 533bce2c8eab97ebd4fef5e92a018a5a1aac467d..edb708d8a691c349fb4cd4619cef9f571be2a916 100644 (file)
@@ -53,77 +53,77 @@ AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream,
        switch (option_type) {
        case AVI_OPTION_TYPE_MAIN:
                switch (option) {
-                       case AVI_OPTION_WIDTH:
-                               movie->header->Width = *((int *) opt_data);
-                               movie->header->SuggestedBufferSize = movie->header->Width*movie->header->Height*3;                              
-
-                               for (i=0; i < movie->header->Streams; i++) {
-                                       if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
-                                               ((AviBitmapInfoHeader *) movie->streams[i].sf)->Width = *((int *) opt_data);
-                                               movie->streams[i].sh.SuggestedBufferSize = movie->header->SuggestedBufferSize;
-                                               movie->streams[i].sh.right = *((int *) opt_data);
-                                               ((AviBitmapInfoHeader *) movie->streams[i].sf)->SizeImage = movie->header->SuggestedBufferSize;
-                                               fseek (movie->fp, movie->offset_table[1+i*2+1], SEEK_SET);
-                                               awrite (movie, movie->streams[i].sf, 1, movie->streams[i].sf_size, movie->fp, AVI_BITMAPH);
-                                       }
+               case AVI_OPTION_WIDTH:
+                       movie->header->Width = *((int *) opt_data);
+                       movie->header->SuggestedBufferSize = movie->header->Width*movie->header->Height*3;
+
+                       for (i=0; i < movie->header->Streams; i++) {
+                               if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
+                                       ((AviBitmapInfoHeader *) movie->streams[i].sf)->Width = *((int *) opt_data);
+                                       movie->streams[i].sh.SuggestedBufferSize = movie->header->SuggestedBufferSize;
+                                       movie->streams[i].sh.right = *((int *) opt_data);
+                                       ((AviBitmapInfoHeader *) movie->streams[i].sf)->SizeImage = movie->header->SuggestedBufferSize;
+                                       fseek (movie->fp, movie->offset_table[1+i*2+1], SEEK_SET);
+                                       awrite (movie, movie->streams[i].sf, 1, movie->streams[i].sf_size, movie->fp, AVI_BITMAPH);
                                }
+                       }
+
+                       break;
 
-                               break;
-                               
-                       case AVI_OPTION_HEIGHT:
-                               movie->header->Height = *((int *) opt_data);
-                               movie->header->SuggestedBufferSize = movie->header->Width*movie->header->Height*3;
-                               
-                               for (i=0; i < movie->header->Streams; i++) {
-                                       if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
-                                               ((AviBitmapInfoHeader *) movie->streams[i].sf)->Height = *((int *) opt_data);
-                                               movie->streams[i].sh.SuggestedBufferSize = movie->header->SuggestedBufferSize;
-                                               movie->streams[i].sh.bottom = *((int *) opt_data);
-                                               ((AviBitmapInfoHeader *) movie->streams[i].sf)->SizeImage = movie->header->SuggestedBufferSize;
-                                               fseek (movie->fp, movie->offset_table[1+i*2+1], SEEK_SET);
-                                               awrite (movie, movie->streams[i].sf, 1, movie->streams[i].sf_size, movie->fp, AVI_BITMAPH);
-                                       }
+               case AVI_OPTION_HEIGHT:
+                       movie->header->Height = *((int *) opt_data);
+                       movie->header->SuggestedBufferSize = movie->header->Width*movie->header->Height*3;
+
+                       for (i=0; i < movie->header->Streams; i++) {
+                               if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
+                                       ((AviBitmapInfoHeader *) movie->streams[i].sf)->Height = *((int *) opt_data);
+                                       movie->streams[i].sh.SuggestedBufferSize = movie->header->SuggestedBufferSize;
+                                       movie->streams[i].sh.bottom = *((int *) opt_data);
+                                       ((AviBitmapInfoHeader *) movie->streams[i].sf)->SizeImage = movie->header->SuggestedBufferSize;
+                                       fseek (movie->fp, movie->offset_table[1+i*2+1], SEEK_SET);
+                                       awrite (movie, movie->streams[i].sf, 1, movie->streams[i].sf_size, movie->fp, AVI_BITMAPH);
                                }
+                       }
+
+                       break;
 
-                               break;
-                               
-                       case AVI_OPTION_QUALITY:
-                               for (i=0; i < movie->header->Streams; i++) {
-                                       if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
-                                               movie->streams[i].sh.Quality = (*((int *) opt_data))*100;
-                                               fseek (movie->fp, movie->offset_table[1+i*2+1], SEEK_SET);
-                                               awrite (movie, movie->streams[i].sf, 1, movie->streams[i].sf_size, movie->fp, AVI_BITMAPH);                                             
-                                       }
+               case AVI_OPTION_QUALITY:
+                       for (i=0; i < movie->header->Streams; i++) {
+                               if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
+                                       movie->streams[i].sh.Quality = (*((int *) opt_data))*100;
+                                       fseek (movie->fp, movie->offset_table[1+i*2+1], SEEK_SET);
+                                       awrite (movie, movie->streams[i].sf, 1, movie->streams[i].sf_size, movie->fp, AVI_BITMAPH);
                                }
-                               break;
-                               
-                       case AVI_OPTION_FRAMERATE:
-                               if (1000000/(*((double *) opt_data)))
-                                       movie->header->MicroSecPerFrame = 1000000/(*((double *) opt_data));                                     
-
-                               for (i=0; i < movie->header->Streams; i++) {
-                                       if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
-                                               movie->streams[i].sh.Scale = movie->header->MicroSecPerFrame;
-                                               fseek (movie->fp, movie->offset_table[1+i*2+1], SEEK_SET);
-                                               awrite (movie, movie->streams[i].sf, 1, movie->streams[i].sf_size, movie->fp, AVI_BITMAPH);
-                                       }
+                       }
+                       break;
+
+               case AVI_OPTION_FRAMERATE:
+                       if (1000000/(*((double *) opt_data)))
+                               movie->header->MicroSecPerFrame = 1000000/(*((double *) opt_data));
+
+                       for (i=0; i < movie->header->Streams; i++) {
+                               if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
+                                       movie->streams[i].sh.Scale = movie->header->MicroSecPerFrame;
+                                       fseek (movie->fp, movie->offset_table[1+i*2+1], SEEK_SET);
+                                       awrite (movie, movie->streams[i].sf, 1, movie->streams[i].sf_size, movie->fp, AVI_BITMAPH);
                                }
-                               
+                       }
+
                }
 
-       fseek (movie->fp, movie->offset_table[0], SEEK_SET);
-       awrite (movie, movie->header, 1, sizeof(AviMainHeader), movie->fp, AVI_MAINH);
+               fseek (movie->fp, movie->offset_table[0], SEEK_SET);
+               awrite (movie, movie->header, 1, sizeof(AviMainHeader), movie->fp, AVI_MAINH);
 
-       break;
-  case AVI_OPTION_TYPE_STRH:
-       break;
-  case AVI_OPTION_TYPE_STRF:
-       break;
-  default:
-       return AVI_ERROR_OPTION;
-       break;
-  }
+               break;
+       case AVI_OPTION_TYPE_STRH:
+               break;
+       case AVI_OPTION_TYPE_STRF:
+               break;
+       default:
+               return AVI_ERROR_OPTION;
+               break;
+       }
 
-  return AVI_ERROR_NONE;
+       return AVI_ERROR_NONE;
 }
 
index 88b6ca296c7747ebd3f37f5cf580a8eb86486bca..ebdbbfcf7b4a5d1d1ed0586b7d54ada3b0320600 100644 (file)
@@ -856,10 +856,10 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
 #if 0
 static float projectPointOntoLine(float *p, float *a, float *b) 
 {
-   float ba[3], pa[3];
-   VECSUB(ba, b, a);
-   VECSUB(pa, p, a);
-   return INPR(pa, ba) / INPR(ba, ba);
+       float ba[3], pa[3];
+       VECSUB(ba, b, a);
+       VECSUB(pa, p, a);
+       return INPR(pa, ba) / INPR(ba, ba);
 }
 
 static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,float *out_normal) 
index f68533803e7cbe5cd03aadc3df972dd62280da8c..34e5fef8074b1700f7a140893d6376f4549540c4 100644 (file)
@@ -1026,19 +1026,19 @@ void forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int i
        rt2= 3.0f*(q0-2.0f*q1+q2)/f;
        f*= it;
        rt3= (q3-q0+3.0f*(q1-q2))/f;
-       
-         q0= rt0;
+
+       q0= rt0;
        q1= rt1+rt2+rt3;
        q2= 2*rt2+6*rt3;
        q3= 6*rt3;
-  
-         for(a=0; a<=it; a++) {
+
+       for(a=0; a<=it; a++) {
                *p= q0;
                p = (float *)(((char *)p)+stride);
                q0+= q1;
-                q1+= q2;
-                q2+= q3;
-        }
+               q1+= q2;
+               q2+= q3;
+       }
 }
 
 static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float *p3, float *p, int it, int stride)
@@ -1048,7 +1048,7 @@ static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float
         *
         * This could also be optimized like forward_diff_bezier */
        int a;
-         for(a=0; a<=it; a++) {
+       for(a=0; a<=it; a++) {
                float t = (float)a / (float)it;
 
                int i;
@@ -1057,7 +1057,7 @@ static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float
                }
                normalize_v3(p);
                p = (float *)(((char *)p)+stride);
-        }
+       }
 }
 
 /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@@ -1092,7 +1092,7 @@ float *make_orco_surf(Object *ob)
                sizev = nu->pntsv*resolv;
                if (nu->flagu & CU_NURB_CYCLIC) sizeu++;
                if (nu->flagv & CU_NURB_CYCLIC) sizev++;
-                if(nu->pntsv>1) tot+= sizeu * sizev;
+               if(nu->pntsv>1) tot+= sizeu * sizev;
                
                nu= nu->next;
        }
index 884d6313c26b767369e0de8d41b47e269cf11891..0696653d2e4c2c065168153d1fc283fa7b649ef5 100644 (file)
@@ -360,7 +360,7 @@ void flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP
                index= strrchr(name, '.'); // last occurrence
                if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever!
                        if(strip_number==0)
-                                BLI_strncpy(number, index, sizeof(number));
+                               BLI_strncpy(number, index, sizeof(number));
                        *index= 0;
                        len= BLI_strnlen(name, MAX_VGROUP_NAME);
                }
index 170b4c234466663922a74f688f645bc500dd13a9..94fbcd9ccb4a8aaf14b34ef01bec01661d902abf 100644 (file)
@@ -1092,10 +1092,10 @@ void graph_bfs(void)
                                        push_queue(nqueue,itA->node);
                                }
                                
-                                else {
+                               else {
                                        fprintf(stderr,"bfs not dag tree edge color :%i \n",itA->node->color);
                                }
-                                
+
                                
                                itA = itA->next;
                        }
@@ -1225,7 +1225,7 @@ DagNodeQueue * graph_dfs(void)
                while(nqueue->count) {
                        //graph_print_queue(nqueue);
 
-                        skip = 0;
+                       skip = 0;
                        node = get_top_node_queue(nqueue);
                        
                        minheight = pos[node->DFS_dist];
@@ -1253,7 +1253,7 @@ DagNodeQueue * graph_dfs(void)
                                                */
                                                /*if (node->DFS_dist >= itA->node->DFS_dist)
                                                        itA->node->DFS_dist = node->DFS_dist + 1;
-                                                       
+
                                                        fprintf(stderr,"dfs forward or cross edge :%15s %i-%i %15s %i-%i \n",
                                                                ((ID *) node->ob)->name,
                                                                node->DFS_dvtm, 
@@ -1287,17 +1287,17 @@ DagNodeQueue * graph_dfs(void)
                                /*
                                 fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );       
                                */
-                                push_stack(retqueue,node);
+                               push_stack(retqueue,node);
                                
                        }
                }
        }
                node = node->next;
        } while (node);
-//       fprintf(stderr,"i size : %i \n", maxpos);
-         
+//     fprintf(stderr,"i size : %i \n", maxpos);
+
        queue_delete(nqueue);
-         return(retqueue);
+       return(retqueue);
 }
 
 /* unused */
index c8e5998774dcb8550c50dee9a7d8ce19256e2b7c..b5194ca2f8965fac0b259b513016b084354b68f0 100644 (file)
@@ -1869,9 +1869,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
                   already applied, thats how it worked for years, so keep for compatibility (sergey) */
                copy_displist(&cu->disp, dispbase);
 
-                if (!forRender) {
-                        tex_space_curve(cu);
-                }
+               if (!forRender) {
+                       tex_space_curve(cu);
+               }
 
                if(!forOrco) curve_calc_modifiers_post(scene, ob, dispbase, derivedFinal, forRender, originalVerts, deformedVerts);
 
index 16f47f3cc59e9de3bdcb81198d7a650f5c137132..ae7738184381ef39f98cd158745524b8ca2ced15 100644 (file)
@@ -138,22 +138,22 @@ static int is_stl(const char *str)
        return 1;
 }
 
-#define READSTLVERT {                                   \
-  if (fread(mvert->co, sizeof(float), 3, fpSTL) != 3) { \
-       char error_msg[255];                                \
-       MEM_freeN(vertdata);                                \
-       MEM_freeN(facedata);                                \
-       fclose(fpSTL);                                      \
-       sprintf(error_msg, "Problems reading face %d!", i); \
-       return;                                             \
-  }                                                     \
-  else {                                                \
-       if (ENDIAN_ORDER==B_ENDIAN) {                       \
-         SWITCH_INT(mvert->co[0]);                         \
-         SWITCH_INT(mvert->co[1]);                         \
-         SWITCH_INT(mvert->co[2]);                         \
-       }                                                   \
-  }                                                     \
+#define READSTLVERT {                                             \
+       if (fread(mvert->co, sizeof(float), 3, fpSTL) != 3) {      \
+               char error_msg[255];                                \
+               MEM_freeN(vertdata);                                \
+               MEM_freeN(facedata);                                \
+               fclose(fpSTL);                                      \
+               sprintf(error_msg, "Problems reading face %d!", i); \
+               return;                                             \
+       }                                                          \
+       else {                                                     \
+               if (ENDIAN_ORDER==B_ENDIAN) {                       \
+                       SWITCH_INT(mvert->co[0]);                    \
+                       SWITCH_INT(mvert->co[1]);                    \
+                       SWITCH_INT(mvert->co[2]);                    \
+               }                                                   \
+       }                                                          \
 }
 
 static void simple_vertex_normal_blend(short *no, short *ble)
index 45cb62548874106858bc810f74bf8d30fc80b8e2..a8c7266b3fa44cd1f4df6024d248d79f16d8d4bc 100644 (file)
@@ -1003,15 +1003,15 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
                fp = fopen(filename, "rb+");
        }
 
-        if (!fp)
-                return NULL;
-       
+       if (!fp)
+               return NULL;
+
        pf= MEM_mallocN(sizeof(PTCacheFile), "PTCacheFile");
        pf->fp= fp;
        pf->old_format = 0;
        pf->frame = cfra;
-       
-        return pf;
+
+       return pf;
 }
 static void ptcache_file_close(PTCacheFile *pf)
 {
index 3dfef2e9d787211c43ee684f0d018761243bf951..aa91cff03b928243a69fc5d0f0a7caf59ef698bc 100644 (file)
@@ -1675,15 +1675,15 @@ float hyp3,hyp4,b4,b5
                                        output = in_band(wipezone,width,hyp,facf0,1,1);
                                else
                                        output = in_band(wipezone,width,hyp,facf0,0,1);
-                        }
+                       }
                        else {
                                if(b1 < b2)
                                        output = in_band(wipezone,width,hyp,facf0,0,1);
                                else
                                        output = in_band(wipezone,width,hyp,facf0,1,1);
-                        }
+                       }
                break;
-        
+
                case DO_DOUBLE_WIPE:
                        if(!wipe->forward)
                                facf0 = 1.0f-facf0;   // Go the other direction
@@ -1726,45 +1726,45 @@ float hyp3,hyp4,b4,b5
                                          output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
                        }
                        if(!wipe->forward)output = 1-output;
-                break;
-                case DO_CLOCK_WIPE:
+               break;
+               case DO_CLOCK_WIPE:
                          /*
                                  temp1: angle of effect center in rads
                                  temp2: angle of line through (halfx,halfy) and (x,y) in rads
                                  temp3: angle of low side of blur
                                  temp4: angle of high side of blur
                          */
-                        output = 1.0f - facf0;
-                        widthf = wipe->edgeWidth*2.0f*(float)M_PI;
-                         temp1 = 2.0f * (float)M_PI * facf0;
-                       
-                        if(wipe->forward){
-                                temp1 = 2.0f*(float)M_PI - temp1;
-                        }
-                       
-                         x = x - halfx;
-                         y = y - halfy;
-
-                         temp2 = asin(abs(y)/sqrt(x*x + y*y));
-                         if(x <= 0 && y >= 0) temp2 = (float)M_PI - temp2;
-                         else if(x<=0 && y <= 0) temp2 += (float)M_PI;
-                         else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2;
-
-                         if(wipe->forward){
-                                 temp3 = temp1-(widthf*0.5f)*facf0;
-                                 temp4 = temp1+(widthf*0.5f)*(1-facf0);
-                         } else{
-                                 temp3 = temp1-(widthf*0.5f)*(1-facf0);
-                                 temp4 = temp1+(widthf*0.5f)*facf0;
+                       output = 1.0f - facf0;
+                       widthf = wipe->edgeWidth*2.0f*(float)M_PI;
+                       temp1 = 2.0f * (float)M_PI * facf0;
+
+                       if(wipe->forward){
+                               temp1 = 2.0f*(float)M_PI - temp1;
+                       }
+
+                       x = x - halfx;
+                       y = y - halfy;
+
+                       temp2 = asin(abs(y)/sqrt(x*x + y*y));
+                       if(x <= 0 && y >= 0) temp2 = (float)M_PI - temp2;
+                       else if(x<=0 && y <= 0) temp2 += (float)M_PI;
+                       else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2;
+
+                       if(wipe->forward){
+                               temp3 = temp1-(widthf*0.5f)*facf0;
+                               temp4 = temp1+(widthf*0.5f)*(1-facf0);
+                       } else{
+                               temp3 = temp1-(widthf*0.5f)*(1-facf0);
+                               temp4 = temp1+(widthf*0.5f)*facf0;
                        }
-                         if (temp3 < 0) temp3 = 0;
-                         if (temp4 > 2.0f*(float)M_PI) temp4 = 2.0f*(float)M_PI;
-                       
-                       
-                         if(temp2 < temp3) output = 0;
-                         else if (temp2 > temp4) output = 1;
-                         else output = (temp2-temp3)/(temp4-temp3);
-                         if(x == 0 && y == 0) output = 1;
+                       if (temp3 < 0) temp3 = 0;
+                       if (temp4 > 2.0f*(float)M_PI) temp4 = 2.0f*(float)M_PI;
+
+
+                       if(temp2 < temp3) output = 0;
+                       else if (temp2 > temp4) output = 1;
+                       else output = (temp2-temp3)/(temp4-temp3);
+                       if(x == 0 && y == 0) output = 1;
                        if(output != output) output = 1;
                        if(wipe->forward) output = 1 - output;
                break;
@@ -1840,12 +1840,12 @@ float hyp3,hyp4,b4,b5
                        hwidth = width*0.5f;
 
                        temp1 = (halfx-(halfx)*facf0);
-                        pointdist = sqrt(temp1*temp1 + temp1*temp1);
-                
-                        temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y));
-                        if(temp2 > pointdist) output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,0,1);
-                        else output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,1,1);
-                
+                       pointdist = sqrt(temp1*temp1 + temp1*temp1);
+
+                       temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y));
+                       if(temp2 > pointdist) output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,0,1);
+                       else output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,1,1);
+
                        if(!wipe->forward) output = 1-output;
                        
                break;
index a765c9ee8f04037d2cd1866e984d6a1d27b3d563..b2e6f5290c30a21c1d8bf10dcc52744e04187bb0 100644 (file)
@@ -845,7 +845,7 @@ typedef struct SeqUniqueInfo {
 /*
 static void seqbase_unique_name(ListBase *seqbasep, Sequence *seq)
 {
-        BLI_uniquename(seqbasep, seq, "Sequence", '.', offsetof(Sequence, name), SEQ_NAME_MAXSTR);
+       BLI_uniquename(seqbasep, seq, "Sequence", '.', offsetof(Sequence, name), SEQ_NAME_MAXSTR);
 }*/
 
 static void seqbase_unique_name(ListBase *seqbasep, SeqUniqueInfo *sui)
index 90581870070c68c8b3721ce3c51c917ae57e9ec6..4405bce3d51522374c121e09bd6fb9e32621c4e9 100644 (file)
@@ -1470,20 +1470,20 @@ static float calc_voxel_transp(float *result, float *input, int res[3], int *pix
 
 long long smoke_get_mem_req(int xres, int yres, int zres, int amplify)
 {
-         int totalCells = xres * yres * zres;
-         int amplifiedCells = totalCells * amplify * amplify * amplify;
+       int totalCells = xres * yres * zres;
+       int amplifiedCells = totalCells * amplify * amplify * amplify;
 
-         // print out memory requirements
-         long long int coarseSize = sizeof(float) * totalCells * 22 +
-                                          sizeof(unsigned char) * totalCells;
+       // print out memory requirements
+       long long int coarseSize = sizeof(float) * totalCells * 22 +
+       sizeof(unsigned char) * totalCells;
 
-         long long int fineSize = sizeof(float) * amplifiedCells * 7 + // big grids
-                                        sizeof(float) * totalCells * 8 +     // small grids
-                                        sizeof(float) * 128 * 128 * 128;     // noise tile
+       long long int fineSize = sizeof(float) * amplifiedCells * 7 + // big grids
+       sizeof(float) * totalCells * 8 +     // small grids
+       sizeof(float) * 128 * 128 * 128;     // noise tile
 
-         long long int totalMB = (coarseSize + fineSize) / (1024 * 1024);
+       long long int totalMB = (coarseSize + fineSize) / (1024 * 1024);
 
-         return totalMB;
+       return totalMB;
 }
 
 static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, float *tRay, bresenham_callback cb, float *result, float *input, int res[3], float correct)
index 0578b15527223f5df4a3e7fa7b4277386e179bbb..30d2816769c9a250db755bccb7477fab29dd3883 100644 (file)
@@ -1648,12 +1648,12 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
 
 static void scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow)
 {
-  SoftBody *sb = ob->soft;
-  ListBase *do_effector = NULL;
+       SoftBody *sb = ob->soft;
+       ListBase *do_effector = NULL;
 
-  do_effector = pdInitEffectors(scene, ob, NULL, sb->effector_weights);
-  _scan_for_ext_spring_forces(scene, ob, timenow, 0, sb->totspring, do_effector);
-  pdEndEffectors(&do_effector);
+       do_effector = pdInitEffectors(scene, ob, NULL, sb->effector_weights);
+       _scan_for_ext_spring_forces(scene, ob, timenow, 0, sb->totspring, do_effector);
+       pdEndEffectors(&do_effector);
 }
 
 static void *exec_scan_for_ext_spring_forces(void *data)
@@ -2216,50 +2216,50 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
                /* naive ball self collision */
                /* needs to be done if goal snaps or not */
                if(do_selfcollision){
-                                int attached;
-                               BodyPoint   *obp;
-                               BodySpring *bs;
-                               int c,b;
-                               float velcenter[3],dvel[3],def[3];
-                               float distance;
-                               float compare;
-                                float bstune = sb->ballstiff;
-
-                               for(c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) {
-                                       compare = (obp->colball + bp->colball);
-                                       sub_v3_v3v3(def, bp->pos, obp->pos);
-                                       /* rather check the AABBoxes before ever calulating the real distance */
-                                       /* mathematically it is completly nuts, but performace is pretty much (3) times faster */
-                                       if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
-                                       distance = normalize_v3(def);
-                                       if (distance < compare ){
-                                               /* exclude body points attached with a spring */
-                                               attached = 0;
-                                               for(b=obp->nofsprings;b>0;b--){
-                                                       bs = sb->bspring + obp->springs[b-1];
-                                                       if (( ilast-bb == bs->v2)  || ( ilast-bb == bs->v1)){
-                                                               attached=1;
-                                                               continue;}
-                                               }
-                                               if (!attached){
-                                                       float f = bstune/(distance) + bstune/(compare*compare)*distance - 2.0f*bstune/compare ;
+                       int attached;
+                       BodyPoint   *obp;
+                       BodySpring *bs;
+                       int c,b;
+                       float velcenter[3],dvel[3],def[3];
+                       float distance;
+                       float compare;
+                       float bstune = sb->ballstiff;
+
+                       for(c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) {
+                               compare = (obp->colball + bp->colball);
+                               sub_v3_v3v3(def, bp->pos, obp->pos);
+                               /* rather check the AABBoxes before ever calulating the real distance */
+                               /* mathematically it is completly nuts, but performace is pretty much (3) times faster */
+                               if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
+                               distance = normalize_v3(def);
+                               if (distance < compare ){
+                                       /* exclude body points attached with a spring */
+                                       attached = 0;
+                                       for(b=obp->nofsprings;b>0;b--){
+                                               bs = sb->bspring + obp->springs[b-1];
+                                               if (( ilast-bb == bs->v2)  || ( ilast-bb == bs->v1)){
+                                                       attached=1;
+                                                       continue;}
+                                       }
+                                       if (!attached){
+                                               float f = bstune/(distance) + bstune/(compare*compare)*distance - 2.0f*bstune/compare ;
 
-                                                       mid_v3_v3v3(velcenter, bp->vec, obp->vec);
-                                                       sub_v3_v3v3(dvel,velcenter,bp->vec);
-                                                       mul_v3_fl(dvel,_final_mass(ob,bp));
+                                               mid_v3_v3v3(velcenter, bp->vec, obp->vec);
+                                               sub_v3_v3v3(dvel,velcenter,bp->vec);
+                                               mul_v3_fl(dvel,_final_mass(ob,bp));
 
-                                                       Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
-                                                       Vec3PlusStVec(bp->force,sb->balldamp,dvel);
+                                               Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
+                                               Vec3PlusStVec(bp->force,sb->balldamp,dvel);
 
-                                                       /* exploit force(a,b) == -force(b,a) part2/2 */
-                                                       sub_v3_v3v3(dvel,velcenter,obp->vec);
-                                                       mul_v3_fl(dvel,_final_mass(ob,bp));
+                                               /* exploit force(a,b) == -force(b,a) part2/2 */
+                                               sub_v3_v3v3(dvel,velcenter,obp->vec);
+                                               mul_v3_fl(dvel,_final_mass(ob,bp));
 
-                                                       Vec3PlusStVec(obp->force,sb->balldamp,dvel);
-                                                       Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
-                                               }
+                                               Vec3PlusStVec(obp->force,sb->balldamp,dvel);
+                                               Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
                                        }
                                }
+                       }
                }
                /* naive ball self collision done */
 
@@ -2930,7 +2930,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
 /* now we have individual masses   */
 /* claim a minimum mass for vertex */
                if (_final_mass(ob,bp) > 0.009999f) timeovermass = forcetime/_final_mass(ob,bp);
-                 else timeovermass = forcetime/0.009999f;
+               else timeovermass = forcetime/0.009999f;
 
 
                if(_final_goal(ob,bp) < SOFTGOALSNAP){
index 73e23bd2a051195407729ee8129a2a89da2234bc..ba7f9bdd41547bfae02ab76c25c92e04220cb4b9 100644 (file)
@@ -158,7 +158,7 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL
        avi = MEM_mallocN (sizeof(AviMovie), "avimovie");
 
        /* RPW 11-21-2002 
-        if (rd->imtype != AVI_FORMAT_MJPEG) format = AVI_FORMAT_AVI_RGB;
+       if (rd->imtype != AVI_FORMAT_MJPEG) format = AVI_FORMAT_AVI_RGB;
        */
        if (rd->imtype != R_AVIJPEG ) format = AVI_FORMAT_AVI_RGB;
        else format = AVI_FORMAT_MJPEG;
index 0144dea3960195ed4b0bf76fd4f27bf9abb7fee4..ff08ef4dba94fb7fd3a2c8551cf630fc86a8c04a 100644 (file)
@@ -175,7 +175,7 @@ unsigned int BLI_ghashutil_inthash(const void *ptr) {
        key += ~(key <<  9);
        key ^=  (key >> 17);
 
-         return (unsigned int)(key & 0xffffffff);
+       return (unsigned int)(key & 0xffffffff);
 }
 
 int BLI_ghashutil_intcmp(const void *a, const void *b) {
index 4c16363f6d37097793a89d247296c01953c372cc..8c7e097d2398e261f9a6623c5147c16c1cca66b5 100644 (file)
@@ -174,7 +174,7 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
        vertex_pack_indices = MEM_mallocN( len*3*sizeof(int), "boxPack Indices");
        
        for (box=boxarray, box_index=0, i=0; box_index < len; box_index++, box++) {
-                               
+
                vert->blb = vert->brb = vert->tlb =\
                        vert->isect_cache[0] = vert->isect_cache[1] =\
                        vert->isect_cache[2] = vert->isect_cache[3] = NULL;
@@ -260,17 +260,17 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
                                if (vert->free & quad_flags[j]) {
                                        switch (j) {
                                        case BL:
-                                                SET_BOXRIGHT(box, vert->x);
-                                                SET_BOXTOP(box, vert->y);
-                                                break;
+                                               SET_BOXRIGHT(box, vert->x);
+                                               SET_BOXTOP(box, vert->y);
+                                               break;
                                        case TR:
-                                                SET_BOXLEFT(box, vert->x);
-                                                SET_BOXBOTTOM(box, vert->y);
-                                                break;
+                                               SET_BOXLEFT(box, vert->x);
+                                               SET_BOXBOTTOM(box, vert->y);
+                                               break;
                                        case TL:
-                                                SET_BOXRIGHT(box, vert->x);
-                                                SET_BOXBOTTOM(box, vert->y);
-                                                break;
+                                               SET_BOXRIGHT(box, vert->x);
+                                               SET_BOXBOTTOM(box, vert->y);
+                                               break;
                                        case BR:
                                                SET_BOXLEFT(box, vert->x);
                                                SET_BOXTOP(box, vert->y);
index 2407078fc76a0b8d571c3063ca1550f80ba5d99a..2e0f4b483b14f2ade2c4a93b3a6a8fb78d4806b1 100644 (file)
@@ -133,13 +133,13 @@ int BLI_is_writable(const char *filename)
 
 int BLI_touch(const char *file)
 {
-   FILE *f = fopen(file,"r+b");
-   if (f != NULL) {
+       FILE *f = fopen(file,"r+b");
+       if (f != NULL) {
                char c = getc(f);
                rewind(f);
                putc(c,f);
        } else {
-          f = fopen(file,"wb");
+               f = fopen(file,"wb");
        }
        if (f) {
                fclose(f);
index 42a9587596e0ff401a9c23183ad8735124756ed9..4af56c66dde01e36c8fcee6f3d033912b4962410 100644 (file)
@@ -99,7 +99,7 @@ float area_tri_v2(const float v1[2], const float v2[2], const float v3[2])
 
 float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2])
 {
-   return 0.5f * ((v1[0]-v2[0])*(v2[1]-v3[1]) + (v1[1]-v2[1])*(v3[0]-v2[0]));
+       return 0.5f * ((v1[0]-v2[0])*(v2[1]-v3[1]) + (v1[1]-v2[1])*(v3[0]-v2[0]));
 }
 
 float area_quad_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])  /* only convex Quadrilaterals */
@@ -1524,22 +1524,22 @@ void interp_weights_face_v3(float w[4], const float v1[3], const float v2[3], co
  * note: using area_tri_signed_v2 means locations outside the triangle are correctly weighted */
 void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3])
 {
-   float wtot_inv, wtot;
+       float wtot_inv, wtot;
 
-   w[0] = area_tri_signed_v2(v2, v3, co);
-   w[1] = area_tri_signed_v2(v3, v1, co);
-   w[2] = area_tri_signed_v2(v1, v2, co);
-   wtot = w[0]+w[1]+w[2];
+       w[0] = area_tri_signed_v2(v2, v3, co);
+       w[1] = area_tri_signed_v2(v3, v1, co);
+       w[2] = area_tri_signed_v2(v1, v2, co);
+       wtot = w[0]+w[1]+w[2];
 
-   if (wtot != 0.0f) {
-          wtot_inv = 1.0f/wtot;
+       if (wtot != 0.0f) {
+               wtot_inv = 1.0f/wtot;
 
-          w[0] = w[0]*wtot_inv;
-          w[1] = w[1]*wtot_inv;
-          w[2] = w[2]*wtot_inv;
-   }
-   else /* dummy values for zero area face */
-          w[0] = w[1] = w[2] = 1.0f/3.0f;
+               w[0] = w[0]*wtot_inv;
+               w[1] = w[1]*wtot_inv;
+               w[2] = w[2]*wtot_inv;
+       }
+       else /* dummy values for zero area face */
+               w[0] = w[1] = w[2] = 1.0f/3.0f;
 }
 
 /* given 2 triangles in 3D space, and a point in relation to the first triangle.
index 9a36f0006240f27b557435f1727199a314cd642c..75520bb8ba087c9de31090c23df4c55881fb23a2 100644 (file)
@@ -315,7 +315,7 @@ MINLINE float dot_v3v3(const float a[3], const float b[3])
 
 MINLINE float cross_v2v2(const float a[2], const float b[2])
 {
-        return a[0]*b[1] - a[1]*b[0];
+       return a[0]*b[1] - a[1]*b[0];
 }
 
 MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
index 49a09dd7b15f39e759f3d3d91cd29deadf8abfe0..5d80edebbef53a85bc88a14c2c381c3f4f916097 100644 (file)
@@ -1098,7 +1098,7 @@ static float dist_Minkovsky4(float x, float y, float z, float e)
 /* Minkovsky, general case, slow, maybe too slow to be useful */
 static float dist_Minkovsky(float x, float y, float z, float e)
 {
- return pow(pow(fabs(x), e) + pow(fabs(y), e) + pow(fabs(z), e), 1.0/e);
      return pow(pow(fabs(x), e) + pow(fabs(y), e) + pow(fabs(z), e), 1.0/e);
 }
 
 
@@ -1275,18 +1275,18 @@ static float voronoi_CrS(float x, float y, float z)
 /* returns unsigned cellnoise */
 static float cellNoiseU(float x, float y, float z)
 {
-  int xi = (int)(floor(x));
-  int yi = (int)(floor(y));
-  int zi = (int)(floor(z));
-  unsigned int n = xi + yi*1301 + zi*314159;
-  n ^= (n<<13);
-  return ((float)(n*(n*n*15731 + 789221) + 1376312589) / 4294967296.0);
+       int xi = (int)(floor(x));
+       int yi = (int)(floor(y));
+       int zi = (int)(floor(z));
+       unsigned int n = xi + yi*1301 + zi*314159;
+       n ^= (n<<13);
+       return ((float)(n*(n*n*15731 + 789221) + 1376312589) / 4294967296.0);
 }
 
 /* idem, signed */
 float cellNoise(float x, float y, float z)
 {
-  return (2.0*cellNoiseU(x, y, z)-1.0);
+       return (2.0*cellNoiseU(x, y, z)-1.0);
 }
 
 /* returns a vector/point/color in ca, using point hasharray directly */
index f7115b4d46f057c3d2fb3fe4870d2be73225c341..73d6588b97fe9df8b45eec5eb7d9163b43e589ca 100644 (file)
@@ -324,8 +324,8 @@ void BLI_cleanup_path(const char *relabase, char *dir)
        /* Note, this should really be moved to the file selector,
         * since this function is used in many areas */
        if(strcmp(dir, ".")==0) {       /* happens for example in FILE_MAIN */
-          get_default_root(dir);
-          return;
+               get_default_root(dir);
+               return;
        }       
 
        while ( (start = strstr(dir, "\\..\\")) ) {
@@ -353,9 +353,9 @@ void BLI_cleanup_path(const char *relabase, char *dir)
        }
 #else
        if(dir[0]=='.') {       /* happens, for example in FILE_MAIN */
-          dir[0]= '/';
-          dir[1]= 0;
-          return;
+               dir[0]= '/';
+               dir[1]= 0;
+               return;
        }
 
        /* support for odd paths: eg /../home/me --> /home/me
@@ -525,7 +525,7 @@ int BLI_parent_dir(char *path)
        BLI_add_slash(tmp);
        strcat(tmp, parent_dir);
        BLI_cleanup_dir(NULL, tmp);
-       
+
        if (!BLI_testextensie(tmp, parent_dir)) {
                BLI_strncpy(path, tmp, sizeof(tmp));    
                return 1;
index 90754e7d2bb51df61e0bcafd9fce049895a77e8c..596ab2b04703eb6fe89777f71fbd64e4f91e907b 100644 (file)
@@ -307,21 +307,21 @@ int check_file_chars(char *filename)
 #include <string.h>
 char* dirname(char *path)
 {
-          char *p;
-          if( path == NULL || *path == '\0' )
-                          return ".";
-          p = path + strlen(path) - 1;
-          while( *p == '/' ) {
-                          if( p == path )
-                                          return path;
-                          *p-- = '\0';
-          }
-          while( p >= path && *p != '/' )
-                          p--;
-          return
-                          p < path ? "." :
-                          p == path ? "/" :
-                          (*p = '\0', path);
+       char *p;
+       if( path == NULL || *path == '\0' )
+       return ".";
+       p = path + strlen(path) - 1;
+       while( *p == '/' ) {
+               if( p == path )
+                       return path;
+               *p-- = '\0';
+       }
+       while( p >= path && *p != '/' )
+       p--;
+       return
+       p < path ? "." :
+       p == path ? "/" :
+       (*p = '\0', path);
 }
 /* End of copied part */
 
index e4e61e49e90ee5d032a03e89344ce92290792eb3..08f9b655fac62c619b3ec6611e32e462036d60ba 100644 (file)
@@ -1206,7 +1206,7 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain)
        
        /* used entries were restored, so we put them to zero */
        for (i=0; i<fd->imamap->nentries; i++, entry++) {
-                if (entry->nr>0)
+               if (entry->nr>0)
                        entry->newp= NULL;
        }
        
@@ -6516,7 +6516,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                
                                ar->v2d.max[0]= MAXFRAMEF;
                                ar->v2d.max[1]= FLT_MAX;
-                               
+
                                ar->v2d.minzoom= 0.01f;
                                ar->v2d.maxzoom= 50;
                                ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
index adfc9ee8113c5a01e1755af2994c6c591c7b6cd7..23f91f88c8d905b0a11baeca35ba37b85619224f 100644 (file)
@@ -2724,7 +2724,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *UNUSED(op))
 
        /* cancel if nothing selected */
        if (CTX_DATA_COUNT(C, selected_bones) == 0)
-         return OPERATOR_CANCELLED;
+               return OPERATOR_CANCELLED;
        
        ED_armature_sync_selection(arm->edbo); // XXX why is this needed?
 
@@ -5806,7 +5806,7 @@ EditBone * test_subdivideByCorrelation(Scene *scene, Object *obedit, ReebArc *ar
                lastBone = subdivideArcBy(arm, arm->edbo, iter, invmat, tmat, nextAdaptativeSubdivision);
        }
        
-         return lastBone;
+       return lastBone;
 }
 
 float arcLengthRatio(ReebArc *arc)
index bd05f7f6581bad2672d80f70b34d2e367f10bd1c..b750bd5ef1c3f2ab65bbe26356767581d20dc368 100644 (file)
@@ -1536,7 +1536,7 @@ RigGraph *RIG_graphFromArmature(const bContext *C, Object *ob, bArmature *arm)
        Scene *scene = CTX_data_scene(C);
        EditBone *ebone;
        RigGraph *rg;
-       
+
        rg = newRigGraph();
        
        if (obedit == ob)
@@ -1588,7 +1588,7 @@ static RigGraph *armatureSelectedToGraph(bContext *C, Object *ob, bArmature *arm
        Scene *scene = CTX_data_scene(C);
        EditBone *ebone;
        RigGraph *rg;
-       
+
        rg = newRigGraph();
        
        if (obedit == ob)
@@ -2829,7 +2829,7 @@ void BIF_retargetArmature(bContext *C)
                {
                        RigGraph *rigg;
                        bArmature *arm;
-                       
+
                        arm = ob->data;
                
                        /* Put the armature into editmode */
index 566ccd7cd3f1837ce8ba2245e6030dfb91f5cdd1..b99605e65c18e41b4fcf3794fd3f8881214cc142 100644 (file)
@@ -1123,7 +1123,7 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
        det = INPR(edge1, pvec);
 
        if (det == 0.0f)
-         return 0;
+               return 0;
        inv_det = 1.0f / det;
 
        /* calculate distance from vert0 to ray origin */
@@ -1132,7 +1132,7 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
        /* calculate U parameter and test bounds */
        u = INPR(tvec, pvec) * inv_det;
        if (u < -EPSILON || u > 1.0f+EPSILON)
-         return 0;
+               return 0;
 
        /* prepare to test V parameter */
        cross_v3_v3v3(qvec, tvec, edge1);
@@ -1140,7 +1140,7 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
        /* calculate V parameter and test bounds */
        v = INPR(dir, qvec) * inv_det;
        if (v < -EPSILON || u + v > 1.0f+EPSILON)
-         return 0;
+               return 0;
 
        isectco[0]= (1.0f - u - v)*vert0[0] + u*vert1[0] + v*vert2[0];
        isectco[1]= (1.0f - u - v)*vert0[1] + u*vert1[1] + v*vert2[1];
index 490d4c587f99b49c75eda6e23821ac23a6f6ba3b..04501243acb346ae59a045a3ebc288ac266dd860 100644 (file)
@@ -2572,7 +2572,7 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions)
        int totfaces;
        int countfaces = 0;
 #endif
-       
+
        rg = newReebGraph();
        
        rg->resolution = subdivisions;
index 68f45c5fdb4f8e3a33c3fd179f5adb0c9fc124d2..bea5a729f31318497a4b28bc20f742072c164891 100644 (file)
@@ -2855,7 +2855,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
        int a, b, sel, amount, *usel, *vsel, i;
        float factor;
 
-   // printf("*** subdivideNurb: entering subdivide\n");
+       // printf("*** subdivideNurb: entering subdivide\n");
 
        for(nu= editnurb->nurbs.first; nu; nu= nu->next) {
                amount= 0;
@@ -3231,8 +3231,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
                                                MEM_freeN(nu->bp);
                                                nu->bp= bpnew;
                                                nu->pntsu+= sel;
-                                               nurbs_knot_calc_u(nu); /* shift knots
-                                                                                                        forward */
+                                               nurbs_knot_calc_u(nu); /* shift knots forward */
                                        }
                                }
                        }
@@ -4997,8 +4996,8 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
        int a, location[2], deselect;
 
        deselect= RNA_boolean_get(op->ptr, "deselect");
-       location[0]= event->x - ar->winrct.xmin;
-       location[1]= event->y - ar->winrct.ymin;
+       location[0]= event->x - ar->winrct.xmin;
+       location[1]= event->y - ar->winrct.ymin;
 
        view3d_operator_needs_opengl(C);
        view3d_set_viewcontext(C, &vc);
index fc29a18154a233e511f212e71e6a7b6c3f133cfe..90a83009c4dee6f537f63b30499c97947abe0494 100644 (file)
@@ -1171,13 +1171,13 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
 
 
 /*   uiWidgetStateColors
- char inner_anim[4];
- char inner_anim_sel[4];
- char inner_key[4];
- char inner_key_sel[4];
- char inner_driven[4];
- char inner_driven_sel[4];
- float blend;
      char inner_anim[4];
      char inner_anim_sel[4];
      char inner_key[4];
      char inner_key_sel[4];
      char inner_driven[4];
      char inner_driven_sel[4];
      float blend;
  
 */
 
@@ -1192,15 +1192,15 @@ static struct uiWidgetStateColors wcol_state_colors= {
 };
 
 /*  uiWidgetColors
- float outline[3];
- float inner[4];
- float inner_sel[4];
- float item[3];
- float text[3];
- float text_sel[3];
-
- short shaded;
- float shadetop, shadedown;
      float outline[3];
      float inner[4];
      float inner_sel[4];
      float item[3];
      float text[3];
      float text_sel[3];
+
      short shaded;
      float shadetop, shadedown;
 */     
 
 static struct uiWidgetColors wcol_num= {
index dc1023952a6f31f45076707d82e65704f1cf2c24..83840f0f4cbcf1538a1db19d41f4a768ef7ea190 100644 (file)
@@ -2755,7 +2755,7 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float
 
                                // Beauty Long Edges
                                else {
-                                        for(j=0;j<2;j++) {
+                                       for(j=0;j<2;j++) {
                                                hold = -1;
                                                for(i=0;i<4;i++) {
                                                        if(length[i] < 0) {
@@ -2969,8 +2969,8 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float
                        }
                }
        }
-        if(em->selectmode & SCE_SELECT_VERTEX) {
-                for(eed = em->edges.first;eed;eed = eed->next) {
+       if(em->selectmode & SCE_SELECT_VERTEX) {
+               for(eed = em->edges.first;eed;eed = eed->next) {
                        if(eed->f & SELECT) {
                                eed->v1->f |= SELECT;
                                eed->v2->f |= SELECT;
@@ -3643,7 +3643,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir)
                return;
 
        /* how many edges does each face have */
-        if(face[0]->e4) fac1= 4;
+       if(face[0]->e4) fac1= 4;
        else fac1= 3;
 
        if(face[1]->e4) fac2= 4;
@@ -4061,8 +4061,8 @@ useless:
                }
                // Make sure loop is not 2 edges of same face
                if(ct > 1) {
-                  BKE_report(op->reports, RPT_ERROR, "Loop crosses itself");
-                  return 0;
+                       BKE_report(op->reports, RPT_ERROR, "Loop crosses itself");
+                       return 0;
                }
        }
        // Get # of selected verts
@@ -4179,11 +4179,11 @@ useless:
                        for(eed=em->edges.first;eed;eed=eed->next) {
                                if(editedge_containsVert(eed, ev)) {
                                        if(!(eed->f & SELECT)) {
-                                                if(!tempsv->up) {
-                                                        tempsv->up = eed;
-                                                } else if (!(tempsv->down)) {
-                                                        tempsv->down = eed;
-                                                }
+                                               if(!tempsv->up) {
+                                                       tempsv->up = eed;
+                                               } else if (!(tempsv->down)) {
+                                                       tempsv->down = eed;
+                                               }
                                        }
                                }
                        }
@@ -4195,33 +4195,33 @@ useless:
                                        for(efa = em->faces.first;efa;efa=efa->next) {
                                                if(editface_containsEdge(efa, eed)) {
                                                        if(editedge_containsVert(efa->e1, ev) && efa->e1 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e1;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e1;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e1;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e1;
+                                                               }
                                                        }
                                                        if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e2;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e2;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e2;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e2;
+                                                               }
                                                        }
                                                        if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e3;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e3;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e3;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e3;
+                                                               }
                                                        }
                                                        if(efa->e4) {
                                                                if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) {
-                                                                        if(!tempsv->up) {
-                                                                                tempsv->up = efa->e4;
-                                                                        } else if (!(tempsv->down)) {
-                                                                                tempsv->down = efa->e4;
-                                                                        }
+                                                                       if(!tempsv->up) {
+                                                                               tempsv->up = efa->e4;
+                                                                       } else if (!(tempsv->down)) {
+                                                                               tempsv->down = efa->e4;
+                                                                       }
                                                                }
                                                        }
 
@@ -4665,7 +4665,7 @@ useless:
                                                        mvalo[0] = -1;
                                        } else if(ELEM(event, RIGHTARROWKEY, WHEELUPMOUSE)) { // Scroll through Control Edges
                                                look = vertlist;
-                                                while(look) {
+                                               while(look) {
                                                        if(nearest == (EditVert*)look->link) {
                                                                if(look->next == NULL) {
                                                                        nearest =  (EditVert*)vertlist->link;
@@ -4679,7 +4679,7 @@ useless:
                                                }
                                        } else if(ELEM(event, LEFTARROWKEY, WHEELDOWNMOUSE)) { // Scroll through Control Edges
                                                look = vertlist;
-                                                while(look) {
+                                               while(look) {
                                                        if(look->next) {
                                                                if(look->next->link == nearest) {
                                                                        nearest = (EditVert*)look->link;
@@ -4817,7 +4817,7 @@ void mesh_set_face_flags(EditMesh *em, short mode)
        add_numbut(12, TOG|SHO, "Sort", 0, 0, &m_sort, NULL);
 
        if (!do_clever_numbuts((mode ? "Set Flags" : "Clear Flags"), 13, REDRAW))
-                return;
+               return;
 
        /* these 2 cant both be on */
        if (mode) /* are we seeting*/
index 901f3d7c5f1fa4aaef284d24c775565ab63b3fb5..56a27da54df7a3ba810f09c655ebe75365e7d9ff 100644 (file)
@@ -3346,7 +3346,7 @@ static int open_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSE
 {
        if(drag->type==WM_DRAG_PATH) {
                if(drag->icon==ICON_FILE_BLEND)
-                  return 1;
+                       return 1;
        }
        return 0;
 }
index 01a9a75ca13d38d2b7d6f28450fae48505b2737e..5caf72a4a2f788915aa4f35e598fded021de565c 100644 (file)
@@ -486,22 +486,22 @@ static int project_bucket_offset_safe(const ProjPaintState *ps, const float proj
 /* still use 2D X,Y space but this works for verts transformed by a perspective matrix, using their 4th component as a weight */
 static void barycentric_weights_v2_persp(float v1[4], float v2[4], float v3[4], float co[2], float w[3])
 {
-   float wtot_inv, wtot;
+       float wtot_inv, wtot;
 
-   w[0] = area_tri_signed_v2(v2, v3, co) / v1[3];
-   w[1] = area_tri_signed_v2(v3, v1, co) / v2[3];
-   w[2] = area_tri_signed_v2(v1, v2, co) / v3[3];
-   wtot = w[0]+w[1]+w[2];
+       w[0] = area_tri_signed_v2(v2, v3, co) / v1[3];
+       w[1] = area_tri_signed_v2(v3, v1, co) / v2[3];
+       w[2] = area_tri_signed_v2(v1, v2, co) / v3[3];
+       wtot = w[0]+w[1]+w[2];
 
-   if (wtot != 0.0f) {
-          wtot_inv = 1.0f/wtot;
+       if (wtot != 0.0f) {
+               wtot_inv = 1.0f/wtot;
 
-          w[0] = w[0]*wtot_inv;
-          w[1] = w[1]*wtot_inv;
-          w[2] = w[2]*wtot_inv;
-   }
-   else /* dummy values for zero area face */
-          w[0] = w[1] = w[2] = 1.0f/3.0f;
+               w[0] = w[0]*wtot_inv;
+               w[1] = w[1]*wtot_inv;
+               w[2] = w[2]*wtot_inv;
+       }
+       else /* dummy values for zero area face */
+               w[0] = w[1] = w[2] = 1.0f/3.0f;
 }
 
 static float VecZDepthOrtho(float pt[2], float v1[3], float v2[3], float v3[3], float w[3])
@@ -1740,7 +1740,7 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s
         */
        
        if((bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) || (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]) ) {
-          return 1;
+               return 1;
        }
        
        /* out of bounds left */
index e8731391352a2ce8e071f8883940ef4c002f57b7..10a1fe62ccafb1c2c9baac1b26b16a301cdd9c89 100644 (file)
@@ -112,7 +112,7 @@ static SpaceLink *action_new(const bContext *C)
        
        ar->v2d.max[0]= MAXFRAMEF;
        ar->v2d.max[1]= FLT_MAX;
-       
+
        ar->v2d.minzoom= 0.01f;
        ar->v2d.maxzoom= 50;
        ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
index 17e7b1b5b18526999dd951b3cd8420383d3a3832..fb1144b4fa85930dc8d541353e08e7dd7da9ec5e 100644 (file)
@@ -766,7 +766,7 @@ void GRAPH_OT_properties(wmOperatorType *ot)
        
        ot->exec= graph_properties;
        ot->poll= ED_operator_graphedit_active;
-       
+
        /* flags */
        ot->flag= 0;
 }
index 3dffb924434518aac74444e2de181184e89821d7..52b48e1f9fdeea0efb0ae44b40b7de365873b693 100644 (file)
@@ -447,7 +447,7 @@ static int is_preview_allowed(ScrArea *cur)
        for(sa=G.curscreen->areabase.first; sa; sa= sa->next) {
                if(sa!=cur && sa->spacetype==SPACE_IMAGE) {
                        if(image_preview_active(sa, NULL, NULL))
-                          return 0;
+                               return 0;
                }
        }
        /* check image type */
index 8030bffae2d2fa9c19a3cbb79f8bf71529afddc7..85d36ea9b29013df35f5035296e38dcbc7384ac3 100644 (file)
@@ -188,7 +188,7 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f
                        sprintf(str, "  R:%-.4f", fp[0]);
                else if (cp)
                        sprintf(str, "  R:%-3d", cp[0]);
-               else
+               else
                        sprintf(str, "  R:-");
                BLF_position(blf_mono_font, dx, 6, 0);
                BLF_draw_ascii(blf_mono_font, str, sizeof(str));
@@ -199,7 +199,7 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f
                        sprintf(str, "  G:%-.4f", fp[1]);
                else if (cp)
                        sprintf(str, "  G:%-3d", cp[1]);
-               else
+               else
                        sprintf(str, "  G:-");
                BLF_position(blf_mono_font, dx, 6, 0);
                BLF_draw_ascii(blf_mono_font, str, sizeof(str));
@@ -210,7 +210,7 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f
                        sprintf(str, "  B:%-.4f", fp[2]);
                else if (cp)
                        sprintf(str, "  B:%-3d", cp[2]);
-               else
+               else
                        sprintf(str, "  B:-");
                BLF_position(blf_mono_font, dx, 6, 0);
                BLF_draw_ascii(blf_mono_font, str, sizeof(str));
index 9cea8d4f220db88beef840afa99bcbc7425a52d3..61c999f51abae0d1ca2055aaceca228dc658713d 100644 (file)
@@ -768,13 +768,13 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
        Image *ima= NULL;
 
        if(sima) {
-                ima= sima->image;
+               ima= sima->image;
        }
 
        if (ima==NULL) {
-                Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
-                if(tex && tex->type==TEX_IMAGE)
-                        ima= tex->ima;
+               Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
+               if(tex && tex->type==TEX_IMAGE)
+                       ima= tex->ima;
        }
 
        if(ima)
index db8eff11498beee40c312e61418f9375a380cc82..bce492f5a040ae4e1ade57cc7330407599d40960 100644 (file)
@@ -2200,28 +2200,28 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
                }
        case ACT_CAMERA:
 
-                ysize= 48;
+               ysize= 48;
 
-                glRects(xco, yco-ysize, xco+width, yco);
-                uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+               glRects(xco, yco-ysize, xco+width, yco);
+               uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
                
-                ca= act->data;
+               ca= act->data;
 
-                uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:",                xco+10, yco-24, (width-20)/2, 19, &(ca->ob), "Look at this Object");
-                uiDefButF(block, NUM, 0, "Height:",    xco+10+(width-20)/2, yco-24, (width-20)/2, 19, &ca->height, 0.0, 20.0, 0, 0, "");
+               uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:",         xco+10, yco-24, (width-20)/2, 19, &(ca->ob), "Look at this Object");
+               uiDefButF(block, NUM, 0, "Height:",     xco+10+(width-20)/2, yco-24, (width-20)/2, 19, &ca->height, 0.0, 20.0, 0, 0, "");
                
-                uiDefButF(block, NUM, 0, "Min:",       xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, "");
+               uiDefButF(block, NUM, 0, "Min:",        xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, "");
                
-                if(ca->axis==0) ca->axis= 'x';
-                uiDefButS(block, ROW, 0, "X",  xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis");
-                uiDefButS(block, ROW, 0, "Y",  xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis");
+               if(ca->axis==0) ca->axis= 'x';
+               uiDefButS(block, ROW, 0, "X",   xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis");
+               uiDefButS(block, ROW, 0, "Y",   xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis");
                
-                uiDefButF(block, NUM, 0, "Max:",       xco+20+(width)/2, yco-44, (width-60)/2, 19, &ca->max, 0.0, 20.0, 0, 0, "");
+               uiDefButF(block, NUM, 0, "Max:",        xco+20+(width)/2, yco-44, (width-60)/2, 19, &ca->max, 0.0, 20.0, 0, 0, "");
 
-                yco-= ysize;
+               yco-= ysize;
+
+               break;
 
-                break;
-                               
        case ACT_EDIT_OBJECT:
                
                eoa= act->data;
@@ -2230,7 +2230,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
                        ysize = 92;
                        glRects(xco, yco-ysize, xco+width, yco);
                        uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-        
+
                        uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:",         xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object and all its children (cant be on an visible layer)");
                        uiDefButI(block, NUM, 0, "Time:",       xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the new Object lives");
 
@@ -2313,8 +2313,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
                 yco-= ysize;
 
                break;
-        case ACT_CONSTRAINT:
+
+       case ACT_CONSTRAINT:
                coa= act->data;
        
                if (coa->type == ACT_CONST_TYPE_LOC) {
@@ -2451,69 +2451,69 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
                break;
  
        case ACT_SCENE:
-                 sca= act->data; 
+               sca= act->data;
                
-                 if(sca->type==ACT_SCENE_RESTART) { 
-                         ysize= 28; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-                 } 
-                 else if(sca->type==ACT_SCENE_CAMERA) { 
-                       
-                         ysize= 48; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-        
-                         uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:",               xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera. Leave empty to refer to self object"); 
-                 } 
-                 else if(sca->type==ACT_SCENE_SET) { 
+               if(sca->type==ACT_SCENE_RESTART) {
+                       ysize= 28;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+               }
+               else if(sca->type==ACT_SCENE_CAMERA) {
+
+                       ysize= 48;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+
+                       uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:",         xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera. Leave empty to refer to self object");
+               }
+               else if(sca->type==ACT_SCENE_SET) {
                        
-                         ysize= 48; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-       
-                         uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",          xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene"); 
-                 } 
+                       ysize= 48;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+
+                       uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",            xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene");
+               }
                else if(sca->type==ACT_SCENE_ADD_FRONT) { 
                        
-                         ysize= 48; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-       
-                         uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",          xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene"); 
-                 } 
+                       ysize= 48;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+
+                       uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",            xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene");
+               }
                else if(sca->type==ACT_SCENE_ADD_BACK) { 
                        
-                         ysize= 48; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-       
-                         uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",          xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene"); 
-                 } 
+                       ysize= 48;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+
+                       uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",            xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene");
+               }
                else if(sca->type==ACT_SCENE_REMOVE) { 
                        
-                         ysize= 48; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-       
-                         uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",          xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene");
-                 } 
+                       ysize= 48;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+
+                       uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",            xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene");
+               }
                else if(sca->type==ACT_SCENE_SUSPEND) { 
                        
-                         ysize= 48; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-       
-                         uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",          xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene");
-                 } 
+                       ysize= 48;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+
+                       uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",            xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene");
+               }
                else if(sca->type==ACT_SCENE_RESUME) { 
                        
-                         ysize= 48; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-       
-                         uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",          xco+40, yco-44, (width-80), 19, &(sca->scene), "Unpause a Scene");
-                 } 
+                       ysize= 48;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+
+                       uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:",            xco+40, yco-44, (width-80), 19, &(sca->scene), "Unpause a Scene");
+               }
 
                str= "Scene %t|Restart %x0|Set Scene %x1|Set Camera %x2|Add OverlayScene %x3|Add BackgroundScene %x4|Remove Scene %x5|Suspend Scene %x6|Resume Scene %x7";
                uiDefButS(block, MENU, B_REDR, str,             xco+40, yco-24, (width-80), 19, &sca->type, 0.0, 0.0, 0, 0, ""); 
@@ -2850,41 +2850,41 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
                yco -= ysize;
                break;
        case ACT_PARENT:
-                 parAct = act->data; 
+               parAct = act->data;
 
-                 if(parAct->type==ACT_PARENT_SET) { 
+               if(parAct->type==ACT_PARENT_SET) {
                        
-                         ysize= 48; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-                         uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:",               xco+95, yco-24, (width-100), 19, &(parAct->ob), "Set this object as parent"); 
+                       ysize= 48;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+                       uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:",         xco+95, yco-24, (width-100), 19, &(parAct->ob), "Set this object as parent");
                        uiBlockBeginAlign(block);
                        uiDefButBitS(block, TOGN, ACT_PARENT_COMPOUND, B_REDR,
-                                 "Compound",
-                                 xco + 5, yco - 44, (width - 10)/2, 19, &parAct->flag,
-                                 0.0, 0.0, 0, 0,
-                                 "Add this object shape to the parent shape (only if the parent shape is already compound)");
+                       "Compound",
+                       xco + 5, yco - 44, (width - 10)/2, 19, &parAct->flag,
+                       0.0, 0.0, 0, 0,
+                       "Add this object shape to the parent shape (only if the parent shape is already compound)");
                        uiDefButBitS(block, TOGN, ACT_PARENT_GHOST, B_REDR,
-                                 "Ghost",
-                                 xco + 5 + ((width - 10)/2), yco - 44, (width - 10)/2, 19, &parAct->flag,
-                                 0.0, 0.0, 0, 0,
-                                 "Make this object ghost while parented (only if not compound)");
+                       "Ghost",
+                       xco + 5 + ((width - 10)/2), yco - 44, (width - 10)/2, 19, &parAct->flag,
+                       0.0, 0.0, 0, 0,
+                       "Make this object ghost while parented (only if not compound)");
                        uiBlockEndAlign(block);
-                 }
-                 else if(parAct->type==ACT_PARENT_REMOVE) { 
-                       
-                         ysize= 28; 
-                         glRects(xco, yco-ysize, xco+width, yco); 
-                         uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-                }
+               }
+               else if(parAct->type==ACT_PARENT_REMOVE) {
+
+                       ysize= 28;
+                       glRects(xco, yco-ysize, xco+width, yco);
+                       uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
+               }
 
                str= "Parent %t|Set Parent %x0|Remove Parent %x1";
                uiDefButI(block, MENU, B_REDR, str,             xco+5, yco-24, parAct->type==1?(width-80):90, 19, &parAct->type, 0.0, 0.0, 0, 0, ""); 
 
-                 yco-= ysize; 
-                 break; 
+               yco-= ysize;
+               break;
        case ACT_ARMATURE:
-                 armAct = act->data; 
+               armAct = act->data;
 
                if (ob->type == OB_ARMATURE) {
                        str= "Constraint %t|Run armature %x0|Enable %x1|Disable %x2|Set target %x3|Set weight %x4";
@@ -2922,8 +2922,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
                  }
                glRects(xco, yco-ysize, xco+width, yco); 
                uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); 
-                 yco-= ysize; 
-                 break; 
+               yco-= ysize;
+               break;
 
         default:
                ysize= 4;
index 3e6e75fc7ec4adce32cf3bc6ed9c00db51d503fb..94232699c30bc7159f40d689ea35f41d90fc544a 100644 (file)
@@ -504,7 +504,7 @@ void NLA_OT_properties(wmOperatorType *ot)
        
        ot->exec= nla_properties;
        ot->poll= ED_operator_nla_active;
-       
+
        /* flags */
        ot->flag= 0;
 }
index 941a88c5c4039018207594e5a286d7a28a2e6a21..90f9996e3923793360f80ab8a92a713ef32f2d19 100644 (file)
@@ -159,7 +159,7 @@ static SpaceLink *nla_new(const bContext *C)
        
        ar->v2d.max[0]= MAXFRAMEF;
        ar->v2d.max[1]= 10000.0f;
-       
+
        ar->v2d.minzoom= 0.01f;
        ar->v2d.maxzoom= 50;
        ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
index a310b309d846b2f0bf9d317547fb84781eb4e6b0..db9a052fdbd74cdeed9c9a29d50b8c8ae65291a7 100644 (file)
@@ -834,26 +834,26 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C)
 {
        uiLayout *row, *col;
        
-   uiItemL(layout, "Despill Channel:", ICON_NONE);
-   row =uiLayoutRow(layout,0);
+       uiItemL(layout, "Despill Channel:", ICON_NONE);
+       row =uiLayoutRow(layout,0);
        uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 
-   col= uiLayoutColumn(layout, 0);
-   uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
+       col= uiLayoutColumn(layout, 0);
+       uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
 
-   if(RNA_enum_get(ptr, "limit_method")==0) {
-         uiItemL(col, "Limiting Channel:", ICON_NONE);
-         row=uiLayoutRow(col,0);
-         uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
-   }
+       if(RNA_enum_get(ptr, "limit_method")==0) {
+               uiItemL(col, "Limiting Channel:", ICON_NONE);
+               row=uiLayoutRow(col,0);
+               uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+       }
 
-   uiItemR(col, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
-   uiItemR(col, ptr, "use_unspill", 0, NULL, ICON_NONE);
-   if (RNA_enum_get(ptr, "use_unspill")== 1) {
-         uiItemR(col, ptr, "unspill_red", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
-         uiItemR(col, ptr, "unspill_green", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
-         uiItemR(col, ptr, "unspill_blue", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
-   }
+       uiItemR(col, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       uiItemR(col, ptr, "use_unspill", 0, NULL, ICON_NONE);
+       if (RNA_enum_get(ptr, "use_unspill")== 1) {
+               uiItemR(col, ptr, "unspill_red", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+               uiItemR(col, ptr, "unspill_green", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+               uiItemR(col, ptr, "unspill_blue", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+       }
 }
 
 static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
@@ -865,9 +865,9 @@ static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *UNUSED(C
        uiItemR(col, ptr, "threshold", 0, NULL, ICON_NONE);
        
        col= uiLayoutColumn(layout, 1);
-   /*uiItemR(col, ptr, "lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);  Removed for now */
+       /*uiItemR(col, ptr, "lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);  Removed for now */
        uiItemR(col, ptr, "gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
-   /*uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, NULL, ICON_NONE);  Removed for now*/
+       /*uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, NULL, ICON_NONE);  Removed for now*/
 }
 
 static void node_composit_buts_color_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
@@ -884,24 +884,24 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED(
 {      
        uiLayout *col, *row;
 
-   uiItemL(layout, "Color Space:", ICON_NONE);
+       uiItemL(layout, "Color Space:", ICON_NONE);
        row= uiLayoutRow(layout, 0);
        uiItemR(row, ptr, "color_space", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 
-   col=uiLayoutColumn(layout, 0);  
-   uiItemL(col, "Key Channel:", ICON_NONE);
+       col=uiLayoutColumn(layout, 0);
+       uiItemL(col, "Key Channel:", ICON_NONE);
        row= uiLayoutRow(col, 0);
        uiItemR(row, ptr, "matte_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 
        col =uiLayoutColumn(layout, 0);
 
-   uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
-   if(RNA_enum_get(ptr, "limit_method")==0) {
-         uiItemL(col, "Limiting Channel:", ICON_NONE);
-         row=uiLayoutRow(col,0);
-         uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
-   }
-   
+       uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
+       if(RNA_enum_get(ptr, "limit_method")==0) {
+               uiItemL(col, "Limiting Channel:", ICON_NONE);
+               row=uiLayoutRow(col,0);
+               uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+       }
+
        uiItemR(col, ptr, "limit_max", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
        uiItemR(col, ptr, "limit_min", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
 }
@@ -957,7 +957,7 @@ static void node_composit_buts_scale(uiLayout *layout, bContext *UNUSED(C), Poin
 
 static void node_composit_buts_rotate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 {
-   uiItemR(layout, ptr, "filter_type", 0, "", ICON_NONE);
+       uiItemR(layout, ptr, "filter_type", 0, "", ICON_NONE);
 }
 
 static void node_composit_buts_invert(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
@@ -1123,7 +1123,7 @@ static void node_composit_set_butfunc(bNodeType *ntype)
                        break;
                case CMP_NODE_OUTPUT_FILE:
                        ntype->uifunc= node_composit_buts_file_output;
-                       break;  
+                       break;
                case CMP_NODE_DIFF_MATTE:
                        ntype->uifunc=node_composit_buts_diff_matte;
                        break;
@@ -1142,9 +1142,9 @@ static void node_composit_set_butfunc(bNodeType *ntype)
                case CMP_NODE_SCALE:
                        ntype->uifunc= node_composit_buts_scale;
                        break;
-         case CMP_NODE_ROTATE:
-                ntype->uifunc=node_composit_buts_rotate;
-                break;
+               case CMP_NODE_ROTATE:
+                       ntype->uifunc=node_composit_buts_rotate;
+                       break;
                case CMP_NODE_CHANNEL_MATTE:
                        ntype->uifunc= node_composit_buts_channel_matte;
                        break;
@@ -1168,16 +1168,16 @@ static void node_composit_set_butfunc(bNodeType *ntype)
                        break;
                case CMP_NODE_VIEW_LEVELS:
                        ntype->uifunc=node_composit_buts_view_levels;
-                        break;
+                       break;
                case CMP_NODE_COLORBALANCE:
                        ntype->uifunc=node_composit_buts_colorbalance;
-                        break;
+                       break;
                case CMP_NODE_HUECORRECT:
                        ntype->uifunc=node_composit_buts_huecorrect;
-                        break;
+                       break;
                case CMP_NODE_ZCOMBINE:
                        ntype->uifunc=node_composit_buts_zcombine;
-                        break;
+                       break;
                case CMP_NODE_COMBYCCA:
                case CMP_NODE_SEPYCCA:
                        ntype->uifunc=node_composit_buts_ycc;
@@ -1499,7 +1499,7 @@ void draw_nodespace_color_info(ARegion *ar, int channels, int x, int y, char *cp
                        sprintf(str, "  R:%-.4f", fp[0]);
                else if (cp)
                        sprintf(str, "  R:%-3d", cp[0]);
-               else
+               else
                        sprintf(str, "  R:-");
                BLF_position(blf_mono_font, dx, 6, 0);
                BLF_draw_ascii(blf_mono_font, str, sizeof(str));
@@ -1510,7 +1510,7 @@ void draw_nodespace_color_info(ARegion *ar, int channels, int x, int y, char *cp
                        sprintf(str, "  G:%-.4f", fp[1]);
                else if (cp)
                        sprintf(str, "  G:%-3d", cp[1]);
-               else
+               else
                        sprintf(str, "  G:-");
                BLF_position(blf_mono_font, dx, 6, 0);
                BLF_draw_ascii(blf_mono_font, str, sizeof(str));
@@ -1521,7 +1521,7 @@ void draw_nodespace_color_info(ARegion *ar, int channels, int x, int y, char *cp
                        sprintf(str, "  B:%-.4f", fp[2]);
                else if (cp)
                        sprintf(str, "  B:%-3d", cp[2]);
-               else
+               else
                        sprintf(str, "  B:-");
                BLF_position(blf_mono_font, dx, 6, 0);
                BLF_draw_ascii(blf_mono_font, str, sizeof(str));
index fce9c883c84589d7c98319f4f2bc52724acebbc1..0e574ca5ffb14bdb990e33cc474eaf9c5918937d 100644 (file)
@@ -1340,8 +1340,8 @@ static void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
        int show_opened= (soops->treestore==NULL); /* on first view, we open scenes */
 
        if(soops->tree.first && (soops->storeflag & SO_TREESTORE_REDRAW))
-          return;
-          
+               return;
+
        outliner_free_tree(&soops->tree);
        outliner_storage_cleanup(soops);
        
@@ -3533,8 +3533,8 @@ static EnumPropertyItem prop_group_op_types[] = {
        {2, "LOCAL", 0, "Make Local", ""},
        {3, "LINK", 0, "Link Group Objects to Scene", ""},
        {4, "TOGVIS", 0, "Toggle Visible", ""},
-       {5, "TOGSEL", 0, "Toggle Selectable", ""},
-       {6, "TOGREN", 0, "Toggle Renderable", ""},
+       {5, "TOGSEL", 0, "Toggle Selectable", ""},
+       {6, "TOGREN", 0, "Toggle Renderable", ""},
        {0, NULL, 0, NULL, NULL}
 };
 
@@ -3561,7 +3561,7 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op)
        else if(event==3) {
                outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_linkobs2scene_cb);
                ED_undo_push(C, "Link Group Objects to Scene");
-       }   
+       }
        
        
        WM_event_add_notifier(C, NC_GROUP, NULL);
@@ -5255,7 +5255,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
                        if(tselem->type==0 && te->idcode==ID_GR){ 
                                int restrict_bool;
                                gr = (Group *)tselem->id;
-                               
+
                                uiBlockSetEmboss(block, UI_EMBOSSN);
 
                                restrict_bool= group_restrict_flag(gr, OB_RESTRICT_VIEW);
@@ -5271,7 +5271,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
                                uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr);
 
                                uiBlockSetEmboss(block, UI_EMBOSS);
-                       }
+                       }
                        /* scene render layers and passes have toggle-able flags too! */
                        else if(tselem->type==TSE_R_LAYER) {
                                uiBlockSetEmboss(block, UI_EMBOSSN);
index 31edfd522a3bd7a1cb47e16dc378aafaba390e0d..091018670ba4600b95b2ddda5d3de488baf4540f 100644 (file)
@@ -1483,7 +1483,7 @@ static int text_get_cursor_rel(SpaceText* st, ARegion *ar, TextLine *linein, int
                }
        }
 
-  return selc;
+       return selc;
 }
 
 static int cursor_skip_find_line(SpaceText* st, ARegion *ar,
index 246ed853cc8b049cafef2ffd0bdaf606070a128c..445d2f434faec3c1b3d54030db77f32fdf491dc8 100644 (file)
@@ -485,12 +485,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
 
                /* NDOF */
                /* Not implemented yet
-                if (G.ndofdevice ==0 ) {
+               if (G.ndofdevice ==0 ) {
                        uiDefIconTextButC(block, ICONTEXTROW,B_NDOF, ICON_NDOF_TURN, ndof_pup(), 0,0,XIC+10,YIC, &(v3d->ndofmode), 0, 3.0, 0, 0, "Ndof mode");
-               
+
                        uiDefIconButC(block, TOG, B_NDOF,  ICON_NDOF_DOM,
-                                         0,0,XIC,YIC,
-                                         &v3d->ndoffilter, 0, 1, 0, 0, "dominant axis");       
+                                       0,0,XIC,YIC,
+                                       &v3d->ndoffilter, 0, 1, 0, 0, "dominant axis");
                }
                 */
 
@@ -513,7 +513,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                uiDefButS(block, MENU, B_MAN_MODE, str_menu,0,0,70,YIC, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation");
                MEM_freeN((void *)str_menu);
        }
-               
+
        if(obedit==NULL && v3d->localvd==NULL) {
                unsigned int ob_lay = ob ? ob->lay : 0;
                
index 39a18d31d7e8f0a84b76f7d1bfb87fcaa21ac43f..75999fdeb6d353625d7e1db2d4c090fb17f2b369 100644 (file)
@@ -669,10 +669,10 @@ static void do_lasso_select_armature(ViewContext *vc, short mcords[][2], short m
                                change= TRUE;
                        }
                        if(lasso_inside(mcords, moves, sco2[0], sco2[1])) {
-                          if(select) ebone->flag |= BONE_TIPSEL;
-                          else ebone->flag &= ~BONE_TIPSEL;
-                          didpoint= 1;
-                          change= TRUE;
+                               if(select) ebone->flag |= BONE_TIPSEL;
+                               else ebone->flag &= ~BONE_TIPSEL;
+                               didpoint= 1;
+                               change= TRUE;
                        }
                        /* if one of points selected, we skip the bone itself */
                        if(didpoint==0 && lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) {
index c97833aea4b5b80d8b0d8cfa60bf00e890c0a24b..1fdc2d9cad7929769a18a24e68d9a37a4c0ee2dd 100644 (file)
@@ -939,25 +939,25 @@ void project_float_noclip(ARegion *ar, float *vec, float *adr)
 
 int get_view3d_ortho(View3D *v3d, RegionView3D *rv3d)
 {
-  Camera *cam;
-  
-  if(rv3d->persp==RV3D_CAMOB) {
-         if(v3d->camera && v3d->camera->type==OB_CAMERA) {
-                 cam= v3d->camera->data;
-
-                 if(cam && cam->type==CAM_ORTHO)
-                         return 1;
-                 else
-                         return 0;
-         }
-         else
-                 return 0;
-  }
-  
-  if(rv3d->persp==RV3D_ORTHO)
-         return 1;
-
-  return 0;
+       Camera *cam;
+
+       if(rv3d->persp==RV3D_CAMOB) {
+               if(v3d->camera && v3d->camera->type==OB_CAMERA) {
+                       cam= v3d->camera->data;
+
+                       if(cam && cam->type==CAM_ORTHO)
+                               return 1;
+                       else
+                               return 0;
+               }
+               else
+                       return 0;
+       }
+
+       if(rv3d->persp==RV3D_ORTHO)
+               return 1;
+
+       return 0;
 }
 
 /* copies logic of get_view3d_viewplane(), keep in sync */
index d0c93116cb236f5a0bc63465c238ff9de0544e70..c710312606d7cca61ad62e5dce317041d404e2b4 100644 (file)
@@ -4485,11 +4485,11 @@ static int createSlideVerts(TransInfo *t)
                        for(eed=em->edges.first;eed;eed=eed->next) {
                                if(editedge_containsVert(eed, ev)) {
                                        if(!(eed->f & SELECT)) {
-                                                if(!tempsv->up) {
-                                                        tempsv->up = eed;
-                                                } else if (!(tempsv->down)) {
-                                                        tempsv->down = eed;
-                                                }
+                                               if(!tempsv->up) {
+                                                       tempsv->up = eed;
+                                               } else if (!(tempsv->down)) {
+                                                       tempsv->down = eed;
+                                               }
                                        }
                                }
                        }
@@ -4501,33 +4501,33 @@ static int createSlideVerts(TransInfo *t)
                                        for(efa = em->faces.first;efa;efa=efa->next) {
                                                if(editface_containsEdge(efa, eed)) {
                                                        if(editedge_containsVert(efa->e1, ev) && efa->e1 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e1;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e1;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e1;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e1;
+                                                               }
                                                        }
                                                        if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e2;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e2;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e2;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e2;
+                                                               }
                                                        }
                                                        if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) {
-                                                                if(!tempsv->up) {
-                                                                        tempsv->up = efa->e3;
-                                                                } else if (!(tempsv->down)) {
-                                                                        tempsv->down = efa->e3;
-                                                                }
+                                                               if(!tempsv->up) {
+                                                                       tempsv->up = efa->e3;
+                                                               } else if (!(tempsv->down)) {
+                                                                       tempsv->down = efa->e3;
+                                                               }
                                                        }
                                                        if(efa->e4) {
                                                                if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) {
-                                                                        if(!tempsv->up) {
-                                                                                tempsv->up = efa->e4;
-                                                                        } else if (!(tempsv->down)) {
-                                                                                tempsv->down = efa->e4;
-                                                                        }
+                                                                       if(!tempsv->up) {
+                                                                               tempsv->up = efa->e4;
+                                                                       } else if (!(tempsv->down)) {
+                                                                               tempsv->down = efa->e4;
+                                                                       }
                                                                }
                                                        }
 
index e5e31a8e319adfc301ec145260a01445dec652ca..5793b1c65790e7c91fb64b290569f86ee32eee48 100644 (file)
@@ -876,7 +876,7 @@ static void setNearestAxis3d(TransInfo *t)
                axis[1] = (float)(icoord[1] - t->center2d[1]);
                axis[2] = 0.0f;
 
-                if (normalize_v3(axis) != 0.0f) {
+               if (normalize_v3(axis) != 0.0f) {
                        project_v3_v3v3(proj, mvec, axis);
                        sub_v3_v3v3(axis, mvec, proj);
                        len[i] = normalize_v3(axis);
index b2a76681bff620ead7d1c67bf71c199aa5b2e70a..8d73da0063c8821d505503910c320fa7b836fb14 100644 (file)
@@ -434,7 +434,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        float pointsize;
        int drawfaces, interpedges;
        Image *ima= sima->image;
-       
+
        em= BKE_mesh_get_editmesh(me);
        activetf= EM_get_active_mtface(em, &efa_act, NULL, 0); /* will be set to NULL if hidden */
 
index 7ba85d30763ee63b6c0b05740aa4488f3d6727a8..a9ee65b027b9c3e70497ed9fa5b1c3ecdcf51467 100644 (file)
@@ -595,7 +595,7 @@ static void p_vert_load_pin_select_uvs(PHandle *handle, PVert *v)
                        if (e->flag & PEDGE_SELECT)
                                v->flag |= PVERT_SELECT;
 
-                        if (e->flag & PEDGE_PIN) {
+                       if (e->flag & PEDGE_PIN) {
                                pinuv[0] += e->orig_uv[0]*handle->aspx;
                                pinuv[1] += e->orig_uv[1]*handle->aspy;
                                npins++;
index 323ca6ab78bbace9a1a59b222c6053d6c15899c9..25be2e2aeb44b71b7d4bb179d4a7e24ce05e4dbb 100644 (file)
@@ -210,8 +210,8 @@ static int is_pow2_limit(int num)
        /* take texture clamping into account */
 
        /* XXX: texturepaint not global!
-          if (G.f & G_TEXTUREPAINT)
-          return 1;*/
+       if (G.f & G_TEXTUREPAINT)
+               return 1;*/
 
        if (U.glreslimit != 0 && num > U.glreslimit)
                return 0;
@@ -222,8 +222,8 @@ static int is_pow2_limit(int num)
 static int smaller_pow2_limit(int num)
 {
        /* XXX: texturepaint not global!
-          if (G.f & G_TEXTUREPAINT)
-          return 1;*/
+       if (G.f & G_TEXTUREPAINT)
+               return 1;*/
        
        /* take texture clamping into account */
        if (U.glreslimit != 0 && num > U.glreslimit)
index c0bed18d89bf2ce2062f536fe2c4acf535d5fe59..f6352a968782d05805942733b694ffeebf1c54e6 100644 (file)
@@ -1218,11 +1218,11 @@ void GPU_pixelbuffer_texture(GPUTexture *tex, GPUPixelBuffer *pb)
        int i;
 
        glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
-        for (i = 0; i < pb->numbuffers; i++) {
+
+       for (i = 0; i < pb->numbuffers; i++) {
                glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, pb->bindcode[pb->current]);
                glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, pb->datasize, NULL,
-                       GL_STREAM_DRAW_ARB);
+               GL_STREAM_DRAW_ARB);
 
                pixels = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, GL_WRITE_ONLY);
                /*memcpy(pixels, _oImage.data(), pb->datasize);*/
index 32dae3c982e9fbf22646908cdb5d62ffbdb2edae..0759d97e69ffffa3a93e646e60d07282c9c3125c 100644 (file)
@@ -95,9 +95,9 @@ int imb_is_a_jpeg(unsigned char *mem) {
 //----------------------------------------------------------
 
 typedef struct my_error_mgr {
-  struct jpeg_error_mgr pub;   /* "public" fields */
+       struct jpeg_error_mgr pub;      /* "public" fields */
 
-  jmp_buf setjmp_buffer;       /* for return to caller */
+       jmp_buf setjmp_buffer;  /* for return to caller */
 } my_error_mgr;
 
 typedef my_error_mgr * my_error_ptr;
index e59cf77a8715be49b6aa4ddf1c550c6849bec7e6..9bc4ba6776cc0e59f409b705e3981233d83f36ed 100644 (file)
@@ -271,7 +271,7 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1)
                        for(x = ibuf2->x ; x>0 ; x--) *dest1++ = *dest2++ = *p1++;
                        dest1 = dest2;
                }
-                if (do_float) {
+               if (do_float) {
                        dest2f = dest1f + (4*ibuf2->x);
                        for(x = ibuf2->x*4 ; x>0 ; x--) *dest1f++ = *dest2f++ = *p1f++;
                        dest1f = dest2f;
index 1f2eebbedc09b608175e2b5fda7bf13c001e1d09..3e17665fa39ebad03c7f717539414035026b6822 100644 (file)
@@ -108,19 +108,19 @@ typedef enum {
 } UnsafeCharacterSet;
 
 static const unsigned char acceptable[96] = {
-  /* A table of the ASCII chars from space (32) to DEL (127) */
-  /*      !    "    #    $    %    &    '    (    )    *    +    ,    -    .    / */ 
-  0x00,0x3F,0x20,0x20,0x28,0x00,0x2C,0x3F,0x3F,0x3F,0x3F,0x2A,0x28,0x3F,0x3F,0x1C,
-  /* 0    1    2    3    4    5    6    7    8    9    :    ;    <    =    >    ? */
-  0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x38,0x20,0x20,0x2C,0x20,0x20,
-  /* @    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O */
-  0x38,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
-  /* P    Q    R    S    T    U    V    W    X    Y    Z    [    \    ]    ^    _ */
-  0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x20,0x3F,
-  /* `    a    b    c    d    e    f    g    h    i    j    k    l    m    n    o */
-  0x20,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
-  /* p    q    r    s    t    u    v    w    x    y    z    {    |    }    ~  DEL */
-  0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x3F,0x20
+       /* A table of the ASCII chars from space (32) to DEL (127) */
+       /*      !    "    #    $    %    &    '    (    )    *    +    ,    -    .    / */
+       0x00,0x3F,0x20,0x20,0x28,0x00,0x2C,0x3F,0x3F,0x3F,0x3F,0x2A,0x28,0x3F,0x3F,0x1C,
+       /* 0    1    2    3    4    5    6    7    8    9    :    ;    <    =    >    ? */
+       0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x38,0x20,0x20,0x2C,0x20,0x20,
+       /* @    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O */
+       0x38,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
+       /* P    Q    R    S    T    U    V    W    X    Y    Z    [    \    ]    ^    _ */
+       0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x20,0x3F,
+       /* `    a    b    c    d    e    f    g    h    i    j    k    l    m    n    o */
+       0x20,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
+       /* p    q    r    s    t    u    v    w    x    y    z    {    |    }    ~  DEL */
+       0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x3F,0x20
 };
 
 static const char hex[17] = "0123456789abcdef";
index 155696fb19969360ff0b8c3feb0e11d2be0ae852..746649e27cafb499b592748be807b3d988bf5bb2 100644 (file)
@@ -605,7 +605,7 @@ void imb_loadtiletiff(ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int
                return;
        }
 
-       if(TIFFSetDirectory(image, ibuf->miplevel)) {
+       if(TIFFSetDirectory(image, ibuf->miplevel)) {
                /* allocate the image buffer */
                TIFFGetField(image, TIFFTAG_IMAGEWIDTH,  &width);
                TIFFGetField(image, TIFFTAG_IMAGELENGTH, &height);
index e0e521a81d567bb3372ebbb6b59f818e2813a16a..4e9b023b3260c224a4e5cc18acdfda0cbc81e084 100644 (file)
@@ -576,33 +576,33 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
                        
                        /* compare length and amount of elems */
                        if( spcur[1] == spold[1]) {
-                                if( newsdna->typelens[spcur[0]] == sdna->typelens[spold[0]] ) {
-                                        
-                                        /* same length, same amount of elems, now per type and name */
-                                        b= spold[1];
-                                        spold+= 2;
-                                        spcur+= 2;
-                                        while(b > 0) {
-                                                str1= newsdna->types[spcur[0]];
-                                                str2= sdna->types[spold[0]];
-                                                if(strcmp(str1, str2)!=0) break;
-
-                                                str1= newsdna->names[spcur[1]];
-                                                str2= sdna->names[spold[1]];
-                                                if(strcmp(str1, str2)!=0) break;
-                                                
-                                                /* same type and same name, now pointersize */
-                                                if(ispointer(str1)) {
-                                                        if(sdna->pointerlen!=newsdna->pointerlen) break;
-                                                }
-                                                
-                                                b--;
-                                                spold+= 2;
-                                                spcur+= 2;
-                                        }
-                                        if(b==0) compflags[a]= 1;
-
-                                }
+                               if( newsdna->typelens[spcur[0]] == sdna->typelens[spold[0]] ) {
+
+                                       /* same length, same amount of elems, now per type and name */
+                                       b= spold[1];
+                                       spold+= 2;
+                                       spcur+= 2;
+                                       while(b > 0) {
+                                               str1= newsdna->types[spcur[0]];
+                                               str2= sdna->types[spold[0]];
+                                               if(strcmp(str1, str2)!=0) break;
+
+                                               str1= newsdna->names[spcur[1]];
+                                               str2= sdna->names[spold[1]];
+                                               if(strcmp(str1, str2)!=0) break;
+
+                                               /* same type and same name, now pointersize */
+                                               if(ispointer(str1)) {
+                                                       if(sdna->pointerlen!=newsdna->pointerlen) break;
+                                               }
+
+                                               b--;
+                                               spold+= 2;
+                                               spcur+= 2;
+                                       }
+                                       if(b==0) compflags[a]= 1;
+
+                               }
                        }
                        
                }
index 74857115bc5f50920716b7542feeacb4a9f50426..f3f79cde6172d144ddbfe9547b4ab2c5a1b3c144 100644 (file)
@@ -111,7 +111,7 @@ static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type))
        if(id->icon_id >= BIFICONID_LAST) {
                BKE_icon_delete(id);
                BKE_previewimg_free_id(id);
-       }
+       }
 
        id->icon_id = 0;
 }
index 12d27bc80c2ff6115cb383479dc2f942c3e682b4..92c762098c79f603d9960ea17d4af630cd6ea186 100644 (file)
@@ -56,24 +56,24 @@ static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
        bController *controller= (bController*)ptr->data;
 
        switch(controller->type) {
-               case CONT_LOGIC_AND:
-                       return &RNA_AndController;
-               case CONT_LOGIC_OR:
-                       return &RNA_OrController;
-               case CONT_LOGIC_NAND:
-                       return &RNA_NandController;
-               case CONT_LOGIC_NOR:
-                       return &RNA_NorController;
-               case CONT_LOGIC_XOR:
-                       return &RNA_XorController;
-               case CONT_LOGIC_XNOR:
-                       return &RNA_XnorController;
-                case CONT_EXPRESSION:
-                       return &RNA_ExpressionController;
-               case CONT_PYTHON:
-                       return &RNA_PythonController;
-               default:
-                       return &RNA_Controller;
+       case CONT_LOGIC_AND:
+               return &RNA_AndController;
+       case CONT_LOGIC_OR:
+               return &RNA_OrController;
+       case CONT_LOGIC_NAND:
+               return &RNA_NandController;
+       case CONT_LOGIC_NOR:
+               return &RNA_NorController;
+       case CONT_LOGIC_XOR:
+               return &RNA_XorController;
+       case CONT_LOGIC_XNOR:
+               return &RNA_XnorController;
+       case CONT_EXPRESSION:
+               return &RNA_ExpressionController;
+       case CONT_PYTHON:
+               return &RNA_PythonController;
+       default:
+               return &RNA_Controller;
        }
 }
 
index 091ec073f6147cb7fbb77c0406e9547675209c3f..2d5c26199d69cf6473e9b344957a6ea3c99586cc 100644 (file)
@@ -155,7 +155,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int
 
        ibuf= BKE_image_get_ibuf(image, NULL);
 
-       if(ibuf == NULL || ibuf->rect == NULL ) {
+       if(ibuf == NULL || ibuf->rect == NULL ) {
                BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2);
                return (int)GL_INVALID_OPERATION;
        }
index 0dd536b64c2952cb385505976d3b124d0928b35e..b6d0f77c5a5f9dde5e82c1563af78fac2bb37a89 100644 (file)
@@ -462,7 +462,7 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *C, ReportList *r
        node = nodeAddNodeType(ntree, type, group, NULL);
 
        if (node == NULL) {
-                BKE_reportf(reports, RPT_ERROR, "Unable to create node");
+               BKE_reportf(reports, RPT_ERROR, "Unable to create node");
        }
        else {
                nodeGroupVerify(ntree); /* update group node socket links*/
@@ -1668,8 +1668,8 @@ static void def_cmp_channel_matte(StructRNA *srna)
 
        prop = RNA_def_property(srna, "limit_channel", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "channel");
-   RNA_def_property_enum_items(prop, prop_tri_channel_items);
-   RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf");
+       RNA_def_property_enum_items(prop, prop_tri_channel_items);
+       RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf");
        RNA_def_property_ui_text(prop, "Limit Channel", "Limit by this channels value");
        RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
        
@@ -1843,10 +1843,10 @@ static void def_cmp_crop(StructRNA *srna)
        RNA_def_property_ui_text(prop, "Crop Image Size", "Whether to crop the size of the input image");
        RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 
-   prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
-   RNA_def_property_ui_text(prop, "Relative", "Use relative values to crop image");
-   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+       prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
+       RNA_def_property_ui_text(prop, "Relative", "Use relative values to crop image");
+       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 
        RNA_def_struct_sdna_from(srna, "NodeTwoXYs", "storage");
 
@@ -1874,29 +1874,29 @@ static void def_cmp_crop(StructRNA *srna)
        RNA_def_property_ui_text(prop, "Y2", "");
        RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 
-   prop = RNA_def_property(srna, "rel_min_x", PROP_FLOAT, PROP_NONE);
-   RNA_def_property_float_sdna(prop, NULL, "fac_x1");
-   RNA_def_property_range(prop, 0.0, 1.0);
-   RNA_def_property_ui_text(prop, "X1", "");
-   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
-
-   prop = RNA_def_property(srna, "rel_max_x", PROP_FLOAT, PROP_NONE);
-   RNA_def_property_float_sdna(prop, NULL, "fac_x2");
-   RNA_def_property_range(prop, 0.0, 1.0);
-   RNA_def_property_ui_text(prop, "X2", "");
-   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
-
-   prop = RNA_def_property(srna, "rel_min_y", PROP_FLOAT, PROP_NONE);
-   RNA_def_property_float_sdna(prop, NULL, "fac_y1");
-   RNA_def_property_range(prop, 0.0, 1.0);
-   RNA_def_property_ui_text(prop, "Y1", "");
-   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
-
-   prop = RNA_def_property(srna, "rel_max_y", PROP_FLOAT, PROP_NONE);
-   RNA_def_property_float_sdna(prop, NULL, "fac_y2");
-   RNA_def_property_range(prop, 0.0, 1.0);
-   RNA_def_property_ui_text(prop, "Y2", "");
-   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+       prop = RNA_def_property(srna, "rel_min_x", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fac_x1");
+       RNA_def_property_range(prop, 0.0, 1.0);
+       RNA_def_property_ui_text(prop, "X1", "");
+       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+       prop = RNA_def_property(srna, "rel_max_x", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fac_x2");
+       RNA_def_property_range(prop, 0.0, 1.0);
+       RNA_def_property_ui_text(prop, "X2", "");
+       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+       prop = RNA_def_property(srna, "rel_min_y", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fac_y1");
+       RNA_def_property_range(prop, 0.0, 1.0);
+       RNA_def_property_ui_text(prop, "Y1", "");
+       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+       prop = RNA_def_property(srna, "rel_max_y", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "fac_y2");
+       RNA_def_property_range(prop, 0.0, 1.0);
+       RNA_def_property_ui_text(prop, "Y2", "");
+       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 }
 
 static void def_cmp_dblur(StructRNA *srna)
index 2a369ba9044341590b07322d7d804511cdc42ca7..d6af04f24750d20a43088c7b197fd2442b2049cd 100644 (file)
@@ -87,10 +87,10 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int
        int cage = !apply_modifiers;
 
        /* perform the mesh extraction based on type */
-        switch (ob->type) {
-        case OB_FONT:
-        case OB_CURVE:
-        case OB_SURF:
+       switch (ob->type) {
+       case OB_FONT:
+       case OB_CURVE:
+       case OB_SURF:
 
                /* copies object and modifiers (but not the data) */
                tmpobj= copy_object(ob);
@@ -130,7 +130,7 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int
                free_libblock_us( &G.main->object, tmpobj );
                break;
 
-        case OB_MBALL:
+       case OB_MBALL:
                /* metaballs don't have modifiers, so just convert to mesh */
                ob = find_basis_mball( sce, ob );
                /* todo, re-generatre for render-res */
@@ -138,9 +138,9 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int
 
                tmpmesh = add_mesh("Mesh");
                mball_to_mesh( &ob->disp, tmpmesh );
-                break;
+               break;
 
-        case OB_MESH:
+       case OB_MESH:
                /* copies object and modifiers (but not the data) */
                if (cage) {
                        /* copies the data */
@@ -165,10 +165,10 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int
                }
                
                break;
-        default:
+       default:
                BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
-                return NULL;
-         }
+               return NULL;
+       }
 
        /* Copy materials to new mesh */
        switch (ob->type) {
index fe164cbd3c127aed12b472d2ce979fe95f2a2c4e..9fd5fafc712e3730ed1d6f8dfda0afd4e43c0190 100644 (file)
@@ -1092,24 +1092,24 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
        RNA_def_struct_ui_text(srna, "SPH Fluid Settings", "Settings for particle fluids physics");
        
        /* Fluid settings */
-       prop= RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE);
+       prop= RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "spring_k");
-       RNA_def_property_range(prop, 0.0f, 100.0f);
+       RNA_def_property_range(prop, 0.0f, 100.0f);
        RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
-       RNA_def_property_ui_text(prop, "Spring Force", "Spring force");
+       RNA_def_property_ui_text(prop, "Spring Force", "Spring force");
        RNA_def_property_update(prop, 0, "rna_Particle_reset");
-  
-       prop= RNA_def_property(srna, "fluid_radius", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "radius");
-       RNA_def_property_range(prop, 0.0f, 20.0f);
+
+       prop= RNA_def_property(srna, "fluid_radius", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "radius");
+       RNA_def_property_range(prop, 0.0f, 20.0f);
        RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
        RNA_def_property_ui_text(prop, "Interaction Radius", "Fluid interaction radius");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
 
-       prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_range(prop, 0.0f, 2.0f);
+       prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_range(prop, 0.0f, 2.0f);
        RNA_def_property_ui_text(prop, "Rest Length", "Spring rest length (factor of particle radius)");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
 
        prop= RNA_def_property(srna, "use_viscoelastic_springs", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_VISCOELASTIC_SPRINGS);
@@ -1121,70 +1121,70 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Initial Rest Length", "Use the initial length as spring rest length instead of 2 * particle size");
        RNA_def_property_update(prop, 0, "rna_Particle_reset");
 
-       prop= RNA_def_property(srna, "plasticity", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "plasticity_constant");
-       RNA_def_property_range(prop, 0.0f, 100.0f);
-       RNA_def_property_ui_text(prop, "Plasticity", "How much the spring rest length can change after the elastic limit is crossed");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+       prop= RNA_def_property(srna, "plasticity", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "plasticity_constant");
+       RNA_def_property_range(prop, 0.0f, 100.0f);
+       RNA_def_property_ui_text(prop, "Plasticity", "How much the spring rest length can change after the elastic limit is crossed");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
+       prop= RNA_def_property(srna, "yield_ratio", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "yield_ratio");
+       RNA_def_property_range(prop, 0.0f, 1.0f);
+       RNA_def_property_ui_text(prop, "Elastic Limit", "How much the spring has to be stretched/compressed in order to change it's rest length");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
 
-       prop= RNA_def_property(srna, "yield_ratio", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "yield_ratio");
-       RNA_def_property_range(prop, 0.0f, 1.0f);
-       RNA_def_property_ui_text(prop, "Elastic Limit", "How much the spring has to be stretched/compressed in order to change it's rest length");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+       prop= RNA_def_property(srna, "spring_frames", PROP_INT, PROP_NONE);
+       RNA_def_property_range(prop, 0.0f, 100.0f);
+       RNA_def_property_ui_text(prop, "Spring Frames", "Create springs for this number of frames since particles birth (0 is always)");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
 
-       prop= RNA_def_property(srna, "spring_frames", PROP_INT, PROP_NONE);
-       RNA_def_property_range(prop, 0.0f, 100.0f);
-       RNA_def_property_ui_text(prop, "Spring Frames", "Create springs for this number of frames since particles birth (0 is always)");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
-       /* Viscosity */
-       prop= RNA_def_property(srna, "linear_viscosity", PROP_FLOAT, PROP_NONE);
+       /* Viscosity */
+       prop= RNA_def_property(srna, "linear_viscosity", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "viscosity_omega");
-       RNA_def_property_range(prop, 0.0f, 100.0f);
+       RNA_def_property_range(prop, 0.0f, 100.0f);
        RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
-       RNA_def_property_ui_text(prop, "Viscosity", "Linear viscosity");
+       RNA_def_property_ui_text(prop, "Viscosity", "Linear viscosity");
        RNA_def_property_update(prop, 0, "rna_Particle_reset");
-  
-       prop= RNA_def_property(srna, "stiff_viscosity", PROP_FLOAT, PROP_NONE);
+
+       prop= RNA_def_property(srna, "stiff_viscosity", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "viscosity_beta");
        RNA_def_property_range(prop, 0.0f, 100.0f);
        RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
-       RNA_def_property_ui_text(prop, "Stiff viscosity", "Creates viscosity for expanding fluid)");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+       RNA_def_property_ui_text(prop, "Stiff viscosity", "Creates viscosity for expanding fluid)");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
 
        /* Double density relaxation */
-       prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "stiffness_k");
-       RNA_def_property_range(prop, 0.0f, 100.0f);
+       prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "stiffness_k");
+       RNA_def_property_range(prop, 0.0f, 100.0f);
        RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
-       RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is");
+       RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is");
        RNA_def_property_update(prop, 0, "rna_Particle_reset");
-  
-       prop= RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "stiffness_knear");
+
+       prop= RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "stiffness_knear");
        RNA_def_property_range(prop, 0.0f, 100.0f);
        RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
-       RNA_def_property_ui_text(prop, "Repulsion Factor", "How strongly the fluid tries to keep from clustering (factor of stiffness)");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
-  
-       prop= RNA_def_property(srna, "rest_density", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_ui_text(prop, "Repulsion Factor", "How strongly the fluid tries to keep from clustering (factor of stiffness)");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
+       prop= RNA_def_property(srna, "rest_density", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "rest_density");
-       RNA_def_property_range(prop, 0.0f, 100.0f);
+       RNA_def_property_range(prop, 0.0f, 100.0f);
        RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
-       RNA_def_property_ui_text(prop, "Rest Density", "Fluid rest density");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
-       
+       RNA_def_property_ui_text(prop, "Rest Density", "Fluid rest density");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
        /* Buoyancy */
        prop= RNA_def_property(srna, "buoyancy", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "buoyancy");
-       RNA_def_property_range(prop, 0.0f, 10.0f);
+       RNA_def_property_float_sdna(prop, NULL, "buoyancy");
+       RNA_def_property_range(prop, 0.0f, 10.0f);
        RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
-       RNA_def_property_ui_text(prop, "Buoyancy", "Artificial buoyancy force in negative gravity direction based on pressure differences inside the fluid");
-       RNA_def_property_update(prop, 0, "rna_Particle_reset");
+       RNA_def_property_ui_text(prop, "Buoyancy", "Artificial buoyancy force in negative gravity direction based on pressure differences inside the fluid");
+       RNA_def_property_update(prop, 0, "rna_Particle_reset");
 
        /* Factor flags */
-       
+
        prop= RNA_def_property(srna, "factor_repulsion", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_REPULSION);
        RNA_def_property_ui_text(prop, "Factor Repulsion", "Repulsion is a factor of stiffness");
index 3a34b048aa3ed8b7fec21eeee7f2b55782696c8d..90954fef1c767132e81ecb85666c1538b274b9a5 100644 (file)
@@ -313,60 +313,60 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
                else
                        /* if the offset has no translation, just make one copy */
                        count = 1;
-                 }
+       }
 
-                 if(count < 1)
-                         count = 1;
+       if(count < 1)
+               count = 1;
 
        /* allocate memory for count duplicates (including original) plus
                  * start and end caps
        */
-                 finalVerts = dm->getNumVerts(dm) * count;
-                 finalEdges = dm->getNumEdges(dm) * count;
-                 finalFaces = dm->getNumFaces(dm) * count;
-                 if(start_cap) {
-                         finalVerts += start_cap->getNumVerts(start_cap);
-                         finalEdges += start_cap->getNumEdges(start_cap);
-                         finalFaces += start_cap->getNumFaces(start_cap);
-                 }
-                 if(end_cap) {
-                         finalVerts += end_cap->getNumVerts(end_cap);
-                         finalEdges += end_cap->getNumEdges(end_cap);
-                         finalFaces += end_cap->getNumFaces(end_cap);
-                 }
-                 result = CDDM_from_template(dm, finalVerts, finalEdges, finalFaces);
-
-                 /* calculate the offset matrix of the final copy (for merging) */ 
-                 unit_m4(final_offset);
-
-                 for(j=0; j < count - 1; j++) {
-                         mul_m4_m4m4(tmp_mat, final_offset, offset);
-                         copy_m4_m4(final_offset, tmp_mat);
-                 }
-
-                 numVerts = numEdges = numFaces = 0;
-                 mvert = CDDM_get_verts(result);
-
-                 for (i = 0; i < maxVerts; i++) {
-                         indexMap[i].merge = -1; /* default to no merge */
-                         indexMap[i].merge_final = 0; /* default to no merge */
-                 }
-
-                 for (i = 0; i < maxVerts; i++) {
-                         MVert *inMV;
-                         MVert *mv = &mvert[numVerts];
-                         MVert *mv2;
-                         float co[3];
-
-                         inMV = &src_mvert[i];
-
-                         DM_copy_vert_data(dm, result, i, numVerts, 1);
-                         *mv = *inMV;
-                         numVerts++;
-
-                         indexMap[i].new = numVerts - 1;
-
-                         copy_v3_v3(co, mv->co);
+       finalVerts = dm->getNumVerts(dm) * count;
+       finalEdges = dm->getNumEdges(dm) * count;
+       finalFaces = dm->getNumFaces(dm) * count;
+       if(start_cap) {
+               finalVerts += start_cap->getNumVerts(start_cap);
+               finalEdges += start_cap->getNumEdges(start_cap);
+               finalFaces += start_cap->getNumFaces(start_cap);
+       }
+       if(end_cap) {
+               finalVerts += end_cap->getNumVerts(end_cap);
+               finalEdges += end_cap->getNumEdges(end_cap);
+               finalFaces += end_cap->getNumFaces(end_cap);
+       }
+       result = CDDM_from_template(dm, finalVerts, finalEdges, finalFaces);
+
+       /* calculate the offset matrix of the final copy (for merging) */
+       unit_m4(final_offset);
+
+       for(j=0; j < count - 1; j++) {
+               mul_m4_m4m4(tmp_mat, final_offset, offset);
+               copy_m4_m4(final_offset, tmp_mat);
+       }
+
+       numVerts = numEdges = numFaces = 0;
+       mvert = CDDM_get_verts(result);
+
+       for (i = 0; i < maxVerts; i++) {
+               indexMap[i].merge = -1; /* default to no merge */
+               indexMap[i].merge_final = 0; /* default to no merge */
+       }
+
+       for (i = 0; i < maxVerts; i++) {
+               MVert *inMV;
+               MVert *mv = &mvert[numVerts];
+               MVert *mv2;
+               float co[3];
+
+               inMV = &src_mvert[i];
+
+               DM_copy_vert_data(dm, result, i, numVerts, 1);
+               *mv = *inMV;
+               numVerts++;
+
+               indexMap[i].new = numVerts - 1;
+
+               copy_v3_v3(co, mv->co);
                
                /* Attempts to merge verts from one duplicate with verts from the
                          * next duplicate which are closer than amd->merge_dist.
@@ -374,405 +374,405 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
                          * If verts are merged in the first duplicate pair, they are merged
                          * in all pairs.
                */
-                         if((count > 1) && (amd->flags & MOD_ARR_MERGE)) {
-                                 float tmp_co[3];
-                                 mul_v3_m4v3(tmp_co, offset, mv->co);
-
-                                 for(j = 0; j < maxVerts; j++) {
-                                         /* if vertex already merged, don't use it */
-                                         if( indexMap[j].merge != -1 ) continue;
-
-                                         inMV = &src_mvert[j];
-                                         /* if this vert is within merge limit, merge */
-                                         if(compare_len_v3v3(tmp_co, inMV->co, amd->merge_dist)) {
-                                                 indexMap[i].merge = j;
-
-                                                 /* test for merging with final copy of merge target */
-                                                 if(amd->flags & MOD_ARR_MERGEFINAL) {
-                                                         copy_v3_v3(tmp_co, inMV->co);
-                                                         inMV = &src_mvert[i];
-                                                         mul_m4_v3(final_offset, tmp_co);
-                                                         if(compare_len_v3v3(tmp_co, inMV->co, amd->merge_dist))
-                                                                 indexMap[i].merge_final = 1;
-                                                 }
-                                                 break;
-                                         }
-                                 }
-                         }
-
-                         /* if no merging, generate copies of this vert */
-                         if(indexMap[i].merge < 0) {
-                                 for(j=0; j < count - 1; j++) {
-                                         mv2 = &mvert[numVerts];
-
-                                         DM_copy_vert_data(result, result, numVerts - 1, numVerts, 1);
-                                         *mv2 = *mv;
-                                         numVerts++;
-
-                                         mul_m4_v3(offset, co);
-                                         copy_v3_v3(mv2->co, co);
-                                 }
-                         } else if(indexMap[i].merge != i && indexMap[i].merge_final) {
+               if((count > 1) && (amd->flags & MOD_ARR_MERGE)) {
+                       float tmp_co[3];
+                       mul_v3_m4v3(tmp_co, offset, mv->co);
+
+                       for(j = 0; j < maxVerts; j++) {
+                               /* if vertex already merged, don't use it */
+                               if( indexMap[j].merge != -1 ) continue;
+
+                               inMV = &src_mvert[j];
+                               /* if this vert is within merge limit, merge */
+                               if(compare_len_v3v3(tmp_co, inMV->co, amd->merge_dist)) {
+                                       indexMap[i].merge = j;
+
+                                       /* test for merging with final copy of merge target */
+                                       if(amd->flags & MOD_ARR_MERGEFINAL) {
+                                               copy_v3_v3(tmp_co, inMV->co);
+                                               inMV = &src_mvert[i];
+                                               mul_m4_v3(final_offset, tmp_co);
+                                               if(compare_len_v3v3(tmp_co, inMV->co, amd->merge_dist))
+                                                       indexMap[i].merge_final = 1;
+                                       }
+                                       break;
+                               }
+                       }
+               }
+
+               /* if no merging, generate copies of this vert */
+               if(indexMap[i].merge < 0) {
+                       for(j=0; j < count - 1; j++) {
+                               mv2 = &mvert[numVerts];
+
+                               DM_copy_vert_data(result, result, numVerts - 1, numVerts, 1);
+                               *mv2 = *mv;
+                               numVerts++;
+
+                               mul_m4_v3(offset, co);
+                               copy_v3_v3(mv2->co, co);
+                       }
+               } else if(indexMap[i].merge != i && indexMap[i].merge_final) {
                        /* if this vert is not merging with itself, and it is merging
                                  * with the final copy of its merge target, remove the first copy
                        */
-                                 numVerts--;
-                                 DM_free_vert_data(result, numVerts, 1);
-                         }
-                 }
+                       numVerts--;
+                       DM_free_vert_data(result, numVerts, 1);
+               }
+       }
 
-                 /* make a hashtable so we can avoid duplicate edges from merging */
-                 edges = BLI_edgehash_new();
+       /* make a hashtable so we can avoid duplicate edges from merging */
+       edges = BLI_edgehash_new();
 
-                 maxEdges = dm->getNumEdges(dm);
-                 medge = CDDM_get_edges(result);
-                 for(i = 0; i < maxEdges; i++) {
-                         MEdge inMED;
-                         MEdge med;
-                         MEdge *med2;
-                         int vert1, vert2;
+       maxEdges = dm->getNumEdges(dm);
+       medge = CDDM_get_edges(result);
+       for(i = 0; i < maxEdges; i++) {
+               MEdge inMED;
+               MEdge med;
+               MEdge *med2;
+               int vert1, vert2;
 
-                         dm->getEdge(dm, i, &inMED);
+               dm->getEdge(dm, i, &inMED);
 
-                         med = inMED;
-                         med.v1 = indexMap[inMED.v1].new;
-                         med.v2 = indexMap[inMED.v2].new;
+               med = inMED;
+               med.v1 = indexMap[inMED.v1].new;
+               med.v2 = indexMap[inMED.v2].new;
 
                /* if vertices are to be merged with the final copies of their
                          * merge targets, calculate that final copy
                */
-                         if(indexMap[inMED.v1].merge_final) {
-                                 med.v1 = calc_mapping(indexMap, indexMap[inMED.v1].merge,
-                                                 count - 1);
-                         }
-                         if(indexMap[inMED.v2].merge_final) {
-                                 med.v2 = calc_mapping(indexMap, indexMap[inMED.v2].merge,
-                                                 count - 1);
-                         }
-
-                         if(med.v1 == med.v2) continue;
-                         
-                         /* XXX Unfortunately the calc_mapping returns sometimes numVerts... leads to bad crashes */
-                         if(med.v1 >= numVerts)
-                                 med.v1= numVerts-1;
-                         if(med.v2 >= numVerts)
-                                 med.v2= numVerts-1;
-                         
-                         if (initFlags) {
-                                 med.flag |= ME_EDGEDRAW | ME_EDGERENDER;
-                         }
-
-                         if(!BLI_edgehash_haskey(edges, med.v1, med.v2)) {
-                                 DM_copy_edge_data(dm, result, i, numEdges, 1);
-                                 medge[numEdges] = med;
-                                 numEdges++;
-
-                                 BLI_edgehash_insert(edges, med.v1, med.v2, NULL);
-                         }
-
-                         for(j = 1; j < count; j++)
-                         {
-                                 vert1 = calc_mapping(indexMap, inMED.v1, j);
-                                 vert2 = calc_mapping(indexMap, inMED.v2, j);
-                                 
-                                 /* edge could collapse to single point after mapping */
-                                 if(vert1 == vert2) continue;
-                                 
-                                 /* XXX Unfortunately the calc_mapping returns sometimes numVerts... leads to bad crashes */
-                                 if(vert1 >= numVerts)
-                                         vert1= numVerts-1;
-                                 if(vert2 >= numVerts)
-                                         vert2= numVerts-1;
-
-                                 /* avoid duplicate edges */
-                                 if(!BLI_edgehash_haskey(edges, vert1, vert2)) {
-                                         med2 = &medge[numEdges];
-
-                                         DM_copy_edge_data(dm, result, i, numEdges, 1);
-                                         *med2 = med;
-                                         numEdges++;
-
-                                         med2->v1 = vert1;
-                                         med2->v2 = vert2;
-
-                                         BLI_edgehash_insert(edges, med2->v1, med2->v2, NULL);
-                                 }
-                         }
-                 }
-
-                 maxFaces = dm->getNumFaces(dm);
-                 mface = CDDM_get_faces(result);
-                 for (i=0; i < maxFaces; i++) {
-                         MFace inMF;
-                         MFace *mf = &mface[numFaces];
-
-                         dm->getFace(dm, i, &inMF);
-
-                         DM_copy_face_data(dm, result, i, numFaces, 1);
-                         *mf = inMF;
-
-                         mf->v1 = indexMap[inMF.v1].new;
-                         mf->v2 = indexMap[inMF.v2].new;
-                         mf->v3 = indexMap[inMF.v3].new;
-                         if(inMF.v4)
-                                 mf->v4 = indexMap[inMF.v4].new;
+               if(indexMap[inMED.v1].merge_final) {
+                       med.v1 = calc_mapping(indexMap, indexMap[inMED.v1].merge,
+                       count - 1);
+               }
+               if(indexMap[inMED.v2].merge_final) {
+                       med.v2 = calc_mapping(indexMap, indexMap[inMED.v2].merge,
+                       count - 1);
+               }
+
+               if(med.v1 == med.v2) continue;
+
+               /* XXX Unfortunately the calc_mapping returns sometimes numVerts... leads to bad crashes */
+               if(med.v1 >= numVerts)
+                       med.v1= numVerts-1;
+               if(med.v2 >= numVerts)
+                       med.v2= numVerts-1;
+
+               if (initFlags) {
+                       med.flag |= ME_EDGEDRAW | ME_EDGERENDER;
+               }
+
+               if(!BLI_edgehash_haskey(edges, med.v1, med.v2)) {
+                       DM_copy_edge_data(dm, result, i, numEdges, 1);
+                       medge[numEdges] = med;
+                       numEdges++;
+
+                       BLI_edgehash_insert(edges, med.v1, med.v2, NULL);
+               }
+
+               for(j = 1; j < count; j++)
+               {
+                       vert1 = calc_mapping(indexMap, inMED.v1, j);
+                       vert2 = calc_mapping(indexMap, inMED.v2, j);
+
+                       /* edge could collapse to single point after mapping */
+                       if(vert1 == vert2) continue;
+
+                       /* XXX Unfortunately the calc_mapping returns sometimes numVerts... leads to bad crashes */
+                       if(vert1 >= numVerts)
+                               vert1= numVerts-1;
+                       if(vert2 >= numVerts)
+                               vert2= numVerts-1;
+
+                       /* avoid duplicate edges */
+                       if(!BLI_edgehash_haskey(edges, vert1, vert2)) {
+                               med2 = &medge[numEdges];
+
+                               DM_copy_edge_data(dm, result, i, numEdges, 1);
+                               *med2 = med;
+                               numEdges++;
+
+                               med2->v1 = vert1;
+                               med2->v2 = vert2;
+
+                               BLI_edgehash_insert(edges, med2->v1, med2->v2, NULL);
+                       }
+               }
+       }
+
+       maxFaces = dm->getNumFaces(dm);
+       mface = CDDM_get_faces(result);
+       for (i=0; i < maxFaces; i++) {
+               MFace inMF;
+               MFace *mf = &mface[numFaces];
+
+               dm->getFace(dm, i, &inMF);
+
+               DM_copy_face_data(dm, result, i, numFaces, 1);
+               *mf = inMF;
+
+               mf->v1 = indexMap[inMF.v1].new;
+               mf->v2 = indexMap[inMF.v2].new;
+               mf->v3 = indexMap[inMF.v3].new;
+               if(inMF.v4)
+                       mf->v4 = indexMap[inMF.v4].new;
 
                /* if vertices are to be merged with the final copies of their
                          * merge targets, calculate that final copy
                */
-                         if(indexMap[inMF.v1].merge_final)
-                                 mf->v1 = calc_mapping(indexMap, indexMap[inMF.v1].merge, count-1);
-                         if(indexMap[inMF.v2].merge_final)
-                                 mf->v2 = calc_mapping(indexMap, indexMap[inMF.v2].merge, count-1);
-                         if(indexMap[inMF.v3].merge_final)
-                                 mf->v3 = calc_mapping(indexMap, indexMap[inMF.v3].merge, count-1);
-                         if(inMF.v4 && indexMap[inMF.v4].merge_final)
-                                 mf->v4 = calc_mapping(indexMap, indexMap[inMF.v4].merge, count-1);
-
-                         if(test_index_face_maxvert(mf, &result->faceData, numFaces, inMF.v4?4:3, numVerts) < 3)
-                                 continue;
-
-                         numFaces++;
-
-                         /* if the face has fewer than 3 vertices, don't create it */
-                         if(mf->v3 == 0 || (mf->v1 && (mf->v1 == mf->v3 || mf->v1 == mf->v4))) {
-                                 numFaces--;
-                                 DM_free_face_data(result, numFaces, 1);
-                         }
-
-                         for(j = 1; j < count; j++)
-                         {
-                                 MFace *mf2 = &mface[numFaces];
-
-                                 DM_copy_face_data(dm, result, i, numFaces, 1);
-                                 *mf2 = *mf;
-
-                                 mf2->v1 = calc_mapping(indexMap, inMF.v1, j);
-                                 mf2->v2 = calc_mapping(indexMap, inMF.v2, j);
-                                 mf2->v3 = calc_mapping(indexMap, inMF.v3, j);
-                                 if (inMF.v4)
-                                         mf2->v4 = calc_mapping(indexMap, inMF.v4, j);
-
-                                 numFaces++;
-
-                                 /* if the face has fewer than 3 vertices, don't create it */
-                                 if(test_index_face_maxvert(mf2, &result->faceData, numFaces-1, inMF.v4?4:3, numVerts) < 3) {
-                                         numFaces--;
-                                         DM_free_face_data(result, numFaces, 1);
-                                                                }
-                         }
-                 }
-
-                 /* add start and end caps */
-                 if(start_cap) {
-                         float startoffset[4][4];
-                         MVert *cap_mvert;
-                         MEdge *cap_medge;
-                         MFace *cap_mface;
-                         int *origindex;
-                         int *vert_map;
-                         int capVerts, capEdges, capFaces;
-
-                         capVerts = start_cap->getNumVerts(start_cap);
-                         capEdges = start_cap->getNumEdges(start_cap);
-                         capFaces = start_cap->getNumFaces(start_cap);
-                         cap_mvert = start_cap->getVertArray(start_cap);
-                         cap_medge = start_cap->getEdgeArray(start_cap);
-                         cap_mface = start_cap->getFaceArray(start_cap);
-
-                         invert_m4_m4(startoffset, offset);
-
-                         vert_map = MEM_callocN(sizeof(*vert_map) * capVerts,
-                                         "arrayModifier_doArray vert_map");
-
-                         origindex = result->getVertDataArray(result, CD_ORIGINDEX);
-                         for(i = 0; i < capVerts; i++) {
-                                 MVert *mv = &cap_mvert[i];
-                                 short merged = 0;
-
-                                 if(amd->flags & MOD_ARR_MERGE) {
-                                         float tmp_co[3];
-                                         MVert *in_mv;
-                                         int j;
-
-                                         copy_v3_v3(tmp_co, mv->co);
-                                         mul_m4_v3(startoffset, tmp_co);
-
-                                         for(j = 0; j < maxVerts; j++) {
-                                                 in_mv = &src_mvert[j];
-                                                 /* if this vert is within merge limit, merge */
-                                                 if(compare_len_v3v3(tmp_co, in_mv->co, amd->merge_dist)) {
-                                                         vert_map[i] = calc_mapping(indexMap, j, 0);
-                                                         merged = 1;
-                                                         break;
-                                                 }
-                                         }
-                                 }
-
-                                 if(!merged) {
-                                         DM_copy_vert_data(start_cap, result, i, numVerts, 1);
-                                         mvert[numVerts] = *mv;
-                                         mul_m4_v3(startoffset, mvert[numVerts].co);
-                                         origindex[numVerts] = ORIGINDEX_NONE;
-
-                                         vert_map[i] = numVerts;
-
-                                         numVerts++;
-                                 }
-                         }
-                         origindex = result->getEdgeDataArray(result, CD_ORIGINDEX);
-                         for(i = 0; i < capEdges; i++) {
-                                 int v1, v2;
-
-                                 v1 = vert_map[cap_medge[i].v1];
-                                 v2 = vert_map[cap_medge[i].v2];
-
-                                 if(!BLI_edgehash_haskey(edges, v1, v2)) {
-                                         DM_copy_edge_data(start_cap, result, i, numEdges, 1);
-                                         medge[numEdges] = cap_medge[i];
-                                         medge[numEdges].v1 = v1;
-                                         medge[numEdges].v2 = v2;
-                                         origindex[numEdges] = ORIGINDEX_NONE;
-
-                                         numEdges++;
-                                 }
-                         }
-                         origindex = result->getFaceDataArray(result, CD_ORIGINDEX);
-                         for(i = 0; i < capFaces; i++) {
-                                 DM_copy_face_data(start_cap, result, i, numFaces, 1);
-                                 mface[numFaces] = cap_mface[i];
-                                 mface[numFaces].v1 = vert_map[mface[numFaces].v1];
-                                 mface[numFaces].v2 = vert_map[mface[numFaces].v2];
-                                 mface[numFaces].v3 = vert_map[mface[numFaces].v3];
-                                 if(mface[numFaces].v4) {
-                                         mface[numFaces].v4 = vert_map[mface[numFaces].v4];
-
-                                         test_index_face_maxvert(&mface[numFaces], &result->faceData,
-                                                                         numFaces, 4, numVerts);
-                                 }
-                                 else
-                                 {
-                                         test_index_face(&mface[numFaces], &result->faceData,
-                                                                         numFaces, 3);
-                                 }
-
-                                 origindex[numFaces] = ORIGINDEX_NONE;
-
-                                 numFaces++;
-                         }
-
-                         MEM_freeN(vert_map);
-                         start_cap->release(start_cap);
-                 }
-
-                 if(end_cap) {
-                         float endoffset[4][4];
-                         MVert *cap_mvert;
-                         MEdge *cap_medge;
-                         MFace *cap_mface;
-                         int *origindex;
-                         int *vert_map;
-                         int capVerts, capEdges, capFaces;
-
-                         capVerts = end_cap->getNumVerts(end_cap);
-                         capEdges = end_cap->getNumEdges(end_cap);
-                         capFaces = end_cap->getNumFaces(end_cap);
-                         cap_mvert = end_cap->getVertArray(end_cap);
-                         cap_medge = end_cap->getEdgeArray(end_cap);
-                         cap_mface = end_cap->getFaceArray(end_cap);
-
-                         mul_m4_m4m4(endoffset, final_offset, offset);
-
-                         vert_map = MEM_callocN(sizeof(*vert_map) * capVerts,
-                                         "arrayModifier_doArray vert_map");
-
-                         origindex = result->getVertDataArray(result, CD_ORIGINDEX);
-                         for(i = 0; i < capVerts; i++) {
-                                 MVert *mv = &cap_mvert[i];
-                                 short merged = 0;
-
-                                 if(amd->flags & MOD_ARR_MERGE) {
-                                         float tmp_co[3];
-                                         MVert *in_mv;
-                                         int j;
-
-                                         copy_v3_v3(tmp_co, mv->co);
-                                         mul_m4_v3(offset, tmp_co);
-
-                                         for(j = 0; j < maxVerts; j++) {
-                                                 in_mv = &src_mvert[j];
-                                                 /* if this vert is within merge limit, merge */
-                                                 if(compare_len_v3v3(tmp_co, in_mv->co, amd->merge_dist)) {
-                                                         vert_map[i] = calc_mapping(indexMap, j, count - 1);
-                                                         merged = 1;
-                                                         break;
-                                                 }
-                                         }
-                                 }
-
-                                 if(!merged) {
-                                         DM_copy_vert_data(end_cap, result, i, numVerts, 1);
-                                         mvert[numVerts] = *mv;
-                                         mul_m4_v3(endoffset, mvert[numVerts].co);
-                                         origindex[numVerts] = ORIGINDEX_NONE;
-
-                                         vert_map[i] = numVerts;
-
-                                         numVerts++;
-                                 }
-                         }
-                         origindex = result->getEdgeDataArray(result, CD_ORIGINDEX);
-                         for(i = 0; i < capEdges; i++) {
-                                 int v1, v2;
-
-                                 v1 = vert_map[cap_medge[i].v1];
-                                 v2 = vert_map[cap_medge[i].v2];
-
-                                 if(!BLI_edgehash_haskey(edges, v1, v2)) {
-                                         DM_copy_edge_data(end_cap, result, i, numEdges, 1);
-                                         medge[numEdges] = cap_medge[i];
-                                         medge[numEdges].v1 = v1;
-                                         medge[numEdges].v2 = v2;
-                                         origindex[numEdges] = ORIGINDEX_NONE;
-
-                                         numEdges++;
-                                 }
-                         }
-                         origindex = result->getFaceDataArray(result, CD_ORIGINDEX);
-                         for(i = 0; i < capFaces; i++) {
-                                 DM_copy_face_data(end_cap, result, i, numFaces, 1);
-                                 mface[numFaces] = cap_mface[i];
-                                 mface[numFaces].v1 = vert_map[mface[numFaces].v1];
-                                 mface[numFaces].v2 = vert_map[mface[numFaces].v2];
-                                 mface[numFaces].v3 = vert_map[mface[numFaces].v3];
-                                 if(mface[numFaces].v4) {
-                                         mface[numFaces].v4 = vert_map[mface[numFaces].v4];
-
-                                         test_index_face(&mface[numFaces], &result->faceData,
-                                                                         numFaces, 4);
-                                 }
-                                 else
-                                 {
-                                         test_index_face(&mface[numFaces], &result->faceData,
-                                                                         numFaces, 3);
-                                 }
-                                 origindex[numFaces] = ORIGINDEX_NONE;
-
-                                 numFaces++;
-                         }
-
-                         MEM_freeN(vert_map);
-                         end_cap->release(end_cap);
-                 }
-
-                 BLI_edgehash_free(edges, NULL);
-                 MEM_freeN(indexMap);
-
-                 CDDM_lower_num_verts(result, numVerts);
-                 CDDM_lower_num_edges(result, numEdges);
-                 CDDM_lower_num_faces(result, numFaces);
-
-                 return result;
+               if(indexMap[inMF.v1].merge_final)
+                       mf->v1 = calc_mapping(indexMap, indexMap[inMF.v1].merge, count-1);
+               if(indexMap[inMF.v2].merge_final)
+                       mf->v2 = calc_mapping(indexMap, indexMap[inMF.v2].merge, count-1);
+               if(indexMap[inMF.v3].merge_final)
+                       mf->v3 = calc_mapping(indexMap, indexMap[inMF.v3].merge, count-1);
+               if(inMF.v4 && indexMap[inMF.v4].merge_final)
+                       mf->v4 = calc_mapping(indexMap, indexMap[inMF.v4].merge, count-1);
+
+               if(test_index_face_maxvert(mf, &result->faceData, numFaces, inMF.v4?4:3, numVerts) < 3)
+                       continue;
+
+               numFaces++;
+
+               /* if the face has fewer than 3 vertices, don't create it */
+               if(mf->v3 == 0 || (mf->v1 && (mf->v1 == mf->v3 || mf->v1 == mf->v4))) {
+                       numFaces--;
+                       DM_free_face_data(result, numFaces, 1);
+               }
+
+               for(j = 1; j < count; j++)
+               {
+                       MFace *mf2 = &mface[numFaces];
+
+                       DM_copy_face_data(dm, result, i, numFaces, 1);
+                       *mf2 = *mf;
+
+                       mf2->v1 = calc_mapping(indexMap, inMF.v1, j);
+                       mf2->v2 = calc_mapping(indexMap, inMF.v2, j);
+                       mf2->v3 = calc_mapping(indexMap, inMF.v3, j);
+                       if (inMF.v4)
+                               mf2->v4 = calc_mapping(indexMap, inMF.v4, j);
+
+                       numFaces++;
+
+                       /* if the face has fewer than 3 vertices, don't create it */
+                       if(test_index_face_maxvert(mf2, &result->faceData, numFaces-1, inMF.v4?4:3, numVerts) < 3) {
+                               numFaces--;
+                               DM_free_face_data(result, numFaces, 1);
+                       }
+               }
+       }
+
+       /* add start and end caps */
+       if(start_cap) {
+               float startoffset[4][4];
+               MVert *cap_mvert;
+               MEdge *cap_medge;
+               MFace *cap_mface;
+               int *origindex;
+               int *vert_map;
+               int capVerts, capEdges, capFaces;
+
+               capVerts = start_cap->getNumVerts(start_cap);
+               capEdges = start_cap->getNumEdges(start_cap);
+               capFaces = start_cap->getNumFaces(start_cap);
+               cap_mvert = start_cap->getVertArray(start_cap);
+               cap_medge = start_cap->getEdgeArray(start_cap);
+               cap_mface = start_cap->getFaceArray(start_cap);
+
+               invert_m4_m4(startoffset, offset);
+
+               vert_map = MEM_callocN(sizeof(*vert_map) * capVerts,
+               "arrayModifier_doArray vert_map");
+
+               origindex = result->getVertDataArray(result, CD_ORIGINDEX);
+               for(i = 0; i < capVerts; i++) {
+                       MVert *mv = &cap_mvert[i];
+                       short merged = 0;
+
+                       if(amd->flags & MOD_ARR_MERGE) {
+                               float tmp_co[3];
+                               MVert *in_mv;
+                               int j;
+
+                               copy_v3_v3(tmp_co, mv->co);
+                               mul_m4_v3(startoffset, tmp_co);
+
+                               for(j = 0; j < maxVerts; j++) {
+                                       in_mv = &src_mvert[j];
+                                       /* if this vert is within merge limit, merge */
+                                       if(compare_len_v3v3(tmp_co, in_mv->co, amd->merge_dist)) {
+                                               vert_map[i] = calc_mapping(indexMap, j, 0);
+                                               merged = 1;
+                                               break;
+                                       }
+                               }
+                       }
+
+                       if(!merged) {
+                               DM_copy_vert_data(start_cap, result, i, numVerts, 1);
+                               mvert[numVerts] = *mv;
+                               mul_m4_v3(startoffset, mvert[numVerts].co);
+                               origindex[numVerts] = ORIGINDEX_NONE;
+
+                               vert_map[i] = numVerts;
+
+                               numVerts++;
+                       }
+               }
+               origindex = result->getEdgeDataArray(result, CD_ORIGINDEX);
+               for(i = 0; i < capEdges; i++) {
+                       int v1, v2;
+
+                       v1 = vert_map[cap_medge[i].v1];
+                       v2 = vert_map[cap_medge[i].v2];
+
+                       if(!BLI_edgehash_haskey(edges, v1, v2)) {
+                               DM_copy_edge_data(start_cap, result, i, numEdges, 1);
+                               medge[numEdges] = cap_medge[i];
+                               medge[numEdges].v1 = v1;
+                               medge[numEdges].v2 = v2;
+                               origindex[numEdges] = ORIGINDEX_NONE;
+
+                               numEdges++;
+                       }
+               }
+               origindex = result->getFaceDataArray(result, CD_ORIGINDEX);
+               for(i = 0; i < capFaces; i++) {
+                       DM_copy_face_data(start_cap, result, i, numFaces, 1);
+                       mface[numFaces] = cap_mface[i];
+                       mface[numFaces].v1 = vert_map[mface[numFaces].v1];
+                       mface[numFaces].v2 = vert_map[mface[numFaces].v2];
+                       mface[numFaces].v3 = vert_map[mface[numFaces].v3];
+                       if(mface[numFaces].v4) {
+                               mface[numFaces].v4 = vert_map[mface[numFaces].v4];
+
+                               test_index_face_maxvert(&mface[numFaces], &result->faceData,
+                               numFaces, 4, numVerts);
+                       }
+                       else
+                       {
+                               test_index_face(&mface[numFaces], &result->faceData,
+                               numFaces, 3);
+                       }
+
+                       origindex[numFaces] = ORIGINDEX_NONE;
+
+                       numFaces++;
+               }
+
+               MEM_freeN(vert_map);
+               start_cap->release(start_cap);
+       }
+
+       if(end_cap) {
+               float endoffset[4][4];
+               MVert *cap_mvert;
+               MEdge *cap_medge;
+               MFace *cap_mface;
+               int *origindex;
+               int *vert_map;
+               int capVerts, capEdges, capFaces;
+
+               capVerts = end_cap->getNumVerts(end_cap);
+               capEdges = end_cap->getNumEdges(end_cap);
+               capFaces = end_cap->getNumFaces(end_cap);
+               cap_mvert = end_cap->getVertArray(end_cap);
+               cap_medge = end_cap->getEdgeArray(end_cap);
+               cap_mface = end_cap->getFaceArray(end_cap);
+
+               mul_m4_m4m4(endoffset, final_offset, offset);
+
+               vert_map = MEM_callocN(sizeof(*vert_map) * capVerts,
+               "arrayModifier_doArray vert_map");
+
+               origindex = result->getVertDataArray(result, CD_ORIGINDEX);
+               for(i = 0; i < capVerts; i++) {
+                       MVert *mv = &cap_mvert[i];
+                       short merged = 0;
+
+                       if(amd->flags & MOD_ARR_MERGE) {
+                               float tmp_co[3];
+                               MVert *in_mv;
+                               int j;
+
+                               copy_v3_v3(tmp_co, mv->co);
+                               mul_m4_v3(offset, tmp_co);
+
+                               for(j = 0; j < maxVerts; j++) {
+                                       in_mv = &src_mvert[j];
+                                       /* if this vert is within merge limit, merge */
+                                       if(compare_len_v3v3(tmp_co, in_mv->co, amd->merge_dist)) {
+                                               vert_map[i] = calc_mapping(indexMap, j, count - 1);
+                                               merged = 1;
+                                               break;
+                                       }
+                               }
+                       }
+
+                       if(!merged) {
+                               DM_copy_vert_data(end_cap, result, i, numVerts, 1);
+                               mvert[numVerts] = *mv;
+                               mul_m4_v3(endoffset, mvert[numVerts].co);
+                               origindex[numVerts] = ORIGINDEX_NONE;
+
+                               vert_map[i] = numVerts;
+
+                               numVerts++;
+                       }
+               }
+               origindex = result->getEdgeDataArray(result, CD_ORIGINDEX);
+               for(i = 0; i < capEdges; i++) {
+                       int v1, v2;
+
+                       v1 = vert_map[cap_medge[i].v1];
+                       v2 = vert_map[cap_medge[i].v2];
+
+                       if(!BLI_edgehash_haskey(edges, v1, v2)) {
+                               DM_copy_edge_data(end_cap, result, i, numEdges, 1);
+                               medge[numEdges] = cap_medge[i];
+                               medge[numEdges].v1 = v1;
+                               medge[numEdges].v2 = v2;
+                               origindex[numEdges] = ORIGINDEX_NONE;
+
+                               numEdges++;
+                       }
+               }
+               origindex = result->getFaceDataArray(result, CD_ORIGINDEX);
+               for(i = 0; i < capFaces; i++) {
+                       DM_copy_face_data(end_cap, result, i, numFaces, 1);
+                       mface[numFaces] = cap_mface[i];
+                       mface[numFaces].v1 = vert_map[mface[numFaces].v1];
+                       mface[numFaces].v2 = vert_map[mface[numFaces].v2];
+                       mface[numFaces].v3 = vert_map[mface[numFaces].v3];
+                       if(mface[numFaces].v4) {
+                               mface[numFaces].v4 = vert_map[mface[numFaces].v4];
+
+                               test_index_face(&mface[numFaces], &result->faceData,
+                               numFaces, 4);
+                       }
+                       else
+                       {
+                               test_index_face(&mface[numFaces], &result->faceData,
+                               numFaces, 3);
+                       }
+                       origindex[numFaces] = ORIGINDEX_NONE;
+
+                       numFaces++;
+               }
+
+               MEM_freeN(vert_map);
+               end_cap->release(end_cap);
+       }
+
+       BLI_edgehash_free(edges, NULL);
+       MEM_freeN(indexMap);
+
+       CDDM_lower_num_verts(result, numVerts);
+       CDDM_lower_num_edges(result, numEdges);
+       CDDM_lower_num_faces(result, numFaces);
+
+       return result;
 }
 
 static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
index 1cf67ac8cae070109606c168c72b294176a012c8..e293be5886dcfd88f188078ba633fbb91dc36e3f 100644 (file)
@@ -212,17 +212,17 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                        !BLI_ghashIterator_isDone(hashIter);
                        BLI_ghashIterator_step(hashIter)
        ) {
-          MVert source;
-          MVert *dest;
-          int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
-          int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(hashIter));
+               MVert source;
+               MVert *dest;
+               int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
+               int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(hashIter));
 
-          dm->getVert(dm, oldIndex, &source);
-          dest = CDDM_get_vert(result, newIndex);
+               dm->getVert(dm, oldIndex, &source);
+               dest = CDDM_get_vert(result, newIndex);
 
-          DM_copy_vert_data(dm, result, oldIndex, newIndex, 1);
-          *dest = source;
-   }
+               DM_copy_vert_data(dm, result, oldIndex, newIndex, 1);
+               *dest = source;
+       }
        BLI_ghashIterator_free(hashIter);
        
        /* copy the edges across, remapping indices */
index 09e29d9ed8efe36786932fa484ec1a10d6fef84c..22ba1447d20ad1eeb1de6061b3c98b56bf243ef3 100644 (file)
@@ -175,11 +175,11 @@ static SmoothMesh *smoothmesh_new(int num_verts, int num_edges, int num_faces,
 {
        SmoothMesh *mesh = MEM_callocN(sizeof(*mesh), "smoothmesh");
        mesh->verts = MEM_callocN(sizeof(*mesh->verts) * max_verts,
-                                 "SmoothMesh.verts");
+                       "SmoothMesh.verts");
        mesh->edges = MEM_callocN(sizeof(*mesh->edges) * max_edges,
-                                 "SmoothMesh.edges");
+                       "SmoothMesh.edges");
        mesh->faces = MEM_callocN(sizeof(*mesh->faces) * max_faces,
-                                 "SmoothMesh.faces");
+                       "SmoothMesh.faces");
 
        mesh->num_verts = num_verts;
        mesh->num_edges = num_edges;
@@ -280,8 +280,8 @@ static void smoothmesh_print(SmoothMesh *mesh)
                dm->getVert(dm, vert->oldIndex, &mv);
 
                printf("%3d: ind={%3d, %3d}, pos={% 5.1f, % 5.1f, % 5.1f}",
-                          i, vert->oldIndex, vert->newIndex,
-        mv.co[0], mv.co[1], mv.co[2]);
+                               i, vert->oldIndex, vert->newIndex,
+                               mv.co[0], mv.co[1], mv.co[2]);
                printf(", faces={");
                for(node = vert->faces; node != NULL; node = node->next) {
                        printf(" %d", ((SmoothFace *)node->link)->newIndex);
@@ -296,8 +296,8 @@ static void smoothmesh_print(SmoothMesh *mesh)
 
                printf("%4d: indices={%4d, %4d}, verts={%4d, %4d}",
                           i,
-        edge->oldIndex, edge->newIndex,
-  edge->verts[0]->newIndex, edge->verts[1]->newIndex);
+               edge->oldIndex, edge->newIndex,
+               edge->verts[0]->newIndex, edge->verts[1]->newIndex);
                if(edge->verts[0] == edge->verts[1]) printf(" <- DUPLICATE VERTEX");
                printf(", faces={");
                for(node = edge->faces; node != NULL; node = node->next) {
@@ -311,7 +311,7 @@ static void smoothmesh_print(SmoothMesh *mesh)
                SmoothFace *face = &mesh->faces[i];
 
                printf("%4d: indices={%4d, %4d}, edges={", i,
-                          face->oldIndex, face->newIndex);
+                               face->oldIndex, face->newIndex);
                for(j = 0; j < SMOOTHFACE_MAX_EDGES && face->edges[j]; j++) {
                        if(face->flip[j])
                                printf(" -%-2d", face->edges[j]->newIndex);
@@ -339,7 +339,7 @@ static SmoothMesh *smoothmesh_from_derivedmesh(DerivedMesh *dm)
        totface = dm->getNumFaces(dm);
 
        mesh = smoothmesh_new(totvert, totedge, totface,
-                                 totvert, totedge, totface);
+                       totvert, totedge, totface);
 
        mesh->dm = dm;
 
@@ -410,8 +410,8 @@ static DerivedMesh *CDDM_from_smoothmesh(SmoothMesh *mesh)
 {
        DerivedMesh *result = CDDM_from_template(mesh->dm,
                        mesh->num_verts,
-   mesh->num_edges,
-   mesh->num_faces);
+                       mesh->num_edges,
+                       mesh->num_faces);
        MVert *new_verts = CDDM_get_verts(result);
        MEdge *new_edges = CDDM_get_edges(result);
        MFace *new_faces = CDDM_get_faces(result);
@@ -422,7 +422,7 @@ static DerivedMesh *CDDM_from_smoothmesh(SmoothMesh *mesh)
                MVert *newMV = &new_verts[vert->newIndex];
 
                DM_copy_vert_data(mesh->dm, result,
-                                 vert->oldIndex, vert->newIndex, 1);
+                               vert->oldIndex, vert->newIndex, 1);
                mesh->dm->getVert(mesh->dm, vert->oldIndex, newMV);
        }
 
@@ -431,7 +431,7 @@ static DerivedMesh *CDDM_from_smoothmesh(SmoothMesh *mesh)
                MEdge *newME = &new_edges[edge->newIndex];
 
                DM_copy_edge_data(mesh->dm, result,
-                                 edge->oldIndex, edge->newIndex, 1);
+                               edge->oldIndex, edge->newIndex, 1);
                mesh->dm->getEdge(mesh->dm, edge->oldIndex, newME);
                newME->v1 = edge->verts[0]->newIndex;
                newME->v2 = edge->verts[1]->newIndex;
@@ -442,7 +442,7 @@ static DerivedMesh *CDDM_from_smoothmesh(SmoothMesh *mesh)
                MFace *newMF = &new_faces[face->newIndex];
 
                DM_copy_face_data(mesh->dm, result,
-                                 face->oldIndex, face->newIndex, 1);
+                               face->oldIndex, face->newIndex, 1);
                mesh->dm->getFace(mesh->dm, face->oldIndex, newMF);
 
                newMF->v1 = face->edges[0]->verts[face->flip[0]]->newIndex;
@@ -666,7 +666,7 @@ static void edge_replace_vert(void *ptr, void *userdata)
 
 #ifdef EDGESPLIT_DEBUG_3
        printf("replacing vert %4d with %4d in edge %4d",
-                  find->newIndex, replace->newIndex, edge->newIndex);
+                       find->newIndex, replace->newIndex, edge->newIndex);
        printf(": {%4d, %4d}", edge->verts[0]->newIndex, edge->verts[1]->newIndex);
 #endif
 
@@ -702,15 +702,15 @@ static void face_replace_edge(void *ptr, void *userdata)
 
 #ifdef EDGESPLIT_DEBUG_3
        printf("replacing edge %4d with %4d in face %4d",
-                  find->newIndex, replace->newIndex, face->newIndex);
+                       find->newIndex, replace->newIndex, face->newIndex);
        if(face->edges[3])
                printf(": {%2d %2d %2d %2d}",
-                          face->edges[0]->newIndex, face->edges[1]->newIndex,
-        face->edges[2]->newIndex, face->edges[3]->newIndex);
+                               face->edges[0]->newIndex, face->edges[1]->newIndex,
+                               face->edges[2]->newIndex, face->edges[3]->newIndex);
        else
                printf(": {%2d %2d %2d}",
-                          face->edges[0]->newIndex, face->edges[1]->newIndex,
-        face->edges[2]->newIndex);
+                               face->edges[0]->newIndex, face->edges[1]->newIndex,
+                               face->edges[2]->newIndex);
 #endif
 
        for(i = 0; i < SMOOTHFACE_MAX_EDGES && face->edges[i]; i++) {
@@ -724,12 +724,12 @@ static void face_replace_edge(void *ptr, void *userdata)
 #ifdef EDGESPLIT_DEBUG_3
        if(face->edges[3])
                printf(" -> {%2d %2d %2d %2d}\n",
-                          face->edges[0]->newIndex, face->edges[1]->newIndex,
-        face->edges[2]->newIndex, face->edges[3]->newIndex);
+                               face->edges[0]->newIndex, face->edges[1]->newIndex,
+                               face->edges[2]->newIndex, face->edges[3]->newIndex);
        else
                printf(" -> {%2d %2d %2d}\n",
-                          face->edges[0]->newIndex, face->edges[1]->newIndex,
-        face->edges[2]->newIndex);
+                               face->edges[0]->newIndex, face->edges[1]->newIndex,
+                               face->edges[2]->newIndex);
 #endif
 }
 
@@ -776,7 +776,7 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, Lin
        LinkNode *visited_edges = NULL;
 #ifdef EDGESPLIT_DEBUG_1
        printf("=== START === find_other_sharp_edge(edge = %4d, vert = %4d)\n",
-                  edge->newIndex, vert->newIndex);
+                       edge->newIndex, vert->newIndex);
 #endif
 
        /* get a face on which to start */
@@ -800,7 +800,7 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, Lin
                         && !linklist_contains(visited_edges, edge2)) {
 #ifdef EDGESPLIT_DEBUG_3
                printf("current face %4d; current edge %4d\n", face->newIndex,
-                          edge2->newIndex);
+                               edge2->newIndex);
 #endif
                /* get the next face */
                face = other_face(edge2, face);
@@ -818,26 +818,26 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, Lin
                        edge2 = other_edge(face, vert, edge2);
 #ifdef EDGESPLIT_DEBUG_3
                        printf("next face %4d; next edge %4d\n",
-                                  face->newIndex, edge2->newIndex);
+                                       face->newIndex, edge2->newIndex);
                } else {
                        printf("loose edge: %4d\n", edge2->newIndex);
 #endif
                }
-                        }
+       }
 
-                        /* either we came back to the start edge or we found a sharp/loose edge */
-                        if(linklist_contains(visited_edges, edge2))
-                                /* we came back to the start edge */
-                                edge2 = NULL;
+       /* either we came back to the start edge or we found a sharp/loose edge */
+       if(linklist_contains(visited_edges, edge2))
+               /* we came back to the start edge */
+               edge2 = NULL;
 
-                        BLI_linklist_free(visited_edges, NULL);
+       BLI_linklist_free(visited_edges, NULL);
 
 #ifdef EDGESPLIT_DEBUG_1
-                        printf("=== END === find_other_sharp_edge(edge = %4d, vert = %4d), "
-                                        "returning edge %d\n",
-        edge->newIndex, vert->newIndex, edge2 ? edge2->newIndex : -1);
+       printf("=== END === find_other_sharp_edge(edge = %4d, vert = %4d), "
+                                       "returning edge %d\n",
+       edge->newIndex, vert->newIndex, edge2 ? edge2->newIndex : -1);
 #endif
-                        return edge2;
+       return edge2;
 }
 
 static void split_single_vert(SmoothVert *vert, SmoothFace *face,
@@ -911,7 +911,7 @@ static void propagate_split(SmoothEdge *edge, SmoothVert *vert,
        LinkNode *visited_faces = NULL;
 #ifdef EDGESPLIT_DEBUG_1
        printf("=== START === propagate_split(edge = %4d, vert = %4d)\n",
-                  edge->newIndex, vert->newIndex);
+                       edge->newIndex, vert->newIndex);
 #endif
 
        edge2 = find_other_sharp_edge(vert, edge, &visited_faces);
@@ -956,7 +956,7 @@ static void propagate_split(SmoothEdge *edge, SmoothVert *vert,
        BLI_linklist_free(visited_faces, NULL);
 #ifdef EDGESPLIT_DEBUG_1
        printf("=== END === propagate_split(edge = %4d, vert = %4d)\n",
-                  edge->newIndex, vert->newIndex);
+                       edge->newIndex, vert->newIndex);
 #endif
 }
 
@@ -969,7 +969,7 @@ static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh)
        LinkNode *visited_faces = NULL;
 #ifdef EDGESPLIT_DEBUG_1
        printf("=== START === split_edge(edge = %4d, vert = %4d)\n",
-                  edge->newIndex, vert->newIndex);
+                       edge->newIndex, vert->newIndex);
 #endif
 
        edge2 = find_other_sharp_edge(vert, edge, &visited_faces);
@@ -1042,7 +1042,7 @@ static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh)
        BLI_linklist_free(visited_faces, NULL);
 #ifdef EDGESPLIT_DEBUG_1
        printf("=== END === split_edge(edge = %4d, vert = %4d)\n",
-                  edge->newIndex, vert->newIndex);
+                       edge->newIndex, vert->newIndex);
 #endif
 }
 
@@ -1078,31 +1078,31 @@ static void tag_and_count_extra_edges(SmoothMesh *mesh, float split_angle,
                        /* (the edge can only be sharp if we're checking angle or flag,
                        * and it has at least 2 faces) */
 
-                                                /* if we're checking the sharp flag and it's set, good */
-                                                if((flags & MOD_EDGESPLIT_FROMFLAG) && (edge->flag & ME_SHARP)) {
-                                                        /* this edge is sharp */
-                                                        sharp = 1;
-
-                                                        (*extra_edges)++;
-                                                } else if(flags & MOD_EDGESPLIT_FROMANGLE) {
-                                                        /* we know the edge has 2 faces, so check the angle */
-                                                        SmoothFace *face1 = edge->faces->link;
-                                                        SmoothFace *face2 = edge->faces->next->link;
-                                                        float edge_angle_cos = dot_v3v3(face1->normal,
-                                                                        face2->normal);
-
-                                                        if(edge_angle_cos < threshold) {
-                                                                /* this edge is sharp */
-                                                                sharp = 1;
-
-                                                                (*extra_edges)++;
-                                                        }
-                                                }
-                                        }
+                       /* if we're checking the sharp flag and it's set, good */
+                       if((flags & MOD_EDGESPLIT_FROMFLAG) && (edge->flag & ME_SHARP)) {
+                               /* this edge is sharp */
+                               sharp = 1;
+
+                               (*extra_edges)++;
+                       } else if(flags & MOD_EDGESPLIT_FROMANGLE) {
+                               /* we know the edge has 2 faces, so check the angle */
+                               SmoothFace *face1 = edge->faces->link;
+                               SmoothFace *face2 = edge->faces->next->link;
+                               float edge_angle_cos = dot_v3v3(face1->normal,
+                               face2->normal);
+
+                               if(edge_angle_cos < threshold) {
+                                       /* this edge is sharp */
+                                       sharp = 1;
+
+                                       (*extra_edges)++;
+                               }
+                       }
+               }
 
-                                        /* set/clear sharp flag appropriately */
-                                        if(sharp) edge->flag |= ME_SHARP;
-                                        else edge->flag &= ~ME_SHARP;
+               /* set/clear sharp flag appropriately */
+               if(sharp) edge->flag |= ME_SHARP;
+               else edge->flag &= ~ME_SHARP;
        }
 }
 
@@ -1244,7 +1244,7 @@ static DerivedMesh *edgesplitModifier_do(EdgeSplitModifierData *emd, DerivedMesh
 #ifdef EDGESPLIT_DEBUG_0
        printf("Edgesplit: Estimated %d verts & %d edges, "
                        "found %d verts & %d edges\n", max_verts, max_edges,
-   mesh->num_verts, mesh->num_edges);
+                       mesh->num_verts, mesh->num_edges);
 #endif
 
        result = CDDM_from_smoothmesh(mesh);
index 00ab5d027fb18a2dbc3e140684ea8b60443c1a48..f1bc0d33fd8a4cdd8fbdb04eb373097f18695517 100644 (file)
@@ -997,19 +997,19 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
 
                        createFacepa(emd,psmd,derivedData);
                }
-                                /* 2. create new mesh */
-                                if(emd->flag & eExplodeFlag_EdgeCut){
-                                        int *facepa = emd->facepa;
-                                        DerivedMesh *splitdm=cutEdges(emd,dm);
-                                        DerivedMesh *explode=explodeMesh(emd, psmd, md->scene, ob, splitdm);
-
-                                        MEM_freeN(emd->facepa);
-                                        emd->facepa=facepa;
-                                        splitdm->release(splitdm);
-                                        return explode;
-                                }
-                                else
-                                        return explodeMesh(emd, psmd, md->scene, ob, derivedData);
+               /* 2. create new mesh */
+               if(emd->flag & eExplodeFlag_EdgeCut){
+                       int *facepa = emd->facepa;
+                       DerivedMesh *splitdm=cutEdges(emd,dm);
+                       DerivedMesh *explode=explodeMesh(emd, psmd, md->scene, ob, splitdm);
+
+                       MEM_freeN(emd->facepa);
+                       emd->facepa=facepa;
+                       splitdm->release(splitdm);
+                       return explode;
+               }
+               else
+                       return explodeMesh(emd, psmd, md->scene, ob, derivedData);
        }
        return derivedData;
 }
index cba7e150633d80afd745a683a4ebdb593c12a251..9dcdfaf21e646f775b676bfed90a9d20485bd0f7 100644 (file)
@@ -142,7 +142,7 @@ static void node_composit_exec_alphaover(void *UNUSED(data), bNode *node, bNodeS
 
 static void node_alphaover_init(bNode* node)
 {
-   node->storage= MEM_callocN(sizeof(NodeTwoFloats), "NodeTwoFloats");
+       node->storage= MEM_callocN(sizeof(NodeTwoFloats), "NodeTwoFloats");
 }
 
 void register_node_type_cmp_alphaover(ListBase *lb)
index 1031ab3d360ef9f51aa8049a41d95afcc64d64d5..2b33126b3a769bfc30d6d0726df9ea20594cabff 100644 (file)
@@ -715,7 +715,7 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
 
 static void node_composit_init_blur(bNode* node)
 {
-   node->storage= MEM_callocN(sizeof(NodeBlurData), "node blur data");
+       node->storage= MEM_callocN(sizeof(NodeBlurData), "node blur data");
 }
 
 void register_node_type_cmp_blur(ListBase *lb)
index cdd360dc0fe01e38f1571e3721fb88425cec9606..b32c531d8f9ba9d26ec45deebb04261755d955b6 100644 (file)
@@ -74,34 +74,34 @@ static void do_channel_matte(bNode *node, float *out, float *in)
        float alpha=0.0;        
 
        switch(c->algorithm) {
-         case 0: { /* Alpha=key_channel-limit channel */
-                int key_channel=node->custom2-1;
-                int limit_channel=c->channel-1;
-                alpha=in[key_channel]-in[limit_channel];
-                break;
-         }
-         case 1: {     /* Alpha=G-MAX(R, B) */
-                switch(node->custom2) {
+       case 0: { /* Alpha=key_channel-limit channel */
+               int key_channel=node->custom2-1;
+               int limit_channel=c->channel-1;
+               alpha=in[key_channel]-in[limit_channel];
+               break;
+       }
+       case 1: { /* Alpha=G-MAX(R, B) */
+               switch(node->custom2) {
                        case 1: {
-                                       alpha=in[0]-MAX2(in[1],in[2]);
-                                       break;
-                        }
+                               alpha=in[0]-MAX2(in[1],in[2]);
+                               break;
+                       }
                        case 2: {
-                                       alpha=in[1]-MAX2(in[0],in[2]);
-                                       break;
-                        }
+                               alpha=in[1]-MAX2(in[0],in[2]);
+                               break;
+                       }
                        case 3: {
-                                       alpha=in[2]-MAX2(in[0],in[1]);
-                                       break;
-                        }
+                               alpha=in[2]-MAX2(in[0],in[1]);
+                               break;
+                       }
                        default:
                                break;
-                }
-         }
-         default:
-                break;
-   }
-       
+               }
+       }
+       default:
+               break;
+       }
+
        /*flip because 0.0 is transparent, not 1.0*/
        alpha=1-alpha;
        
@@ -124,7 +124,6 @@ static void do_channel_matte(bNode *node, float *out, float *in)
        else {
                out[3]=in[3];
        }
-
 }
 
 static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
@@ -132,7 +131,7 @@ static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack
        CompBuf *cbuf;
        CompBuf *outbuf;
        
-       if(in[0]->hasinput==0)  return;
+       if(in[0]->hasinput==0) return;
        if(in[0]->data==NULL) return;
        if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
        
@@ -142,24 +141,24 @@ static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack
        
        /*convert to colorspace*/
        switch(node->custom1) {
-          case CMP_NODE_CHANNEL_MATTE_CS_RGB:
-                  break;
-          case CMP_NODE_CHANNEL_MATTE_CS_HSV: /*HSV*/
-                  composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_hsva, CB_RGBA);
-                  break;
-          case CMP_NODE_CHANNEL_MATTE_CS_YUV: /*YUV*/
-                  composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_yuva, CB_RGBA);
-                  break;
-          case CMP_NODE_CHANNEL_MATTE_CS_YCC: /*YCC*/
-                  composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_normalized_rgba_to_ycca2, CB_RGBA);
-                  break;
-          default:
-                  break;
+       case CMP_NODE_CHANNEL_MATTE_CS_RGB:
+               break;
+       case CMP_NODE_CHANNEL_MATTE_CS_HSV: /*HSV*/
+               composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_hsva, CB_RGBA);
+               break;
+       case CMP_NODE_CHANNEL_MATTE_CS_YUV: /*YUV*/
+               composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_rgba_to_yuva, CB_RGBA);
+               break;
+       case CMP_NODE_CHANNEL_MATTE_CS_YCC: /*YCC*/
+               composit1_pixel_processor(node, outbuf, cbuf, in[1]->vec, do_normalized_rgba_to_ycca2, CB_RGBA);
+               break;
+       default:
+               break;
        }
 
        /*use the selected channel information to do the key */
        composit1_pixel_processor(node, outbuf, outbuf, in[1]->vec, do_channel_matte, CB_RGBA);
-   
+
        /*convert back to RGB colorspace in place*/
        switch(node->custom1) {
        case CMP_NODE_CHANNEL_MATTE_CS_RGB: /*RGB*/
@@ -189,17 +188,17 @@ static void node_composit_exec_channel_matte(void *data, bNode *node, bNodeStack
 
 static void node_composit_init_channel_matte(bNode *node)
 {
-   NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
-   node->storage=c;
-   c->t1= 1.0f;
-   c->t2= 0.0f;
-   c->t3= 0.0f;
-   c->fsize= 0.0f;
-   c->fstrength= 0.0f;
-   c->algorithm=1; /*max channel limiting */
-   c->channel=1; /* limit by red */
-   node->custom1= 1; /* RGB channel */
-   node->custom2= 2; /* Green Channel */
+       NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
+       node->storage=c;
+       c->t1= 1.0f;
+       c->t2= 0.0f;
+       c->t3= 0.0f;
+       c->fsize= 0.0f;
+       c->fstrength= 0.0f;
+       c->algorithm=1; /*max channel limiting */
+       c->channel=1; /* limit by red */
+       node->custom1= 1; /* RGB channel */
+       node->custom2= 2; /* Green Channel */
 }
 
 void register_node_type_cmp_channel_matte(ListBase *lb)
@@ -215,4 +214,3 @@ void register_node_type_cmp_channel_matte(ListBase *lb)
 
        nodeRegisterType(lb, &ntype);
 }
-
index 94b086f1ba049f2ed02dba38aefd02a6737e6500..03230f2e2129e6e1f4700a4aaaac09ee90425b33 100644 (file)
@@ -49,17 +49,17 @@ static bNodeSocketType cmp_node_chroma_out[]={
 
 static void do_rgba_to_ycca_normalized(bNode *UNUSED(node), float *out, float *in)
 {
-   rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
+       rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
 
-   //normalize to 0..1.0
-   out[0]=out[0]/255.0;
-   out[1]=out[1]/255.0;
-   out[2]=out[2]/255.0;
+       //normalize to 0..1.0
+       out[0]=out[0]/255.0;
+       out[1]=out[1]/255.0;
+       out[2]=out[2]/255.0;
 
-   //rescale to -1.0..1.0
-   out[0]=(out[0]*2.0)-1.0;
-   out[1]=(out[1]*2.0)-1.0;
-   out[2]=(out[2]*2.0)-1.0;
+       //rescale to -1.0..1.0
+       out[0]=(out[0]*2.0)-1.0;
+       out[1]=(out[1]*2.0)-1.0;
+       out[2]=(out[2]*2.0)-1.0;
 
 //     out[0]=((out[0])-16)/255.0;
 //     out[1]=((out[1])-128)/255.0;
@@ -69,16 +69,16 @@ static void do_rgba_to_ycca_normalized(bNode *UNUSED(node), float *out, float *i
 
 static void do_ycca_to_rgba_normalized(bNode *UNUSED(node), float *out, float *in)
 {
-   /*un-normalize the normalize from above */
-   in[0]=(in[0]+1.0)/2.0;
-   in[1]=(in[1]+1.0)/2.0;
-   in[2]=(in[2]+1.0)/2.0;
+       /*un-normalize the normalize from above */
+       in[0]=(in[0]+1.0)/2.0;
+       in[1]=(in[1]+1.0)/2.0;
+       in[2]=(in[2]+1.0)/2.0;
 
-   in[0]=(in[0]*255.0);
-   in[1]=(in[1]*255.0);
-   in[2]=(in[2]*255.0);
+       in[0]=(in[0]*255.0);
+       in[1]=(in[1]*255.0);
+       in[2]=(in[2]*255.0);
 
-//     in[0]=(in[0]*255.0)+16;
+       //      in[0]=(in[0]*255.0)+16;
 //     in[1]=(in[1]*255.0)+128;
 //     in[2]=(in[2]*255.0)+128;
        ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601);
@@ -180,13 +180,13 @@ static void node_composit_exec_chroma_matte(void *data, bNode *node, bNodeStack
 
 static void node_composit_init_chroma_matte(bNode *node)
 {
-   NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
-   node->storage= c;
-   c->t1= 30.0f;
-   c->t2= 10.0f;
-   c->t3= 0.0f;
-   c->fsize= 0.0f;
-   c->fstrength= 1.0f;
+       NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma");
+       node->storage= c;
+       c->t1= 30.0f;
+       c->t2= 10.0f;
+       c->t3= 0.0f;
+       c->fsize= 0.0f;
+       c->fstrength= 1.0f;
 }
 
 void register_node_type_cmp_chroma_matte(ListBase *lb)
index 90916284f1e9bfeb275426b3f173d1385c9597b0..151850105b75073ff5db36be073d66840cd25d99 100644 (file)
@@ -53,14 +53,14 @@ static void do_color_key(bNode *node, float *out, float *in)
        c=node->storage;
 
 
-   VECCOPY(out, in);
+       VECCOPY(out, in);
 
-   if(fabs(in[0]-c->key[0]) < c->t1 &&
-         fabs(in[1]-c->key[1]) < c->t2 &&
-         fabs(in[2]-c->key[2]) < c->t3) 
-   {
-         out[3]=0.0; /*make transparent*/
-   }
+       if(fabs(in[0]-c->key[0]) < c->t1 &&
+          fabs(in[1]-c->key[1]) < c->t2 &&
+          fabs(in[2]-c->key[2]) < c->t3)
+       {
+               out[3]=0.0; /*make transparent*/
+       }
 
        else { /*pixel is outside key color */
                out[3]=in[3]; /* make pixel just as transparent as it was before */
@@ -108,13 +108,13 @@ static void node_composit_exec_color_matte(void *data, bNode *node, bNodeStack *
 
 static void node_composit_init_color_matte(bNode *node)
 {
-   NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node color");
-   node->storage= c;
-   c->t1= 0.01f;
-   c->t2= 0.1f;
-   c->t3= 0.1f;
-   c->fsize= 0.0f;
-   c->fstrength= 1.0f;
+       NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node color");
+       node->storage= c;
+       c->t1= 0.01f;
+       c->t2= 0.1f;
+       c->t3= 0.1f;
+       c->fsize= 0.0f;
+       c->fstrength= 1.0f;
 }
 
 void register_node_type_cmp_color_matte(ListBase *lb)
index c9997ba8a75cc0dc2489fb951a8d7f5e86adc04f..905d97709c3a6f05d4807eb0e0510dad08c4c3df 100644 (file)
@@ -39,8 +39,8 @@
 
 /* ******************* Color Spill Supression ********************************* */
 static bNodeSocketType cmp_node_color_spill_in[]={
-   {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
-   {SOCK_VALUE, 1, "Fac",      1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
+       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
+       {SOCK_VALUE, 1, "Fac",  1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
        {-1,0,""}
 };
 
@@ -51,17 +51,17 @@ static bNodeSocketType cmp_node_color_spill_out[]={
 
 static void do_simple_spillmap_red(bNode *node, float* out, float *in)
 {
-   NodeColorspill *ncs;
+       NodeColorspill *ncs;
        ncs=node->storage;
        out[0]=in[0]-( ncs->limscale * in[ncs->limchan] );
 }
 
 static void do_simple_spillmap_red_fac(bNode *node, float* out, float *in, float *fac)
 {
-   NodeColorspill *ncs;
-   ncs=node->storage;
+       NodeColorspill *ncs;
+       ncs=node->storage;
 
-   out[0] = *fac * (in[0]-( ncs->limscale * in[ncs->limchan]));
+       out[0] = *fac * (in[0]-( ncs->limscale * in[ncs->limchan]));
 }
 
 static void do_simple_spillmap_green(bNode *node, float* out, float *in)
@@ -73,10 +73,10 @@ static void do_simple_spillmap_green(bNode *node, float* out, float *in)
 
 static void do_simple_spillmap_green_fac(bNode *node, float* out, float *in, float *fac)
 {
-   NodeColorspill *ncs;
-   ncs=node->storage;
+       NodeColorspill *ncs;
+       ncs=node->storage;
 
-   out[0] = *fac * (in[1]-( ncs->limscale * in[ncs->limchan]));
+       out[0] = *fac * (in[1]-( ncs->limscale * in[ncs->limchan]));
 }
 
 static void do_simple_spillmap_blue(bNode *node, float* out, float *in)
@@ -88,10 +88,10 @@ static void do_simple_spillmap_blue(bNode *node, float* out, float *in)
 
 static void do_simple_spillmap_blue_fac(bNode *node, float* out, float *in, float *fac)
 {
-   NodeColorspill *ncs;
-   ncs=node->storage;
+       NodeColorspill *ncs;
+       ncs=node->storage;
 
-   out[0] = *fac * (in[2]-( ncs->limscale * in[ncs->limchan]));
+       out[0] = *fac * (in[2]-( ncs->limscale * in[ncs->limchan]));
 }
 
 static void do_average_spillmap_red(bNode *node, float* out, float *in)
@@ -103,10 +103,10 @@ static void do_average_spillmap_red(bNode *node, float* out, float *in)
 
 static void do_average_spillmap_red_fac(bNode *node, float* out, float *in, float *fac)
 {
-   NodeColorspill *ncs;
-   ncs=node->storage;
+       NodeColorspill *ncs;
+       ncs=node->storage;
 
-   out[0] = *fac * (in[0]-(ncs->limscale * avg(in[1], in[2]) ));
+       out[0] = *fac * (in[0]-(ncs->limscale * avg(in[1], in[2]) ));
 }
 
 static void do_average_spillmap_green(bNode *node, float* out, float *in)
@@ -118,10 +118,10 @@ static void do_average_spillmap_green(bNode *node, float* out, float *in)
 
 static void do_average_spillmap_green_fac(bNode *node, float* out, float *in, float *fac)
 {
-   NodeColorspill *ncs;
-   ncs=node->storage;
+       NodeColorspill *ncs;
+       ncs=node->storage;
 
-   out[0] = *fac * (in[0]-(ncs->limscale * avg(in[0], in[2]) ));
+       out[0] = *fac * (in[0]-(ncs->limscale * avg(in[0], in[2]) ));
 }
 
 static void do_average_spillmap_blue(bNode *node, float* out, float *in)
@@ -133,10 +133,10 @@ static void do_average_spillmap_blue(bNode *node, float* out, float *in)
 
 static void do_average_spillmap_blue_fac(bNode *node, float* out, float *in, float *fac)
 {
-   NodeColorspill *ncs;
-   ncs=node->storage;
+       NodeColorspill *ncs;
+       ncs=node->storage;
 
-   out[0] = *fac * (in[0]-(ncs->limscale * avg(in[0], in[1]) ));
+       out[0] = *fac * (in[0]-(ncs->limscale * avg(in[0], in[1]) ));
 }
 
 static void do_apply_spillmap_red(bNode *node, float* out, float *in, float *map)
@@ -189,48 +189,47 @@ static void do_apply_spillmap_blue(bNode *node, float* out, float *in, float *ma
 
 static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
 {
-       /*
-       Originally based on the information from the book "The Art and Science of Digital Composition" and 
-       discussions from vfxtalk.com.*/
-   CompBuf *cbuf;
-   CompBuf *mask;
+       /* Originally based on the information from the book "The Art and Science of Digital Composition" and
+        * discussions from vfxtalk.com .*/
+       CompBuf *cbuf;
+       CompBuf *mask;
        CompBuf *rgbbuf;
        CompBuf *spillmap;
        NodeColorspill *ncs;
        ncs=node->storage;
 
-   /* early out for missing connections */
-   if(out[0]->hasoutput==0 ) return;
-   if(in[0]->hasinput==0) return;
-   if(in[0]->data==NULL) return;
+       /* early out for missing connections */
+       if(out[0]->hasoutput==0 ) return;
+       if(in[0]->hasinput==0) return;
+       if(in[0]->data==NULL) return;
        
-   cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
-   mask=typecheck_compbuf(in[1]->data, CB_VAL);
+       cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
+       mask=typecheck_compbuf(in[1]->data, CB_VAL);
        spillmap=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
        rgbbuf=dupalloc_compbuf(cbuf);
 
        switch(node->custom1)
        {
-       case 1:  /*red spill*/
+               case 1:  /*red spill*/
                {
                        switch(node->custom2)
                        {
-         case 0: /* simple limit */
-            {
-               if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) {
-                  composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_simple_spillmap_red, CB_RGBA);
-               } else {
-                  composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_red_fac, CB_RGBA,  CB_VAL);
-          &nb