From 31d2ee9bf77bb991ea4779c47379b2cee84b27ed Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 6 Mar 2012 18:40:15 +0000 Subject: style cleanup, brackets in else/if, some indentation. --- source/blender/blenkernel/intern/DerivedMesh.c | 54 +++++----- source/blender/blenkernel/intern/boids.c | 3 +- source/blender/blenkernel/intern/cloth.c | 9 +- source/blender/blenkernel/intern/collision.c | 3 +- source/blender/blenkernel/intern/effect.c | 3 +- source/blender/blenkernel/intern/fcurve.c | 17 ++-- source/blender/blenkernel/intern/font.c | 14 ++- source/blender/blenkernel/intern/icons.c | 9 +- source/blender/blenkernel/intern/image_gen.c | 18 ++-- .../blender/blenkernel/intern/navmesh_conversion.c | 3 +- source/blender/blenkernel/intern/nla.c | 9 +- source/blender/blenkernel/intern/ocean.c | 6 +- source/blender/blenkernel/intern/particle.c | 14 +-- source/blender/blenkernel/intern/shrinkwrap.c | 18 ++-- source/blender/blenkernel/intern/smoke.c | 30 ++---- source/blender/blenkernel/intern/sound.c | 15 +-- source/blender/blenkernel/intern/unit.c | 3 +- source/blender/blenkernel/intern/writeffmpeg.c | 6 +- source/blender/blenlib/intern/BLI_args.c | 9 +- source/blender/blenlib/intern/BLI_memarena.c | 3 +- source/blender/blenlib/intern/freetypefont.c | 20 ++-- source/blender/blenlib/intern/listbase.c | 6 +- source/blender/blenlib/intern/math_geom.c | 9 +- source/blender/blenlib/intern/path_util.c | 6 +- source/blender/blenlib/intern/threads.c | 21 ++-- source/blender/blenloader/intern/readfile.c | 3 +- source/blender/bmesh/operators/bmo_bevel.c | 3 +- .../editors/animation/anim_channels_defines.c | 9 +- .../blender/editors/animation/anim_channels_edit.c | 3 +- source/blender/editors/animation/anim_draw.c | 9 +- source/blender/editors/animation/anim_filter.c | 3 +- source/blender/editors/animation/anim_markers.c | 9 +- source/blender/editors/animation/keyframing.c | 3 +- source/blender/editors/armature/editarmature.c | 71 +++++-------- .../editors/armature/editarmature_retarget.c | 8 +- source/blender/editors/gpencil/drawgpencil.c | 10 +- source/blender/editors/gpencil/gpencil_paint.c | 12 +-- source/blender/editors/interface/interface_draw.c | 18 ++-- .../blender/editors/interface/interface_handlers.c | 9 +- source/blender/editors/interface/interface_icons.c | 3 +- .../editors/interface/interface_templates.c | 3 +- source/blender/editors/mesh/loopcut.c | 3 +- source/blender/editors/object/object_constraint.c | 3 +- source/blender/editors/object/object_relations.c | 9 +- source/blender/editors/physics/particle_edit.c | 16 ++- source/blender/editors/physics/physics_fluid.c | 3 +- source/blender/editors/screen/screen_ops.c | 9 +- source/blender/editors/sculpt_paint/sculpt.c | 9 +- source/blender/editors/sculpt_paint/sculpt_uv.c | 3 +- source/blender/editors/sound/sound_ops.c | 3 +- source/blender/editors/space_file/file_ops.c | 8 +- source/blender/editors/space_file/fsmenu.c | 4 +- source/blender/editors/space_file/space_file.c | 4 +- source/blender/editors/space_graph/graph_draw.c | 12 +-- source/blender/editors/space_graph/graph_select.c | 6 +- source/blender/editors/space_logic/logic_window.c | 87 ++++++---------- source/blender/editors/space_nla/nla_draw.c | 3 +- source/blender/editors/space_nla/nla_edit.c | 3 +- source/blender/editors/space_node/node_edit.c | 3 +- .../editors/space_sequencer/sequencer_draw.c | 3 +- source/blender/editors/space_text/text_ops.c | 4 +- source/blender/editors/space_text/text_python.c | 12 ++- source/blender/editors/space_view3d/drawobject.c | 50 +++++----- source/blender/editors/space_view3d/drawvolume.c | 22 ++-- source/blender/editors/transform/transform.c | 27 ++--- .../editors/transform/transform_constraints.c | 3 +- .../editors/transform/transform_conversions.c | 12 +-- .../blender/editors/transform/transform_generics.c | 45 +++------ source/blender/editors/transform/transform_input.c | 45 ++++----- .../editors/transform/transform_manipulator.c | 12 +-- .../editors/transform/transform_orientations.c | 60 ++++------- source/blender/editors/transform/transform_snap.c | 111 +++++++-------------- source/blender/editors/util/numinput.c | 6 +- .../blender/editors/uvedit/uvedit_smart_stitch.c | 9 +- source/blender/gpu/intern/gpu_codegen.c | 3 +- source/blender/gpu/intern/gpu_draw.c | 9 +- source/blender/imbuf/intern/cineon/cineonlib.c | 9 +- source/blender/imbuf/intern/jp2.c | 5 +- source/blender/imbuf/intern/jpeg.c | 3 +- source/blender/imbuf/intern/radiance_hdr.c | 3 +- source/blender/imbuf/intern/util.c | 6 +- source/blender/makesdna/intern/makesdna.c | 3 +- source/blender/makesrna/intern/rna_actuator.c | 11 +- source/blender/makesrna/intern/rna_controller.c | 7 +- source/blender/makesrna/intern/rna_modifier.c | 3 +- source/blender/makesrna/intern/rna_object.c | 3 +- source/blender/makesrna/intern/rna_scene.c | 3 +- source/blender/makesrna/intern/rna_space.c | 3 +- source/blender/modifiers/intern/MOD_boolean_util.c | 8 +- source/blender/modifiers/intern/MOD_cloth.c | 22 ++-- source/blender/modifiers/intern/MOD_collision.c | 15 +-- source/blender/modifiers/intern/MOD_displace.c | 6 +- source/blender/modifiers/intern/MOD_dynamicpaint.c | 8 +- source/blender/modifiers/intern/MOD_explode.c | 15 ++- source/blender/modifiers/intern/MOD_fluidsim.c | 21 ++-- .../blender/modifiers/intern/MOD_fluidsim_util.c | 9 +- source/blender/modifiers/intern/MOD_mask.c | 25 ++--- source/blender/modifiers/intern/MOD_simpledeform.c | 35 +++---- source/blender/modifiers/intern/MOD_smoke.c | 20 ++-- source/blender/modifiers/intern/MOD_surface.c | 13 +-- .../composite/nodes/node_composite_brightness.c | 6 +- source/blender/nodes/texture/node_texture_util.c | 8 +- source/blender/python/intern/bpy_operator.c | 3 +- .../blender/render/intern/source/convertblender.c | 49 +++++---- source/blender/render/intern/source/pipeline.c | 3 +- source/blender/render/intern/source/rayshade.c | 38 +++---- .../blender/render/intern/source/render_result.c | 3 +- .../blender/render/intern/source/render_texture.c | 4 +- .../blender/render/intern/source/renderdatabase.c | 24 ++--- source/blender/render/intern/source/shadeinput.c | 17 ++-- .../blender/render/intern/source/volume_precache.c | 3 +- source/blender/render/intern/source/voxeldata.c | 3 +- source/blender/windowmanager/intern/wm_draw.c | 3 +- .../blender/windowmanager/intern/wm_event_system.c | 9 +- source/blender/windowmanager/intern/wm_init_exit.c | 6 +- source/creator/creator.c | 43 ++++---- 116 files changed, 600 insertions(+), 983 deletions(-) diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 0d12785872c..bc9794db698 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2460,14 +2460,12 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) MFace * mface = dm->getTessFaceArray(dm); MTFace * mtface = dm->getTessFaceDataArray(dm, CD_MTFACE); - if(mtface) - { + if(mtface) { double dsum = 0.0; int nr_accumulated = 0; int f; - for ( f=0; fauto_bump_scale = use_as_render_bump_scale; } } - else - { + else { dm->auto_bump_scale = 1.0f; } } diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index f3f4d7c9598..8fa0a46f6da 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -250,8 +250,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * } //check boids in own system - if(acbr->options & BRULE_ACOLL_WITH_BOIDS) - { + if (acbr->options & BRULE_ACOLL_WITH_BOIDS) { neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn); if(neighbors > 1) for(n=1; nprev_state.co); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index e2d12c04bf2..e5276d1bbd4 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -288,8 +288,7 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, int moving) ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, (mfaces->v4 ? 4 : 3)); } - else - { + else { ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, (mfaces->v4 ? 4 : 3)); } @@ -332,8 +331,7 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving) ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1); } - else - { + else { ret = BLI_bvhtree_update_node(bvhtree, i, co, NULL, 1); } @@ -1096,8 +1094,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ) BLI_linklist_prepend ( &cloth->springs, spring ); } - else - { + else { cloth_free_errorsprings(cloth, edgehash, edgelist); return 0; } diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 5e65d104a03..ce0de3216d3 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -2543,8 +2543,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl ret = 1; ret2 += ret; } - else - { + else { // check for approximated time collisions } } diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 21c798c3cae..1124922efaa 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -426,8 +426,7 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect if(col->ob == eff->ob) continue; - if(collmd->bvhtree) - { + if (collmd->bvhtree) { BVHTreeRayHit hit; hit.index = -1; diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 3efcd3d8dcf..50e3c2c63eb 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1873,15 +1873,13 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim lastbezt= prevbezt + a; /* evaluation time at or past endpoints? */ - if (prevbezt->vec[1][0] >= evaltime) - { + if (prevbezt->vec[1][0] >= evaltime) { /* before or on first keyframe */ if ( (fcu->extend == FCURVE_EXTRAPOLATE_LINEAR) && (prevbezt->ipo != BEZT_IPO_CONST) && - !(fcu->flag & FCURVE_DISCRETE_VALUES) ) + !(fcu->flag & FCURVE_DISCRETE_VALUES) ) { /* linear or bezier interpolation */ - if (prevbezt->ipo==BEZT_IPO_LIN) - { + if (prevbezt->ipo==BEZT_IPO_LIN) { /* Use the next center point instead of our own handle for * linear interpolated extrapolate */ @@ -1981,8 +1979,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim cvalue= lastbezt->vec[1][1]; } } - else - { + else { /* evaltime occurs somewhere in the middle of the curve */ for (a=0; prevbezt && bezt && (a < fcu->totvert-1); a++, prevbezt=bezt, bezt++) { @@ -1991,8 +1988,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim cvalue= bezt->vec[1][1]; } /* evaltime occurs within the interval defined by these two keyframes */ - else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime)) - { + else if ((prevbezt->vec[1][0] <= evaltime) && (bezt->vec[1][0] >= evaltime)) { /* value depends on interpolation mode */ if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES)) { @@ -2012,8 +2008,7 @@ static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltim else cvalue= prevbezt->vec[1][1]; } - else - { + else { /* bezier interpolation */ /* v1,v2 are the first keyframe and its 2nd handle */ v1[0]= prevbezt->vec[1][0]; diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index ba23b2123d6..4cf47906b64 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -165,8 +165,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont) pf= vfont->packedfile; // We need to copy a tmp font to memory unless it is already there - if(!tmpfnt) - { + if(!tmpfnt) { tpf= MEM_callocN(sizeof(*tpf), "PackedFile"); tpf->data= MEM_mallocN(pf->size, "packFile"); tpf->size= pf->size; @@ -178,11 +177,11 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont) tmpfnt->vfont= vfont; BLI_addtail(&ttfdata, tmpfnt); } - } else { + } + else { pf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); - - if(!tmpfnt) - { + + if (!tmpfnt) { tpf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); // Add temporary packed file to globals @@ -257,8 +256,7 @@ VFont *load_vfont(Main *bmain, const char *name) } // Do not add FO_BUILTIN_NAME to temporary listbase - if(strcmp(filename, FO_BUILTIN_NAME)) - { + if (strcmp(filename, FO_BUILTIN_NAME)) { tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font"); tmpfnt->pf= tpf; tmpfnt->vfont= vfont; diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 533dd783422..72038955c55 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -66,8 +66,7 @@ static void icon_free(void *val) { Icon* icon = val; - if (icon) - { + if (icon) { if (icon->drawinfo_free) { icon->drawinfo_free(icon->drawinfo); } @@ -236,8 +235,7 @@ void BKE_icon_changed(int id) icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(id)); - if (icon) - { + if (icon) { PreviewImage *prv = BKE_previewimg_get((ID*)icon->obj); /* all previews changed */ @@ -302,8 +300,7 @@ void BKE_icon_set(int icon_id, struct Icon* icon) old_icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id)); - if (old_icon) - { + if (old_icon) { printf("BKE_icon_set: Internal error, icon already set: %d\n", icon_id); return; } diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index 111350bb1bb..d4185af2f98 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -202,12 +202,9 @@ static void checker_board_color_tint(unsigned char *rect, float *rect_float, int int x, y; float blend_half= blend * 0.5f; - for(y= 0; y < height; y++) - { - for(x= 0; x < width; x++) - { - if( ( (y/size)%2 == 1 && (x/size)%2 == 1 ) || ( (y/size)%2 == 0 && (x/size)%2 == 0 ) ) - { + for (y= 0; y < height; y++) { + for (x= 0; x < width; x++) { + if (((y / size) % 2 == 1 && (x / size) % 2 == 1 ) || ( (y / size) % 2 == 0 && (x / size) % 2 == 0 )) { if (rect) { rect[0]= (char)BLEND_CHAR(rect[0], blend); rect[1]= (char)BLEND_CHAR(rect[1], blend); @@ -251,12 +248,9 @@ static void checker_board_color_tint(unsigned char *rect, float *rect_float, int static void checker_board_grid_fill(unsigned char *rect, float *rect_float, int width, int height, float blend) { int x, y; - for(y= 0; y < height; y++) - { - for(x= 0; x < width; x++) - { - if( ((y % 32) == 0) || ((x % 32) == 0) || x == 0 ) - { + for(y= 0; y < height; y++) { + for(x= 0; x < width; x++) { + if (((y % 32) == 0) || ((x % 32) == 0) || x == 0) { if (rect) { rect[0]= BLEND_CHAR(rect[0], blend); rect[1]= BLEND_CHAR(rect[1], blend); diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c index 4c9c0a3a1fc..cdba036a6ae 100644 --- a/source/blender/blenkernel/intern/navmesh_conversion.c +++ b/source/blender/blenkernel/intern/navmesh_conversion.c @@ -248,8 +248,7 @@ int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, //move to next edge edge = (edge+1)%3; } - else - { + else { //move to next tri int twinedge = -1; for (k=0; k<3; k++) diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 814f0715d11..f67d3274b34 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -352,8 +352,7 @@ NlaStrip *add_nla_soundstrip (Scene *scene, Speaker *speaker) * otherwise default to length of 10 frames */ #ifdef WITH_AUDASPACE - if (speaker->sound) - { + if (speaker->sound) { AUD_SoundInfo info = AUD_getInfo(speaker->sound->playback_handle); strip->end = (float)ceil((double)info.length * FPS); @@ -1395,8 +1394,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls) * is directly followed/preceeded by another strip, forming an * 'island' of continuous strips */ - if ( (ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start)==0) ) - { + if ((ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start)==0)) { /* start overlaps - pick the largest overlap */ if ( ((ps && ns) && (*ps > *ns)) || (ps) ) nls->blendin= *ps - nls->start; @@ -1406,8 +1404,7 @@ static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls) else /* no overlap allowed/needed */ nls->blendin= 0.0f; - if ( (pe || ne) && ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end)==0) ) - { + if ((pe || ne) && ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end)==0)) { /* end overlaps - pick the largest overlap */ if ( ((pe && ne) && (*pe > *ne)) || (pe) ) nls->blendout= nls->end - *pe; diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index dd9444d87e0..87929d6a185 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -435,8 +435,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u ocr->disp[0] = INTERP(oc->_disp_x); ocr->disp[2] = INTERP(oc->_disp_z); } - else - { + else { ocr->disp[0] = 0.0; ocr->disp[2] = 0.0; } @@ -479,8 +478,7 @@ void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i,int j) ocr->disp[0] = oc->_disp_x[i*oc->_N+j]; ocr->disp[2] = oc->_disp_z[i*oc->_N+j]; } - else - { + else { ocr->disp[0] = 0.0f; ocr->disp[2] = 0.0f; } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 78df8d26c4d..d86b3c7a9d3 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -543,11 +543,9 @@ void psys_free(Object *ob, ParticleSystem * psys) } // check if we are last non-visible particle system - for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) { - if(tpsys->part) - { - if(ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR)) - { + for (tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) { + if (tpsys->part) { + if (ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR)) { nr++; break; } @@ -3487,16 +3485,14 @@ void object_remove_particle_system(Scene *scene, Object *ob) return; /* clear all other appearances of this pointer (like on smoke flow modifier) */ - if((md = modifiers_findByType(ob, eModifierType_Smoke))) - { + if ((md = modifiers_findByType(ob, eModifierType_Smoke))) { SmokeModifierData *smd = (SmokeModifierData *)md; if((smd->type == MOD_SMOKE_TYPE_FLOW) && smd->flow && smd->flow->psys) if(smd->flow->psys == psys) smd->flow->psys = NULL; } - if((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) - { + if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) { DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; if(pmd->brush && pmd->brush->psys) if(pmd->brush->psys == psys) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index a98834c5e35..6800c210963 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -236,8 +236,7 @@ int normal_projection_project_vertex(char options, const float *vert, const floa hit_tmp.dist *= mat4_to_scale( ((SpaceTransform*)transf)->local2target ); } - else - { + else { co = vert; no = dir; } @@ -303,8 +302,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) { if(calc->vert == NULL) return; } - else - { + else { //The code supports any axis that is a combination of X,Y,Z //although currently UI only allows to set the 3 different axis if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) proj_axis[0] = 1.0f; @@ -355,8 +353,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) copy_v3_v3(tmp_no, proj_axis); } } - else - { + else { copy_v3_v3(tmp_co, co); copy_v3_v3(tmp_no, proj_axis); } @@ -439,12 +436,10 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) if(weight == 0.0f) continue; //Convert the vertex to tree coordinates - if(calc->vert) - { + if(calc->vert) { copy_v3_v3(tmp_co, calc->vert[i].co); } - else - { + else { copy_v3_v3(tmp_co, co); } space_transform_apply(&calc->local2target, tmp_co); @@ -469,8 +464,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //Make the vertex stay on the front side of the face madd_v3_v3v3fl(tmp_co, nearest.co, nearest.no, calc->keepDist); } - else - { + else { //Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position float dist = sasqrt( nearest.dist ); if(dist > FLT_EPSILON) diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 8f0fcc04e1e..bffd4703ce4 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -211,8 +211,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, smd->domain->res[1] = (int)(size[1] * scale + 0.5); smd->domain->res[2] = (int)(size[2] * scale + 0.5); } - else - { + else { scale = res / size[2]; smd->domain->dx = size[2] / res; smd->domain->res[2] = res; @@ -220,8 +219,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, smd->domain->res[1] = (int)(size[1] * scale + 0.5); } } - else - { + else { if(size[1] > size[2]) { scale = res / size[1]; @@ -230,8 +228,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, smd->domain->res[0] = (int)(size[0] * scale + 0.5); smd->domain->res[2] = (int)(size[2] * scale + 0.5); } - else - { + else { scale = res / size[2]; smd->domain->dx = size[2] / res; smd->domain->res[2] = res; @@ -378,8 +375,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs) sub_v3_v3v3(side1, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co); sub_v3_v3v3(side2, mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co); } - else - { + else { sub_v3_v3v3(side1, mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co); sub_v3_v3v3(side2, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co); } @@ -410,8 +406,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs) copy_v3_v3(p2, mvert[ mface[i].v3 ].co); copy_v3_v3(p3, mvert[ mface[i].v4 ].co); } - else - { + else { copy_v3_v3(p2, mvert[ mface[i].v2 ].co); copy_v3_v3(p3, mvert[ mface[i].v3 ].co); } @@ -1073,8 +1068,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd) if(psys->particles[p].flag & (PARS_NO_DISP|PARS_UNEXIST)) continue; } - else - { + else { /* handle child particle */ ChildParticle *cpa = &psys->child[p - totpart]; @@ -1272,8 +1266,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd) } - else - { + else { /* for() { @@ -1630,14 +1623,12 @@ static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int sub_v3_v3v3(tmp, pos, p0); mul_v3_fl(tmp, 1.0 / dx); - if(correct) - { + if (correct) { cell[0] = MIN2(res[0] - 1, MAX2(0, (int)floor(tmp[0]))); cell[1] = MIN2(res[1] - 1, MAX2(0, (int)floor(tmp[1]))); cell[2] = MIN2(res[2] - 1, MAX2(0, (int)floor(tmp[2]))); } - else - { + else { cell[0] = (int)floor(tmp[0]); cell[1] = (int)floor(tmp[1]); cell[2] = (int)floor(tmp[2]); @@ -1687,8 +1678,7 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa // we're ouside get_cell(p0, res, dx, pos, cell, 1); } - else - { + else { // we're inside get_cell(p0, res, dx, light, cell, 1); } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 594c7a9a2f3..a41e765695e 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -628,19 +628,16 @@ void sound_seek_scene(struct Main *bmain, struct Scene *scene) AUD_resume(scene->sound_scene_handle); if (scene->sound_scrub_handle && AUD_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID) AUD_seek(scene->sound_scrub_handle, 0); - else - { + else { if (scene->sound_scrub_handle) AUD_stop(scene->sound_scrub_handle); scene->sound_scrub_handle = AUD_pauseAfter(scene->sound_scene_handle, 1 / FPS); } } - else - { + else { if (scene->audio.flag & AUDIO_SYNC) AUD_seekSequencer(scene->sound_scene_handle, CFRA / FPS); - else - { + else { if (status == AUD_STATUS_PLAYING) AUD_seek(scene->sound_scene_handle, CFRA / FPS); } @@ -731,14 +728,12 @@ void sound_update_scene(struct Scene* scene) { if (speaker->sound) AUD_moveSequence(strip->speaker_handle, strip->start / FPS, -1, 0); - else - { + else { AUD_removeSequence(scene->sound_scene, strip->speaker_handle); strip->speaker_handle = NULL; } } - else - { + else { if (speaker->sound) { strip->speaker_handle = AUD_addSequence(scene->sound_scene, speaker->sound->playback_handle, strip->start / FPS, -1, 0); diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index c3ba8f1ad6a..3b84cb4eb5f 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -689,8 +689,7 @@ void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int syste /* find and substitute all units */ for (unit= usys->units; unit->name; unit++) { - if (len_max > 0 && (unit->name_alt || unit == unit_def)) - { + if (len_max > 0 && (unit->name_alt || unit == unit_def)) { const char *found= unit_find_str(orig_str, unit->name_short); if (found) { int offset= (int)(found - orig_str); diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 9d68e1d899c..bca7f6ff7bb 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -627,8 +627,7 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD)) audio_input_samples = audio_outbuf_size * 8 / c->bits_per_coded_sample / c->channels; - else - { + else { audio_input_samples = c->frame_size; if(c->frame_size * c->channels * sizeof(int16_t) * 4 > audio_outbuf_size) audio_outbuf_size = c->frame_size * c->channels * sizeof(int16_t) * 4; @@ -994,8 +993,7 @@ void end_ffmpeg(void) }*/ #ifdef WITH_AUDASPACE - if(audio_mixdown_device) - { + if (audio_mixdown_device) { AUD_closeReadDevice(audio_mixdown_device); audio_mixdown_device = 0; } diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index bbf005e79ac..3d137641889 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -237,8 +237,7 @@ void BLI_argsPrintArgDoc(struct bArgs *ba, const char *arg) { bArgument *a = lookUp(ba, arg, -1, -1); - if (a) - { + if (a) { bArgDoc *d = a->doc; internalDocPrint(d); @@ -251,10 +250,8 @@ void BLI_argsPrintOtherDoc(struct bArgs *ba) { bArgDoc *d; - for( d = ba->docs.first; d; d = d->next) - { - if (d->done == 0) - { + for (d = ba->docs.first; d; d = d->next) { + if (d->done == 0) { internalDocPrint(d); } } diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 4debe1a4b04..72f312ba6e4 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -94,8 +94,7 @@ void *BLI_memarena_alloc(MemArena *ma, int size) if (size>ma->cursize) { unsigned char *tmp; - if(size > ma->bufsize - (ma->align - 1)) - { + if(size > ma->bufsize - (ma->align - 1)) { ma->cursize = PADUP(size+1, ma->align); } else ma->cursize = ma->bufsize; diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 8fe081fe70b..f55ebf915e2 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -99,8 +99,7 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf err= FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP); // If loading succeeded, convert the FT glyph to the internal format - if(!err) - { + if(!err) { int *npoints; int *onpoints; @@ -162,9 +161,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf if(k == 0) m = l; //virtual conic on-curve points - if(k < npoints[j] - 1 ) - { - if( ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l+1] == FT_Curve_Tag_Conic) { + if (k < npoints[j] - 1) { + if (ftoutline.tags[l] == FT_Curve_Tag_Conic && ftoutline.tags[l+1] == FT_Curve_Tag_Conic) { dx = (ftoutline.points[l].x + ftoutline.points[l+1].x)* scale / 2.0f; dy = (ftoutline.points[l].y + ftoutline.points[l+1].y)* scale / 2.0f; @@ -291,8 +289,7 @@ static int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode) if(!tf) return FALSE; // Load the font to memory - if(tf->pf) - { + if (tf->pf) { err= FT_New_Memory_Face( library, tf->pf->data, tf->pf->size, @@ -369,17 +366,14 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf) lcode= charcode= FT_Get_First_Char(face, &glyph_index); // No charmap found from the ttf so we need to figure it out - if(glyph_index == 0) - { + if (glyph_index == 0) { FT_CharMap found = NULL; FT_CharMap charmap; int n; - for ( n = 0; n < face->num_charmaps; n++ ) - { + for (n = 0; n < face->num_charmaps; n++) { charmap = face->charmaps[n]; - if (charmap->encoding == FT_ENCODING_APPLE_ROMAN) - { + if (charmap->encoding == FT_ENCODING_APPLE_ROMAN) { found = charmap; break; } diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index 6155bf83a57..71077f8e467 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -182,10 +182,8 @@ void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *)) if (cmp == NULL) return; if (listbase == NULL) return; - if (listbase->first != listbase->last) - { - for( previous = listbase->first, current = previous->next; current; current = next ) - { + if (listbase->first != listbase->last) { + for (previous = listbase->first, current = previous->next; current; current = next) { next = current->next; previous = current->prev; diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 9f5e191c9ff..18418f3105c 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -957,8 +957,7 @@ int isect_sweeping_sphere_tri_v3( return 0; } } - else - { + else { float t0=(-a+radius)/nordotv; float t1=(-a-radius)/nordotv; @@ -1279,13 +1278,11 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3], const float return 1; /* intersection found */ } - else - { + else { return 0; } } - else - { + else { return 0; } } diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 54a865c7c22..ffee44078b2 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -468,8 +468,7 @@ void BLI_path_rel(char *file, const char *relfile) /* the last slash in the file indicates where the path part ends */ lslash = BLI_last_slash(temp); - if (lslash) - { + if (lslash) { /* find the prefix of the filename that is equal for both filenames. * This is replaced by the two slashes at the beginning */ char *p= temp; @@ -838,8 +837,7 @@ const char *BLI_getDefaultDocumentFolder(void) */ hResult = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, documentfolder); - if (hResult == S_OK) - { + if (hResult == S_OK) { if (BLI_is_dir(documentfolder)) return documentfolder; } diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 6048ca8cfc3..3894a6a0b8e 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -464,12 +464,10 @@ ThreadedWorker *BLI_create_worker(void *(*do_thread)(void *), int tot, int sleep worker = MEM_callocN(sizeof(ThreadedWorker), "threadedworker"); - if (tot > RE_MAX_THREAD) - { + if (tot > RE_MAX_THREAD) { tot = RE_MAX_THREAD; } - else if (tot < 1) - { + else if (tot < 1) { tot= 1; } @@ -498,25 +496,20 @@ void BLI_insert_work(ThreadedWorker *worker, void *param) WorkParam *p = MEM_callocN(sizeof(WorkParam), "workparam"); int index; - if (BLI_available_threads(&worker->threadbase) == 0) - { + if (BLI_available_threads(&worker->threadbase) == 0) { index = worker->total; - while(index == worker->total) - { + while(index == worker->total) { PIL_sleep_ms(worker->sleep_time); - for (index = 0; index < worker->total; index++) - { - if (worker->busy[index] == 0) - { + for (index = 0; index < worker->total; index++) { + if (worker->busy[index] == 0) { BLI_remove_thread_index(&worker->threadbase, index); break; } } } } - else - { + else { index = BLI_available_thread_index(&worker->threadbase); } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 81e9cbbde9d..e5125d0fb47 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10818,8 +10818,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) sAct->sound3D.min_gain = sound->min_gain; sAct->sound3D.rolloff_factor = sound->attenuation; } - else - { + else { sAct->sound3D.reference_distance = 1.0f; sAct->volume = 1.0f; sAct->sound3D.max_gain = 1.0f; diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index 879e5e13a3a..e055cd2306e 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -362,8 +362,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) float co[3]; if (BMO_elem_flag_test(bm, l->e, BEVEL_FLAG)) { - if (BMO_elem_flag_test(bm, l->prev->e, BEVEL_FLAG)) - { + if (BMO_elem_flag_test(bm, l->prev->e, BEVEL_FLAG)) { tag = tags + BM_elem_index_get(l); calc_corner_co(bm, l, fac, co, do_dist, do_even); tag->newv = BM_vert_create(bm, co, l->v); diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index f15ce721081..9e3630aea67 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2600,8 +2600,7 @@ short ANIM_channel_setting_get (bAnimContext *ac, bAnimListElem *ale, int settin bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale); /* 1) check that the setting exists for the current context */ - if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) ) - { + if ((acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting))) { /* 2) get pointer to check for flag in, and the flag to check for */ short negflag, ptrsize; int flag; @@ -2678,8 +2677,7 @@ void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale); /* 1) check that the setting exists for the current context */ - if ( (acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting)) ) - { + if ((acf) && (!acf->has_setting || acf->has_setting(ac, ale, setting))) { /* 2) get pointer to check for flag in, and the flag to check for */ short negflag, ptrsize; int flag; @@ -2831,8 +2829,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float UI_DrawString(offset, ytext, name); /* draw red underline if channel is disabled */ - if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED)) - { + if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED)) { // FIXME: replace hardcoded color here, and check on extents! glColor3f(1.0f, 0.0f, 0.0f); glLineWidth(2.0); diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 74ae587218b..ec1583f2aa3 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -541,8 +541,7 @@ void ANIM_fcurve_delete_from_animdata (bAnimContext *ac, AnimData *adt, FCurve * /* XXX: there's a problem where many actions could build up in the file if multiple * full add/delete cycles are performed on the same objects, but assume that this is rare */ - if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON)==0) - { + if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON)==0) { id_us_min(&adt->action->id); adt->action = NULL; } diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 714c3276769..1ef02f46000 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -367,18 +367,15 @@ void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, s float ANIM_unit_mapping_get_factor (Scene *scene, ID *id, FCurve *fcu, short restore) { /* sanity checks */ - if (id && fcu && fcu->rna_path) - { + if (id && fcu && fcu->rna_path) { PointerRNA ptr, id_ptr; PropertyRNA *prop; /* get RNA property that F-Curve affects */ RNA_id_pointer_create(id, &id_ptr); - if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) - { + if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) { /* rotations: radians <-> degrees? */ - if (RNA_SUBTYPE_UNIT(RNA_property_subtype(prop)) == PROP_UNIT_ROTATION) - { + if (RNA_SUBTYPE_UNIT(RNA_property_subtype(prop)) == PROP_UNIT_ROTATION) { /* if the radians flag is not set, default to using degrees which need conversions */ if ((scene) && (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS) == 0) { if (restore) diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 81836d83b95..05a2cc33fac 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1038,8 +1038,7 @@ static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDope * but to do this, we need to check that the group doesn't have it's not-visible flag set preventing * all its sub-curves to be shown */ - if ( !(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE) ) - { + if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE)) { /* group must be editable for its children to be editable (if we care about this) */ if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) { /* get first F-Curve which can be used here */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 7f7b1b28319..b3efeffe1d9 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -83,10 +83,10 @@ static ListBase *context_get_markers(Scene *scene, ScrArea *sa) /* local markers can only be shown when there's only a single active action to grab them from * - flag only takes effect when there's an action, otherwise it can get too confusing? */ - if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && (saction->action)) - { - if (saction->flag & SACTION_POSEMARKERS_SHOW) + if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && (saction->action)) { + if (saction->flag & SACTION_POSEMARKERS_SHOW) { return &saction->action->markers; + } } } } @@ -851,8 +851,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) float vec[3]; char str_tx[256]; - if (handleNumInput(&mm->num, evt)) - { + if (handleNumInput(&mm->num, evt)) { applyNumInput(&mm->num, vec); outputNumInput(&mm->num, str_tx); diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 161f549e257..2a66a6c0aba 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -105,8 +105,7 @@ short ANIM_get_keyframing_flags (Scene *scene, short incl_mode) } /* only if including settings from the autokeying mode... */ - if (incl_mode) - { + if (incl_mode) { /* keyframing mode - only replace existing keyframes */ if (IS_AUTOKEY_MODE(scene, EDITKEYS)) flag |= INSERTKEY_REPLACE; diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 6a128abea18..365eb28278d 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -2533,8 +2533,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase curBone->temp = eBone; eBone->temp = curBone; - if (name != NULL) - { + if (name != NULL) { BLI_strncpy(eBone->name, name, sizeof(eBone->name)); } @@ -5557,8 +5556,7 @@ void transform_armature_mirror_update(Object *obedit) eboflip->roll= -ebo->roll; /* Also move connected parent, in case parent's name isn't mirrored properly */ - if (eboflip->parent && eboflip->flag & BONE_CONNECTED) - { + if (eboflip->parent && eboflip->flag & BONE_CONNECTED) { EditBone *parent = eboflip->parent; copy_v3_v3(parent->tail, eboflip->head); parent->rad_tail = ebo->rad_head; @@ -5589,8 +5587,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode bArmature *arm= obedit->data; EditBone *lastBone = NULL; - if (scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE) - { + if (scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE) { ReebArcIterator arc_iter; BArcIterator *iter = (BArcIterator*)&arc_iter; float *previous = NULL, *current = NULL; @@ -5624,8 +5621,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode len1 = normalize_v3(vec1); len2 = normalize_v3(vec2); - if (len1 > 0.0f && len2 > 0.0f && dot_v3v3(vec1, vec2) < angleLimit) - { + if (len1 > 0.0f && len2 > 0.0f && dot_v3v3(vec1, vec2) < angleLimit) { copy_v3_v3(parent->tail, previous); child = ED_armature_edit_bone_add(arm, "Bone"); @@ -5641,8 +5637,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode /* If the bone wasn't subdivided, delete it and return NULL * to let subsequent subdivision methods do their thing. * */ - if (parent == root) - { + if (parent == root) { if(parent==arm->act_edbone) arm->act_edbone= NULL; ED_armature_edit_bone_remove(arm, parent); parent = NULL; @@ -5658,8 +5653,7 @@ EditBone * test_subdivideByCorrelation(Scene *scene, Object *obedit, ReebArc *ar { EditBone *lastBone = NULL; - if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION) - { + if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION) { float invmat[4][4]= MAT4_UNITY; float tmat[3][3]= MAT3_UNITY; ReebArcIterator arc_iter; @@ -5682,19 +5676,16 @@ float arcLengthRatio(ReebArc *arc) arcLength = len_v3v3(arc->head->p, arc->tail->p); - if (arc->bcount > 0) - { + if (arc->bcount > 0) { /* Add the embedding */ - for ( i = 1; i < arc->bcount; i++) - { + for ( i = 1; i < arc->bcount; i++) { embedLength += len_v3v3(arc->buckets[i - 1].p, arc->buckets[i].p); } /* Add head and tail -> embedding vectors */ embedLength += len_v3v3(arc->head->p, arc->buckets[0].p); embedLength += len_v3v3(arc->tail->p, arc->buckets[arc->bcount - 1].p); } - else - { + else { embedLength = arcLength; } @@ -5734,8 +5725,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) src = scene->basact->object; - if (obedit != NULL) - { + if (obedit != NULL) { ED_armature_from_edit(obedit); ED_armature_edit_free(obedit); } @@ -5772,32 +5762,28 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) * Finally, the arc direction is stored in its flag: 1 (low -> high), -1 (high -> low) */ - /* if arc is a symmetry axis, internal bones go up the tree */ - if (arc->symmetry_level == 1 && arc->tail->degree != 1) - { + /* if arc is a symmetry axis, internal bones go up the tree */ + if (arc->symmetry_level == 1 && arc->tail->degree != 1) { head = arc->tail; tail = arc->head; arc->flag = -1; /* mark arc direction */ } /* Bones point AWAY from the symmetry axis */ - else if (arc->head->symmetry_level == 1) - { + else if (arc->head->symmetry_level == 1) { head = arc->head; tail = arc->tail; arc->flag = 1; /* mark arc direction */ } - else if (arc->tail->symmetry_level == 1) - { + else if (arc->tail->symmetry_level == 1) { head = arc->tail; tail = arc->head; arc->flag = -1; /* mark arc direction */ } /* otherwise, always go from low weight to high weight */ - else - { + else { head = arc->head; tail = arc->tail; @@ -5805,10 +5791,8 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) } /* Loop over subdivision methods */ - for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++) - { - switch(scene->toolsettings->skgen_subdivisions[i]) - { + for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++) { + switch(scene->toolsettings->skgen_subdivisions[i]) { case SKGEN_SUB_LENGTH: lastBone = test_subdivideByLength(scene, obedit, arc, head, tail); break; @@ -5821,8 +5805,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) } } - if (lastBone == NULL) - { + if (lastBone == NULL) { EditBone *bone; bone = ED_armature_edit_bone_add(obedit->data, "Bone"); bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; @@ -5843,20 +5826,18 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) ReebArc *incomingArc = NULL; int i; - for (i = 0; i < node->degree; i++) - { + for (i = 0; i < node->degree; i++) { arc = (ReebArc*)node->arcs[i]; /* if arc is incoming into the node */ - if ((arc->head == node && arc->flag == -1) || (arc->tail == node && arc->flag == 1)) + if ((arc->head == node && arc->flag == -1) || + (arc->tail == node && arc->flag == 1)) { - if (incomingArc == NULL) - { + if (incomingArc == NULL) { incomingArc = arc; /* loop further to make sure there's only one incoming arc */ } - else - { + else { /* skip this node if more than one incomingArc */ incomingArc = NULL; break; /* No need to look further, we are skipping already */ @@ -5864,8 +5845,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) } } - if (incomingArc != NULL) - { + if (incomingArc != NULL) { EditBone *parentBone = BLI_ghash_lookup(arcBoneMap, incomingArc); /* Look for outgoing arcs and parent their bones */ @@ -5874,8 +5854,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) arc = node->arcs[i]; /* if arc is outgoing from the node */ - if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1)) - { + if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1)) { EditBone *childBone = BLI_ghash_lookup(arcBoneMap, arc); /* find the root bone */ diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index f1ea39e45b9..375184d3229 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -2901,12 +2901,10 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg) char *num_string = scene->toolsettings->skgen_num_string; int free_template = 0; - if (template_rigg) - { - ob = template_rigg->ob; + if (template_rigg) { + ob = template_rigg->ob; } - else - { + else { free_template = 1; ob = obedit; template_rigg = armatureSelectedToGraph(C, ob, ob->data); diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 5e9acc5b84f..76af016b6c6 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -189,8 +189,7 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short dfl glVertex2fv(co); glEnd(); } - else - { + else { /* draw filled circle as is done in circf (but without the matrix push/pops which screwed things up) */ GLUquadricObj *qobj = gluNewQuadric(); @@ -289,8 +288,7 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s /* tessellation code - draw stroke as series of connected quads with connection * edges rotated to minimise shrinking artifacts, and rounded endcaps */ - else - { + else { bGPDspoint *pt1, *pt2; float pm[2]; int i; @@ -384,8 +382,8 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness_s mt[1]= mb[1] * pthick; athick= len_v2(mt); dfac= pthick - (athick * 2); - if ( ((athick * 2.0f) < pthick) && (IS_EQF(athick, pthick)==0) ) - { + + if (((athick * 2.0f) < pthick) && (IS_EQF(athick, pthick)==0)) { mt[0] += (mb[0] * dfac); mt[1] += (mb[1] * dfac); } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 84d3162434a..535a0f947f1 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -194,8 +194,7 @@ static void gp_get_3d_reference (tGPsdata *p, float vec[3]) /* the reference point used depends on the owner... */ #if 0 // XXX: disabled for now, since we can't draw relative to the owner yet - if (p->ownerPtr.type == &RNA_Object) - { + if (p->ownerPtr.type == &RNA_Object) { Object *ob= (Object *)p->ownerPtr.data; /* active Object @@ -517,10 +516,8 @@ static void gp_stroke_simplify (tGPsdata *p) pressure += old_points[offs].pressure * sfac; \ } - for (i = 0, j = 0; i < num_points; i++) - { - if (i - j == 3) - { + for (i = 0, j = 0; i < num_points; i++) { + if (i - j == 3) { float co[2], pressure; int mco[2]; @@ -1855,8 +1852,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) /* handle mode-specific events */ if (p->status == GP_STATUS_PAINTING) { /* handle painting mouse-movements? */ - if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (p->flags & GP_PAINTFLAG_FIRSTRUN)) - { + if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (p->flags & GP_PAINTFLAG_FIRSTRUN)) { /* handle drawing event */ //printf("\t\tGP - add point\n"); gpencil_draw_apply_event(op, event); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 97248e8710c..1cf93ba8b11 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -557,24 +557,21 @@ static void ui_draw_but_CHARTAB(uiBut *but) // Set the font to be either unicode or FO_BUILTIN_NAME wstr[0] = cs; - if(strcmp(G.selfont->name, FO_BUILTIN_NAME)) - { + if (strcmp(G.selfont->name, FO_BUILTIN_NAME)) { BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr)); } - else - { - if(G.ui_international == TRUE) - { + else { + if (G.ui_international == TRUE) { BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr)); } - else - { + else { ustr[0] = cs; ustr[1] = 0; } } - if((G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) || (G.selfont && !strcmp(G.selfont->name, FO_BUILTIN_NAME) && G.ui_international == TRUE)) + if ((G.selfont && strcmp(G.selfont->name, FO_BUILTIN_NAME)) || + (G.selfont && !strcmp(G.selfont->name, FO_BUILTIN_NAME) && G.ui_international == TRUE)) { float wid; float llx, lly, llz, urx, ury, urz; @@ -595,8 +592,7 @@ static void ui_draw_but_CHARTAB(uiBut *but) ui_rasterpos_safe(px, py, but->aspect); FTF_DrawString((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8); } - else - { + else { ui_rasterpos_safe(sx + butw/2, sy + buth/2, but->aspect); UI_DrawString(but->font, (char *) ustr, 0); } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index cc30cda78be..0496c8c5c36 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4193,8 +4193,7 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut if(che > G.charmax) che = 0; - if(G.obedit) - { + if(G.obedit) { do_textedit(0,0,che); } @@ -4227,10 +4226,8 @@ static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut return WM_UI_HANDLER_BREAK; } else if(ELEM(event->type, WHEELDOWNMOUSE, PAGEDOWNKEY)) { - for(but= block->buttons.first; but; but= but->next) - { - if(but->type == CHARTAB) - { + for(but= block->buttons.first; but; but= but->next) { + if(but->type == CHARTAB) { G.charstart = G.charstart + (12*6); if(G.charstart > (0xffff - 12*6)) G.charstart = 0xffff - (12*6); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index bde2c334444..552d5b0d221 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1015,8 +1015,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al static void ui_id_preview_image_render_size(bContext *C, ID *id, PreviewImage *pi, int size) { - if ((pi->changed[size] ||!pi->rect[size])) /* changed only ever set by dynamic icons */ - { + if ((pi->changed[size] ||!pi->rect[size])) { /* changed only ever set by dynamic icons */ /* create the rect if necessary */ icon_set_image(C, id, pi, size); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 70336eb9e0f..aa2d939d5f1 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -774,8 +774,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, } if (ob->type==OB_MESH) { - if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex)) - { + if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex)) { /* -- convert to rna ? */ but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, TIP_("Apply modifier to editing cage during Editmode")); diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 59151cf107c..358cd8d2012 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -514,8 +514,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event) if (event->val==KM_PRESS) { float value; - if (handleNumInput(&lcd->num, event)) - { + if (handleNumInput(&lcd->num, event)) { applyNumInput(&lcd->num, &value); cuts= CLAMPIS(value, 1, 32); diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index a90edb29c29..b7b2033b2ed 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -391,8 +391,7 @@ static void test_constraints (Object *owner, bPoseChannel *pchan) /* if the number of points does not match the amount required by the chain length, * free the points array and request a rebind... */ - if ((data->points == NULL) || (data->numpoints != data->chainlen+1)) - { + if ((data->points == NULL) || (data->numpoints != data->chainlen+1)) { /* free the points array */ if (data->points) { MEM_freeN(data->points); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 2945075b9de..931896ed916 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -319,13 +319,11 @@ static int make_proxy_exec (bContext *C, wmOperator *op) GroupObject *go; Scene *scene= CTX_data_scene(C); - if (gob->dup_group != NULL) - { + if (gob->dup_group != NULL) { go= BLI_findlink(&gob->dup_group->gobject, RNA_enum_get(op->ptr, "object")); ob= go->ob; } - else - { + else { ob= gob; gob = NULL; } @@ -598,8 +596,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object /* BUT, to keep the deforms, we need a modifier, and then we need to set the object that it uses */ // XXX currently this should only happen for meshes, curves, surfaces, and lattices - this stuff isn't available for metas yet - if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) - { + if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) { ModifierData *md; switch (partype) { diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 3cc7c8a944e..e08139e9a78 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -252,9 +252,8 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create) break; } } - else if(pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) { - if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) - { + else if (pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) { + if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) { pset->flag |= PE_FADE_TIME; // NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB; PE_create_particle_edit(scene, ob, pid->cache, NULL); @@ -262,9 +261,8 @@ static PTCacheEdit *pe_get_current(Scene *scene, Object *ob, int create) edit = pid->cache->edit; break; } - else if(pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) { - if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) - { + else if (pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) { + if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) { pset->flag |= PE_FADE_TIME; // NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB; PE_create_particle_edit(scene, ob, pid->cache, NULL); @@ -3632,10 +3630,10 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) PE_update_object(scene, ob, 1); } - if(edit->psys) + if (edit->psys) { WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob); - else - { + } + else { DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); } diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index d3af007d2e6..96a59ee4542 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -860,8 +860,7 @@ static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *r curFrame++; - if((exists = BLI_exists(targetFile))) - { + if ((exists = BLI_exists(targetFile))) { BLI_delete(targetFile, 0, 0); BLI_delete(targetFileVel, 0, 0); BLI_delete(previewFile, 0, 0); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 5504434e6b5..a8ad50b2f53 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2907,10 +2907,13 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e else if (sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0; else sync= (scene->flag & SCE_FRAME_DROP); - if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && finite(time = sound_sync_scene(scene))) - scene->r.cfra = (double)time * FPS + 0.5; - else + if ((scene->audio.flag & AUDIO_SYNC) && + (sad->flag & ANIMPLAY_FLAG_REVERSE) == FALSE && + finite(time = sound_sync_scene(scene))) { + scene->r.cfra = (double)time * FPS + 0.5; + } + else { if (sync) { int step = floor(wt->duration * FPS); /* skip frames */ diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index b5ecff74448..9c78b6126e7 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1543,11 +1543,10 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode unode= sculpt_undo_push_node(ob, nodes[n]); origco=unode->co; - if(!unode->layer_disp) - { - #pragma omp critical - unode->layer_disp= MEM_callocN(sizeof(float)*unode->totvert, "layer disp"); - } + if (!unode->layer_disp) { + #pragma omp critical + unode->layer_disp= MEM_callocN(sizeof(float)*unode->totvert, "layer disp"); + } layer_disp= unode->layer_disp; diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index f0aedae88ac..72e9f861aa9 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -414,8 +414,7 @@ static void uv_sculpt_stroke_exit(bContext *C, wmOperator *op) if (data->timer) { WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), data->timer); } - if (data->elementMap) - { + if (data->elementMap) { EDBM_free_uv_element_map(data->elementMap); } if (data->uv) { diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 205b2064f51..8f6a01dc6cd 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -345,8 +345,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op) result = AUD_mixdown(scene->sound_scene, SFRA * specs.rate / FPS, (EFRA - SFRA) * specs.rate / FPS, accuracy, filename, specs, container, codec, bitrate); - if(result) - { + if (result) { BKE_report(op->reports, RPT_ERROR, result); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 05de70b99ab..f663307507a 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -215,8 +215,7 @@ static FileSelect file_select(bContext* C, const rcti* rect, FileSelType select, if (sel.first != sel.last) select = 0; /* Do we have a valid selection and are we actually selecting */ - if ( (sel.last >= 0) && ((select == FILE_SEL_ADD) || (select == FILE_SEL_TOGGLE)) ) - { + if ((sel.last >= 0) && ((select == FILE_SEL_ADD) || (select == FILE_SEL_TOGGLE))) { /* Check last selection, if selected, act on the file or dir */ if (filelist_is_selected(sfile->files, sel.last, check_type)) { retval = file_select_do(C, sel.last); @@ -1171,9 +1170,8 @@ int file_filename_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); - if(sfile->params) { - if (file_select_match(sfile, sfile->params->file)) - { + if (sfile->params) { + if (file_select_match(sfile, sfile->params->file)) { sfile->params->file[0] = '\0'; WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); } diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 4f4ad52e4a4..4c9d2be791b 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -334,8 +334,8 @@ void fsmenu_read_system(struct FSMenu* fsmenu) continue; FSRefMakePath(&dir, path, FILE_MAX); - if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net")) - { /* /net and /home are meaningless on OSX, home folders are stored in /Users */ + if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net")) { + /* /net and /home are meaningless on OSX, home folders are stored in /Users */ fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0); } } diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 7821547aaf3..9eafd4533d2 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -196,8 +196,8 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa)) filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT); filelist_setfilter(sfile->files, params->flag & FILE_FILTER ? params->filter : 0); filelist_setfilter_types(sfile->files, params->filter_glob); - if (filelist_empty(sfile->files)) - { + + if (filelist_empty(sfile->files)) { thumbnails_stop(sfile->files, C); filelist_readdir(sfile->files); if(params->sort!=FILE_SORT_NONE) { diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index f1afb3c82db..8af16bd1aec 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -292,8 +292,7 @@ static void draw_fcurve_vertices (SpaceIpo *sipo, ARegion *ar, FCurve *fcu, shor glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); /* draw the two handles first (if they're shown, the curve doesn't have just a single keyframe, and the curve is being edited) */ - if (do_handles) - { + if (do_handles) { set_fcurve_vertex_color(fcu, 0); draw_fcurve_vertices_handles(fcu, sipo, v2d, 0, sel_handle_only); @@ -327,8 +326,7 @@ static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu) { return 0; } - else - { + else { return 1; } } @@ -368,8 +366,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu) fp= bezt->vec[0]; /* only draw first handle if previous segment had handles */ - if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) - { + if ((!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ))) { UI_GetThemeColor3ubv(basecol + bezt->h1, col); col[3]= drawFCurveFade(fcu) * 255; glColor4ubv((GLubyte *)col); @@ -378,8 +375,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu) } /* only draw second handle if this segment is bezier */ - if (bezt->ipo == BEZT_IPO_BEZ) - { + if (bezt->ipo == BEZT_IPO_BEZ) { UI_GetThemeColor3ubv(basecol + bezt->h2, col); col[3]= drawFCurveFade(fcu) * 255; glColor4ubv((GLubyte *)col); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index e44f1abd262..bdd3497a931 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1006,14 +1006,12 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, const int mval[2], /* handles - only do them if they're visible */ if (fcurve_handle_sel_check(sipo, bezt1) && (fcu->totvert > 1)) { /* first handle only visible if previous segment had handles */ - if ( (!prevbezt && (bezt1->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) - { + if ((!prevbezt && (bezt1->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ))) { nearest_fcurve_vert_store(matches, v2d, fcu, bezt1, NULL, NEAREST_HANDLE_LEFT, mval); } /* second handle only visible if this segment is bezier */ - if (bezt1->ipo == BEZT_IPO_BEZ) - { + if (bezt1->ipo == BEZT_IPO_BEZ) { nearest_fcurve_vert_store(matches, v2d, fcu, bezt1, NULL, NEAREST_HANDLE_RIGHT, mval); } } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 26c56e9948f..07d47e64be2 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -1359,11 +1359,12 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19, ps->maxvalue, 0, MAX_NAME, 0, 0, "check for max value"); } - else if(ps->type == SENS_PROP_CHANGED); - else - { + else if(ps->type == SENS_PROP_CHANGED) { + /* pass */ + } + else { uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19, - ps->value, 0, MAX_NAME, 0, 0, "check for value"); + ps->value, 0, MAX_NAME, 0, 0, "check for value"); } yco-= ysize; @@ -1511,14 +1512,12 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short &raySens->mode, 0.0, 0.0, 0, 0, "Toggle collision on material or property"); - if (raySens->mode & SENS_COLLISION_MATERIAL) - { + if (raySens->mode & SENS_COLLISION_MATERIAL) { uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19, &raySens->matname, 0, MAX_NAME, 0, 0, "Only look for Objects with this material"); } - else - { + else { uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19, &raySens->propname, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); @@ -1878,12 +1877,10 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo wval = (width-100)/3; if (oa->type == ACT_OBJECT_NORMAL) { - if ( ob->gameflag & OB_DYNAMIC ) - { + if (ob->gameflag & OB_DYNAMIC) { ysize= 175; } - else - { + else { ysize= 72; } @@ -2031,12 +2028,10 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo &aa->end_reset, 0.0, 0.0, 0, 0, "Restore last frame when switching on/off, otherwise play from the start each time"); - if(aa->type == ACT_ACTION_FROM_PROP) - { + if(aa->type == ACT_ACTION_FROM_PROP) { uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position"); } - else - { + else { uiDefButF(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame"); uiDefButF(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame"); } @@ -2048,8 +2043,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR - if(aa->type == ACT_ACTION_MOTION) - { + if (aa->type == ACT_ACTION_MOTION) { uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action"); } #endif @@ -2185,8 +2179,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo 12.0, 0, 0, "Sets the pitch of this sound"); uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space"); - if(sa->flag & ACT_SND_3D_SOUND) - { + if(sa->flag & ACT_SND_3D_SOUND) { uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19, &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0, "The minimum gain of the sound, no matter how far it is away"); @@ -2395,14 +2388,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo &coa->flag, 0.0, 0.0, 0, 0, "Set object axis along (local axis) or parallel (global axis) to the normal at hit position"); uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19, &coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property"); - if (coa->flag & ACT_CONST_MATERIAL) - { + if (coa->flag & ACT_CONST_MATERIAL) { uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19, coa->matprop, 0, MAX_NAME, 0, 0, "Ray detects only Objects with this material"); } - else - { + else { uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19, coa->matprop, 0, MAX_NAME, 0, 0, "Ray detect only Objects with this property"); @@ -2454,14 +2445,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo &coa->flag, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes"); uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19, &coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property"); - if (coa->flag & ACT_CONST_MATERIAL) - { + if (coa->flag & ACT_CONST_MATERIAL) { uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19, coa->matprop, 0, MAX_NAME, 0, 0, "Ray detects only Objects with this material"); } - else - { + else { uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19, coa->matprop, 0, MAX_NAME, 0, 0, "Ray detect only Objects with this property"); @@ -2548,9 +2537,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo break; case ACT_GAME: { - gma = act->data; - if (gma->type == ACT_GAME_LOAD) - { + gma = act->data; + if (gma->type == ACT_GAME_LOAD) { //ysize = 68; ysize = 48; glRects(xco, yco-ysize, xco+width, yco); @@ -2807,15 +2795,14 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo &ma->bodyType, 0.0, 0.0, 0, 0, "Toggle message type: either Text or a PropertyName"); - if (ma->bodyType == ACT_MESG_MESG) - { + if (ma->bodyType == ACT_MESG_MESG) { /* line 3: Message Body */ uiDefBut(block, TEX, 1, "Body: ", (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, &ma->body, 0, MAX_NAME, 0, 0, "Optional message body Text"); - } else - { + } + else { /* line 3: Property body (set by property) */ uiDefBut(block, TEX, 1, "Propname: ", (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, @@ -2829,8 +2816,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo tdfa = act->data; ysize = 50; - if(tdfa->type == ACT_2DFILTER_CUSTOMFILTER) - { + if (tdfa->type == ACT_2DFILTER_CUSTOMFILTER) { ysize +=20; } glRects( xco, yco-ysize, xco+width, yco ); @@ -2839,13 +2825,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo switch(tdfa->type) { case ACT_2DFILTER_MOTIONBLUR: - if(!tdfa->flag) - { + if (!tdfa->flag) { uiDefButS(block, TOG, B_REDR, "D", xco+30,yco-44,19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur"); uiDefButF(block, NUM, B_REDR, "Value:", xco+52,yco-44,width-82,19,&tdfa->float_arg,0.0,1.0,0.0,0.0,"Set motion blur value"); } - else - { + else { uiDefButS(block, TOG, B_REDR, "Disabled", xco+30,yco-44,width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur"); } break; @@ -4187,11 +4171,11 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr) case ACT_PROP_COPY: row = uiLayoutRow(layout, 0); uiItemR(row, ptr, "object", 0, NULL, ICON_NONE); - if(ob_from){ + if (ob_from) { RNA_pointer_create((ID *)ob_from, &RNA_GameObjectSettings, ob_from, &obj_settings_ptr); uiItemPointerR(row, ptr, "object_property", &obj_settings_ptr, "properties", NULL, ICON_NONE); - }else - { + } + else { sub= uiLayoutRow(row, 0); uiLayoutSetActive(sub, 0); uiItemR(sub, ptr, "object_property", 0, NULL, ICON_NONE); @@ -4325,8 +4309,7 @@ static void draw_actuator_sound(uiLayout *layout, PointerRNA *ptr, bContext *C) uiLayout *row, *col; uiTemplateID(layout, C, ptr, "sound", NULL, "SOUND_OT_open", NULL); - if (!RNA_pointer_get(ptr, "sound").data) - { + if (!RNA_pointer_get(ptr, "sound").data) { uiItemL(layout, "Select a sound from the list or load a new one", ICON_NONE); return; } @@ -4402,21 +4385,18 @@ static void draw_actuator_steering(uiLayout *layout, PointerRNA *ptr) uiItemR(col, ptr, "facing", 0, NULL, 0); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "facing_axis", 0, NULL, 0); - if (!RNA_boolean_get(ptr, "facing")) - { + if (!RNA_boolean_get(ptr, "facing")) { uiLayoutSetActive(col, 0); } col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "normal_up", 0, NULL, 0); - if (!RNA_pointer_get(ptr, "navmesh").data) - { + if (!RNA_pointer_get(ptr, "navmesh").data) { uiLayoutSetActive(col, 0); } row = uiLayoutRow(layout, 0); uiItemR(row, ptr, "self_terminated", 0, NULL, 0); - if (RNA_enum_get(ptr, "mode")==ACT_STEERING_PATHFOLLOWING) - { + if (RNA_enum_get(ptr, "mode")==ACT_STEERING_PATHFOLLOWING) { uiItemR(row, ptr, "update_period", 0, NULL, 0); row = uiLayoutRow(layout, 0); } @@ -5040,8 +5020,7 @@ void logic_buttons(bContext *C, ARegion *ar) uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Sensor settings"); ycoo= yco; - if(sens->flag & SENS_SHOW) - { + if (sens->flag & SENS_SHOW) { uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, UI_UNIT_Y, &sens->type, 0, 0, 0, 0, "Sensor type"); but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, MAX_NAME, 0, 0, "Sensor name"); uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 0253f04a05d..f94918e4b4a 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -692,8 +692,7 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie /* if this track is active and we're tweaking it, don't draw these toggles */ // TODO: need a special macro for this... - if ( ((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0 ) - { + if (((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0) { if (nlt->flag & NLATRACK_MUTED) mute = ICON_MUTE_IPO_ON; else diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index a142119d685..c0e9b7a3a57 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1282,8 +1282,7 @@ static int nlaedit_swap_exec (bContext *C, wmOperator *op) if ((nlt->strips.first == nlt->strips.last) && (nlt->strips.first != NULL)) { NlaStrip *mstrip = (NlaStrip *)nlt->strips.first; - if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2)) - { + if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2)) { /* remove this temp meta, so that we can see the strips inside */ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 1d8cbec2cb3..a423322edd5 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -3389,8 +3389,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) ntemp.type = -1; /* check input variables */ - if (RNA_struct_property_is_set(op->ptr, "filepath")) - { + if (RNA_struct_property_is_set(op->ptr, "filepath")) { char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index f740a3c4875..e50d1ae6fc9 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -171,8 +171,7 @@ static void drawseqwave(Scene *scene, Sequence *seq, float x1, float y1, float x * x2 the end x value, same for y1 and y2 * stepsize is width of a pixel. */ - if(seq->flag & SEQ_AUDIO_DRAW_WAVEFORM) - { + if(seq->flag & SEQ_AUDIO_DRAW_WAVEFORM) { int i, j, pos; int length = floor((x2-x1)/stepsize)+1; float ymid = (y1+y2)/2; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 1975e4ca633..9fed3db7f16 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1132,8 +1132,8 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op) tmp = tmp->next; } - if(type == TO_TABS) // Converting to tabs - { //start over from the beginning + if (type == TO_TABS) { // Converting to tabs + //start over from the beginning tmp = text->lines.first; while(tmp) { diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c index efe744696df..88bd6b9c4c0 100644 --- a/source/blender/editors/space_text/text_python.c +++ b/source/blender/editors/space_text/text_python.c @@ -355,9 +355,10 @@ static short UNUSED_FUNCTION(do_texttools)(SpaceText *st, char ascii, unsigned s } } - if(draw) - {}; // XXX redraw_alltext(); - + if (draw) { + // XXX redraw_alltext(); + } + return swallow; } @@ -540,8 +541,9 @@ static short UNUSED_FUNCTION(do_textmarkers)(SpaceText *st, char ascii, unsigned } } - if(draw) - {}; // XXX redraw_alltext(); + if (draw) { + // XXX redraw_alltext(); + } return swallow; } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 2596ba3f4bc..0cc5d877b44 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -4493,8 +4493,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv drawn = 1; } } - else - { + else { state.time=cfra; if (psys_get_particle_state(&sim,a,&state,0)) { float pixsize; @@ -6769,12 +6768,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) SmokeModifierData *smd = (SmokeModifierData *)md; // draw collision objects - if ((smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll) - { + if ((smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll) { #if 0 SmokeCollSettings *scs = smd->coll; - if (scs->points) - { + if (scs->points) { size_t i; glLoadMatrixf(rv3d->viewmat); @@ -6805,8 +6802,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } // only draw domains - if (smd->domain && smd->domain->fluid) - { + if (smd->domain && smd->domain->fluid) { if (CFRA < smd->domain->point_cache[0]->startframe) ; /* don't show smoke before simulation starts, this could be made an option in the future */ else if (!smd->domain->wt || !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) @@ -6842,8 +6838,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) float tmp[3]; int index = smoke_get_index(x, smd->domain->res[0], y, smd->domain->res[1], z); - if (density[index] > FLT_EPSILON) - { + if (density[index] > FLT_EPSILON) { float color[3]; copy_v3_v3(tmp, smd->domain->p0); tmp[0] += smd->domain->dx * x + smd->domain->dx * 0.5; @@ -6864,8 +6859,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if (col) cpack(col); #endif } - else if (smd->domain->wt && (smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) - { + else if (smd->domain->wt && (smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) { smd->domain->tex = NULL; GPU_create_smoke(smd, 1); draw_volume(ar, smd->domain->tex, @@ -6878,12 +6872,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { - bConstraint *con; - for (con=ob->constraints.first; con; con= con->next) - { - if (con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) - { + + for (con=ob->constraints.first; con; con= con->next) { + if (con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) { bRigidBodyJointConstraint *data = (bRigidBodyJointConstraint*)con->data; if (data->flag&CONSTRAINT_DRAW_PIVOT) drawRBpivot(data); @@ -6907,7 +6899,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if (dtx & OB_BOUNDBOX) { draw_bounding_volume(scene, ob, ob->boundtype); } - if (dtx & OB_TEXSPACE) drawtexspace(ob); + if (dtx & OB_TEXSPACE) { + drawtexspace(ob); + } if (dtx & OB_DRAWNAME) { /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */ /* but, we also dont draw names for sets or duplicators */ @@ -6922,13 +6916,16 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } } /*if (dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/ - if ((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(scene, rv3d, ob); + if ((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) { + drawWireExtra(scene, rv3d, ob); + } } } if (dt<=OB_SOLID && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { if ((ob->gameflag & OB_DYNAMIC) || - ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) { + ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) + { float imat[4][4], vec[3]= {0.0f, 0.0f, 0.0f}; invert_m4_m4(imat, rv3d->viewmatob); @@ -6945,11 +6942,16 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) glLoadMatrixf(rv3d->viewmat); - if (zbufoff) glDisable(GL_DEPTH_TEST); + if (zbufoff) { + glDisable(GL_DEPTH_TEST); + } - if (warning_recursive) return; - if (base->flag & OB_FROMDUPLI) return; - if (v3d->flag2 & V3D_RENDER_OVERRIDE) return; + if ((warning_recursive) || + (base->flag & OB_FROMDUPLI) || + (v3d->flag2 & V3D_RENDER_OVERRIDE)) + { + return; + } /* object centers, need to be drawn in viewmat space for speed, but OK for picking select */ if (!is_obact || !(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) { diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index b36ce6656b2..52f432c2e7d 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -339,8 +339,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 // printf("i: %d\n", i); // printf("point %f, %f, %f\n", cv[i][0], cv[i][1], cv[i][2]); - if (GL_TRUE == glewIsSupported("GL_ARB_fragment_program")) - { + if (GL_TRUE == glewIsSupported("GL_ARB_fragment_program")) { glEnable(GL_FRAGMENT_PROGRAM_ARB); glGenProgramsARB(1, &prog); @@ -406,12 +405,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 copy_v3_v3(p0, points); // sort points to get a convex polygon - for (i = 1; i < numpoints - 1; i++) - { - for (j = i + 1; j < numpoints; j++) - { - if (!convex(p0, viewnormal, &points[j * 3], &points[i * 3])) - { + for (i = 1; i < numpoints - 1; i++) { + for (j = i + 1; j < numpoints; j++) { + if (!convex(p0, viewnormal, &points[j * 3], &points[i * 3])) { float tmp2[3]; copy_v3_v3(tmp2, &points[j * 3]); copy_v3_v3(&points[j * 3], &points[i * 3]); @@ -441,8 +437,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 GPU_texture_unbind(tex_shadow); GPU_texture_unbind(tex); - if (GLEW_ARB_fragment_program) - { + if (GLEW_ARB_fragment_program) { glDisable(GL_FRAGMENT_PROGRAM_ARB); glDeleteProgramsARB(1, &prog); } @@ -450,10 +445,11 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3 MEM_freeN(points); - if (!gl_blend) + if (!gl_blend) { glDisable(GL_BLEND); - if (gl_depth) - { + } + + if (gl_depth) { glEnable(GL_DEPTH_TEST); glDepthMask(GL_TRUE); } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 8c690268444..979e3820018 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1827,8 +1827,7 @@ int transformEnd(bContext *C, TransInfo *t) exit_code = OPERATOR_CANCELLED; restoreTransObjects(t); // calls recalcData() } - else - { + else { exit_code = OPERATOR_FINISHED; } @@ -2447,8 +2446,7 @@ int handleEventShear(TransInfo *t, wmEvent *event) initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE); t->customData = (void*)1; } - else - { + else { initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE); t->customData = NULL; } @@ -2732,8 +2730,7 @@ int Resize(TransInfo *t, const int mval[2]) { ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f; } - else - { + else { ratio = t->values[0]; } @@ -3451,10 +3448,8 @@ static void applyTranslation(TransInfo *t, float vec[3]) continue; /* handle snapping rotation before doing the translation */ - if (usingSnappingNormal(t)) - { - if (validSnappingNormal(t)) - { + if (usingSnappingNormal(t)) { + if (validSnappingNormal(t)) { float *original_normal = td->axismtx[2]; float axis[3]; float quat[4]; @@ -3470,8 +3465,7 @@ static void applyTranslation(TransInfo *t, float vec[3]) ElementRotation(t, td, mat, V3D_LOCAL); } - else - { + else { float mat[3][3]; unit_m3(mat); @@ -4174,12 +4168,10 @@ int BoneSize(TransInfo *t, const int mval[2]) // TRANSFORM_FIX_ME MOVE TO MOUSE INPUT /* for manipulator, center handle, the scaling can't be done relative to center */ - if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0) - { + if ((t->flag & T_USES_MANIPULATOR) && t->con.mode==0) { ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f; } - else - { + else { ratio = t->values[0]; } @@ -5103,8 +5095,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2])) ED_area_headerprint(t->sa, str); } - else - { + else { size[0] = size[1] = size[2] = 1; size_to_mat3( mat,size); diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index a0e4c5897db..1292a058f41 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -721,8 +721,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) copy_m4_m4(tmat, rv3d->viewmat); invert_m4_m4(imat, tmat); } - else - { + else { unit_m4(tmat); unit_m4(imat); } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 4e51462921c..ed01de848ae 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -721,8 +721,7 @@ static void bone_children_clear_transflag(int mode, short around, ListBase *lb) { bone->flag |= BONE_TRANSFORM_CHILD; } - else - { + else { bone->flag &= ~BONE_TRANSFORM; } @@ -1132,8 +1131,7 @@ static void createTransArmatureVerts(TransInfo *t) if (ebo->flag & BONE_SELECTED) t->total++; } - else - { + else { if (ebo->flag & BONE_TIPSEL) t->total++; if (ebo->flag & BONE_ROOTSEL) @@ -1201,8 +1199,7 @@ static void createTransArmatureVerts(TransInfo *t) td->val= &ebo->dist; td->ival= ebo->dist; } - else - { + else { // abusive storage of scale in the loc pointer :) td->loc= &ebo->xwidth; copy_v3_v3(td->iloc, td->loc); @@ -1243,8 +1240,7 @@ static void createTransArmatureVerts(TransInfo *t) td++; } } - else - { + else { if (ebo->flag & BONE_TIPSEL) { copy_v3_v3(td->iloc, ebo->tail); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 47989f756e1..f3cede75786 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -797,8 +797,7 @@ static void recalcData_view3d(TransInfo *t) rotation_between_vecs_to_quat(qrot, td->axismtx[1], vec); mul_qt_v3(qrot, up_axis); } - else - { + else { mul_m3_v3(t->mat, up_axis); } @@ -811,8 +810,7 @@ static void recalcData_view3d(TransInfo *t) transform_armature_mirror_update(t->obedit); } - else - { + else { if(t->state != TRANS_CANCEL) { applyProject(t); } @@ -993,8 +991,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) copy_v2_v2_int(t->imval, event->mval); t->event_type = event->type; } - else - { + else { t->imval[0] = 0; t->imval[1] = 0; } @@ -1074,8 +1071,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->current_orientation = V3D_MANIP_GLOBAL; } } - else - { + else { t->current_orientation = v3d->twmode; } @@ -1121,8 +1117,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->view = &ar->v2d; t->around = sipo->around; } - else - { + else { if(ar) { // XXX for now, get View2D from the active region t->view = &ar->v2d; @@ -1141,10 +1136,8 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->flag |= T_RELEASE_CONFIRM; } } - else - { - if (U.flag & USER_RELEASECONFIRM) - { + else { + if (U.flag & USER_RELEASECONFIRM) { t->flag |= T_RELEASE_CONFIRM; } } @@ -1181,22 +1174,18 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) break; } } - else - { + else { /* use settings from scene only if modal */ - if (t->flag & T_MODAL) - { - if ((t->options & CTX_NO_PET) == 0) - { - if (t->obedit && ts->proportional != PROP_EDIT_OFF) - { + if (t->flag & T_MODAL) { + if ((t->options & CTX_NO_PET) == 0) { + if (t->obedit && ts->proportional != PROP_EDIT_OFF) { t->flag |= T_PROP_EDIT; - if(ts->proportional == PROP_EDIT_CONNECTED) + if (ts->proportional == PROP_EDIT_CONNECTED) { t->flag |= T_PROP_CONNECTED; + } } - else if (t->obedit == NULL && ts->proportional_objects) - { + else if (t->obedit == NULL && ts->proportional_objects) { t->flag |= T_PROP_EDIT; } } @@ -1207,8 +1196,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) { t->prop_size = RNA_float_get(op->ptr, "proportional_size"); } - else - { + else { t->prop_size = ts->proportional_size; } @@ -1224,8 +1212,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) { t->prop_mode = RNA_enum_get(op->ptr, "proportional_edit_falloff"); } - else - { + else { t->prop_mode = ts->prop_mode; } } diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index a4f03e76fd1..3faddeb6639 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -44,16 +44,14 @@ static void InputVector(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) { float vec[3], dvec[3]; - if(mi->precision) - { + if (mi->precision) { /* calculate the main translation and the precise one separate */ convertViewVec(t, dvec, (mval[0] - mi->precision_mval[0]), (mval[1] - mi->precision_mval[1])); mul_v3_fl(dvec, 0.1f); convertViewVec(t, vec, (mi->precision_mval[0] - t->imval[0]), (mi->precision_mval[1] - t->imval[1])); add_v3_v3v3(output, vec, dvec); } - else - { + else { convertViewVec(t, output, (mval[0] - t->imval[0]), (mval[1] - t->imval[1])); } @@ -62,8 +60,7 @@ static void InputVector(TransInfo *t, MouseInput *mi, const int mval[2], float o static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) { float ratio, precise_ratio, dx, dy; - if(mi->precision) - { + if (mi->precision) { /* calculate ratio for shiftkey pos, and for total, and blend these for precision */ dx = (float)(mi->center[0] - mi->precision_mval[0]); dy = (float)(mi->center[1] - mi->precision_mval[1]); @@ -75,8 +72,7 @@ static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], ratio = (ratio + (precise_ratio - ratio) / 10.0f) / mi->factor; } - else - { + else { dx = (float)(mi->center[0] - mval[0]); dy = (float)(mi->center[1] - mval[1]); ratio = (float)sqrt( dx*dx + dy*dy) / mi->factor; @@ -101,13 +97,11 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const int mval[2], flo static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) { - if(mi->precision) - { + if (mi->precision) { output[0] = ( mi->imval[1] - mi->precision_mval[1] ) + ( mi->precision_mval[1] - mval[1] ) * 0.1f; output[1] = ( mi->precision_mval[0] - mi->imval[0] ) + ( mval[0] - mi->precision_mval[0] ) * 0.1f; } - else - { + else { output[0] = (float)( mi->imval[1] - mval[1] ); output[1] = (float)( mval[0] - mi->imval[0] ); } @@ -122,8 +116,7 @@ static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2] pad = t->ar->winx / 10; - if (mi->precision) - { + if (mi->precision) { /* deal with Shift key by adding motion / 10 to motion before shift press */ x = mi->precision_mval[0] + (float)(mval[0] - mi->precision_mval[0]) / 10.0f; } @@ -249,9 +242,8 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], * approximate the angle with the opposite side of the normalized triangle * This is a good approximation here since the smallest acos value seems to be around * 0.02 degree and lower values don't even have a 0.01% error compared to the approximation - * */ - if (dphi == 0) - { + */ + if (dphi == 0) { double dx, dy; dx2 /= A; @@ -267,11 +259,12 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi; } - if(mi->precision) dphi = dphi/30.0f; + if (mi->precision) { + dphi = dphi/30.0f; + } /* if no delta angle, don't update initial position */ - if (dphi != 0) - { + if (dphi != 0) { mi->imval[0] = mval[0]; mi->imval[1] = mval[1]; } @@ -385,13 +378,11 @@ void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *, float [3]) void applyMouseInput(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) { - if (mi->apply != NULL) - { + if (mi->apply != NULL) { mi->apply(t, mi, mval, output); } - if (mi->post) - { + if (mi->post) { mi->post(t, output); } } @@ -404,16 +395,14 @@ int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event) { case LEFTSHIFTKEY: case RIGHTSHIFTKEY: - if (event->val==KM_PRESS) - { + if (event->val == KM_PRESS) { t->modifiers |= MOD_PRECISION; /* shift is modifier for higher precision transform * store the mouse position where the normal movement ended */ copy_v2_v2_int(mi->precision_mval, event->mval); mi->precision = 1; } - else - { + else { t->modifiers &= ~MOD_PRECISION; mi->precision = 0; } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index bdb0b3dfd7c..cdbf130377a 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -202,8 +202,7 @@ static int test_rotmode_euler(short rotmode) int gimbal_axis(Object *ob, float gmat[][3]) { if (ob) { - if(ob->mode & OB_MODE_POSE) - { + if (ob->mode & OB_MODE_POSE) { bPoseChannel *pchan= get_active_posechannel(ob); if(pchan) { @@ -222,8 +221,7 @@ int gimbal_axis(Object *ob, float gmat[][3]) /* apply bone transformation */ mul_m3_m3m3(tmat, pchan->bone->bone_mat, mat); - if (pchan->parent) - { + if (pchan->parent) { float parent_mat[3][3]; copy_m3_m4(parent_mat, pchan->parent->pose_mat); @@ -233,8 +231,7 @@ int gimbal_axis(Object *ob, float gmat[][3]) copy_m3_m4(obmat, ob->obmat); mul_m3_m3m3(gmat, obmat, mat); } - else - { + else { /* needed if object transformation isn't identity */ copy_m3_m4(obmat, ob->obmat); mul_m3_m3m3(gmat, obmat, tmat); @@ -255,8 +252,7 @@ int gimbal_axis(Object *ob, float gmat[][3]) return 0; } - if (ob->parent) - { + if (ob->parent) { float parent_mat[3][3]; copy_m3_m4(parent_mat, ob->parent->obmat); normalize_m3(parent_mat); diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 5f83bb4c29c..6b3380ea42e 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -276,12 +276,10 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[], ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; TransformOrientation *ts = NULL; - if (overwrite) - { + if (overwrite) { ts = findOrientationName(transform_spaces, name); } - else - { + else { uniqueOrientationName(transform_spaces, name); } @@ -537,8 +535,7 @@ void initTransformOrientation(bContext *C, TransInfo *t) break; case V3D_MANIP_VIEW: - if (t->ar->regiontype == RGN_TYPE_WINDOW) - { + if (t->ar->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = t->ar->regiondata; float mat[3][3]; @@ -547,8 +544,7 @@ void initTransformOrientation(bContext *C, TransInfo *t) normalize_m3(mat); copy_m3_m3(t->spacemtx, mat); } - else - { + else { unit_m3(t->spacemtx); } break; @@ -609,10 +605,8 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], break; } } - else - { - if (em->bm->totfacesel >= 1) - { + else { + if (em->bm->totfacesel >= 1) { BMFace *efa; BMIter iter; @@ -752,18 +746,14 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], while(a--) { /* exception */ - if ( (bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT ) - { + if ((bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT) { sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[2]); } - else - { - if(bezt->f1) - { + else { + if (bezt->f1) { sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[1]); } - if(bezt->f2) - { + if (bezt->f2) { sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[2]); } if(bezt->f3) @@ -792,12 +782,10 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], for (ml = editelems.first; ml; ml = ml->next) { if (ml->flag & SELECT) { - if (ml_sel == NULL) - { + if (ml_sel == NULL) { ml_sel = ml; } - else - { + else { ml_sel = NULL; break; } @@ -845,21 +833,18 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], normalize_v3(normal); normalize_v3(plane); - if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0) - { + if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0) { result = ORIENTATION_EDGE; } } /* Vectors from edges don't need the special transpose inverse multiplication */ - if (result == ORIENTATION_EDGE) - { + if (result == ORIENTATION_EDGE) { mul_mat3_m4_v3(ob->obmat, normal); mul_mat3_m4_v3(ob->obmat, plane); } - else - { + else { mul_m3_v3(mat, normal); mul_m3_v3(mat, plane); } @@ -933,33 +918,28 @@ void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[] switch (type) { case ORIENTATION_NORMAL: - if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) - { + if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_VERT: - if (createSpaceNormal(orientation_mat, normal) == 0) - { + if (createSpaceNormal(orientation_mat, normal) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_EDGE: - if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) - { + if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_FACE: - if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) - { + if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } break; } - if (type == ORIENTATION_NONE) - { + if (type == ORIENTATION_NONE) { unit_m3(orientation_mat); } } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 265af47db80..1ee87b395b2 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -388,8 +388,7 @@ static void initSnappingMode(TransInfo *t) Scene *scene = t->scene; /* force project off when not supported */ - if (ts->snap_mode != SCE_SNAP_MODE_FACE) - { + if (ts->snap_mode != SCE_SNAP_MODE_FACE) { t->tsnap.project = 0; } @@ -404,12 +403,10 @@ static void initSnappingMode(TransInfo *t) (obedit != NULL && ELEM4(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE)) ) // Temporary limited to edit mode meshes, armature, curves { /* Exclude editmesh if using proportional edit */ - if ((obedit->type == OB_MESH) && (t->flag & T_PROP_EDIT)) - { + if ((obedit->type == OB_MESH) && (t->flag & T_PROP_EDIT)) { t->tsnap.modeSelect = SNAP_NOT_OBEDIT; } - else - { + else { t->tsnap.modeSelect = t->tsnap.snap_self ? SNAP_ALL : SNAP_NOT_OBEDIT; } } @@ -425,14 +422,12 @@ static void initSnappingMode(TransInfo *t) { t->tsnap.modeSelect = SNAP_NOT_SELECTED; } - else - { + else { /* Grid if snap is not possible */ t->tsnap.mode = SCE_SNAP_MODE_INCREMENT; } } - else - { + else { /* Always grid outside of 3D view */ t->tsnap.mode = SCE_SNAP_MODE_INCREMENT; } @@ -831,23 +826,20 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) } } /* otherwise, pair first with second and so on */ - else - { + else { for (p2 = p1->next; p2 && p2->ob != p1->ob; p2 = p2->next) { /* nothing to do here */ } } - if (p2) - { + if (p2) { p2->flag = 1; add_v3_v3v3(vec, p1->p, p2->p); mul_v3_fl(vec, 0.5f); } - else - { + else { copy_v3_v3(vec, p1->p); } @@ -860,8 +852,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) new_dist = len_v3v3(last_p, vec); - if (new_dist < max_dist) - { + if (new_dist < max_dist) { copy_v3_v3(p, vec); max_dist = new_dist; } @@ -880,13 +871,11 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) BLI_freelistN(&depth_peels); } - else - { + else { found = snapObjectsTransform(t, mval, &dist, loc, no, t->tsnap.modeSelect); } - if (found == 1) - { + if (found == 1) { float tangent[3]; sub_v3_v3v3(tangent, loc, t->tsnap.snapPoint); @@ -902,8 +891,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) t->tsnap.status |= POINT_INIT; } - else - { + else { t->tsnap.status &= ~POINT_INIT; } } @@ -923,8 +911,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) t->tsnap.status |= POINT_INIT; } - else - { + else { t->tsnap.status &= ~POINT_INIT; } } @@ -977,8 +964,7 @@ static void TargetSnapActive(TransInfo *t) t->tsnap.status |= TARGET_INIT; } /* No active, default to median */ - else - { + else { t->tsnap.target = SCE_SNAP_TARGET_MEDIAN; t->tsnap.targetSnap = TargetSnapMedian; TargetSnapMedian(t); @@ -1043,8 +1029,7 @@ static void TargetSnapClosest(TransInfo *t) dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint); - if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist)) - { + if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist)) { copy_v3_v3(t->tsnap.snapTarget, loc); closest = td; t->tsnap.dist = dist; @@ -1052,8 +1037,7 @@ static void TargetSnapClosest(TransInfo *t) } } /* use element center otherwise */ - else - { + else { float loc[3]; float dist; @@ -1070,11 +1054,9 @@ static void TargetSnapClosest(TransInfo *t) } } } - else - { + else { int i; - for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++) - { + for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++) { float loc[3]; float dist; @@ -1446,21 +1428,17 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh if (em != NULL) { - if (index_array) - { + if (index_array) { index = index_array[i]; } - else - { + else { index = i; } - if (index == ORIGINDEX_NONE) - { + if (index == ORIGINDEX_NONE) { test = 0; } - else - { + else { efa = EDBM_get_face_for_index(em, index); if (efa && BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) @@ -1528,23 +1506,18 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh test = 1; /* reset for every vert */ - if (em != NULL) - { - if (index_array) - { + if (em != NULL) { + if (index_array) { index = index_array[i]; } - else - { + else { index = i; } - if (index == ORIGINDEX_NONE) - { + if (index == ORIGINDEX_NONE) { test = 0; } - else - { + else { eve = EDBM_get_vert_for_index(em, index); if (eve && (BM_elem_flag_test(eve, BM_ELEM_HIDDEN) || BM_elem_flag_test(eve, BM_ELEM_SELECT))) @@ -1590,21 +1563,17 @@ static int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh if (em != NULL) { - if (index_array) - { + if (index_array) { index = index_array[i]; } - else - { + else { index = i; } - if (index == ORIGINDEX_NONE) - { + if (index == ORIGINDEX_NONE) { test = 0; } - else - { + else { eed = EDBM_get_edge_for_index(em, index); if (eed && (BM_elem_flag_test(eed, BM_ELEM_HIDDEN) || @@ -1647,14 +1616,12 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo BMEditMesh *em; DerivedMesh *dm; - if (editobject) - { + if (editobject) { em = BMEdit_FromObject(ob); /* dm = editbmesh_get_derived_cage(scene, ob, em, CD_MASK_BAREMESH); */ dm = editbmesh_get_derived_base(ob, em); /* limitation, em & dm MUST have the same number of faces */ } - else - { + else { em = NULL; dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); } @@ -1938,14 +1905,12 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L DerivedMesh *dm = NULL; int val; - if (dob != obedit) - { + if (dob != obedit) { dm = mesh_get_derived_final(scene, dob, CD_MASK_BAREMESH); val = peelDerivedMesh(dob, dm, dob->obmat, ray_start, ray_normal, mval, depth_peels); } - else - { + else { em = ((Mesh *)dob->data)->edit_mesh; dm = editmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH); @@ -1967,14 +1932,12 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L DerivedMesh *dm = NULL; int val; - if (ob != obedit) - { + if (ob != obedit) { dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels); } - else - { + else { em = BMEdit_FromObject(ob); dm = editbmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH); diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index 52422d37f29..a477a11e6c7 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -148,12 +148,10 @@ void applyNumInput(NumInput *n, float *vec) vec[j] = 0.0001f; } else { - if (n->inv[i]) - { + if (n->inv[i]) { vec[j] = 1.0f / n->val[i]; } - else - { + else { vec[j] = n->val[i]; } } diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index f7dd90e6084..676701b9c2a 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -185,8 +185,7 @@ static StitchPreviewer * stitch_preview_init(void) /* destructor...yeah this should be C++ :) */ static void stitch_preview_delete(void) { - if(_stitch_preview) - { + if(_stitch_preview) { if(_stitch_preview->preview_polys){ MEM_freeN(_stitch_preview->preview_polys); _stitch_preview->preview_polys = NULL; @@ -507,8 +506,7 @@ static void stitch_set_face_preview_buffer_position(BMFace *efa, StitchPreviewer { int index = BM_elem_index_get(efa); - if(preview_position[index].data_position == STITCH_NO_PREVIEW) - { + if(preview_position[index].data_position == STITCH_NO_PREVIEW) { preview_position[index].data_position = preview->preview_uvs*2; preview_position[index].polycount_position = preview->num_polys++; preview->preview_uvs += efa->len; @@ -1294,8 +1292,7 @@ static void stitch_select(bContext *C, Scene *scene, wmEvent *event, StitchState UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]); uv_find_nearest_vert(scene, ima, stitch_state->em, co, NULL, &hit); - if(hit.efa) - { + if (hit.efa) { /* Add vertex to selection, deselect all common uv's of vert other * than selected and update the preview. This behavior was decided so that * you can do stuff like deselect the opposite stitchable vertex and the initial still gets deselected */ diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index bc77d15f76b..f6db4f6e735 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -631,8 +631,7 @@ static char *code_generate_vertex(ListBase *nodes) for (node=nodes->first; node; node=node->next) for (input=node->inputs.first; input; input=input->next) if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) { - if(input->attribtype == CD_TANGENT) /* silly exception */ - { + if(input->attribtype == CD_TANGENT) { /* silly exception */ BLI_dynstr_appendf(ds, "\tvar%d.xyz = normalize((gl_ModelViewMatrix * vec4(att%d.xyz, 0)).xyz);\n", input->attribid, input->attribid); BLI_dynstr_appendf(ds, "\tvar%d.w = att%d.w;\n", input->attribid, input->attribid); } diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 7a61ee2eebc..526f293d0b9 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -278,8 +278,7 @@ static GLenum gpu_get_mipmap_filter(int mag) /* Anisotropic filtering settings */ void GPU_set_anisotropic(float value) { - if (GTS.anisotropic != value) - { + if (GTS.anisotropic != value) { GPU_free_images(); /* Clamp value to the maximum value the graphics card supports */ @@ -875,8 +874,7 @@ int GPU_update_image_time(Image *ima, double time) void GPU_free_smoke(SmokeModifierData *smd) { - if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain) - { + if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain) { if(smd->domain->tex) GPU_texture_free(smd->domain->tex); smd->domain->tex = NULL; @@ -1301,8 +1299,7 @@ void GPU_end_object_materials(void) GMS.alphablend= NULL; /* resetting the texture matrix after the glScale needed for tiled textures */ - if(GTS.tilemode) - { + if(GTS.tilemode) { glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c index b4da39ac41e..810ed7b26a4 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.c +++ b/source/blender/imbuf/intern/cineon/cineonlib.c @@ -335,10 +335,11 @@ cineonGetRowBytes(CineonFile* cineon, unsigned short* row, int y) { longsRead = logimage_fread(cineon->lineBuffer, 4, cineon->lineBufferLength, cineon); if (longsRead != cineon->lineBufferLength) { - if (verbose) - { d_printf("Couldn't read line %d length %d\n", y, cineon->lineBufferLength * 4); - perror("cineonGetRowBytes"); - } + if (verbose) { + d_printf("Couldn't read line %d length %d\n", y, cineon->lineBufferLength * 4); + perror("cineonGetRowBytes"); + } + return 1; } diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index 1892aa459a6..b219d4b592e 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -146,7 +146,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) /* decode the stream and fill the image structure */ image = opj_decode(dinfo, cio); - if(!image) { + if (!image) { fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n"); opj_destroy_decompress(dinfo); opj_cio_close(cio); @@ -157,8 +157,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) opj_cio_close(cio); - if((image->numcomps * image->x1 * image->y1) == 0) - { + if((image->numcomps * image->x1 * image->y1) == 0) { fprintf(stderr,"\nError: invalid raw image parameters\n"); return NULL; } diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 6c3b7594264..e823843e3cf 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -177,8 +177,7 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t { my_src_ptr src; - if (cinfo->src == NULL) - { /* first time for this JPEG object? */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(my_source_mgr)); } diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index ec63a93ac69..23db6b47b9d 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -183,8 +183,7 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, size_t size, int flags) unsigned char* ptr; char oriY[80], oriX[80]; - if (imb_is_a_hdr((void*)mem)) - { + if (imb_is_a_hdr((void *)mem)) { /* find empty line, next line is resolution info */ for (x=1;x 1) - { + if (debugSDNA > 1) { int a,b; /* short *elem; */ short num_types; diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 4b7bc0a6160..78555d2a877 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -124,8 +124,8 @@ void rna_Actuator_name_set(PointerRNA *ptr, const char *value) static void rna_Actuator_type_set(struct PointerRNA *ptr, int value) { bActuator *act = (bActuator *)ptr->data; - if (value != act->type) - { + + if (value != act->type) { act->type = value; init_actuator(act); } @@ -135,8 +135,8 @@ static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value) { bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; - if (value != ca->type) - { + + if (value != ca->type) { ca->type = value; switch (ca->type) { case ACT_CONST_TYPE_ORI: @@ -364,8 +364,7 @@ static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value) { bActuator *act = (bActuator *)ptr->data; bObjectActuator *oa = act->data; - if (value != oa->type) - { + if (value != oa->type) { oa->type = value; switch (oa->type) { case ACT_OBJECT_NORMAL: diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index f81610a4024..b066114a0cb 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -91,8 +91,8 @@ void rna_Constroller_name_set(PointerRNA *ptr, const char *value) static void rna_Controller_type_set(struct PointerRNA *ptr, int value) { bController *cont = (bController *)ptr->data; - if (value != cont->type) - { + + if (value != cont->type) { cont->type = value; init_controller(cont); } @@ -104,8 +104,7 @@ static void rna_Controller_mode_set(struct PointerRNA *ptr, int value) bPythonCont *pycon = (bPythonCont *)cont->data; /* if mode changed and previous mode were Script */ - if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) - { + if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) { /* clear script to avoid it to get linked with the controller */ pycon->text = NULL; } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 99440836028..6185d1dee79 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -272,8 +272,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) if (ob->type == OB_MESH && !psys) { /* add particle system */ psmd = (ParticleSystemModifierData *)object_add_particle_system(scene, ob, NULL); - if (psmd) - { + if (psmd) { psys = psmd->psys; part = psys->part; part->lifetime = 1.0f; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 6f7c22389c6..a1e288f6107 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -934,8 +934,7 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value) ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH); /* assume triangle mesh, if no bounds chosen for soft body */ - if ((ob->gameflag & OB_BOUNDS) && (ob->boundtypegameflag & OB_BOUNDS) && (ob->boundtypeboundtype = OB_BOUND_TRIANGLE_MESH; } /* create a BulletSoftBody structure if not already existing */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index e6eb07cf44f..4c4123b2ed3 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1247,8 +1247,7 @@ static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value) scene->audio.flag &= ~AUDIO_SYNC; scene->flag |= SCE_FRAME_DROP; } - else - { + else { scene->audio.flag &= ~AUDIO_SYNC; scene->flag &= ~SCE_FRAME_DROP; } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index bf4814d8d0d..3b34ec235a3 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -255,8 +255,7 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P ts = transform_spaces->first; } - if (ts) - { + if (ts) { RNA_enum_item_add_separator(&item, &totitem); for (; ts; ts = ts->next) { diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c index fe2a074bf87..04b6bf33b1e 100644 --- a/source/blender/modifiers/intern/MOD_boolean_util.c +++ b/source/blender/modifiers/intern/MOD_boolean_util.c @@ -586,9 +586,11 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type) mat= (Material**)MEM_mallocN(sizeof(Material*)*maxmat, "NewBooleanMeshMat"); /* put some checks in for nice user feedback */ - if (dm == NULL || dm_select == NULL) return 0; - if (!dm->getNumTessFaces(dm) || !dm_select->getNumTessFaces(dm_select)) - { + if (dm == NULL || dm_select == NULL) { + return 0; + } + + if (!dm->getNumTessFaces(dm) || !dm_select->getNumTessFaces(dm_select)) { MEM_freeN(mat); return -1; } diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 51ba9103976..f23690454c0 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -75,8 +75,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, DerivedMesh *result=NULL; /* check for alloc failing */ - if(!clmd->sim_parms || !clmd->coll_parms) - { + if (!clmd->sim_parms || !clmd->coll_parms) { initData(md); if(!clmd->sim_parms || !clmd->coll_parms) @@ -101,24 +100,18 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, dm->release(dm); } -static void updateDepgraph( - ModifierData *md, DagForest *forest, Scene *scene, Object *ob, - DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, Scene *scene, Object *ob, DagNode *obNode) { ClothModifierData *clmd = (ClothModifierData*) md; Base *base; - if(clmd) - { - for(base = scene->base.first; base; base= base->next) - { + if(clmd) { + for(base = scene->base.first; base; base= base->next) { Object *ob1= base->object; - if(ob1 != ob) - { + if (ob1 != ob) { CollisionModifierData *coll_clmd = (CollisionModifierData *)modifiers_findByType(ob1, eModifierType_Collision); - if(coll_clmd) - { + if (coll_clmd) { DagNode *curNode = dag_get_node(forest, ob1); dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Cloth Collision"); } @@ -175,8 +168,7 @@ static void freeData(ModifierData *md) { ClothModifierData *clmd = (ClothModifierData*) md; - if (clmd) - { + if (clmd) { if(G.rt > 0) printf("clothModifier_freeData\n"); diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index 1476c792169..82c8b19db2d 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -207,12 +207,10 @@ static void deformVerts(ModifierData *md, Object *ob, } /* happens on file load (ONLY when i decomment changes in readfile.c) */ - if(!collmd->bvhtree) - { + if (!collmd->bvhtree) { collmd->bvhtree = bvhtree_build_from_mvert(collmd->mfaces, collmd->numfaces, collmd->current_x, numverts, ob->pd->pdef_sboft); } - else - { + else { // recalc static bounding boxes bvhtree_update_from_mvert ( collmd->bvhtree, collmd->mfaces, collmd->numfaces, collmd->current_x, collmd->current_xnew, collmd->numverts, 1 ); } @@ -225,14 +223,11 @@ static void deformVerts(ModifierData *md, Object *ob, } } - else if(current_time < collmd->time_xnew) - { + else if(current_time < collmd->time_xnew) { freeData((ModifierData *)collmd); } - else - { - if(numverts != collmd->numverts) - { + else { + if (numverts != collmd->numverts) { freeData((ModifierData *)collmd); } } diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index e0972ff2d32..55971e358a9 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -99,12 +99,10 @@ static int dependsOnTime(ModifierData *md) { DisplaceModifierData *dmd = (DisplaceModifierData *)md; - if(dmd->texture) - { + if(dmd->texture) { return BKE_texture_dependsOnTime(dmd->texture); } - else - { + else { return 0; } } diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index c7b4d41e646..e567765d61b 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -119,15 +119,13 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, DynamicPaintModifierData *pmd = (DynamicPaintModifierData*) md; /* add relation from canvases to all brush objects */ - if(pmd && pmd->canvas) - { + if (pmd && pmd->canvas) { Base *base = scene->base.first; - for(; base; base = base->next) { + for (; base; base = base->next) { DynamicPaintModifierData *pmd2 = (DynamicPaintModifierData *)modifiers_findByType(base->object, eModifierType_DynamicPaint); - if(pmd2 && pmd2->brush && ob!=base->object) - { + if (pmd2 && pmd2->brush && ob!=base->object) { DagNode *brushNode = dag_get_node(forest, base->object); dag_add_relation(forest, brushNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Dynamic Paint Brush"); } diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 89e47094108..05230abdcf5 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -818,13 +818,13 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, vertpahash= BLI_edgehash_new(); for (i=0; ialive==PARS_UNBORN && (emd->flag&eExplodeFlag_Unborn)==0) - || (pa->alive==PARS_ALIVE && (emd->flag&eExplodeFlag_Alive)==0) - || (pa->alive==PARS_DEAD && (emd->flag&eExplodeFlag_Dead)==0)) { + if ((pa->alive == PARS_UNBORN && (emd->flag & eExplodeFlag_Unborn) == 0) || + (pa->alive == PARS_ALIVE && (emd->flag & eExplodeFlag_Alive) == 0) || + (pa->alive == PARS_DEAD && (emd->flag & eExplodeFlag_Dead) == 0)) + { delface++; continue; } @@ -915,8 +915,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, MFace source; int orig_v4; - if(facepa[i]!=totpart) - { + if (facepa[i]!=totpart) { pa=pars+facepa[i]; if(pa->alive==PARS_UNBORN && (emd->flag&eExplodeFlag_Unborn)==0) continue; diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c index 8bf56193a28..3df8718a7c1 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim.c +++ b/source/blender/modifiers/intern/MOD_fluidsim.c @@ -85,12 +85,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *result = NULL; /* check for alloc failing */ - if(!fluidmd->fss) - { + if(!fluidmd->fss) { initData(md); - if(!fluidmd->fss) + if (!fluidmd->fss) { return dm; + } } result= fluidsimModifier_do(fluidmd, md->scene, ob, dm, useRenderParams, isFinalCalc); @@ -105,20 +105,15 @@ static void updateDepgraph( FluidsimModifierData *fluidmd= (FluidsimModifierData*) md; Base *base; - if(fluidmd && fluidmd->fss) - { - if(fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) - { - for(base = scene->base.first; base; base= base->next) - { + if(fluidmd && fluidmd->fss) { + if(fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) { + for(base = scene->base.first; base; base= base->next) { Object *ob1= base->object; - if(ob1 != ob) - { + if(ob1 != ob) { FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob1, eModifierType_Fluidsim); // only put dependancies from NON-DOMAIN fluids in here - if(fluidmdtmp && fluidmdtmp->fss && (fluidmdtmp->fss->type!=OB_FLUIDSIM_DOMAIN)) - { + if(fluidmdtmp && fluidmdtmp->fss && (fluidmdtmp->fss->type!=OB_FLUIDSIM_DOMAIN)) { DagNode *curNode = dag_get_node(forest, ob1); dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Fluidsim Object"); } diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 9dc560afb0f..dc0c4d5ad86 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -506,12 +506,10 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim // load vertex velocities, if they exist... // TODO? use generate flag as loading flag as well? // warning, needs original .bobj.gz mesh loading filename - if(displaymode==3) - { + if (displaymode==3) { fluidsim_read_vel_cache(fluidmd, dm, targetFile); } - else - { + else { if(fss->meshVelocities) MEM_freeN(fss->meshVelocities); @@ -548,8 +546,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, // clmd->sim_parms->timescale= timescale; // support reversing of baked fluid frames here - if((fss->flag & OB_FLUIDSIM_REVERSE) && (fss->lastgoodframe >= 0)) - { + if ((fss->flag & OB_FLUIDSIM_REVERSE) && (fss->lastgoodframe >= 0)) { framenr = fss->lastgoodframe - framenr + 1; CLAMP(framenr, 1, fss->lastgoodframe); } diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index edef19fd032..b9768ff9999 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -85,12 +85,10 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, { MaskModifierData *mmd = (MaskModifierData *)md; - if (mmd->ob_arm) - { + if (mmd->ob_arm) { DagNode *armNode = dag_get_node(forest, mmd->ob_arm); - dag_add_relation(forest, armNode, obNode, - DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Mask Modifier"); + dag_add_relation(forest, armNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Mask Modifier"); } } @@ -140,8 +138,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } /* if mode is to use selected armature bones, aggregate the bone groups */ - if (mmd->mode == MOD_MASK_MODE_ARM) /* --- using selected bones --- */ - { + if (mmd->mode == MOD_MASK_MODE_ARM) { /* --- using selected bones --- */ GHash *vgroupHash; Object *oba= mmd->ob_arm; bPoseChannel *pchan; @@ -156,10 +153,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, bone_select_array= MEM_mallocN(defbase_tot * sizeof(char), "mask array"); - for (i = 0, def = ob->defbase.first; def; def = def->next, i++) - { - if (((pchan= get_pose_channel(oba->pose, def->name)) && pchan->bone && (pchan->bone->flag & BONE_SELECTED))) - { + for (i = 0, def = ob->defbase.first; def; def = def->next, i++) { + pchan = get_pose_channel(oba->pose, def->name); + if (pchan && pchan->bone && (pchan->bone->flag & BONE_SELECTED)) { bone_select_array[i]= TRUE; bone_select_tot++; } @@ -179,8 +175,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, BLI_ghash_insert(vgroupHash, def->name, SET_INT_IN_POINTER(i)); /* if no bones selected, free hashes and return original mesh */ - if (bone_select_tot == 0) - { + if (bone_select_tot == 0) { BLI_ghash_free(vgroupHash, NULL, NULL); MEM_freeN(bone_select_array); @@ -189,8 +184,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, /* repeat the previous check, but for dverts */ dvert= dm->getVertDataArray(dm, CD_MDEFORMVERT); - if (dvert == NULL) - { + if (dvert == NULL) { BLI_ghash_free(vgroupHash, NULL, NULL); MEM_freeN(bone_select_array); @@ -311,8 +305,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } /* all verts must be available */ - if (ok) - { + if (ok) { BLI_ghash_insert(polyHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numPolys)); loop_mapping[numPolys] = numLoops; numPolys++; diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 4485346bf55..f8e50828ef8 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -74,8 +74,7 @@ static void simpleDeform_taper(const float factor, const float dcut[3], float *c co[1] = y + y*scale; co[2] = z; - if(dcut) - { + if (dcut) { co[0] += dcut[0]; co[1] += dcut[1]; co[2] += dcut[2]; @@ -93,9 +92,7 @@ static void simpleDeform_stretch(const float factor, const float dcut[3], float co[1] = y*scale; co[2] = z*(1.0f+factor); - - if(dcut) - { + if (dcut) { co[0] += dcut[0]; co[1] += dcut[1]; co[2] += dcut[2]; @@ -115,8 +112,7 @@ static void simpleDeform_twist(const float factor, const float *dcut, float *co) co[1] = x*sint + y*cost; co[2] = z; - if(dcut) - { + if(dcut) { co[0] += dcut[0]; co[1] += dcut[1]; co[2] += dcut[2]; @@ -132,16 +128,13 @@ static void simpleDeform_bend(const float factor, const float dcut[3], float *co sint = sin(theta); cost = cos(theta); - if(fabsf(factor) > 1e-7f) - { + if (fabsf(factor) > 1e-7f) { co[0] = -(y-1.0f/factor)*sint; co[1] = (y-1.0f/factor)*cost + 1.0f/factor; co[2] = z; } - - if(dcut) - { + if (dcut) { co[0] += cost*dcut[0]; co[1] += sint*dcut[0]; co[2] += dcut[2]; @@ -176,12 +169,10 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object { transf = &tmp_transf; - if(smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL) - { + if (smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL) { space_transform_from_matrixs(transf, ob->obmat, smd->origin->obmat); } - else - { + else { copy_m4_m4(transf->local2target, smd->origin->obmat); invert_m4_m4(transf->target2local, transf->local2target); } @@ -230,17 +221,17 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object { float weight = defvert_array_find_weight_safe(dvert, i, vgroup); - if(weight != 0.0f) - { + if (weight != 0.0f) { float co[3], dcut[3] = {0.0f, 0.0f, 0.0f}; - if(transf) space_transform_apply(transf, vertexCos[i]); + if(transf) { + space_transform_apply(transf, vertexCos[i]); + } copy_v3_v3(co, vertexCos[i]); - //Apply axis limits - if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) //Bend mode shoulnt have any lock axis - { + /* Apply axis limits */ + if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) { /* Bend mode shoulnt have any lock axis */ if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_X) axis_limit(0, lock_axis, co, dcut); if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_Y) axis_limit(1, lock_axis, co, dcut); } diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c index 9b03816ed04..1472639739e 100644 --- a/source/blender/modifiers/intern/MOD_smoke.c +++ b/source/blender/modifiers/intern/MOD_smoke.c @@ -109,21 +109,16 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, { SmokeModifierData *smd = (SmokeModifierData *) md; - if(smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) - { - if(smd->domain->fluid_group) - { + if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) { + if (smd->domain->fluid_group) { GroupObject *go = NULL; - for(go = smd->domain->fluid_group->gobject.first; go; go = go->next) - { - if(go->ob) - { + for (go = smd->domain->fluid_group->gobject.first; go; go = go->next) { + if (go->ob) { SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(go->ob, eModifierType_Smoke); // check for initialized smoke object - if(smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll))) - { + if (smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll))) { DagNode *curNode = dag_get_node(forest, go->ob); dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow"); } @@ -133,11 +128,10 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, else { Base *base = scene->base.first; - for(; base; base = base->next) { + for ( ; base; base = base->next) { SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(base->object, eModifierType_Smoke); - if(smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll))) - { + if (smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll))) { DagNode *curNode = dag_get_node(forest, base->object); dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow"); } diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index 7e85acd47e9..ccb6e79eb64 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -59,9 +59,8 @@ static void initData(ModifierData *md) static void freeData(ModifierData *md) { SurfaceModifierData *surmd = (SurfaceModifierData*) md; - - if (surmd) - { + + if (surmd) { if(surmd->bvhtree) { free_bvhtree_from_mesh(surmd->bvhtree); MEM_freeN(surmd->bvhtree); @@ -102,14 +101,12 @@ static void deformVerts(ModifierData *md, Object *ob, if(derivedData) surmd->dm = CDDM_copy(derivedData); else surmd->dm = get_dm(ob, NULL, NULL, NULL, 0); - if(!ob->pd) - { + if (!ob->pd) { printf("SurfaceModifier deformVerts: Should not happen!\n"); return; } - - if(surmd->dm) - { + + if(surmd->dm) { unsigned int numverts = 0, i = 0; int init = 0; float *vec; diff --git a/source/blender/nodes/composite/nodes/node_composite_brightness.c b/source/blender/nodes/composite/nodes/node_composite_brightness.c index d935d9af7f7..83607ac66b3 100644 --- a/source/blender/nodes/composite/nodes/node_composite_brightness.c +++ b/source/blender/nodes/composite/nodes/node_composite_brightness.c @@ -61,13 +61,11 @@ static void do_brightnesscontrast(bNode *UNUSED(node), float *out, float *in, fl * (http://visca.com/ffactory/archives/5-99/msg00021.html) * Extracted of OpenCV demhist.c */ - if( contrast > 0 ) -{ + if (contrast > 0) { a = 1.0f / a; b = a * (brightness - delta); } - else - { + else { delta *= -1; b = a * (brightness + delta); } diff --git a/source/blender/nodes/texture/node_texture_util.c b/source/blender/nodes/texture/node_texture_util.c index c3d298d1ecd..a528f8cb7a7 100644 --- a/source/blender/nodes/texture/node_texture_util.c +++ b/source/blender/nodes/texture/node_texture_util.c @@ -82,13 +82,12 @@ void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread) { tex_input(out, 4, in, params, thread); - if(in->hasoutput && in->sockettype == SOCK_FLOAT) - { + if (in->hasoutput && in->sockettype == SOCK_FLOAT) { out[1] = out[2] = out[0]; out[3] = 1; } - if(in->hasoutput && in->sockettype == SOCK_VECTOR) { + if (in->hasoutput && in->sockettype == SOCK_VECTOR) { out[0] = out[0] * .5f + .5f; out[1] = out[1] * .5f + .5f; out[2] = out[2] * .5f + .5f; @@ -148,8 +147,7 @@ void ntreeTexCheckCyclics(struct bNodeTree *ntree) bNode *node; for(node= ntree->nodes.first; node; node= node->next) { - if(node->type == TEX_NODE_TEXTURE && node->id) - { + if(node->type == TEX_NODE_TEXTURE && node->id) { /* custom2 stops the node from rendering */ if(node->custom1) { node->custom2 = 1; diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 6a6e6595ed4..b292d00df2e 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -257,8 +257,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) } BKE_reports_clear(reports); - if ((reports->flag & RPT_FREE) == 0) - { + if ((reports->flag & RPT_FREE) == 0) { MEM_freeN(reports); } } diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 976c3707fd4..0af55e28b04 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -663,8 +663,8 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen } } - /* normalize vertex normals */ - for(a=0; atotvert; a++) { + /* normalize vertex normals */ + for (a=0; atotvert; a++) { VertRen *ver= RE_findOrAddVert(obr, a); normalize_v3(ver->n); if(do_tangent) { @@ -680,8 +680,7 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen } } - if(do_nmap_tangent!=0) - { + if (do_nmap_tangent != 0) { SRenderMeshToTangent mesh2tangent; SMikkTSpaceContext sContext; SMikkTSpaceInterface sInterface; @@ -2649,25 +2648,25 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, add_v3_v3(vlr->v4->n, vlr1->n); } } + /* last vertex is an extra case: - - ^ ()----()----()----() - | | | || | - u | |(0,n)||(0,0)| - | | || | - ()====()====[]====() - | | || | - | |(m,n)||(m,0)| - | | || | - ()----()----()----() - v -> - - vertex [] is no longer shared, therefore distribute - normals of the surrounding faces to all of the duplicates of [] - */ - - if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U)) - { + * + * ^ ()----()----()----() + * | | | || | + * u | |(0,n)||(0,0)| + * | | || | + * ()====()====[]====() + * | | || | + * | |(m,n)||(m,0)| + * | | || | + * ()----()----()----() + * v -> + * + * vertex [] is no longer shared, therefore distribute + * normals of the surrounding faces to all of the duplicates of [] + */ + + if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U)) { vlr= RE_findOrAddVlak(obr, UVTOINDEX(sizeu - 1, sizev - 1)); /* (m,n) */ vlr1= RE_findOrAddVlak(obr, UVTOINDEX(0,0)); /* (0,0) */ add_v3_v3v3(n1, vlr->n, vlr1->n); @@ -3476,8 +3475,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) for(vindex=0; vindextype == CD_TANGENT && mtng < 1) - { + else if (layer->type == CD_TANGENT && mtng < 1) { if(need_nmap_tangent!=0) { const float * tangent = (const float *) layer->data; @@ -5479,8 +5477,7 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float * for(j=0;j<3;j++) fsvec[j] = velarray[a].vel[j]; /* (bad) HACK insert average velocity if none is there (see previous comment) */ - if((fsvec[0] == 0.0f) && (fsvec[1] == 0.0f) && (fsvec[2] == 0.0f)) - { + if ((fsvec[0] == 0.0f) && (fsvec[1] == 0.0f) && (fsvec[2] == 0.0f)) { fsvec[0] = avgvel[0]; fsvec[1] = avgvel[1]; fsvec[2] = avgvel[2]; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 76dfda7795e..dfa5acc81e7 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -453,8 +453,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer * re->r.scemode |= R_EXR_TILE_FILE; /* enable automatic */ /* Until use_border is made compatible with save_buffers/full_sample, render without the later instead of not rendering at all.*/ - if(re->r.mode & R_BORDER) - { + if (re->r.mode & R_BORDER) { re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE); } diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 38178db5dcb..526f709e13b 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -265,14 +265,12 @@ RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi) VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255); if(is_raytraceable_vlr(re, vlr)) { - if( (re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS) ) - { + if ((re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS)) { RE_rayobject_add( raytree, RE_vlakprimitive_from_vlak( vlakprimitive, obi, vlr ) ); vlakprimitive++; } - else - { - RE_rayface_from_vlak( face, obi, vlr ); + else { + RE_rayface_from_vlak(face, obi, vlr); RE_rayobject_add( raytree, RE_rayobject_unalignRayFace(face) ); face++; } @@ -336,12 +334,10 @@ static void makeraytree_single(Render *re) ObjectRen *obr = obi->obr; obs++; - if(has_special_rayobject(re, obi)) - { + if (has_special_rayobject(re, obi)) { special++; } - else - { + else { int v; for(v=0;vtotvlak;v++) { @@ -365,8 +361,7 @@ static void makeraytree_single(Render *re) { vlakprimitive = re->rayprimitives = (VlakPrimitive*)MEM_callocN(faces*sizeof(VlakPrimitive), "Raytrace vlak-primitives"); } - else - { + else { face = re->rayfaces = (RayFace*)MEM_callocN(faces*sizeof(RayFace), "Render ray faces"); } @@ -376,8 +371,7 @@ static void makeraytree_single(Render *re) if(test_break(re)) break; - if(has_special_rayobject(re, obi)) - { + if (has_special_rayobject(re, obi)) { RayObject *obj = makeraytree_object(re, obi); if(test_break(re)) @@ -386,8 +380,7 @@ static void makeraytree_single(Render *re) if (obj) RE_rayobject_add( re->raytree, obj ); } - else - { + else { int v; ObjectRen *obr = obi->obr; @@ -399,16 +392,13 @@ static void makeraytree_single(Render *re) for(v=0;vtotvlak;v++) { VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255); - if(is_raytraceable_vlr(re, vlr)) - { - if( (re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS) ) - { + if (is_raytraceable_vlr(re, vlr)) { + if ((re->r.raytrace_options & R_RAYTRACE_USE_LOCAL_COORDS)) { RayObject *obj = RE_vlakprimitive_from_vlak( vlakprimitive, obi, vlr ); RE_rayobject_add( raytree, obj ); vlakprimitive++; } - else - { + else { RE_rayface_from_vlak(face, obi, vlr); if((obi->flag & R_TRANSFORMED)) { @@ -451,15 +441,13 @@ void makeraytree(Render *re) makeraytree_single(re); - if(test_break(re)) - { + if (test_break(re)) { freeraytree(re); re->i.infostr= "Raytree building canceled"; re->stats_draw(re->sdh, &re->i); } - else - { + else { //Calculate raytree max_size //This is ONLY needed to kept a bogus behavior of SUN and HEMI lights INIT_MINMAX(min, max); diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index 30853e8e1f6..384b2e13e90 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -217,8 +217,7 @@ static const char *get_pass_name(int passtype, int channel) if(channel==-1) return "Mist"; return "Mist.Z"; } - if(passtype == SCE_PASS_RAYHITS) - { + if(passtype == SCE_PASS_RAYHITS) { if(channel==-1) return "Rayhits"; if(channel==0) return "Rayhits.R"; if(channel==1) return "Rayhits.G"; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 1e91738c77d..5dbb98d20c2 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1965,10 +1965,10 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt); rgbnor = multitex_mtex(shi, mtex, texvec, dxt, dyt, texres); - if(shi->obr->ob->derivedFinal) - { + if(shi->obr->ob->derivedFinal) { auto_bump = shi->obr->ob->derivedFinal->auto_bump_scale; } + { float fVirtDim = sqrtf(fabsf((float) (dimx*dimy)*mtex->size[0]*mtex->size[1])); auto_bump /= MAX2(fVirtDim, FLT_EPSILON); diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 43761be9d71..9bec8595569 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -813,20 +813,20 @@ void free_renderdata_tables(Render *re) int a=0; for(obr=re->objecttable.first; obr; obr=obr->next) { - if(obr->vertnodes) { + if (obr->vertnodes) { free_renderdata_vertnodes(obr->vertnodes); obr->vertnodes= NULL; obr->vertnodeslen= 0; } - if(obr->vlaknodes) { + if (obr->vlaknodes) { free_renderdata_vlaknodes(obr->vlaknodes); obr->vlaknodes= NULL; obr->vlaknodeslen= 0; obr->totvlak= 0; } - if(obr->bloha) { + if (obr->bloha) { for(a=0; obr->bloha[a]; a++) MEM_freeN(obr->bloha[a]); @@ -835,7 +835,7 @@ void free_renderdata_tables(Render *re) obr->blohalen= 0; } - if(obr->strandnodes) { + if (obr->strandnodes) { free_renderdata_strandnodes(obr->strandnodes); obr->strandnodes= NULL; obr->strandnodeslen= 0; @@ -848,23 +848,23 @@ void free_renderdata_tables(Render *re) MEM_freeN(strandbuf); } - if(obr->mtface) + if (obr->mtface) MEM_freeN(obr->mtface); - if(obr->mcol) + + if (obr->mcol) MEM_freeN(obr->mcol); - if(obr->rayfaces) - { + if (obr->rayfaces) { MEM_freeN(obr->rayfaces); obr->rayfaces = NULL; } - if(obr->rayprimitives) - { + + if (obr->rayprimitives) { MEM_freeN(obr->rayprimitives); obr->rayprimitives = NULL; } - if(obr->raytree) - { + + if (obr->raytree) { RE_rayobject_free(obr->raytree); obr->raytree = NULL; } diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 74a4511b0dc..e855f2e62f3 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -213,15 +213,15 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) shr->z= -shi->co[2]; /* RAYHITS */ -/* - if(1 || shi->passflag & SCE_PASS_RAYHITS) - { +#if 0 + if(1 || shi->passflag & SCE_PASS_RAYHITS) { shr->rayhits[0] = (float)shi->raycounter.faces.test; shr->rayhits[1] = (float)shi->raycounter.bb.hit; shr->rayhits[2] = 0.0; shr->rayhits[3] = 1.0; } - */ +#endif + RE_RC_MERGE(&re_rc_counter[shi->thread], &shi->raycounter); } @@ -821,8 +821,7 @@ void shade_input_set_normals(ShadeInput *shi) normalize_v3(shi->vn); } - else - { + else { copy_v3_v3(shi->vn, shi->facenor); copy_v3_v3(shi->nmapnorm, shi->vn); } @@ -855,8 +854,7 @@ void shade_input_set_vertex_normals(ShadeInput *shi) normalize_v3(shi->vn); } - else - { + else { copy_v3_v3(shi->vn, shi->facenor); copy_v3_v3(shi->nmapnorm, shi->vn); } @@ -970,8 +968,7 @@ void shade_input_set_shade_texco(ShadeInput *shi) // keeping tangents normalized at vertex level // corresponds better to how it's done in game engines - if(obi->flag & R_TRANSFORMED) - { + if (obi->flag & R_TRANSFORMED) { mul_mat3_m4_v3(obi->mat, c0); normalize_v3(c0); mul_mat3_m4_v3(obi->mat, c1); normalize_v3(c1); mul_mat3_m4_v3(obi->mat, c2); normalize_v3(c2); diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index c0723518880..7ca67abe3a1 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -775,8 +775,7 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o //tree= NULL; } - if (ELEM(ma->vol.shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE)) - { + if (ELEM(ma->vol.shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE)) { /* this should be before the filtering */ multiple_scattering_diffusion(re, obi->volume_precache, ma); } diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index ebcc2ce997f..88571bb297b 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -228,8 +228,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra) ob= vd->object; /* draw code for smoke */ - if( (md = (ModifierData *)modifiers_findByType(ob, eModifierType_Smoke)) ) - { + if ((md = (ModifierData *)modifiers_findByType(ob, eModifierType_Smoke))) { SmokeModifierData *smd = (SmokeModifierData *)md; diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index df4ebfd9b9f..d386f65498f 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -576,8 +576,7 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win) else { win->drawdata= MEM_callocN(sizeof(wmDrawTriple), "wmDrawTriple"); - if(!wm_triple_gen_textures(win, win->drawdata)) - { + if(!wm_triple_gen_textures(win, win->drawdata)) { wm_draw_triple_fail(C, win); return; } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index d78faa76855..1d2252b7ceb 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -690,8 +690,7 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P break; /* skip invalid properties */ - if (strcmp(RNA_property_identifier(prop), otmacro->idname) == 0) - { + if (strcmp(RNA_property_identifier(prop), otmacro->idname) == 0) { wmOperatorType *otm= WM_operatortype_find(otmacro->idname, 0); PointerRNA someptr = RNA_property_pointer_get(properties, prop); wmOperator *opm= wm_operator_create(wm, otm, &someptr, NULL); @@ -2486,8 +2485,7 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g data->ry = s * ghost->ry; data->rz = s * ghost->rz; - if (U.ndof_flag & NDOF_ZOOM_UPDOWN) - { + if (U.ndof_flag & NDOF_ZOOM_UPDOWN) { /* rotate so Y is where Z was */ data->ty = s * ghost->tz; data->tz = s * ghost->ty; @@ -2502,8 +2500,7 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g data->rz = s * ghost->ry; #endif } - else - { + else { data->ty = s * ghost->ty; data->tz = s * ghost->tz; } diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 1ae03ca9f6f..b9bc6d04654 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -271,8 +271,7 @@ int WM_init_game(bContext *C) ar->winx = ar->winrct.xmax + 1; ar->winy = ar->winrct.ymax + 1; } - else - { + else { GHOST_RectangleHandle rect = GHOST_GetClientBounds(win->ghostwin); ar->winrct.ymax = GHOST_GetHeightRectangle(rect); ar->winrct.xmax = GHOST_GetWidthRectangle(rect); @@ -287,8 +286,7 @@ int WM_init_game(bContext *C) return 1; } - else - { + else { ReportTimerInfo *rti; BKE_report(&wm->reports, RPT_ERROR, "No valid 3D View found. Game auto start is not possible."); diff --git a/source/creator/creator.c b/source/creator/creator.c index c047111f604..bf1c27cc9c4 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -569,8 +569,7 @@ static int set_engine(int argc, const char **argv, void *data) return 1; } - else - { + else { printf("\nEngine not specified, give 'help' for a list of available engines.\n"); return 0; } @@ -649,31 +648,28 @@ static int set_ge_parameters(int argc, const char **argv, void *data) (void)data; #endif -/** -gameengine parameters are automaticly put into system --g [paramname = value] --g [boolparamname] -example: --g novertexarrays --g maxvertexarraysize = 512 -*/ - - if(argc >= 1) - { + /** + * gameengine parameters are automaticly put into system + * -g [paramname = value] + * -g [boolparamname] + * example: + * -g novertexarrays + * -g maxvertexarraysize = 512 + */ + + if (argc >= 1) { const char *paramname = argv[a]; /* check for single value versus assignment */ - if (a+1 < argc && (*(argv[a+1]) == '=')) - { + if (a+1 < argc && (*(argv[a+1]) == '=')) { a++; - if (a+1 < argc) - { + if (a+1 < argc) { a++; /* assignment */ #ifdef WITH_GAMEENGINE SYS_WriteCommandLineString(syshandle,paramname,argv[a]); #endif - } else - { + } + else { printf("error: argument assignment (%s) without value.\n",paramname); return 0; } @@ -684,8 +680,7 @@ example: SYS_WriteCommandLineInt(syshandle,argv[a],1); #endif /* doMipMap */ - if (!strcmp(argv[a],"nomipmap")) - { + if (!strcmp(argv[a],"nomipmap")) { GPU_set_mipmap(0); //doMipMap = 0; } /* linearMipMap */ @@ -755,7 +750,8 @@ static int render_animation(int UNUSED(argc), const char **UNUSED(argv), void *d RE_SetReports(re, &reports); RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); RE_SetReports(re, NULL); - } else { + } + else { printf("\nError: no blend loaded. cannot use '-a'.\n"); } return 0; @@ -1257,11 +1253,10 @@ int main(int argc, const char **argv) return 0; /* keep blender in background mode running */ #endif - if(G.background) { + if (G.background) { /* actually incorrect, but works for now (ton) */ WM_exit(C); } - else { if((G.fileflags & G_FILE_AUTOPLAY) && (G.f & G_SCRIPT_AUTOEXEC)) { -- cgit v1.2.3