From f9f771cd01b626be30a85a533ea622bcedd981f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Apr 2011 15:53:30 +0000 Subject: converted more mixed tab/space indentations to tabs. only whitespace changes. --- intern/guardedalloc/intern/mallocn.c | 14 +- intern/guardedalloc/test/simpletest/memtest.c | 2 +- release/plugins/sequence/blur.c | 2 +- release/plugins/sequence/gamma.c | 2 +- source/blender/avi/intern/options.c | 124 +-- source/blender/blenkernel/intern/collision.c | 8 +- source/blender/blenkernel/intern/curve.c | 20 +- source/blender/blenkernel/intern/deform.c | 2 +- source/blender/blenkernel/intern/depsgraph.c | 16 +- source/blender/blenkernel/intern/displist.c | 6 +- source/blender/blenkernel/intern/exotic.c | 32 +- source/blender/blenkernel/intern/pointcache.c | 10 +- source/blender/blenkernel/intern/seqeffects.c | 82 +- source/blender/blenkernel/intern/sequencer.c | 2 +- source/blender/blenkernel/intern/smoke.c | 20 +- source/blender/blenkernel/intern/softbody.c | 88 +-- source/blender/blenkernel/intern/writeavi.c | 2 +- source/blender/blenlib/intern/BLI_ghash.c | 2 +- source/blender/blenlib/intern/boxpack2d.c | 20 +- source/blender/blenlib/intern/fileops.c | 6 +- source/blender/blenlib/intern/math_geom.c | 28 +- source/blender/blenlib/intern/math_vector_inline.c | 2 +- source/blender/blenlib/intern/noise.c | 16 +- source/blender/blenlib/intern/path_util.c | 12 +- source/blender/blenlib/intern/winstuff.c | 30 +- source/blender/blenloader/intern/readfile.c | 4 +- source/blender/editors/armature/editarmature.c | 4 +- .../editors/armature/editarmature_retarget.c | 6 +- source/blender/editors/armature/meshlaplacian.c | 6 +- source/blender/editors/armature/reeb.c | 2 +- source/blender/editors/curve/editcurve.c | 9 +- .../blender/editors/interface/interface_widgets.c | 32 +- source/blender/editors/mesh/editmesh_tools.c | 68 +- source/blender/editors/screen/screen_ops.c | 2 +- source/blender/editors/sculpt_paint/paint_image.c | 28 +- source/blender/editors/space_action/space_action.c | 2 +- source/blender/editors/space_graph/graph_buttons.c | 2 +- source/blender/editors/space_image/image_buttons.c | 2 +- source/blender/editors/space_image/image_draw.c | 6 +- source/blender/editors/space_image/image_ops.c | 8 +- source/blender/editors/space_logic/logic_window.c | 188 ++--- source/blender/editors/space_nla/nla_buttons.c | 2 +- source/blender/editors/space_nla/space_nla.c | 2 +- source/blender/editors/space_node/drawnode.c | 80 +- source/blender/editors/space_outliner/outliner.c | 14 +- source/blender/editors/space_text/text_ops.c | 2 +- .../blender/editors/space_view3d/view3d_header.c | 10 +- .../blender/editors/space_view3d/view3d_select.c | 8 +- source/blender/editors/space_view3d/view3d_view.c | 38 +- source/blender/editors/transform/transform.c | 50 +- .../editors/transform/transform_constraints.c | 2 +- source/blender/editors/uvedit/uvedit_draw.c | 2 +- .../blender/editors/uvedit/uvedit_parametrizer.c | 2 +- source/blender/gpu/intern/gpu_draw.c | 8 +- source/blender/gpu/intern/gpu_extensions.c | 6 +- source/blender/imbuf/intern/jpeg.c | 4 +- source/blender/imbuf/intern/scaling.c | 2 +- source/blender/imbuf/intern/thumbs.c | 26 +- source/blender/imbuf/intern/tiff.c | 2 +- source/blender/makesdna/intern/dna_genfile.c | 54 +- source/blender/makesrna/intern/rna_brush.c | 2 +- source/blender/makesrna/intern/rna_controller.c | 36 +- source/blender/makesrna/intern/rna_image_api.c | 2 +- source/blender/makesrna/intern/rna_nodetree.c | 60 +- source/blender/makesrna/intern/rna_object_api.c | 20 +- source/blender/makesrna/intern/rna_particle.c | 108 +-- source/blender/modifiers/intern/MOD_array.c | 866 ++++++++++----------- source/blender/modifiers/intern/MOD_build.c | 18 +- source/blender/modifiers/intern/MOD_edgesplit.c | 132 ++-- source/blender/modifiers/intern/MOD_explode.c | 26 +- .../blender/nodes/intern/CMP_nodes/CMP_alphaOver.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_blur.c | 2 +- .../nodes/intern/CMP_nodes/CMP_channelMatte.c | 100 ++- .../nodes/intern/CMP_nodes/CMP_chromaMatte.c | 48 +- .../nodes/intern/CMP_nodes/CMP_colorMatte.c | 28 +- .../nodes/intern/CMP_nodes/CMP_colorSpill.c | 193 +++-- source/blender/nodes/intern/CMP_nodes/CMP_crop.c | 12 +- source/blender/nodes/intern/CMP_nodes/CMP_curves.c | 10 +- .../blender/nodes/intern/CMP_nodes/CMP_defocus.c | 26 +- .../blender/nodes/intern/CMP_nodes/CMP_diffMatte.c | 72 +- .../nodes/intern/CMP_nodes/CMP_distanceMatte.c | 58 +- .../blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c | 10 +- source/blender/nodes/intern/CMP_nodes/CMP_image.c | 132 ++-- source/blender/nodes/intern/CMP_nodes/CMP_invert.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_levels.c | 2 +- .../nodes/intern/CMP_nodes/CMP_lummaMatte.c | 8 +- .../blender/nodes/intern/CMP_nodes/CMP_mapValue.c | 2 +- .../nodes/intern/CMP_nodes/CMP_sepcombHSVA.c | 70 +- .../nodes/intern/CMP_nodes/CMP_splitViewer.c | 12 +- .../blender/nodes/intern/CMP_nodes/CMP_valToRgb.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_vecBlur.c | 8 +- source/blender/nodes/intern/CMP_nodes/CMP_viewer.c | 10 +- source/blender/nodes/intern/CMP_util.c | 130 ++-- source/blender/nodes/intern/SHD_nodes/SHD_curves.c | 4 +- source/blender/nodes/intern/SHD_nodes/SHD_geom.c | 2 +- .../blender/nodes/intern/SHD_nodes/SHD_mapping.c | 2 +- .../blender/nodes/intern/SHD_nodes/SHD_material.c | 2 +- .../blender/nodes/intern/SHD_nodes/SHD_valToRgb.c | 8 +- source/blender/nodes/intern/TEX_nodes/TEX_curves.c | 6 +- source/blender/nodes/intern/TEX_nodes/TEX_image.c | 10 +- .../blender/nodes/intern/TEX_nodes/TEX_valToRgb.c | 8 +- source/blender/python/generic/IDProp.c | 8 +- source/blender/python/generic/bgl.c | 26 +- source/blender/python/generic/mathutils_geometry.c | 8 +- source/blender/python/intern/bpy_props.c | 6 +- source/blender/python/intern/bpy_rna.c | 14 +- source/blender/render/intern/source/imagetexture.c | 8 +- .../blender/render/intern/source/pixelblending.c | 2 +- source/blender/render/intern/source/pixelshading.c | 16 +- .../blender/render/intern/source/render_texture.c | 2 +- source/blender/render/intern/source/rendercore.c | 14 +- source/blender/render/intern/source/shadbuf.c | 2 +- source/blender/render/intern/source/strand.c | 2 +- source/blender/render/intern/source/zbuf.c | 2 +- .../blender/windowmanager/intern/wm_event_system.c | 2 +- source/blender/windowmanager/intern/wm_jobs.c | 4 +- source/creator/creator.c | 2 +- 117 files changed, 1798 insertions(+), 1802 deletions(-) diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index caf551c84d8..55340d6011d 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -369,16 +369,16 @@ void *MEM_mapallocN(size_t len, const char *str) { #include - 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{ diff --git a/intern/guardedalloc/test/simpletest/memtest.c b/intern/guardedalloc/test/simpletest/memtest.c index 98f943f0d7d..6b3af8b310c 100644 --- a/intern/guardedalloc/test/simpletest/memtest.c +++ b/intern/guardedalloc/test/simpletest/memtest.c @@ -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; diff --git a/release/plugins/sequence/blur.c b/release/plugins/sequence/blur.c index c23a924ac65..cec3351e976 100644 --- a/release/plugins/sequence/blur.c +++ b/release/plugins/sequence/blur.c @@ -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, diff --git a/release/plugins/sequence/gamma.c b/release/plugins/sequence/gamma.c index e1380746cea..7ce86fff347 100644 --- a/release/plugins/sequence/gamma.c +++ b/release/plugins/sequence/gamma.c @@ -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); diff --git a/source/blender/avi/intern/options.c b/source/blender/avi/intern/options.c index 533bce2c8ea..edb708d8a69 100644 --- a/source/blender/avi/intern/options.c +++ b/source/blender/avi/intern/options.c @@ -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; } diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 88b6ca296c7..ebdbbfcf7b4 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -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) diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index f68533803e7..34e5fef8074 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -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; } diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 884d6313c26..0696653d2e4 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -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); } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 170b4c23446..94fbcd9ccb4 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -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 */ diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index c8e5998774d..b5194ca2f89 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -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); diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 16f47f3cc59..ae773818438 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -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) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 45cb6254887..a8c7266b3fa 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -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) { diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 3dfef2e9d78..aa91cff03b9 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -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; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index a765c9ee8f0..b2e6f5290c3 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -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) diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 90581870070..4405bce3d51 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -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) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 0578b155272..30d2816769c 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -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){ diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 73e23bd2a05..ba7f9bdd415 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -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; diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 0144dea3960..ff08ef4dba9 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -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) { diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index 4c16363f6d3..8c7e097d239 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -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); diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 2407078fc76..2e0f4b483b1 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -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); diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 42a9587596e..4af56c66dde 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -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. diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 9a36f000624..75520bb8ba0 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -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]) diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 49a09dd7b15..5d80edebbef 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -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 */ diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index f7115b4d46f..73d6588b97f 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -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; diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 90754e7d2bb..596ab2b0470 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -307,21 +307,21 @@ int check_file_chars(char *filename) #include 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 */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e4e61e49e90..08f9b655fac 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -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; iimamap->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); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index adfc9ee8113..23f91f88c8d 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -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) diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index bd05f7f6581..b750bd5ef1c 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -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 */ diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 566ccd7cd3f..b99605e65c1 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -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]; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 490d4c587f9..04501243acb 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2572,7 +2572,7 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions) int totfaces; int countfaces = 0; #endif - + rg = newReebGraph(); rg->resolution = subdivisions; diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 68f45c5fdb4..bea5a729f31 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -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); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index fc29a18154a..90a83009c4d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -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= { diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index dc1023952a6..83840f0f4cb 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -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*/ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 901f3d7c5f1..56a27da54df 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -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; } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 01a9a75ca13..5caf72a4a2f 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -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 */ diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index e8731391352..10a1fe62cca 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -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); diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 17e7b1b5b18..fb1144b4fa8 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -766,7 +766,7 @@ void GRAPH_OT_properties(wmOperatorType *ot) ot->exec= graph_properties; ot->poll= ED_operator_graphedit_active; - + /* flags */ ot->flag= 0; } diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 3dffb924434..52b48e1f9fd 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -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 */ diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 8030bffae2d..85d36ea9b29 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -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)); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 9cea8d4f220..61c999f51ab 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -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) diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index db8eff11498..bce492f5a04 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -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; diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 3e6e75fc7ec..94232699c30 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -504,7 +504,7 @@ void NLA_OT_properties(wmOperatorType *ot) ot->exec= nla_properties; ot->poll= ED_operator_nla_active; - + /* flags */ ot->flag= 0; } diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 941a88c5c40..90f9996e392 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -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); diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index a310b309d84..db9a052fdbd 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -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)); diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index fce9c883c84..0e574ca5ffb 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -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); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 31edfd522a3..091018670ba 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -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, diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 246ed853cc8..445d2f434fa 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -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; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 39a18d31d7e..75999fdeb6d 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -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])) { diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index c97833aea4b..1fdc2d9cad7 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -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 */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index d0c93116cb2..c710312606d 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -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; + } } } diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index e5e31a8e319..5793b1c6579 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -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); diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index b2a76681bff..8d73da0063c 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -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 */ diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 7ba85d30763..a9ee65b027b 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -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++; diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 323ca6ab78b..25be2e2aeb4 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -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) diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index c0bed18d89b..f6352a96878 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -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);*/ diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 32dae3c982e..0759d97e69f 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -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; diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index e59cf77a871..9bc4ba6776c 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -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; diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 1f2eebbedc0..3e17665fa39 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -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"; diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 155696fb199..746649e27ca 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -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); diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index e0e521a81d5..4e9b023b326 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -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; + + } } } diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 74857115bc5..f3f79cde617 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -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; } diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index 12d27bc80c2..92c762098c7 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -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; } } diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 091ec073f61..2d5c26199d6 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -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; } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 0dd536b64c2..b6d0f77c5a5 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -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) diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 2a369ba9044..d6af04f2475 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -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) { diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index fe164cbd3c1..9fd5fafc712 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -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"); diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 3a34b048aa3..90954fef1c7 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -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, diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index 1cf67ac8cae..e293be5886d 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -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 */ diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index 09e29d9ed8e..22ba1447d20 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -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); diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 00ab5d027fb..f1bc0d33fd8 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -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; } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c b/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c index cba7e150633..9dcdfaf21e6 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c @@ -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) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c index 1031ab3d360..2b33126b3a7 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c @@ -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) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c index cdd360dc0fe..b32c531d8f9 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c @@ -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); } - diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c index 94b086f1ba0..03230f2e212 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c @@ -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) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c index 90916284f1e..151850105b7 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c @@ -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) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c index c9997ba8a75..905d97709c3 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c @@ -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); - } + 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); + } break; } - case 1: /* average limit */ - { - if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) { - composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_red, CB_RGBA); - } else { - composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_red_fac, CB_RGBA, CB_VAL); - } + case 1: /* average limit */ + { + if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_red, CB_RGBA); + } else { + composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_red_fac, CB_RGBA, CB_VAL); + } break; } } @@ -242,59 +241,59 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_red, CB_RGBA, CB_VAL); break; } - case 2: /*green spill*/ + case 2: /*green 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_green, CB_RGBA); - } else { - composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_green_fac, CB_RGBA, CB_VAL); - } - break; - } - case 1: /* average limit */ - { - if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) { - composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_green, CB_RGBA); - } else { - composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_green_fac, CB_RGBA, CB_VAL); - } - break; - } + 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_green, CB_RGBA); + } else { + composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_green_fac, CB_RGBA, CB_VAL); + } + break; + } + case 1: /* average limit */ + { + if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_green, CB_RGBA); + } else { + composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_green_fac, CB_RGBA, CB_VAL); + } + break; + } } if(ncs->unspill==0) { ncs->uspillr=0.0f; ncs->uspillg=1.0f; ncs->uspillb=0.0f; - } + } composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_green, CB_RGBA, CB_VAL); break; } - case 3: /*blue spill*/ + case 3: /*blue 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_blue, CB_RGBA); - } else { - composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_blue_fac, CB_RGBA, CB_VAL); - } - break; - } - case 1: /* average limit */ - { - if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) { - composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_blue, CB_RGBA); - } else { - composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_blue_fac, CB_RGBA, CB_VAL); - } - break; - } + 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_blue, CB_RGBA); + } else { + composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_simple_spillmap_blue_fac, CB_RGBA, CB_VAL); + } + break; + } + case 1: /* average limit */ + { + if ((in[1]->data==NULL) && (in[1]->vec[0] >= 1.f)) { + composit1_pixel_processor(node, spillmap, cbuf, in[0]->vec, do_average_spillmap_blue, CB_RGBA); + } else { + composit2_pixel_processor(node, spillmap, cbuf, in[0]->vec, in[1]->data, in[1]->vec, do_average_spillmap_blue_fac, CB_RGBA, CB_VAL); + } + break; + } } if(ncs->unspill==0) { ncs->uspillr=0.0f; @@ -304,27 +303,27 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod composit2_pixel_processor(node, rgbbuf, cbuf, in[0]->vec, spillmap, NULL, do_apply_spillmap_blue, CB_RGBA, CB_VAL); break; } - default: - break; + default: + break; } out[0]->data=rgbbuf; if(cbuf!=in[0]->data) free_compbuf(cbuf); - - free_compbuf(spillmap); + + free_compbuf(spillmap); } static void node_composit_init_color_spill(bNode *node) { - NodeColorspill *ncs= MEM_callocN(sizeof(NodeColorspill), "node colorspill"); - node->storage=ncs; - node->custom1= 2; /* green channel */ - node->custom2= 0; /* simple limit algo*/ - ncs->limchan= 0; /* limit by red */ - ncs->limscale= 1.0f; /* limit scaling factor */ - ncs->unspill=0; /* do not use unspill */ + NodeColorspill *ncs= MEM_callocN(sizeof(NodeColorspill), "node colorspill"); + node->storage=ncs; + node->custom1= 2; /* green channel */ + node->custom2= 0; /* simple limit algo*/ + ncs->limchan= 0; /* limit by red */ + ncs->limscale= 1.0f; /* limit scaling factor */ + ncs->unspill=0; /* do not use unspill */ } void register_node_type_cmp_color_spill(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_crop.c b/source/blender/nodes/intern/CMP_nodes/CMP_crop.c index 08913575fcf..0331217f0cb 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_crop.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_crop.c @@ -105,12 +105,12 @@ static void node_composit_exec_crop(void *UNUSED(data), bNode *node, bNodeStack static void node_composit_init_crop(bNode* node) { - NodeTwoXYs *nxy= MEM_callocN(sizeof(NodeTwoXYs), "node xy data"); - node->storage= nxy; - nxy->x1= 0; - nxy->x2= 0; - nxy->y1= 0; - nxy->y2= 0; + NodeTwoXYs *nxy= MEM_callocN(sizeof(NodeTwoXYs), "node xy data"); + node->storage= nxy; + nxy->x1= 0; + nxy->x2= 0; + nxy->y1= 0; + nxy->y2= 0; } void register_node_type_cmp_crop(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_curves.c b/source/blender/nodes/intern/CMP_nodes/CMP_curves.c index f0b399ae1e8..921c5e21fea 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_curves.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_curves.c @@ -59,9 +59,9 @@ static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack * static void node_composit_init_curves_time(bNode* node) { - node->custom1= 1; - node->custom2= 250; - node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + node->custom1= 1; + node->custom2= 250; + node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); } void register_node_type_cmp_curve_time(ListBase *lb) @@ -102,7 +102,7 @@ static void node_composit_exec_curve_vec(void *UNUSED(data), bNode *node, bNodeS static void node_composit_init_curve_vec(bNode* node) { - node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f); + node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f); } void register_node_type_cmp_curve_vec(ListBase *lb) @@ -189,7 +189,7 @@ static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeS static void node_composit_init_curve_rgb(bNode* node) { - node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); + node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); } void register_node_type_cmp_curve_rgb(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c index 303d5ee01aa..f249e2cff6c 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c @@ -859,19 +859,19 @@ static void node_composit_exec_defocus(void *UNUSED(data), bNode *node, bNodeSta static void node_composit_init_defocus(bNode* node) { - /* qdn: defocus node */ - NodeDefocus *nbd = MEM_callocN(sizeof(NodeDefocus), "node defocus data"); - nbd->bktype = 0; - nbd->rotation = 0.f; - nbd->preview = 1; - nbd->gamco = 0; - nbd->samples = 16; - nbd->fstop = 128.f; - nbd->maxblur = 0; - nbd->bthresh = 1.f; - nbd->scale = 1.f; - nbd->no_zbuf = 1; - node->storage = nbd; + /* qdn: defocus node */ + NodeDefocus *nbd = MEM_callocN(sizeof(NodeDefocus), "node defocus data"); + nbd->bktype = 0; + nbd->rotation = 0.f; + nbd->preview = 1; + nbd->gamco = 0; + nbd->samples = 16; + nbd->fstop = 128.f; + nbd->maxblur = 0; + nbd->bthresh = 1.f; + nbd->scale = 1.f; + nbd->no_zbuf = 1; + node->storage = nbd; } void register_node_type_cmp_defocus(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c index f0e112761e3..296053298da 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c @@ -51,35 +51,35 @@ static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float * { NodeChroma *c= (NodeChroma *)node->storage; float tolerence=c->t1; - float falloff=c->t2; + float falloff=c->t2; float difference; - float alpha; - - difference=fabs(inColor2[0]-inColor1[0])+ + float alpha; + + difference= fabs(inColor2[0]-inColor1[0])+ fabs(inColor2[1]-inColor1[1])+ fabs(inColor2[2]-inColor1[2]); - /*average together the distances*/ - difference=difference/3.0; + /*average together the distances*/ + difference=difference/3.0; - VECCOPY(outColor, inColor1); + VECCOPY(outColor, inColor1); - /*make 100% transparent*/ - if(difference < tolerence){ - outColor[3]=0.0; + /*make 100% transparent*/ + if(difference < tolerence) { + outColor[3]=0.0; + } + /*in the falloff region, make partially transparent */ + else if(difference < falloff+tolerence) { + difference=difference-tolerence; + alpha=difference/falloff; + /*only change if more transparent than before */ + if(alpha < inColor1[3]) { + outColor[3]=alpha; + } + else { /* leave as before */ + outColor[3]=inColor1[3]; + } } - /*in the falloff region, make partially transparent */ - else if(difference < falloff+tolerence){ - difference=difference-tolerence; - alpha=difference/falloff; - /*only change if more transparent than before */ - if(alpha < inColor1[3]) { - outColor[3]=alpha; - } - else { /* leave as before */ - outColor[3]=inColor1[3]; - } - } else { /*foreground object*/ outColor[3]= inColor1[3]; @@ -90,29 +90,29 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack ** { CompBuf *outbuf=0; CompBuf *imbuf1=0; - CompBuf *imbuf2=0; + CompBuf *imbuf2=0; NodeChroma *c; - + /*is anything connected?*/ if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return; /*must have an image imput*/ if(in[0]->data==NULL) return; - + imbuf1=typecheck_compbuf(in[0]->data, CB_RGBA); - /* if there's an image, use that, if not use the color */ - if(in[1]->data) { - imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA); - } - + /* if there's an image, use that, if not use the color */ + if(in[1]->data) { + imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA); + } + c=node->storage; outbuf=dupalloc_compbuf(imbuf1); - + /* note, processor gets a keyvals array passed on as buffer constant */ composit2_pixel_processor(node, outbuf, imbuf1, in[0]->vec, imbuf2, in[1]->vec, do_diff_matte, CB_RGBA, CB_RGBA); - + out[0]->data=outbuf; if(out[1]->hasoutput) out[1]->data=valbuf_from_rgbabuf(outbuf, CHAN_A); @@ -127,10 +127,10 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack ** static void node_composit_init_diff_matte(bNode *node) { - NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma"); - node->storage= c; - c->t1= 0.1f; - c->t2= 0.1f; + NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma"); + node->storage= c; + c->t1= 0.1f; + c->t2= 0.1f; } void register_node_type_cmp_diff_matte(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c index 2694c0559d7..5f7613464c1 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c @@ -53,35 +53,35 @@ static void do_distance_matte(bNode *node, float *out, float *in) { NodeChroma *c= (NodeChroma *)node->storage; float tolerence=c->t1; - float falloff=c->t2; + float falloff=c->t2; float distance; - float alpha; - - distance=sqrt((c->key[0]-in[0])*(c->key[0]-in[0]) + + float alpha; + + distance=sqrt((c->key[0]-in[0])*(c->key[0]-in[0]) + (c->key[1]-in[1])*(c->key[1]-in[1]) + (c->key[2]-in[2])*(c->key[2]-in[2])); - VECCOPY(out, in); - - /*make 100% transparent */ - if(distance < tolerence) { - out[3]=0.0; - } - /*in the falloff region, make partially transparent */ - else if(distance < falloff+tolerence){ - distance=distance-tolerence; - alpha=distance/falloff; - /*only change if more transparent than before */ - if(alpha < in[3]) { - out[3]=alpha; - } - else { /* leave as before */ - out[3]=in[3]; - } - } - else { - out[3]=in[3]; - } + VECCOPY(out, in); + + /*make 100% transparent */ + if(distance < tolerence) { + out[3]=0.0; + } + /*in the falloff region, make partially transparent */ + else if(distance < falloff+tolerence){ + distance=distance-tolerence; + alpha=distance/falloff; + /*only change if more transparent than before */ + if(alpha < in[3]) { + out[3]=alpha; + } + else { /* leave as before */ + out[3]=in[3]; + } + } + else { + out[3]=in[3]; + } } static void node_composit_exec_distance_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out) @@ -124,10 +124,10 @@ static void node_composit_exec_distance_matte(void *data, bNode *node, bNodeStac static void node_composit_init_distance_matte(bNode *node) { - NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma"); - node->storage= c; - c->t1= 0.1f; - c->t2= 0.1f; + NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma"); + node->storage= c; + c->t1= 0.1f; + c->t2= 0.1f; } void register_node_type_cmp_distance_matte(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c b/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c index 238f9b063c2..7b5511c699c 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c @@ -97,11 +97,11 @@ static void node_composit_exec_hue_sat(void *UNUSED(data), bNode *node, bNodeSta static void node_composit_init_hue_sat(bNode* node) { - NodeHueSat *nhs= MEM_callocN(sizeof(NodeHueSat), "node hue sat"); - node->storage= nhs; - nhs->hue= 0.5f; - nhs->sat= 1.0f; - nhs->val= 1.0f; + NodeHueSat *nhs= MEM_callocN(sizeof(NodeHueSat), "node hue sat"); + node->storage= nhs; + nhs->hue= 0.5f; + nhs->sat= 1.0f; + nhs->val= 1.0f; } void register_node_type_cmp_hue_sat(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c index 1ea3cf96ad0..3caaad26bae 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c @@ -294,12 +294,12 @@ static void node_composit_exec_image(void *data, bNode *node, bNodeStack **UNUSE static void node_composit_init_image(bNode* node) { - ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); - node->storage= iuser; - iuser->frames= 1; - iuser->sfra= 1; - iuser->fie_ima= 2; - iuser->ok= 1; + ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); + node->storage= iuser; + iuser->frames= 1; + iuser->sfra= 1; + iuser->fie_ima= 2; + iuser->ok= 1; } void register_node_type_cmp_image(ListBase *lb) @@ -321,27 +321,27 @@ void register_node_type_cmp_image(ListBase *lb) static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, int recty, int passcode) { - float *fp= RE_RenderLayerGetPass(rl, passcode); - if(fp) { - CompBuf *buf; - int buftype= CB_VEC3; - - if(ELEM3(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST)) - buftype= CB_VAL; - else if(passcode==SCE_PASS_VECTOR) - buftype= CB_VEC4; - else if(ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA)) - buftype= CB_RGBA; - - if(rd->scemode & R_COMP_CROP) - buf= get_cropped_compbuf(&rd->disprect, fp, rectx, recty, buftype); - else { - buf= alloc_compbuf(rectx, recty, buftype, 0); - buf->rect= fp; - } - return buf; - } - return NULL; + float *fp= RE_RenderLayerGetPass(rl, passcode); + if(fp) { + CompBuf *buf; + int buftype= CB_VEC3; + + if(ELEM3(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST)) + buftype= CB_VAL; + else if(passcode==SCE_PASS_VECTOR) + buftype= CB_VEC4; + else if(ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA)) + buftype= CB_RGBA; + + if(rd->scemode & R_COMP_CROP) + buf= get_cropped_compbuf(&rd->disprect, fp, rectx, recty, buftype); + else { + buf= alloc_compbuf(rectx, recty, buftype, 0); + buf->rect= fp; + } + return buf; + } + return NULL; } static void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out, int rectx, int recty) @@ -383,51 +383,51 @@ static void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStac static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { - Scene *sce= (Scene *)node->id; - Render *re= (sce)? RE_GetRender(sce->id.name): NULL; - RenderData *rd= data; - RenderResult *rr= NULL; - - if(re) - rr= RE_AcquireResultRead(re); - - if(rr) { - SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1); - if(srl) { - RenderLayer *rl= RE_GetRenderLayer(rr, srl->name); - if(rl && rl->rectf) { - CompBuf *stackbuf; - - /* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */ - if(rd->scemode & R_COMP_CROP) - stackbuf= get_cropped_compbuf(&rd->disprect, rl->rectf, rr->rectx, rr->recty, CB_RGBA); - else { - stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0); - stackbuf->rect= rl->rectf; - } - if(stackbuf==NULL) { - printf("Error; Preview Panel in UV Window returns zero sized image\n"); - } - else { - stackbuf->xof= rr->xof; - stackbuf->yof= rr->yof; + Scene *sce= (Scene *)node->id; + Render *re= (sce)? RE_GetRender(sce->id.name): NULL; + RenderData *rd= data; + RenderResult *rr= NULL; + + if(re) + rr= RE_AcquireResultRead(re); + + if(rr) { + SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1); + if(srl) { + RenderLayer *rl= RE_GetRenderLayer(rr, srl->name); + if(rl && rl->rectf) { + CompBuf *stackbuf; + + /* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */ + if(rd->scemode & R_COMP_CROP) + stackbuf= get_cropped_compbuf(&rd->disprect, rl->rectf, rr->rectx, rr->recty, CB_RGBA); + else { + stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0); + stackbuf->rect= rl->rectf; + } + if(stackbuf==NULL) { + printf("Error; Preview Panel in UV Window returns zero sized image\n"); + } + else { + stackbuf->xof= rr->xof; + stackbuf->yof= rr->yof; - /* put on stack */ - out[RRES_OUT_IMAGE]->data= stackbuf; + /* put on stack */ + out[RRES_OUT_IMAGE]->data= stackbuf; - if(out[RRES_OUT_ALPHA]->hasoutput) - out[RRES_OUT_ALPHA]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A); + if(out[RRES_OUT_ALPHA]->hasoutput) + out[RRES_OUT_ALPHA]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A); - node_composit_rlayers_out(rd, rl, out, rr->rectx, rr->recty); + node_composit_rlayers_out(rd, rl, out, rr->rectx, rr->recty); - generate_preview(data, node, stackbuf); + generate_preview(data, node, stackbuf); + } } - } - } - } + } + } - if(re) - RE_ReleaseResult(re); + if(re) + RE_ReleaseResult(re); } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_invert.c b/source/blender/nodes/intern/CMP_nodes/CMP_invert.c index f42bcb576fd..27b0324dfe0 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_invert.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_invert.c @@ -116,7 +116,7 @@ static void node_composit_exec_invert(void *UNUSED(data), bNode *node, bNodeStac static void node_composit_init_invert(bNode *node) { - node->custom1 |= CMP_CHAN_RGB; + node->custom1 |= CMP_CHAN_RGB; } /* custom1 = mix type */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_levels.c b/source/blender/nodes/intern/CMP_nodes/CMP_levels.c index 4436be14b5c..2c9f7d97f09 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_levels.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_levels.c @@ -330,7 +330,7 @@ static void node_composit_exec_view_levels(void *data, bNode *node, bNodeStack * static void node_composit_init_view_levels(bNode* node) { - node->custom1=1; /*All channels*/ + node->custom1=1; /*All channels*/ } void register_node_type_cmp_view_levels(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c index 7ed38996cf8..34e58791932 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c @@ -102,10 +102,10 @@ static void node_composit_exec_luma_matte(void *data, bNode *node, bNodeStack ** static void node_composit_init_luma_matte(bNode *node) { - NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma"); - node->storage=c; - c->t1= 1.0f; - c->t2= 0.0f; + NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node chroma"); + node->storage=c; + c->t1= 1.0f; + c->t2= 0.0f; } void register_node_type_cmp_luma_matte(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c b/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c index b4af253ac3a..f14e0fbd804 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c @@ -81,7 +81,7 @@ static void node_composit_exec_map_value(void *UNUSED(data), bNode *node, bNodeS static void node_composit_init_map_value(bNode* node) { - node->storage= add_mapping(); + node->storage= add_mapping(); } void register_node_type_cmp_map_value(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c index 653e3f4211b..87c4ed1dac0 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c @@ -129,46 +129,46 @@ static bNodeSocketType cmp_node_combhsva_out[]= { static void do_comb_hsva(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4) { - float r,g,b; - hsv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b); + float r,g,b; + hsv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b); - out[0] = r; - out[1] = g; - out[2] = b; - out[3] = in4[0]; + out[0] = r; + out[1] = g; + out[2] = b; + out[3] = in4[0]; } static void node_composit_exec_combhsva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { - /* stack order out: 1 rgba channels */ - /* stack order in: 4 value channels */ - - /* input no image? then only color operation */ - if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) { - out[0]->vec[0] = in[0]->vec[0]; - out[0]->vec[1] = in[1]->vec[0]; - out[0]->vec[2] = in[2]->vec[0]; - out[0]->vec[3] = in[3]->vec[0]; - } - else { - /* make output size of first available input image */ - CompBuf *cbuf; - CompBuf *stackbuf; - - /* allocate a CompBuf the size of the first available input */ - if (in[0]->data) cbuf = in[0]->data; - else if (in[1]->data) cbuf = in[1]->data; - else if (in[2]->data) cbuf = in[2]->data; - else cbuf = in[3]->data; - - stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */ - - composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, - in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, - do_comb_hsva, CB_VAL, CB_VAL, CB_VAL, CB_VAL); - - out[0]->data= stackbuf; - } + /* stack order out: 1 rgba channels */ + /* stack order in: 4 value channels */ + + /* input no image? then only color operation */ + if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) { + out[0]->vec[0] = in[0]->vec[0]; + out[0]->vec[1] = in[1]->vec[0]; + out[0]->vec[2] = in[2]->vec[0]; + out[0]->vec[3] = in[3]->vec[0]; + } + else { + /* make output size of first available input image */ + CompBuf *cbuf; + CompBuf *stackbuf; + + /* allocate a CompBuf the size of the first available input */ + if (in[0]->data) cbuf = in[0]->data; + else if (in[1]->data) cbuf = in[1]->data; + else if (in[2]->data) cbuf = in[2]->data; + else cbuf = in[3]->data; + + stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */ + + composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, + in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, + do_comb_hsva, CB_VAL, CB_VAL, CB_VAL, CB_VAL); + + out[0]->data= stackbuf; + } } void register_node_type_cmp_combhsva(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c b/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c index 69499f25b39..13cb3bcfed5 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c @@ -143,12 +143,12 @@ static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack * static void node_composit_init_splitviewer(bNode* node) { - ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); - node->storage= iuser; - iuser->sfra= 1; - iuser->fie_ima= 2; - iuser->ok= 1; - node->custom1= 50; /* default 50% split */ + ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); + node->storage= iuser; + iuser->sfra= 1; + iuser->fie_ima= 2; + iuser->ok= 1; + node->custom1= 50; /* default 50% split */ } void register_node_type_cmp_splitviewer(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c index fa6b5db89f6..1e1c8c61b46 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c @@ -82,7 +82,7 @@ static void node_composit_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeSt static void node_composit_init_valtorgb(bNode* node) { - node->storage= add_colorband(1); + node->storage= add_colorband(1); } void register_node_type_cmp_valtorgb(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c b/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c index b21418f6698..c43bfa2435a 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c @@ -89,10 +89,10 @@ static void node_composit_exec_vecblur(void *UNUSED(data), bNode *node, bNodeSta static void node_composit_init_vecblur(bNode* node) { - NodeBlurData *nbd= MEM_callocN(sizeof(NodeBlurData), "node blur data"); - node->storage= nbd; - nbd->samples= 32; - nbd->fac= 1.0f; + NodeBlurData *nbd= MEM_callocN(sizeof(NodeBlurData), "node blur data"); + node->storage= nbd; + nbd->samples= 32; + nbd->fac= 1.0f; } /* custom1: itterations, custom2: maxspeed (0 = nolimit) */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c b/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c index b3629eb1e16..c4e719efbf9 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c @@ -126,11 +126,11 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, static void node_composit_init_viewer(bNode* node) { - ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); - node->storage= iuser; - iuser->sfra= 1; - iuser->fie_ima= 2; - iuser->ok= 1; + ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); + node->storage= iuser; + iuser->sfra= 1; + iuser->fie_ima= 2; + iuser->ok= 1; } void register_node_type_cmp_viewer(ListBase *lb) diff --git a/source/blender/nodes/intern/CMP_util.c b/source/blender/nodes/intern/CMP_util.c index 45e7cf9d3e7..78025f4d964 100644 --- a/source/blender/nodes/intern/CMP_util.c +++ b/source/blender/nodes/intern/CMP_util.c @@ -673,116 +673,116 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf) void do_rgba_to_yuva(bNode *UNUSED(node), float *out, float *in) { - rgb_to_yuv(in[0],in[1],in[2], &out[0], &out[1], &out[2]); - out[3]=in[3]; + rgb_to_yuv(in[0],in[1],in[2], &out[0], &out[1], &out[2]); + out[3]=in[3]; } void do_rgba_to_hsva(bNode *UNUSED(node), float *out, float *in) { - rgb_to_hsv(in[0],in[1],in[2], &out[0], &out[1], &out[2]); - out[3]=in[3]; + rgb_to_hsv(in[0],in[1],in[2], &out[0], &out[1], &out[2]); + out[3]=in[3]; } void do_rgba_to_ycca(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); - out[3]=in[3]; + rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); + out[3]=in[3]; } void do_yuva_to_rgba(bNode *UNUSED(node), float *out, float *in) { - yuv_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]); - out[3]=in[3]; + yuv_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]); + out[3]=in[3]; } void do_hsva_to_rgba(bNode *UNUSED(node), float *out, float *in) { - hsv_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]); - out[3]=in[3]; + hsv_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]); + out[3]=in[3]; } void do_ycca_to_rgba(bNode *UNUSED(node), float *out, float *in) { - ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); - out[3]=in[3]; + ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); + out[3]=in[3]; } void do_copy_rgba(bNode *UNUSED(node), float *out, float *in) { - QUATCOPY(out, in); + QUATCOPY(out, in); } void do_copy_rgb(bNode *UNUSED(node), float *out, float *in) { - VECCOPY(out, in); - out[3]= 1.0f; + VECCOPY(out, in); + out[3]= 1.0f; } void do_copy_value(bNode *UNUSED(node), float *out, float *in) { - out[0]= in[0]; + out[0]= in[0]; } void do_copy_a_rgba(bNode *UNUSED(node), float *out, float *in, float *fac) { - VECCOPY(out, in); - out[3]= *fac; + VECCOPY(out, in); + out[3]= *fac; } /* only accepts RGBA buffers */ void gamma_correct_compbuf(CompBuf *img, int inversed) { - float *drect; - int x; - - if(img->type!=CB_RGBA) return; - - drect= img->rect; - if(inversed) { - for(x=img->x*img->y; x>0; x--, drect+=4) { - if(drect[0]>0.0f) drect[0]= sqrt(drect[0]); else drect[0]= 0.0f; - if(drect[1]>0.0f) drect[1]= sqrt(drect[1]); else drect[1]= 0.0f; - if(drect[2]>0.0f) drect[2]= sqrt(drect[2]); else drect[2]= 0.0f; - } - } - else { - for(x=img->x*img->y; x>0; x--, drect+=4) { - if(drect[0]>0.0f) drect[0]*= drect[0]; else drect[0]= 0.0f; - if(drect[1]>0.0f) drect[1]*= drect[1]; else drect[1]= 0.0f; - if(drect[2]>0.0f) drect[2]*= drect[2]; else drect[2]= 0.0f; - } - } + float *drect; + int x; + + if(img->type!=CB_RGBA) return; + + drect= img->rect; + if(inversed) { + for(x=img->x*img->y; x>0; x--, drect+=4) { + if(drect[0]>0.0f) drect[0]= sqrt(drect[0]); else drect[0]= 0.0f; + if(drect[1]>0.0f) drect[1]= sqrt(drect[1]); else drect[1]= 0.0f; + if(drect[2]>0.0f) drect[2]= sqrt(drect[2]); else drect[2]= 0.0f; + } + } + else { + for(x=img->x*img->y; x>0; x--, drect+=4) { + if(drect[0]>0.0f) drect[0]*= drect[0]; else drect[0]= 0.0f; + if(drect[1]>0.0f) drect[1]*= drect[1]; else drect[1]= 0.0f; + if(drect[2]>0.0f) drect[2]*= drect[2]; else drect[2]= 0.0f; + } + } } void premul_compbuf(CompBuf *img, int inversed) { - float *drect; - int x; - - if(img->type!=CB_RGBA) return; - - drect= img->rect; - if(inversed) { - for(x=img->x*img->y; x>0; x--, drect+=4) { - if(fabs(drect[3]) < 1e-5f) { - drect[0]= 0.0f; - drect[1]= 0.0f; - drect[2]= 0.0f; - } - else { - drect[0] /= drect[3]; - drect[1] /= drect[3]; - drect[2] /= drect[3]; - } - } - } - else { - for(x=img->x*img->y; x>0; x--, drect+=4) { - drect[0] *= drect[3]; - drect[1] *= drect[3]; - drect[2] *= drect[3]; - } - } + float *drect; + int x; + + if(img->type!=CB_RGBA) return; + + drect= img->rect; + if(inversed) { + for(x=img->x*img->y; x>0; x--, drect+=4) { + if(fabs(drect[3]) < 1e-5f) { + drect[0]= 0.0f; + drect[1]= 0.0f; + drect[2]= 0.0f; + } + else { + drect[0] /= drect[3]; + drect[1] /= drect[3]; + drect[2] /= drect[3]; + } + } + } + else { + for(x=img->x*img->y; x>0; x--, drect+=4) { + drect[0] *= drect[3]; + drect[1] *= drect[3]; + drect[2] *= drect[3]; + } + } } diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c index 78b5e4c1e56..a39a639897e 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c @@ -59,7 +59,7 @@ static void node_shader_exec_curve_vec(void *UNUSED(data), bNode *node, bNodeSta static void node_shader_init_curve_vec(bNode* node) { - node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f); + node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f); } static int gpu_shader_curve_vec(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) @@ -114,7 +114,7 @@ static void node_shader_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeSta static void node_shader_init_curve_rgb(bNode *node) { - node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); + node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); } static int gpu_shader_curve_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_geom.c b/source/blender/nodes/intern/SHD_nodes/SHD_geom.c index c08d5f3548d..379f54bec57 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_geom.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_geom.c @@ -120,7 +120,7 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i static void node_shader_init_geometry(bNode *node) { - node->storage= MEM_callocN(sizeof(NodeGeometry), "NodeGeometry"); + node->storage= MEM_callocN(sizeof(NodeGeometry), "NodeGeometry"); } static int gpu_shader_geom(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c b/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c index 528b43ae56e..eb300301ce2 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c @@ -71,7 +71,7 @@ static void node_shader_exec_mapping(void *UNUSED(data), bNode *node, bNodeStack static void node_shader_init_mapping(bNode *node) { - node->storage= add_mapping(); + node->storage= add_mapping(); } static int gpu_shader_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_material.c b/source/blender/nodes/intern/SHD_nodes/SHD_material.c index 317dd07f8fe..40dfbc0edea 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_material.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_material.c @@ -195,7 +195,7 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, static void node_shader_init_material(bNode* node) { - node->custom1= SH_NODE_MAT_DIFF|SH_NODE_MAT_SPEC; + node->custom1= SH_NODE_MAT_DIFF|SH_NODE_MAT_SPEC; } static int gpu_shader_material(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c index d2538f4c819..86f832c12ee 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c @@ -61,7 +61,7 @@ static void node_shader_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeStac static void node_shader_init_valtorgb(bNode *node) { - node->storage= add_colorband(1); + node->storage= add_colorband(1); } static int gpu_shader_valtorgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) @@ -102,10 +102,10 @@ static bNodeSocketType sh_node_rgbtobw_out[]= { static void node_shader_exec_rgbtobw(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { - /* stack order out: bw */ - /* stack order in: col */ + /* stack order out: bw */ + /* stack order in: col */ - out[0]->vec[0]= in[0]->vec[0]*0.35f + in[0]->vec[1]*0.45f + in[0]->vec[2]*0.2f; + out[0]->vec[0]= in[0]->vec[0]*0.35f + in[0]->vec[1]*0.45f + in[0]->vec[2]*0.2f; } static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c index e388efd17c0..b7af6c748ff 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c @@ -62,9 +62,9 @@ static void time_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out static void time_init(bNode* node) { - node->custom1= 1; - node->custom2= 250; - node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + node->custom1= 1; + node->custom2= 250; + node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); } void register_node_type_tex_curve_time(ListBase *lb) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_image.c b/source/blender/nodes/intern/TEX_nodes/TEX_image.c index fcb18ab3342..a54ca4bb119 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_image.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_image.c @@ -90,11 +90,11 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) static void init(bNode* node) { - ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); - node->storage= iuser; - iuser->sfra= 1; - iuser->fie_ima= 2; - iuser->ok= 1; + ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); + node->storage= iuser; + iuser->sfra= 1; + iuser->fie_ima= 2; + iuser->ok= 1; } void register_node_type_tex_image(ListBase *lb) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c index 19fa6c67c09..8f59828081c 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c @@ -80,12 +80,12 @@ void register_node_type_tex_valtorgb(ListBase *lb) /* **************** RGBTOBW ******************** */ static bNodeSocketType rgbtobw_in[]= { - { SOCK_RGBA, 1, "Color", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f}, - { -1, 0, "" } + { SOCK_RGBA, 1, "Color", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } }; static bNodeSocketType rgbtobw_out[]= { - { SOCK_VALUE, 0, "Val", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, - { -1, 0, "" } + { SOCK_VALUE, 0, "Val", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, + { -1, 0, "" } }; diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c index 36dc6fca503..ccf498f1550 100644 --- a/source/blender/python/generic/IDProp.c +++ b/source/blender/python/generic/IDProp.c @@ -513,15 +513,15 @@ static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop) for (i=0; ilen; i++) { if (prop->subtype == IDP_FLOAT) { PyList_SET_ITEM(seq, i, - PyFloat_FromDouble(((float*)prop->data.pointer)[i])); + PyFloat_FromDouble(((float*)prop->data.pointer)[i])); } else if (prop->subtype == IDP_DOUBLE) { PyList_SET_ITEM(seq, i, - PyFloat_FromDouble(((double*)prop->data.pointer)[i])); + PyFloat_FromDouble(((double*)prop->data.pointer)[i])); } else { PyList_SET_ITEM(seq, i, - PyLong_FromLong(((int*)prop->data.pointer)[i])); + PyLong_FromLong(((int*)prop->data.pointer)[i])); } } return seq; @@ -588,7 +588,7 @@ static PyObject *BPy_IDGroup_Pop(BPy_IDProperty *self, PyObject *value) /*ok something bad happened with the pyobject, so don't remove the prop from the group. if pyform is NULL, then it already should have raised an exception.*/ - return NULL; + return NULL; } IDP_RemFromGroup(self->prop, idprop); diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index 5be3282d6e6..730db73e685 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -132,16 +132,16 @@ static PyObject *Method_##funcname (PyObject *UNUSED(self), PyObject *args) {\ int BGL_typeSize(int type) { switch (type) { - case GL_BYTE: - return sizeof(char); - case GL_SHORT: - return sizeof(short); - case GL_INT: - return sizeof(int); - case GL_FLOAT: - return sizeof(float); - case GL_DOUBLE: - return sizeof(double); + case GL_BYTE: + return sizeof(char); + case GL_SHORT: + return sizeof(short); + case GL_INT: + return sizeof(int); + case GL_FLOAT: + return sizeof(float); + case GL_DOUBLE: + return sizeof(double); } return -1; } @@ -307,7 +307,7 @@ static PyObject *Buffer_item(PyObject *self, int i) return (PyObject *) newbuf; } - + return NULL; } @@ -435,7 +435,7 @@ static PyObject *Buffer_dimensions(PyObject *self) Buffer *buffer= (Buffer *) self; PyObject *list= PyList_New(buffer->ndimensions); int i; - + for (i= 0; indimensions; i++) { PyList_SET_ITEM(list, i, PyLong_FromLong(buffer->dimensions[i])); } @@ -804,7 +804,7 @@ BGLU_Wrap(9, UnProject, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdo * {"glAccum", Method_Accumfunc, METH_VARARGS} */ static struct PyMethodDef BGL_methods[] = { - {"Buffer", Method_Buffer, METH_VARARGS, Method_Buffer_doc}, + {"Buffer", Method_Buffer, METH_VARARGS, Method_Buffer_doc}, /* #ifndef __APPLE__ */ MethodDef(Accum), diff --git a/source/blender/python/generic/mathutils_geometry.c b/source/blender/python/generic/mathutils_geometry.c index 51b1a9754c9..6031c716807 100644 --- a/source/blender/python/generic/mathutils_geometry.c +++ b/source/blender/python/generic/mathutils_geometry.c @@ -841,10 +841,10 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje vec_t1_tar->size != 3 || vec_t2_tar->size != 3 || vec_t3_tar->size != 3) - { - PyErr_SetString(PyExc_ValueError, "One of more of the vector arguments wasnt a 3D vector"); - return NULL; - } + { + PyErr_SetString(PyExc_ValueError, "One of more of the vector arguments wasnt a 3D vector"); + return NULL; + } barycentric_transform(vec, vec_pt->vec, vec_t1_tar->vec, vec_t2_tar->vec, vec_t3_tar->vec, diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index c4663482592..53d28621ae8 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -140,7 +140,7 @@ static PyObject *bpy_prop_deferred_return(PyObject *func, PyObject *kw) return ret; \ } \ else if (PyTuple_GET_SIZE(args) > 1) { \ - PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \ + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \ return NULL; \ } \ srna= srna_from_self(self, #_func"(...):"); \ @@ -762,7 +762,7 @@ static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix } if(!RNA_struct_is_a(srna, &RNA_PropertyGroup)) { - PyErr_Format(PyExc_TypeError, "%.200s expected an RNA type derived from PropertyGroup", error_prefix); + PyErr_Format(PyExc_TypeError, "%.200s expected an RNA type derived from PropertyGroup", error_prefix); return NULL; } @@ -884,7 +884,7 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw return ret; } else if (PyTuple_GET_SIZE(args) > 1) { - PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \ + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \ return NULL; } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e254f80b0e8..19cd9df9403 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2942,9 +2942,9 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname) #if 0 static int pyrna_struct_pydict_contains(PyObject *self, PyObject *pyname) { - PyObject *dict= *(_PyObject_GetDictPtr((PyObject *)self)); - if (dict==NULL) /* unlikely */ - return 0; + PyObject *dict= *(_PyObject_GetDictPtr((PyObject *)self)); + if (dict==NULL) /* unlikely */ + return 0; return PyDict_Contains(dict, pyname); } @@ -5463,19 +5463,19 @@ StructRNA *pyrna_struct_as_srna(PyObject *self, int parent, const char *error_pr } if(py_srna==NULL) { - PyErr_Format(PyExc_RuntimeError, "%.200s, missing bl_rna attribute from '%.200s' instance (may not be registered)", error_prefix, Py_TYPE(self)->tp_name); + PyErr_Format(PyExc_RuntimeError, "%.200s, missing bl_rna attribute from '%.200s' instance (may not be registered)", error_prefix, Py_TYPE(self)->tp_name); return NULL; } if(!BPy_StructRNA_Check(py_srna)) { - PyErr_Format(PyExc_TypeError, "%.200s, bl_rna attribute wrong type '%.200s' on '%.200s'' instance", error_prefix, Py_TYPE(py_srna)->tp_name, Py_TYPE(self)->tp_name); - Py_DECREF(py_srna); + PyErr_Format(PyExc_TypeError, "%.200s, bl_rna attribute wrong type '%.200s' on '%.200s'' instance", error_prefix, Py_TYPE(py_srna)->tp_name, Py_TYPE(self)->tp_name); + Py_DECREF(py_srna); return NULL; } if(py_srna->ptr.type != &RNA_Struct) { PyErr_Format(PyExc_TypeError, "%.200s, bl_rna attribute not a RNA_Struct, on '%.200s'' instance", error_prefix, Py_TYPE(self)->tp_name); - Py_DECREF(py_srna); + Py_DECREF(py_srna); return NULL; } diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 264c82e4f47..7d2c7b35247 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -959,7 +959,7 @@ static void alpha_clip_aniso(ImBuf *ibuf, float minx, float miny, float maxx, fl rf.xmax= maxx*(ibuf->x); rf.ymin= miny*(ibuf->y); rf.ymax= maxy*(ibuf->y); - + alphaclip = clipx_rctf(&rf, 0.0, (float)(ibuf->x)); alphaclip*= clipy_rctf(&rf, 0.0, (float)(ibuf->y)); alphaclip= MAX2(alphaclip, 0.0f); @@ -1421,7 +1421,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f ibuf= BKE_image_get_ibuf(ima, &tex->iuser); } if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) - return retval; + return retval; /* mipmap test */ image_mipmap_test(tex, ibuf); @@ -1467,8 +1467,8 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f if(tex->imaflag & TEX_FILTER_MIN) { /* make sure the filtersize is minimal in pixels (normal, ref map can have miniature pixel dx/dy) */ - float addval= (0.5f * tex->filtersize) / (float) MIN2(ibuf->x, ibuf->y); - + float addval= (0.5f * tex->filtersize) / (float) MIN2(ibuf->x, ibuf->y); + if(addval > minx) minx= addval; if(addval > miny) diff --git a/source/blender/render/intern/source/pixelblending.c b/source/blender/render/intern/source/pixelblending.c index d66f40225fa..c2e34e2a70d 100644 --- a/source/blender/render/intern/source/pixelblending.c +++ b/source/blender/render/intern/source/pixelblending.c @@ -144,7 +144,7 @@ void addalphaAddfacFloat(float *dest, float *source, char addfac) if(c >= RE_FULL_COLOR_FLOAT) dest[3] = RE_FULL_COLOR_FLOAT; else #endif - dest[3]= c; + dest[3]= c; } diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 84523975589..2d42938f6ac 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -290,14 +290,14 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz, int a; if(R.wrld.mode & WO_MIST) { - if(har->type & HA_ONLYSKY) { - /* stars but no mist */ - alpha= har->alfa; - } - else { - /* a bit patchy... */ - alpha= mistfactor(-har->co[2], har->co)*har->alfa; - } + if(har->type & HA_ONLYSKY) { + /* stars but no mist */ + alpha= har->alfa; + } + else { + /* a bit patchy... */ + alpha= mistfactor(-har->co[2], har->co)*har->alfa; + } } else alpha= har->alfa; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index f7bf370c0be..d8b5055effd 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -2269,7 +2269,7 @@ void do_material_tex(ShadeInput *shi) if(use_compat_bump) { rgbnor = compatible_bump_compute(&compat_bump, shi, mtex, tex, &texres, Tnor*stencilTin, co, dx, dy, texvec, dxt, dyt); - } + } else if(use_ntap_bump) { rgbnor = ntap_bump_compute(&ntap_bump, shi, mtex, tex, &texres, Tnor*stencilTin, co, dx, dy, texvec, dxt, dyt); diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 6d19846d80a..7a34fc0af50 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -1058,14 +1058,14 @@ static void reset_sky_speed(RenderPart *pa, RenderLayer *rl) static unsigned short *make_solid_mask(RenderPart *pa) { - intptr_t *rd= pa->rectdaps; - unsigned short *solidmask, *sp; - int x; - + intptr_t *rd= pa->rectdaps; + unsigned short *solidmask, *sp; + int x; + if(rd==NULL) return NULL; - + sp=solidmask= MEM_mallocN(sizeof(short)*pa->rectx*pa->recty, "solidmask"); - + for(x=pa->rectx*pa->recty; x>0; x--, rd++, sp++) { if(*rd) { PixStr *ps= (PixStr *)*rd; @@ -1077,7 +1077,7 @@ static unsigned short *make_solid_mask(RenderPart *pa) else *sp= 0; } - + return solidmask; } diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 038d1bd40cb..dcb9a3063e1 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -952,7 +952,7 @@ static int firstreadshadbuf(ShadBuf *shb, ShadSampleBuf *shsample, int **rz, int /* always test borders of shadowbuffer */ if(xs<0) xs= 0; else if(xs>=shb->size) xs= shb->size-1; if(ys<0) ys= 0; else if(ys>=shb->size) ys= shb->size-1; - + /* calc z */ ofs= (ys>>4)*(shb->size>>4) + (xs>>4); ct= shsample->cbuf+ofs; diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c index f7ec0050c5d..12e85af7575 100644 --- a/source/blender/render/intern/source/strand.c +++ b/source/blender/render/intern/source/strand.c @@ -690,7 +690,7 @@ static void strand_render(Render *re, StrandSegment *sseg, float winmat[][4], St } } } - + static int strand_segment_recursive(Render *re, float winmat[][4], StrandPart *spart, ZSpan *zspan, int totzspan, StrandSegment *sseg, StrandPoint *p1, StrandPoint *p2, int depth) { StrandPoint p; diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 79ee3994386..174b1378f67 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3856,7 +3856,7 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf ShadeInput *shi= ssamp->shi; ShadeResult *shr= ssamp->shr; - for(sample=0; sampletot; sample++, shi++, shr++) { + for(sample=0; sampletot; sample++, shi++, shr++) { if(shi->mask & (1<combined[3])*shr->combined[3]; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index b75ef359204..6b074029984 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1602,7 +1602,7 @@ static int wm_event_inside_i(wmEvent *event, rcti *rect) if(wm_event_always_pass(event)) return 1; if(BLI_in_rcti(rect, event->x, event->y)) - return 1; + return 1; if(event->type==MOUSEMOVE) { if( BLI_in_rcti(rect, event->prevx, event->prevy)) { return 1; diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index 4a8553e16f6..4ab4eebdfe1 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -270,8 +270,8 @@ static void wm_jobs_test_suspend_stop(wmWindowManager *wm, wmJob *test) /* if new job is render, any render job should be stopped */ if(test->flag & WM_JOB_EXCL_RENDER) - if(0==(steve->flag & WM_JOB_EXCL_RENDER)) - continue; + if(0==(steve->flag & WM_JOB_EXCL_RENDER)) + continue; suspend= 1; diff --git a/source/creator/creator.c b/source/creator/creator.c index b7d1a30048f..758989b3eb0 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -404,7 +404,7 @@ static int set_fpe(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(dat /* OSX uses SSE for floating point by default, so here * use SSE instructions to throw floating point exceptions */ _MM_SET_EXCEPTION_MASK(_MM_MASK_MASK &~ - (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO)); + (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO)); # endif /* OSX_SSE_FPE */ # if defined(_WIN32) && defined(_MSC_VER) _controlfp_s(NULL, 0, _MCW_EM); /* enables all fp exceptions */ -- cgit v1.2.3