style cleanup: follow style guide for formatting of if/for/while loops, and else...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 24 Mar 2012 06:38:07 +0000 (06:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 24 Mar 2012 06:38:07 +0000 (06:38 +0000)
367 files changed:
source/blender/blenpluginapi/intern/pluginapi.c
source/blender/bmesh/operators/bmo_dissolve.c
source/blender/bmesh/operators/bmo_extrude.c
source/blender/bmesh/tools/BME_bevel.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/EffectExporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/armature/poseSlide.c
source/blender/editors/armature/poseobject.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editfont.c
source/blender/editors/gpencil/editaction_gpencil.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/gpencil/gpencil_undo.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_bvh.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/dynamicpaint_ops.c
source/blender/editors/physics/particle_boids.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/render/render_preview.c
source/blender/editors/render/render_shading.c
source/blender/editors/render/render_update.c
source/blender/editors/render/render_view.c
source/blender/editors/screen/area.c
source/blender/editors/screen/glutil.c
source/blender/editors/screen/screen_context.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_hide.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_undo.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/buttons_ops.c
source/blender/editors/space_buttons/buttons_texture.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/clip_buttons.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/clip_graph_draw.c
source/blender/editors/space_clip/clip_graph_ops.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/clip_toolbar.c
source/blender/editors/space_clip/clip_utils.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_console/console_draw.c
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/fsmenu.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_draw.c
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_info/info_report.c
source/blender/editors/space_info/info_stats.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_info/textview.c
source/blender/editors/space_logic/logic_buttons.c
source/blender/editors/space_logic/logic_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_buttons.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_select.c
source/blender/editors/space_node/node_state.c
source/blender/editors/space_node/node_templates.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_script/script_edit.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_buttons.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_scopes.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_header.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_text/text_python.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_input.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/crazyspace.c
source/blender/editors/util/ed_util.c
source/blender/editors/util/editmode_undo.c
source/blender/editors/util/numinput.c
source/blender/editors/util/undo.c
source/blender/editors/uvedit/uvedit_buttons.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/imbuf/intern/allocimbuf.c
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/bmp.c
source/blender/imbuf/intern/cache.c
source/blender/imbuf/intern/cineon/cineon_dpx.c
source/blender/imbuf/intern/cineon/cineonlib.c
source/blender/imbuf/intern/cineon/dpxlib.c
source/blender/imbuf/intern/cineon/logImageLib.c
source/blender/imbuf/intern/cineon/logmemfile.c
source/blender/imbuf/intern/divers.c
source/blender/imbuf/intern/filetype.c
source/blender/imbuf/intern/filter.c
source/blender/imbuf/intern/imageprocess.c
source/blender/imbuf/intern/indexer.c
source/blender/imbuf/intern/indexer_dv.c
source/blender/imbuf/intern/iris.c
source/blender/imbuf/intern/jp2.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/metadata.c
source/blender/imbuf/intern/moviecache.c
source/blender/imbuf/intern/png.c
source/blender/imbuf/intern/radiance_hdr.c
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/rectop.c
source/blender/imbuf/intern/rotate.c
source/blender/imbuf/intern/scaling.c
source/blender/imbuf/intern/targa.c
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/thumbs_blend.c
source/blender/imbuf/intern/tiff.c
source/blender/imbuf/intern/util.c
source/blender/imbuf/intern/writeimage.c
source/blender/nodes/composite/node_composite_tree.c
source/blender/nodes/composite/node_composite_util.c
source/blender/nodes/composite/nodes/node_composite_alphaOver.c
source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
source/blender/nodes/composite/nodes/node_composite_blur.c
source/blender/nodes/composite/nodes/node_composite_brightness.c
source/blender/nodes/composite/nodes/node_composite_channelMatte.c
source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
source/blender/nodes/composite/nodes/node_composite_colorMatte.c
source/blender/nodes/composite/nodes/node_composite_colorSpill.c
source/blender/nodes/composite/nodes/node_composite_colorbalance.c
source/blender/nodes/composite/nodes/node_composite_composite.c
source/blender/nodes/composite/nodes/node_composite_crop.c
source/blender/nodes/composite/nodes/node_composite_curves.c
source/blender/nodes/composite/nodes/node_composite_defocus.c
source/blender/nodes/composite/nodes/node_composite_diffMatte.c
source/blender/nodes/composite/nodes/node_composite_dilate.c
source/blender/nodes/composite/nodes/node_composite_directionalblur.c
source/blender/nodes/composite/nodes/node_composite_displace.c
source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
source/blender/nodes/composite/nodes/node_composite_doubleEdgeMask.c
source/blender/nodes/composite/nodes/node_composite_filter.c
source/blender/nodes/composite/nodes/node_composite_flip.c
source/blender/nodes/composite/nodes/node_composite_gamma.c
source/blender/nodes/composite/nodes/node_composite_glare.c
source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
source/blender/nodes/composite/nodes/node_composite_huecorrect.c
source/blender/nodes/composite/nodes/node_composite_idMask.c
source/blender/nodes/composite/nodes/node_composite_image.c
source/blender/nodes/composite/nodes/node_composite_invert.c
source/blender/nodes/composite/nodes/node_composite_levels.c
source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
source/blender/nodes/composite/nodes/node_composite_mapUV.c
source/blender/nodes/composite/nodes/node_composite_mapValue.c
source/blender/nodes/composite/nodes/node_composite_math.c
source/blender/nodes/composite/nodes/node_composite_mixrgb.c
source/blender/nodes/composite/nodes/node_composite_movieclip.c
source/blender/nodes/composite/nodes/node_composite_moviedistortion.c
source/blender/nodes/composite/nodes/node_composite_normal.c
source/blender/nodes/composite/nodes/node_composite_normalize.c
source/blender/nodes/composite/nodes/node_composite_outputFile.c
source/blender/nodes/composite/nodes/node_composite_premulkey.c
source/blender/nodes/composite/nodes/node_composite_rotate.c
source/blender/nodes/composite/nodes/node_composite_scale.c
source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
source/blender/nodes/composite/nodes/node_composite_setalpha.c
source/blender/nodes/composite/nodes/node_composite_splitViewer.c
source/blender/nodes/composite/nodes/node_composite_stabilize2d.c
source/blender/nodes/composite/nodes/node_composite_texture.c
source/blender/nodes/composite/nodes/node_composite_tonemap.c
source/blender/nodes/composite/nodes/node_composite_transform.c
source/blender/nodes/composite/nodes/node_composite_translate.c
source/blender/nodes/composite/nodes/node_composite_valToRgb.c
source/blender/nodes/composite/nodes/node_composite_vecBlur.c
source/blender/nodes/composite/nodes/node_composite_viewer.c
source/blender/nodes/composite/nodes/node_composite_zcombine.c
source/blender/nodes/intern/node_common.c
source/blender/nodes/intern/node_exec.c
source/blender/nodes/intern/node_socket.c
source/blender/nodes/intern/node_util.c
source/blender/nodes/shader/node_shader_tree.c
source/blender/nodes/shader/node_shader_util.c
source/blender/nodes/shader/nodes/node_shader_camera.c
source/blender/nodes/shader/nodes/node_shader_curves.c
source/blender/nodes/shader/nodes/node_shader_dynamic.c
source/blender/nodes/shader/nodes/node_shader_geom.c
source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
source/blender/nodes/shader/nodes/node_shader_mapping.c
source/blender/nodes/shader/nodes/node_shader_material.c
source/blender/nodes/shader/nodes/node_shader_math.c
source/blender/nodes/shader/nodes/node_shader_output.c
source/blender/nodes/shader/nodes/node_shader_tex_checker.c
source/blender/nodes/shader/nodes/node_shader_tex_environment.c
source/blender/nodes/shader/nodes/node_shader_tex_gradient.c
source/blender/nodes/shader/nodes/node_shader_tex_image.c
source/blender/nodes/shader/nodes/node_shader_tex_magic.c
source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
source/blender/nodes/shader/nodes/node_shader_tex_noise.c
source/blender/nodes/shader/nodes/node_shader_tex_sky.c
source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c
source/blender/nodes/shader/nodes/node_shader_tex_wave.c
source/blender/nodes/shader/nodes/node_shader_texture.c
source/blender/nodes/shader/nodes/node_shader_valToRgb.c
source/blender/nodes/shader/nodes/node_shader_vectMath.c
source/blender/nodes/texture/node_texture_tree.c
source/blender/nodes/texture/node_texture_util.c
source/blender/nodes/texture/nodes/node_texture_bricks.c
source/blender/nodes/texture/nodes/node_texture_checker.c
source/blender/nodes/texture/nodes/node_texture_compose.c
source/blender/nodes/texture/nodes/node_texture_curves.c
source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
source/blender/nodes/texture/nodes/node_texture_image.c
source/blender/nodes/texture/nodes/node_texture_math.c
source/blender/nodes/texture/nodes/node_texture_output.c
source/blender/nodes/texture/nodes/node_texture_proc.c
source/blender/nodes/texture/nodes/node_texture_texture.c
source/blender/nodes/texture/nodes/node_texture_valToRgb.c
source/blender/nodes/texture/nodes/node_texture_viewer.c
source/blender/render/intern/raytrace/rayobject_octree.cpp
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/initrender.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pixelblending.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/pointdensity.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/render_result.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/sss.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/sunsky.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/voxeldata.c
source/blender/render/intern/source/zbuf.c
source/creator/creator.c

index b81facf..02166c4 100644 (file)
@@ -186,7 +186,7 @@ LIBEXPORT int ispic(char * name)
 }
 
 /* still the same name */
-/*  void (*ditherfunc)(struct ImBuf *, short, short){} */
+/*  void (*ditherfunc)(struct ImBuf *, short, short) {} */
 
 LIBEXPORT struct ImBuf *scaleImBuf(struct ImBuf *ib,
                                                 short nx,
index 4685b0a..7618035 100644 (file)
@@ -437,7 +437,8 @@ void dummy_exec(BMesh *bm, BMOperator *op)
                                                BM_face_kill(bm, f);
                                                BM_edge_kill(bm, fe);
                                        }
-                               } /* else if (f->len == 3) {
+                               }
+                               /* else if (f->len == 3) {
                                        BMEdge *ed[3];
                                        BMVert *vt[3];
                                        BMLoop *lp[3];
index 32acd99..3048be9 100644 (file)
@@ -131,7 +131,7 @@ static void bm_extrude_copy_face_loop_attributes(BMesh *bm, BMFace *f, BMEdge *e
                if (l2 == l) {
                        l2 = newedge->l;
 
-                       if(l2 != l) {
+                       if (l2 != l) {
                                BM_elem_attrs_copy(bm, bm, l2->f, l->f);
 
                                BM_elem_attrs_copy(bm, bm, l2, l);
index 78d02ee..3b8337f 100644 (file)
@@ -847,17 +847,17 @@ static void bevel_init_edges(BMesh *bm, int options, BME_TransData_Head *td)
        BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
                weight = 0.0;
                if (!BMO_elem_flag_test(bm, e, BME_BEVEL_NONMAN)) {
-                       if(options & BME_BEVEL_SELECT) {
-                               if(BM_elem_flag_test(e, BM_ELEM_SELECT)) weight = 1.0;
+                       if (options & BME_BEVEL_SELECT) {
+                               if (BM_elem_flag_test(e, BM_ELEM_SELECT)) weight = 1.0;
                        }
-                       else if(options & BME_BEVEL_WEIGHT) {
+                       else if (options & BME_BEVEL_WEIGHT) {
                                weight = BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT);
                        }
                        else {
                                weight = 1.0;
                        }
 
-                       if(weight > 0.0) {
+                       if (weight > 0.0) {
                                BMO_elem_flag_enable(bm, e, BME_BEVEL_BEVEL);
                                BMO_elem_flag_enable(bm, e->v1, BME_BEVEL_BEVEL);
                                BMO_elem_flag_enable(bm, e->v2, BME_BEVEL_BEVEL);
@@ -869,9 +869,9 @@ static void bevel_init_edges(BMesh *bm, int options, BME_TransData_Head *td)
 
        /* clean up edges with 2 faces that share more than one edg */
        BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-               if(BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL)) {
+               if (BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL)) {
                        count = BM_face_share_edge_count(e->l->f, e->l->radial_next->f);
-                       if(count > 1) BMO_elem_flag_disable(bm, e, BME_BEVEL_BEVEL);
+                       if (count > 1) BMO_elem_flag_disable(bm, e, BME_BEVEL_BEVEL);
                }
        }
 }
@@ -887,7 +887,7 @@ static BMesh *BME_bevel_initialize(BMesh *bm, int options, int UNUSED(defgrp_ind
        /* tag non-manifold geometr */
        BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
                BMO_elem_flag_enable(bm, v, BME_BEVEL_ORIG);
-               if(v->e) {
+               if (v->e) {
                        BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 0, -1, -1, NULL);
                        if (!BM_vert_is_manifold(v)) {
                                BMO_elem_flag_enable(bm, v, BME_BEVEL_NONMAN);
@@ -910,7 +910,7 @@ static BMesh *BME_bevel_initialize(BMesh *bm, int options, int UNUSED(defgrp_ind
                        BMO_elem_flag_enable(bm, e->v2, BME_BEVEL_NONMAN);
                        BMO_elem_flag_enable(bm, e, BME_BEVEL_NONMAN);
                }
-               if(BMO_elem_flag_test(bm, e->v1, BME_BEVEL_NONMAN) || BMO_elem_flag_test(bm, e->v2, BME_BEVEL_NONMAN)) {
+               if (BMO_elem_flag_test(bm, e->v1, BME_BEVEL_NONMAN) || BMO_elem_flag_test(bm, e->v2, BME_BEVEL_NONMAN)) {
                        BMO_elem_flag_enable(bm, e, BME_BEVEL_NONMAN);
                }
        }
@@ -919,7 +919,7 @@ static BMesh *BME_bevel_initialize(BMesh *bm, int options, int UNUSED(defgrp_ind
                BMO_elem_flag_enable(bm, f, BME_BEVEL_ORIG);
        }
 
-       if(options & BME_BEVEL_VERT) {
+       if (options & BME_BEVEL_VERT) {
                bevel_init_verts(bm, options, td);
        }
        else {
@@ -980,30 +980,30 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
 
        /* bevel poly */
        BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-               if(BMO_elem_flag_test(bm, f, BME_BEVEL_ORIG)) {
+               if (BMO_elem_flag_test(bm, f, BME_BEVEL_ORIG)) {
                        BME_bevel_poly(bm, f, value, options, td);
                }
        }
 
        /* get rid of beveled edge */
        BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-               if(BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL) && BMO_elem_flag_test(bm, e, BME_BEVEL_ORIG)) {
+               if (BMO_elem_flag_test(bm, e, BME_BEVEL_BEVEL) && BMO_elem_flag_test(bm, e, BME_BEVEL_ORIG)) {
                        BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e);
                }
        }
 
        /* link up corners and cli */
        BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-               if(BMO_elem_flag_test(bm, v, BME_BEVEL_ORIG) && BMO_elem_flag_test(bm, v, BME_BEVEL_BEVEL)) {
+               if (BMO_elem_flag_test(bm, v, BME_BEVEL_ORIG) && BMO_elem_flag_test(bm, v, BME_BEVEL_BEVEL)) {
                        curedge = v->e;
                        do {
                                l = curedge->l;
                                l2 = l->radial_next;
-                               if(l->v != v) l = l->next;
-                               if(l2->v != v) l2 = l2->next;
-                               if(l->f->len > 3)
+                               if (l->v != v) l = l->next;
+                               if (l2->v != v) l2 = l2->next;
+                               if (l->f->len > 3)
                                        BM_face_split(bm, l->f, l->next->v, l->prev->v, &l, l->e, FALSE); /* clip this corner off */
-                               if(l2->f->len > 3)
+                               if (l2->f->len > 3)
                                        BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e, FALSE); /* clip this corner off */
                                curedge = bmesh_disk_edge_next(curedge, v);
                        } while (curedge != v->e);
@@ -1013,7 +1013,7 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option
 
        /* Debug print, remov */
        BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-               if(f->len == 2) {
+               if (f->len == 2) {
                        printf("warning");
                }
        }
index 5b1ad60..d6eb406 100644 (file)
@@ -548,7 +548,8 @@ void AnimationExporter::add_source_parameters(COLLADASW::SourceBase::ParameterNa
                                        if ( transform )
                                        {
                                                param.push_back("TRANSFORM");  
-                                       }else{ //assumes if axis isn't specified all axises are added
+                                       }
+                                       else { //assumes if axis isn't specified all axises are added
                                                param.push_back("X");
                                                param.push_back("Y");
                                                param.push_back("Z");
@@ -592,7 +593,8 @@ void AnimationExporter::get_source_values(BezTriple *bezt, COLLADASW::InputSeman
                        }
                        else if (rotation) {
                                values[1] = RAD2DEGF(bezt->vec[0][1]);
-                       } else {
+                       }
+                       else {
                                values[1] = bezt->vec[0][1];
                        }
                        break;
@@ -607,7 +609,8 @@ void AnimationExporter::get_source_values(BezTriple *bezt, COLLADASW::InputSeman
                        }
                        else if (rotation) {
                                values[1] = RAD2DEGF(bezt->vec[2][1]);
-                       } else {
+                       }
+                       else {
                                values[1] = bezt->vec[2][1];
                        }
                        break;
@@ -858,9 +861,11 @@ std::string AnimationExporter::create_interpolation_source(FCurve *fcu, const st
                if (fcu->bezt[i].ipo==BEZT_IPO_BEZ) {
                        source.appendValues(BEZIER_NAME);
                        *has_tangents = true;
-               } else if (fcu->bezt[i].ipo==BEZT_IPO_CONST) {
+               }
+               else if (fcu->bezt[i].ipo==BEZT_IPO_CONST) {
                        source.appendValues(STEP_NAME);
-               } else { // BEZT_IPO_LIN
+               }
+               else { // BEZT_IPO_LIN
                        source.appendValues(LINEAR_NAME);
                }
        }
index b85e9e2..4ad79e0 100644 (file)
@@ -1015,9 +1015,11 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
                else if(IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
                        att1 = linatt;
                        d = (1.0f/linatt);
-               } else if (IS_EQ(constatt, 1.0f)) {
+               }
+               else if (IS_EQ(constatt, 1.0f)) {
                        att1 = 1.0f;
-               } else {
+               }
+               else {
                        // assuming point light (const att = 1.0);
                        att1 = 1.0f;
                }
index 7ada149..0dbd44f 100644 (file)
@@ -138,7 +138,8 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
                        // for now set phong in case spec shader is not blinn
                        writePhong(ep, ma);
                }
-       } else {
+       }
+       else {
                if(ma->diff_shader == MA_DIFF_LAMBERT) {
                        writeLambert(ep, ma);
                }
index 10fae7e..2539756 100644 (file)
@@ -917,7 +917,8 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
                        texture_face = assign_material_to_geom(mat_array[i], uid_material_map, ob, geom_uid,
                                                                                                   &color_texture, layername, texture_face,
                                                                                                   material_texture_mapping_map, i);
-               } else {
+               }
+               else {
                        fprintf(stderr, "invalid referenced material for %s\n", mat_array[i].getName().c_str());
                }
        }
index 69f4597..aa15d53 100644 (file)
@@ -1909,7 +1909,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
        gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
        extend= RNA_boolean_get(op->ptr, "extend");
 
-       if(!extend)
+       if (!extend)
                ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_CLEAR);
 
        if (gesture_mode == GESTURE_MODAL_SELECT)
index be66edb..3f0e1b1 100644 (file)
@@ -88,7 +88,7 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale)
                
                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))
                        RNA_property_update_main(G.main, scene, &ptr, prop);
        }
        else {
index 05a2cc3..a17d15d 100644 (file)
@@ -1188,7 +1188,7 @@ static size_t animfilter_block_data (bAnimContext *ac, ListBase *anim_data, bDop
        size_t items = 0;
 
        /* image object datablocks have no anim-data so check for NULL */
-       if(adt) {
+       if (adt) {
                IdAdtTemplate *iat = (IdAdtTemplate*)id;
 
                /* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed
index 7937d19..86e3c80 100644 (file)
@@ -410,7 +410,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
                }
                else {
                        UI_ThemeColor(TH_TEXT);
-                       if((marker->frame <= cfra) && (marker->frame+5 > cfra)) {
+                       if ((marker->frame <= cfra) && (marker->frame+5 > cfra)) {
                                x= xpos*xscale + 4.0f;
                                y= (ypixels <= 39.0f)? (ypixels - 10.0f) : 29.0f;
                        }
@@ -421,7 +421,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
                }
 
 #ifdef DURIAN_CAMERA_SWITCH
-               if(marker->camera && (marker->camera->restrictflag & OB_RESTRICT_RENDER)) {
+               if (marker->camera && (marker->camera->restrictflag & OB_RESTRICT_RENDER)) {
                        float col[4];
                        glGetFloatv(GL_CURRENT_COLOR, col);
                        col[3]= 0.4;
@@ -638,7 +638,7 @@ static int ed_marker_move_init(bContext *C, wmOperator *op)
        int totmark=0;
        int a;
 
-       if(markers == NULL) return 0;
+       if (markers == NULL) return 0;
        
        for (marker= markers->first; marker; marker= marker->next)
                if (marker->flag & SELECT) totmark++;
@@ -681,7 +681,7 @@ static void ed_marker_move_exit(bContext *C, wmOperator *op)
 
 static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt)
 {
-       if(ed_marker_move_init(C, op)) {
+       if (ed_marker_move_init(C, op)) {
                MarkerMove *mm= op->customdata;
                
                mm->evtx= evt->x;
@@ -872,7 +872,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
 
 static int ed_marker_move_exec(bContext *C, wmOperator *op)
 {
-       if(ed_marker_move_init(C, op)) {
+       if (ed_marker_move_init(C, op)) {
                ed_marker_move_apply(op);
                ed_marker_move_exit(C, op);
                return OPERATOR_FINISHED;
@@ -1051,7 +1051,7 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
                        scene_deselect_all(scene);
                
                for (marker= markers->first; marker; marker= marker->next) {
-                       if(marker->frame==cfra) {
+                       if (marker->frame==cfra) {
                                sel= (marker->flag & SELECT);
                                break;
                        }
@@ -1063,7 +1063,7 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
                                        base= object_in_scene(marker->camera, scene);
                                        if (base) {
                                                ED_base_object_select(base, sel);
-                                               if(sel)
+                                               if (sel)
                                                        ED_base_object_activate(C, base);
                                        }
                                }
@@ -1223,7 +1223,7 @@ static int ed_marker_select_all_exec(bContext *C, wmOperator *op)
                action = (ED_markers_get_first_selected(markers) != NULL) ? SEL_DESELECT : SEL_SELECT;
        }
        
-       for(marker= markers->first; marker; marker= marker->next) {
+       for (marker= markers->first; marker; marker= marker->next) {
                switch (action) {
                case SEL_SELECT:
                        marker->flag |= SELECT;
@@ -1431,7 +1431,7 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op))
        TimeMarker *marker;
 
        marker= ED_markers_get_first_selected(markers);
-       if(marker == NULL)
+       if (marker == NULL)
                return OPERATOR_CANCELLED;
 
        marker->camera= ob;
index 6ca7ffd..8286e81 100644 (file)
@@ -65,7 +65,7 @@ static int change_frame_poll(bContext *C)
        ScrArea *curarea= CTX_wm_area(C);
        
        /* XXX temp? prevent changes during render */
-       if(G.rendering) return 0;
+       if (G.rendering) return 0;
        
        /* as long as there is an active area, and it isn't a Graph Editor 
         * (since the Graph Editor has its own version which does extra stuff),
index 8b93688..1c0bb9b 100644 (file)
@@ -269,7 +269,7 @@ static void nupdate_abk_bezt (void *node, void *data)
        if (abk->numBezts >= MAX_ABK_BUFSIZE) {
                // TODO: need to allocate new array to cater...
                //bezts_extra= MEM_callocN(...);
-               if(G.f & G_DEBUG)
+               if (G.f & G_DEBUG)
                        printf("FIXME: nupdate_abk_bezt() missing case for too many overlapping BezTriples \n");
        }
        else {
index fdd790f..71e7053 100644 (file)
@@ -317,9 +317,9 @@ int insert_vert_fcurve (FCurve *fcu, float x, float y, short flag)
        /* use default interpolation mode, with exceptions for int/discrete values */
        beztr.ipo= U.ipo_new;
 
-       if(fcu->flag & FCURVE_DISCRETE_VALUES)
+       if (fcu->flag & FCURVE_DISCRETE_VALUES)
                beztr.ipo = BEZT_IPO_CONST;
-       else if(beztr.ipo == BEZT_IPO_BEZ && (fcu->flag & FCURVE_INT_VALUES))
+       else if (beztr.ipo == BEZT_IPO_BEZ && (fcu->flag & FCURVE_INT_VALUES))
                beztr.ipo = BEZT_IPO_LIN;
        
        /* add temp beztriple to keyframes */
@@ -573,7 +573,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
                return 0;
                
        /* location or rotation identifiers only... */
-       if(identifier == NULL) {
+       if (identifier == NULL) {
                printf("%s failed: NULL identifier\n", __func__);
                return 0;
        }
@@ -1429,7 +1429,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
                        if (all) {
                                length= RNA_property_array_length(&ptr, prop);
                                
-                               if(length) index= 0;
+                               if (length) index= 0;
                                else length= 1;
                        }
                        else
index 3207806..f66aa31 100644 (file)
@@ -607,7 +607,7 @@ void ANIM_keyingset_info_unregister (Main *bmain, KeyingSetInfo *ksi)
                        BKE_keyingset_free(ks);
                        BLI_remlink(&builtin_keyingsets, ks);
 
-                       for(scene= bmain->scene.first; scene; scene= scene->id.next)
+                       for (scene= bmain->scene.first; scene; scene= scene->id.next)
                                BLI_remlink_safe(&scene->keyingsets, ks);
 
                        MEM_freeN(ks);
index 4155f76..21b9718 100644 (file)
@@ -171,7 +171,7 @@ void ED_operatormacros_armature(void)
        wmOperatorTypeMacro *otmacro;
        
        ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
-       if(ot) {
+       if (ot) {
                ot->description = "Make copies of the selected bones within the same armature and move them";
                WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate");
                otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
@@ -179,7 +179,7 @@ void ED_operatormacros_armature(void)
        }
 
        ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
-       if(ot) {
+       if (ot) {
                ot->description = "Create new bones from the selected joints and move them";
                otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
                RNA_boolean_set(otmacro->ptr, "forked", FALSE);
@@ -190,7 +190,7 @@ void ED_operatormacros_armature(void)
        // XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate?
        // that would require fixing a properties bug 19733
        ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER);
-       if(ot) {
+       if (ot) {
                ot->description = "Create new bones from the selected joints and move them";
                otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
                RNA_boolean_set(otmacro->ptr, "forked", TRUE);
index 71c0e41..4090fc1 100644 (file)
@@ -123,18 +123,18 @@ void ED_armature_validate_active(struct bArmature *arm)
 {
        EditBone *ebone= arm->act_edbone;
 
-       if(ebone) { 
-               if(ebone->flag & BONE_HIDDEN_A)
+       if (ebone) { 
+               if (ebone->flag & BONE_HIDDEN_A)
                        arm->act_edbone= NULL;
        }
 }
 
 static void bone_free(bArmature *arm, EditBone *bone)
 {
-       if(arm->act_edbone==bone)
+       if (arm->act_edbone==bone)
                arm->act_edbone= NULL;
 
-       if(bone->prop) {
+       if (bone->prop) {
                IDP_FreeProperty(bone->prop);
                MEM_freeN(bone->prop);
        }
@@ -275,9 +275,9 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
                else {
                        /* if the bone is not selected, but connected to its parent
                         *  copy the parents tip selection state */
-                       if(eBone->parent &&  (eBone->flag & BONE_CONNECTED)) {
+                       if (eBone->parent &&  (eBone->flag & BONE_CONNECTED)) {
                                /* selecting with the mouse gives this behavior */
-                               if(eBone->parent->flag & BONE_TIPSEL) {
+                               if (eBone->parent->flag & BONE_TIPSEL) {
                                        eBone->flag |= BONE_ROOTSEL;
                                }
                                else {
@@ -306,7 +306,7 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
                eBone->segments = curBone->segments;            
                eBone->layer = curBone->layer;
 
-               if(curBone->prop)
+               if (curBone->prop)
                        eBone->prop= IDP_CopyProperty(curBone->prop);
                
                BLI_addtail(edbo, eBone);
@@ -314,11 +314,11 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
                /*      Add children if necessary */
                if (curBone->childbase.first) {
                        eBoneTest= make_boneList(edbo, &curBone->childbase, eBone, actBone);
-                       if(eBoneTest)
+                       if (eBoneTest)
                                eBoneAct= eBoneTest;
                }
 
-               if(curBone==actBone)
+               if (curBone==actBone)
                        eBoneAct= eBone;
        }
 
@@ -434,7 +434,7 @@ void ED_armature_from_edit(Object *obedit)
                newBone->segments= eBone->segments;
                newBone->layer = eBone->layer;
                
-               if(eBone->prop)
+               if (eBone->prop)
                        newBone->prop= IDP_CopyProperty(eBone->prop);
        }
        
@@ -542,7 +542,7 @@ void docenter_armature (Scene *scene, Object *ob, float cursor[3], int centermod
        float cent[3];
 
        /* Put the armature into editmode */
-       if(ob != obedit) {
+       if (ob != obedit) {
                ED_armature_to_edit(ob);
                obedit= NULL; /* we cant use this so behave as if there is no obedit */
        }
@@ -554,7 +554,7 @@ void docenter_armature (Scene *scene, Object *ob, float cursor[3], int centermod
                mul_m4_v3(ob->imat, cent);
        }
        else {
-               if(around==V3D_CENTROID) {
+               if (around==V3D_CENTROID) {
                        int total= 0;
                        zero_v3(cent);
                        for (ebone= arm->edbo->first; ebone; ebone=ebone->next) {
@@ -582,13 +582,13 @@ void docenter_armature (Scene *scene, Object *ob, float cursor[3], int centermod
        }
        
        /* Turn the list into an armature */
-       if(obedit==NULL) {
+       if (obedit==NULL) {
                ED_armature_from_edit(ob);
                ED_armature_edit_free(ob);
        }
 
        /* Adjust object location for new centerpoint */
-       if(centermode && obedit==NULL) {
+       if (centermode && obedit==NULL) {
                mul_mat3_m4_v3(ob->obmat, cent); /* ommit translation part */
                add_v3_v3(ob->loc, cent);
        }
@@ -1043,12 +1043,12 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
                                                         */
                                                        if (ct->subtarget[0] != 0) {
                                                                if (ct->tar == origArm) {
-                                                                       if(BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
+                                                                       if (BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
                                                                                ct->tar= newArm;
                                                                        }
                                                                }
                                                                else if (ct->tar == newArm) {
-                                                                       if(BLI_findstring(opchans, ct->subtarget, offsetof(bPoseChannel, name))) {
+                                                                       if (BLI_findstring(opchans, ct->subtarget, offsetof(bPoseChannel, name))) {
                                                                                ct->tar= origArm;
                                                                        }
                                                                }
@@ -1079,14 +1079,14 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
                                                 *      - the target isn't origArm/newArm itself
                                                 *      - the target is one that can be found in newArm/origArm
                                                 */
-                                               if(ct->subtarget[0] != '\0') {
+                                               if (ct->subtarget[0] != '\0') {
                                                        if (ct->tar == origArm) {
-                                                               if(BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
+                                                               if (BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
                                                                        ct->tar= newArm;
                                                                }
                                                        }
                                                        else if (ct->tar == newArm) {
-                                                               if(BLI_findstring(opchans, ct->subtarget, offsetof(bPoseChannel, name))) {
+                                                               if (BLI_findstring(opchans, ct->subtarget, offsetof(bPoseChannel, name))) {
                                                                        ct->tar= origArm;
                                                                }
                                                        }
@@ -1104,7 +1104,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
                if (ob->parent && (ob->parent == origArm)) {
                        /* Is object parented to a bone of this src armature? */
                        if ((ob->partype == PARBONE) && (ob->parsubstr[0] != '\0')) {
-                               if(BLI_findstring(npchans, ob->parsubstr, offsetof(bPoseChannel, name))) {
+                               if (BLI_findstring(npchans, ob->parsubstr, offsetof(bPoseChannel, name))) {
                                        ob->parent= newArm;
                                }
                        }
@@ -1263,7 +1263,7 @@ void ARMATURE_OT_separate (wmOperatorType *ot)
 Bone *get_indexed_bone (Object *ob, int index)
 {
        bPoseChannel *pchan;
-       if(ob->pose==NULL) return NULL;
+       if (ob->pose==NULL) return NULL;
        index>>=16;             // bone selection codes use left 2 bytes
        
        pchan= BLI_findlink(&ob->pose->chanbase, index);
@@ -1281,17 +1281,17 @@ static void *get_bone_from_selectbuffer(Scene *scene, Base *base, unsigned int *
        unsigned int hitresult;
        short i, takeNext=0, sel;
        
-       for (i=0; i< hits; i++){
+       for (i=0; i< hits; i++) {
                hitresult = buffer[3+(i*4)];
                
                if (!(hitresult & BONESEL_NOSEL)) {     // -1
-                       if(hitresult & BONESEL_ANY) {   // to avoid including objects in selection
+                       if (hitresult & BONESEL_ANY) {  // to avoid including objects in selection
                                
                                hitresult &= ~(BONESEL_ANY);
                                /* Determine what the current bone is */
                                if (obedit==NULL || base->object!=obedit) {
                                        /* no singular posemode, so check for correct object */
-                                       if(base->selcol == (hitresult & 0xFFFF)) {
+                                       if (base->selcol == (hitresult & 0xFFFF)) {
                                                bone = get_indexed_bone(base->object, hitresult);
                                                
                                                if (findunsel)
@@ -1306,7 +1306,7 @@ static void *get_bone_from_selectbuffer(Scene *scene, Base *base, unsigned int *
                                                sel= 0;
                                        }
                                }
-                               else{
+                               else {
                                        bArmature *arm= obedit->data;
                                        
                                        ebone = BLI_findlink(arm->edbo, hitresult);
@@ -1318,9 +1318,9 @@ static void *get_bone_from_selectbuffer(Scene *scene, Base *base, unsigned int *
                                        data = ebone;
                                }
                                
-                               if(data) {
+                               if (data) {
                                        if (sel) {
-                                               if(!firstSel) firstSel= data;
+                                               if (!firstSel) firstSel= data;
                                                takeNext=1;
                                        }
                                        else {
@@ -1430,7 +1430,7 @@ static int pose_select_connected_invoke(bContext *C, wmOperator *op, wmEvent *ev
                return OPERATOR_CANCELLED;
        
        /* Select parents */
-       for (curBone=bone; curBone; curBone=next){
+       for (curBone=bone; curBone; curBone=next) {
                /* ignore bone if cannot be selected */
                if ((curBone->flag & BONE_UNSELECTABLE) == 0) { 
                                // XXX old cruft! use notifiers instead
@@ -1512,7 +1512,7 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, wmEvent *e
                        if (extend) {
                                curBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
                        }
-                       else{
+                       else {
                                curBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
                        }
                }
@@ -1596,7 +1596,7 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2],
        rect.ymax = mval[1]+5;
        
        hits= view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect);
-       if(hits==0) {
+       if (hits==0) {
                rect.xmin = mval[0]-12;
                rect.xmax = mval[0]+12;
                rect.ymin = mval[1]-12;
@@ -1606,7 +1606,7 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2],
        /* See if there are any selected bones in this group */
        if (hits>0) {
                
-               if(hits==1) {
+               if (hits==1) {
                        if (!(buffer[3] & BONESEL_NOSEL)) 
                                besthitresult= buffer[3];
                }
@@ -1619,12 +1619,12 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2],
                                        ebone = BLI_findlink(edbo, hitresult & ~BONESEL_ANY);
                                        
                                        /* clicks on bone points get advantage */
-                                       if( hitresult & (BONESEL_ROOT|BONESEL_TIP)) {
+                                       if ( hitresult & (BONESEL_ROOT|BONESEL_TIP)) {
                                                /* but also the unselected one */
-                                               if(findunsel) {
-                                                       if( (hitresult & BONESEL_ROOT) && (ebone->flag & BONE_ROOTSEL)==0) 
+                                               if (findunsel) {
+                                                       if ( (hitresult & BONESEL_ROOT) && (ebone->flag & BONE_ROOTSEL)==0) 
                                                                dep= 1;
-                                                       else if( (hitresult & BONESEL_TIP) && (ebone->flag & BONE_TIPSEL)==0) 
+                                                       else if ( (hitresult & BONESEL_TIP) && (ebone->flag & BONE_TIPSEL)==0) 
                                                                dep= 1;
                                                        else 
                                                                dep= 2;
@@ -1633,15 +1633,15 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2],
                                        }
                                        else {
                                                /* bone found */
-                                               if(findunsel) {
-                                                       if((ebone->flag & BONE_SELECTED)==0)
+                                               if (findunsel) {
+                                                       if ((ebone->flag & BONE_SELECTED)==0)
                                                                dep= 2;
                                                        else
                                                                dep= 3;
                                                }
                                                else dep= 3;
                                        }
-                                       if(dep < mindep) {
+                                       if (dep < mindep) {
                                                mindep= dep;
                                                besthitresult= hitresult;
                                        }
@@ -1729,7 +1729,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
                ebone_next= curBone->next;
                if (arm->layer & curBone->layer) {
                        if (curBone->flag & BONE_SELECTED) {
-                               if(curBone==arm->act_edbone) arm->act_edbone= NULL;
+                               if (curBone==arm->act_edbone) arm->act_edbone= NULL;
                                ED_armature_edit_bone_remove(arm, curBone);
                        }
                }
@@ -1769,12 +1769,12 @@ void ED_armature_deselect_all(Object *obedit, int toggle)
        EditBone        *eBone;
        int                     sel=1;
        
-       if(toggle==1) {
+       if (toggle==1) {
                /* Determine if there are any selected bones
                 * and therefore whether we are selecting or deselecting */
-               for (eBone=arm->edbo->first;eBone;eBone=eBone->next){
-                       //                      if(arm->layer & eBone->layer) {
-                       if (eBone->flag & (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL)){
+               for (eBone=arm->edbo->first;eBone;eBone=eBone->next) {
+                       //                      if (arm->layer & eBone->layer) {
+                       if (eBone->flag & (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL)) {
                                sel=0;
                                break;
                        }
@@ -1787,24 +1787,24 @@ void ED_armature_deselect_all(Object *obedit, int toggle)
        for (eBone=arm->edbo->first;eBone;eBone=eBone->next) {
                if (sel==2) {
                        /* invert selection of bone */
-                       if(EBONE_VISIBLE(arm, eBone)) {
+                       if (EBONE_VISIBLE(arm, eBone)) {
                                eBone->flag ^= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
-                               if(arm->act_edbone==eBone)
+                               if (arm->act_edbone==eBone)
                                        arm->act_edbone= NULL;
                        }
                }
                else if (sel==1) {
                        /* select bone */
-                       if(EBONE_VISIBLE(arm, eBone)) {
+                       if (EBONE_VISIBLE(arm, eBone)) {
                                eBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
-                               if(eBone->parent)
+                               if (eBone->parent)
                                        eBone->parent->flag |= (BONE_TIPSEL);
                        }
                }
                else {
                        /* deselect bone */
                        eBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
-                       if(arm->act_edbone==eBone)
+                       if (arm->act_edbone==eBone)
                                arm->act_edbone= NULL;
                }
        }
@@ -1830,7 +1830,7 @@ void ED_armature_deselect_all_visible(Object *obedit)
 /* accounts for connected parents */
 static int ebone_select_flag(EditBone *ebone)
 {
-       if(ebone->parent && (ebone->flag & BONE_CONNECTED)) {
+       if (ebone->parent && (ebone->flag & BONE_CONNECTED)) {
                return ((ebone->parent->flag & BONE_TIPSEL) ? BONE_ROOTSEL : 0) | (ebone->flag & (BONE_SELECTED|BONE_TIPSEL));
        }
        else {
@@ -1860,16 +1860,16 @@ int mouse_armature(bContext *C, const int mval[2], int extend)
                /* by definition the non-root connected bones have no root point drawn,
                 * so a root selection needs to be delivered to the parent tip */
                
-               if(selmask & BONE_SELECTED) {
-                       if(nearBone->parent && (nearBone->flag & BONE_CONNECTED)) {
+               if (selmask & BONE_SELECTED) {
+                       if (nearBone->parent && (nearBone->flag & BONE_CONNECTED)) {
                                /* click in a chain */
-                               if(extend) {
+                               if (extend) {
                                        /* hold shift inverts this bone's selection */
-                                       if(nearBone->flag & BONE_SELECTED) {
+                                       if (nearBone->flag & BONE_SELECTED) {
                                                /* deselect this bone */
                                                nearBone->flag &= ~(BONE_TIPSEL|BONE_SELECTED);
                                                /* only deselect parent tip if it is not selected */
-                                               if(!(nearBone->parent->flag & BONE_SELECTED))
+                                               if (!(nearBone->parent->flag & BONE_SELECTED))
                                                        nearBone->parent->flag &= ~BONE_TIPSEL;
                                        }
                                        else {
@@ -1885,9 +1885,9 @@ int mouse_armature(bContext *C, const int mval[2], int extend)
                                }
                        }
                        else {
-                               if(extend) {
+                               if (extend) {
                                        /* hold shift inverts this bone's selection */
-                                       if(nearBone->flag & BONE_SELECTED)
+                                       if (nearBone->flag & BONE_SELECTED)
                                           nearBone->flag &= ~(BONE_TIPSEL|BONE_ROOTSEL);
                                        else
                                                nearBone->flag |= (BONE_TIPSEL|BONE_ROOTSEL);
@@ -1904,9 +1904,9 @@ int mouse_armature(bContext *C, const int mval[2], int extend)
                
                ED_armature_sync_selection(arm->edbo);
                
-               if(nearBone) {
+               if (nearBone) {
                        /* then now check for active status */
-                       if(ebone_select_flag(nearBone)) {
+                       if (ebone_select_flag(nearBone)) {
                                arm->act_edbone= nearBone;
                        }
                }
@@ -1966,15 +1966,15 @@ float ED_rollBoneToVector(EditBone *bone, const float align_axis[3], const short
        vec_roll_to_mat3(nor, 0.0f, mat);
 
        /* check the bone isn't aligned with the axis */
-       if(!is_zero_v3(align_axis) && angle_v3v3(align_axis, mat[2]) > FLT_EPSILON) {
+       if (!is_zero_v3(align_axis) && angle_v3v3(align_axis, mat[2]) > FLT_EPSILON) {
                float vec[3], align_axis_proj[3], roll;
 
                /* project the new_up_axis along the normal */
                project_v3_v3v3(vec, align_axis, nor);
                sub_v3_v3v3(align_axis_proj, align_axis, vec);
                
-               if(axis_only) {
-                       if(angle_v3v3(align_axis_proj, mat[2]) > (float)(M_PI/2.0)) {
+               if (axis_only) {
+                       if (angle_v3v3(align_axis_proj, mat[2]) > (float)(M_PI/2.0)) {
                                negate_v3(align_axis_proj);
                        }
                }
@@ -2020,7 +2020,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
        copy_m3_m4(imat, ob->obmat);
        invert_m3(imat);
 
-       if(type==7) { /* Cursor */
+       if (type==7) { /* Cursor */
                Scene *scene= CTX_data_scene(C);
                View3D *v3d= CTX_wm_view3d(C); /* can be NULL */
                float cursor_local[3];
@@ -2031,20 +2031,20 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
                mul_m3_v3(imat, cursor_local);
 
                /* cursor */
-               for(ebone= arm->edbo->first; ebone; ebone= ebone->next) {
-                       if(EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
+               for (ebone= arm->edbo->first; ebone; ebone= ebone->next) {
+                       if (EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
                                float cursor_rel[3];
                                sub_v3_v3v3(cursor_rel, cursor_local, ebone->head);
-                               if(axis_flip) negate_v3(cursor_rel);
+                               if (axis_flip) negate_v3(cursor_rel);
                                ebone->roll= ED_rollBoneToVector(ebone, cursor_rel, axis_only);
                        }
                }
        }
        else {
                float vec[3]= {0.0f, 0.0f, 0.0f};
-               if(type==6) { /* View */
+               if (type==6) { /* View */
                        RegionView3D *rv3d= CTX_wm_region_view3d(C);
-                       if(rv3d==NULL) {
+                       if (rv3d==NULL) {
                                BKE_report(op->reports, RPT_ERROR, "No region view3d available");
                                return OPERATOR_CANCELLED;
                        }
@@ -2055,7 +2055,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
                else if (type==5) {
                        float mat[3][3], nor[3];
                        ebone= (EditBone *)arm->act_edbone;
-                       if(ebone==NULL) {
+                       if (ebone==NULL) {
                                BKE_report(op->reports, RPT_ERROR, "No active bone set");
                                return OPERATOR_CANCELLED;
                        }
@@ -2066,15 +2066,15 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
                }
                else { /* Axis */
                        assert(type >= 0 && type <= 5);
-                       if(type<3)      vec[type]= 1.0f; 
+                       if (type<3)     vec[type]= 1.0f; 
                        else            vec[type-2]= -1.0f; 
                        mul_m3_v3(imat, vec);
                }
 
-               if(axis_flip) negate_v3(vec);
+               if (axis_flip) negate_v3(vec);
 
-               for(ebone= arm->edbo->first; ebone; ebone= ebone->next) {
-                       if(EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
+               for (ebone= arm->edbo->first; ebone; ebone= ebone->next) {
+                       if (EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
                                /* roll func is a callback which assumes that all is well */
                                ebone->roll= ED_rollBoneToVector(ebone, vec, axis_only);
                        }
@@ -2082,8 +2082,8 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
        }
 
        if (arm->flag & ARM_MIRROR_EDIT) {
-               for(ebone= arm->edbo->first; ebone; ebone= ebone->next) {
-                       if((EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) == 0) {
+               for (ebone= arm->edbo->first; ebone; ebone= ebone->next) {
+                       if ((EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) == 0) {
                                EditBone *ebone_mirr= ED_armature_bone_get_mirrored(arm->edbo, ebone);
                                if (ebone_mirr && (EBONE_VISIBLE(arm, ebone_mirr) && EBONE_EDITABLE(ebone_mirr))) {
                                        ebone->roll= -ebone_mirr->roll;
@@ -2135,14 +2135,14 @@ static void undoBones_to_editBones(void *uarmv, void *armv, void *UNUSED(data))
        BLI_freelistN(arm->edbo);
        
        /* copy  */
-       for(ebo= uarm->lb.first; ebo; ebo= ebo->next) {
+       for (ebo= uarm->lb.first; ebo; ebo= ebo->next) {
                newebo= MEM_dupallocN(ebo);
                ebo->temp= newebo;
                BLI_addtail(arm->edbo, newebo);
        }
        
        /* active bone */
-       if(uarm->act_edbone) {
+       if (uarm->act_edbone) {
                ebo= uarm->act_edbone;
                arm->act_edbone= ebo->temp;
        }
@@ -2150,11 +2150,11 @@ static void undoBones_to_editBones(void *uarmv, void *armv, void *UNUSED(data))
                arm->act_edbone= NULL;
 
        /* set pointers */
-       for(newebo= arm->edbo->first; newebo; newebo= newebo->next) {
-               if(newebo->parent) newebo->parent= newebo->parent->temp;
+       for (newebo= arm->edbo->first; newebo; newebo= newebo->next) {
+               if (newebo->parent) newebo->parent= newebo->parent->temp;
        }
        /* be sure they don't hang ever */
-       for(newebo= arm->edbo->first; newebo; newebo= newebo->next) {
+       for (newebo= arm->edbo->first; newebo; newebo= newebo->next) {
                newebo->temp= NULL;
        }
 }
@@ -2168,21 +2168,21 @@ static void *editBones_to_undoBones(void *armv, void *UNUSED(obdata))
        uarm= MEM_callocN(sizeof(UndoArmature), "listbase undo");
        
        /* copy */
-       for(ebo= arm->edbo->first; ebo; ebo= ebo->next) {
+       for (ebo= arm->edbo->first; ebo; ebo= ebo->next) {
                newebo= MEM_dupallocN(ebo);
                ebo->temp= newebo;
                BLI_addtail(&uarm->lb, newebo);
        }
        
        /* active bone */
-       if(arm->act_edbone) {
+       if (arm->act_edbone) {
                ebo= arm->act_edbone;
                uarm->act_edbone= ebo->temp;
        }
 
        /* set pointers */
-       for(newebo= uarm->lb.first; newebo; newebo= newebo->next) {
-               if(newebo->parent) newebo->parent= newebo->parent->temp;
+       for (newebo= uarm->lb.first; newebo; newebo= newebo->next) {
+               if (newebo->parent) newebo->parent= newebo->parent->temp;
        }
        
        return uarm;
@@ -2199,7 +2199,7 @@ static void free_undoBones(void *uarmv)
 static void *get_armature_edit(bContext *C)
 {
        Object *obedit= CTX_data_edit_object(C);
-       if(obedit && obedit->type==OB_ARMATURE) {
+       if (obedit && obedit->type==OB_ARMATURE) {
                return obedit->data;
        }
        return NULL;
@@ -2541,7 +2541,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
        BLI_addtail(editbones, eBone);
        
        /* copy the ID property */
-       if(curBone->prop)
+       if (curBone->prop)
                eBone->prop= IDP_CopyProperty(curBone->prop);
 
        /* Lets duplicate the list of constraints that the
@@ -2557,7 +2557,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
                         */
                        channew= verify_pose_channel(dst_ob->pose, eBone->name);
 
-                       if(channew) {
+                       if (channew) {
                                duplicate_pose_channel_data(channew, chanold);
                        }
                }
@@ -2653,9 +2653,9 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *UNUSED(op))
        } 
        
        /* correct the active bone */
-       if(arm->act_edbone) {
+       if (arm->act_edbone) {
                eBone= arm->act_edbone;
-               if(eBone->temp)
+               if (eBone->temp)
                        arm->act_edbone= eBone->temp;
        }
 
@@ -3205,7 +3205,7 @@ static int armature_reveal_exec(bContext *C, wmOperator *UNUSED(op))
        EditBone *ebone;
        
        for (ebone = arm->edbo->first; ebone; ebone=ebone->next) {
-               if(arm->layer & ebone->layer) {
+               if (arm->layer & ebone->layer) {
                        if (ebone->flag & BONE_HIDDEN_A) {
                                ebone->flag |= (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL);
                                ebone->flag &= ~BONE_HIDDEN_A;
@@ -3281,7 +3281,7 @@ void show_all_armature_bones(Scene *scene)
        EditBone *ebone;
        
        for (ebone = arm->edbo->first; ebone; ebone=ebone->next) {
-               if(arm->layer & ebone->layer) {
+               if (arm->layer & ebone->layer) {
                        if (ebone->flag & BONE_HIDDEN_A) {
                                ebone->flag |= (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL);
                                ebone->flag &= ~BONE_HIDDEN_A;
@@ -3481,7 +3481,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
 
        copy_v3_v3(bone->head, curs);
        
-       if(rv3d && (U.flag & USER_ADD_VIEWALIGNED))
+       if (rv3d && (U.flag & USER_ADD_VIEWALIGNED))
                add_v3_v3v3(bone->tail, bone->head, imat[1]);   // bone with unit length 1
        else
                add_v3_v3v3(bone->tail, bone->head, imat[2]);   // bone with unit length 1, pointing up Z
@@ -3988,7 +3988,7 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
                        switch (action) {
                        case SEL_SELECT:
                                ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
-                               if(ebone->parent)
+                               if (ebone->parent)
                                        ebone->parent->flag |= (BONE_TIPSEL);
                                break;
                        case SEL_DESELECT:
@@ -4000,7 +4000,7 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
                                } 
                                else {
                                        ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
-                                       if(ebone->parent)
+                                       if (ebone->parent)
                                                ebone->parent->flag |= (BONE_TIPSEL);
                                }
                                break;
@@ -4312,7 +4312,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
                else {
                        if (nearBone->flag & BONE_SELECTED) {
                                /* if not active, we make it active */
-                               if(nearBone != arm->act_bone) {
+                               if (nearBone != arm->act_bone) {
                                        arm->act_bone= nearBone;
                                }
                                else {
@@ -4416,7 +4416,7 @@ static int bone_skinnable_cb(Object *ob, Bone *bone, void *datap)
        int a, segments;
        struct { Object *armob; void *list; int heat; } *data = datap;
 
-       if(!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
+       if (!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
                if (!(bone->flag & BONE_NO_DEFORM)) {
                        if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
                                segments = bone->segments;
@@ -4490,7 +4490,7 @@ static int dgroup_skinnable_cb(Object *ob, Bone *bone, void *datap)
                        else
                                segments = 1;
 
-                       if(!wpmode || ((arm->layer & bone->layer) && (bone->flag & BONE_SELECTED)))
+                       if (!wpmode || ((arm->layer & bone->layer) && (bone->flag & BONE_SELECTED)))
                                if (!(defgroup = defgroup_find_name(ob, bone->name)))
                                        defgroup = ED_vgroup_add_name(ob, bone->name);
                        
@@ -4710,7 +4710,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
                heat_bone_weighting(ob, mesh, verts, numbones, dgrouplist, dgroupflip,
                        root, tip, selected, &error);
                
-               if(error) {
+               if (error) {
                        BKE_report(reports, RPT_WARNING, error);
                }
        }
@@ -4739,7 +4739,7 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob,
         */
        bArmature *arm= par->data;
 
-       if(mode == ARM_GROUPS_NAME) {
+       if (mode == ARM_GROUPS_NAME) {
                /* Traverse the bone list, trying to create empty vertex 
                 * groups corresponding to the bone.
                 */
@@ -4748,7 +4748,7 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob,
                if (ob->type == OB_MESH)
                        ED_vgroup_data_create(ob->data);
        }
-       else if(mode == ARM_GROUPS_ENVELOPE || mode == ARM_GROUPS_AUTO) {
+       else if (mode == ARM_GROUPS_ENVELOPE || mode == ARM_GROUPS_AUTO) {
                /* Traverse the bone list, trying to create vertex groups 
                 * that are populated with the vertices for which the
                 * bone is closest.
@@ -5148,7 +5148,7 @@ static int hide_selected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
                if (bone->flag & BONE_SELECTED) {
                        bone->flag |= BONE_HIDDEN_P;
                        bone->flag &= ~BONE_SELECTED;
-                       if(arm->act_bone==bone)
+                       if (arm->act_bone==bone)
                                arm->act_bone= NULL;
                }
        }
@@ -5163,7 +5163,7 @@ static int hide_unselected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr
                // hrm... typo here?
                if ((bone->flag & BONE_SELECTED)==0) {
                        bone->flag |= BONE_HIDDEN_P;
-                       if(arm->act_bone==bone)
+                       if (arm->act_bone==bone)
                                arm->act_bone= NULL;
                }
        }
@@ -5176,7 +5176,7 @@ static int pose_hide_exec(bContext *C, wmOperator *op)
        Object *ob= object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm= ob->data;
 
-       if(RNA_boolean_get(op->ptr, "unselected"))
+       if (RNA_boolean_get(op->ptr, "unselected"))
                bone_looper(ob, arm->bonebase.first, NULL, hide_unselected_pose_bone_cb);
        else
                bone_looper(ob, arm->bonebase.first, NULL, hide_selected_pose_bone_cb);
@@ -5296,7 +5296,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
        char oldname[MAXBONENAME];
        
        /* names better differ! */
-       if(strncmp(oldnamep, newnamep, MAXBONENAME)) {
+       if (strncmp(oldnamep, newnamep, MAXBONENAME)) {
                
                /* we alter newname string... so make copy */
                BLI_strncpy(newname, newnamep, MAXBONENAME);
@@ -5371,7 +5371,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
                        
                        if (modifiers_usesArmature(ob, arm)) { 
                                bDeformGroup *dg= defgroup_find_name(ob, oldname);
-                               if(dg) {
+                               if (dg) {
                                        BLI_strncpy(dg->name, newname, MAXBONENAME);
                                }
                        }
@@ -5398,15 +5398,15 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
                /* correct view locking */
                {
                        bScreen *screen;
-                       for(screen= G.main->screen.first; screen; screen= screen->id.next) {
+                       for (screen= G.main->screen.first; screen; screen= screen->id.next) {
                                ScrArea *sa;
                                /* add regions */
-                               for(sa= screen->areabase.first; sa; sa= sa->next) {
+                               for (sa= screen->areabase.first; sa; sa= sa->next) {
                                        SpaceLink *sl;
                                        for (sl= sa->spacedata.first; sl; sl= sl->next) {
-                                               if(sl->spacetype==SPACE_VIEW3D) {
+                                               if (sl->spacetype==SPACE_VIEW3D) {
                                                        View3D *v3d= (View3D *)sl;
-                                                       if(v3d->ob_centre && v3d->ob_centre->data == arm) {
+                                                       if (v3d->ob_centre && v3d->ob_centre->data == arm) {
                                                                if (!strcmp(v3d->ob_centre_bone, oldname)) {
                                                                        BLI_strncpy(v3d->ob_centre_bone, newname, MAXBONENAME);
                                                                }
@@ -5480,7 +5480,7 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op)
        CTX_DATA_BEGIN(C, EditBone *, ebone, selected_editable_bones)
        {
                BLI_strncpy(newname, ebone->name, sizeof(newname));
-               if(bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]))
+               if (bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]))
                        ED_armature_bone_rename(arm, ebone->name, newname);
        }
        CTX_DATA_END;
@@ -5642,7 +5642,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode
                 * to let subsequent subdivision methods do their thing. 
                 * */
                if (parent == root) {
-                       if(parent==arm->act_edbone) arm->act_edbone= NULL;
+                       if (parent==arm->act_edbone) arm->act_edbone= NULL;
                        ED_armature_edit_bone_remove(arm, parent);
                        parent = NULL;
                }
@@ -5862,7 +5862,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg)
                                        EditBone *childBone = BLI_ghash_lookup(arcBoneMap, arc);
 
                                        /* find the root bone */
-                                       while(childBone->parent != NULL)
+                                       while (childBone->parent != NULL)
                                        {
                                                childBone = childBone->parent;
                                        }
index 375184d..2610183 100644 (file)
@@ -323,7 +323,7 @@ static RigGraph *newRigGraph(void)
        rg->free_node = NULL;
        
 #ifdef USE_THREADS
-//     if(G.scene->r.mode & R_FIXED_THREADS)
+//     if (G.scene->r.mode & R_FIXED_THREADS)
 //     {
 //             totthread = G.scene->r.threads;
 //     }
@@ -1008,7 +1008,7 @@ static void RIG_reconnectControlBones(RigGraph *rg)
                        /* look on deform bones first */
                        BLI_ghashIterator_init(&ghi, rg->bones_map);
                        
-                       for( ; !BLI_ghashIterator_isDone(&ghi); BLI_ghashIterator_step(&ghi))
+                       for ( ; !BLI_ghashIterator_isDone(&ghi); BLI_ghashIterator_step(&ghi))
                        {
                                EditBone *bone = (EditBone*)BLI_ghashIterator_getValue(&ghi);
                                
@@ -1298,7 +1298,7 @@ static void RIG_arcFromBoneChain(RigGraph *rg, ListBase *list, EditBone *root_bo
        RigArc *arc = NULL;
        int contain_head = 0;
        
-       for(bone = root_bone; bone; bone = nextEditBoneChild(list, bone, 0))
+       for (bone = root_bone; bone; bone = nextEditBoneChild(list, bone, 0))
        {
                int nb_children;
                
@@ -1550,7 +1550,7 @@ RigGraph *RIG_graphFromArmature(const bContext *C, Object *ob, bArmature *arm)
        rg->ob = ob;
 
        /* Do the rotations */
-       for (ebone = rg->editbones->first; ebone; ebone=ebone->next){
+       for (ebone = rg->editbones->first; ebone; ebone=ebone->next) {
                if (ebone->parent == NULL)
                {
                        RIG_arcFromBoneChain(rg, rg->editbones, ebone, NULL, 0);
@@ -1602,7 +1602,7 @@ static RigGraph *armatureSelectedToGraph(bContext *C, Object *ob, bArmature *arm
        rg->ob = ob;
 
        /* Do the rotations */
-       for (ebone = rg->editbones->first; ebone; ebone=ebone->next){
+       for (ebone = rg->editbones->first; ebone; ebone=ebone->next) {
                if (ebone->parent == NULL)
                {
                        RIG_arcFromBoneChain(rg, rg->editbones, ebone, NULL, 1);
@@ -2488,7 +2488,7 @@ static void markMultiResolutionChildArc(ReebNode *end_enode, ReebNode *enode)
 {
        int i;
        
-       for(i = 0; i < enode->degree; i++)
+       for (i = 0; i < enode->degree; i++)
        {
                ReebArc *earc = (ReebArc*)enode->arcs[i];
                
@@ -2593,7 +2593,7 @@ static void findCorrespondingArc(RigGraph *rigg, RigArc *start_arc, RigNode *sta
 //             RIG_printArcBones(next_iarc);
 //     }
        
-       for(i = 0; i < enode->degree; i++)
+       for (i = 0; i < enode->degree; i++)
        {
                next_earc = (ReebArc*)enode->arcs[i];
                
@@ -2644,14 +2644,14 @@ static void findCorrespondingArc(RigGraph *rigg, RigArc *start_arc, RigNode *sta
 //             printf("flag %i -- level %i -- flag %i -- group %i\n", ARC_FREE, symmetry_level, symmetry_flag, symmetry_group);
 //             
 //             printf("CANDIDATES\n");
-//             for(i = 0; i < enode->degree; i++)
+//             for (i = 0; i < enode->degree; i++)
 //             {
 //                     next_earc = (ReebArc*)enode->arcs[i];
 //                     printf("flag %i -- level %i -- flag %i -- group %i\n", next_earc->flag, next_earc->symmetry_level, next_earc->symmetry_flag, next_earc->symmetry_group);
 //             }
                
                /* Emergency matching */
-               for(i = 0; i < enode->degree; i++)
+               for (i = 0; i < enode->degree; i++)
                {
                        next_earc = (ReebArc*)enode->arcs[i];
                        
@@ -2687,7 +2687,7 @@ static void retargetSubgraph(bContext *C, RigGraph *rigg, RigArc *start_arc, Rig
                matchMultiResolutionNode(rigg, inode, enode);
        }
        
-       for(i = 0; i < inode->degree; i++)
+       for (i = 0; i < inode->degree; i++)
        {
                RigArc *next_iarc = (RigArc*)inode->arcs[i];
                
index f9f3cd6..81b020a 100644 (file)
@@ -1870,7 +1870,7 @@ int sk_detectCommandGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UN
                SK_Intersection *isect, *self_isect;
 
                /* get the the last intersection of the first pair */
-               for( isect = gest->intersections.first; isect; isect = isect->next )
+               for ( isect = gest->intersections.first; isect; isect = isect->next )
                {
                        if (isect->stroke == isect->next->stroke)
                        {
@@ -1897,7 +1897,7 @@ void sk_applyCommandGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UN
 
 //     XXX
 //     command = pupmenu("Action %t|Flatten %x1|Straighten %x2|Polygonize %x3");
-       if(command < 1) return;
+       if (command < 1) return;
 
        for (isect = gest->intersections.first; isect; isect = isect->next)
        {
@@ -2177,7 +2177,7 @@ static int sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], in
        {
                int besthitresult = -1;
 
-               if(hits == 1) {
+               if (hits == 1) {
                        besthitresult = buffer[3];
                }
                else {
index de9b4a8..4c1315e 100644 (file)
@@ -142,7 +142,7 @@ static void laplacian_increase_edge_count(EdgeHash *edgehash, int v1, int v2)
 {
        void **p = BLI_edgehash_lookup_p(edgehash, v1, v2);
 
-       if(p)
+       if (p)
                *p = (void*)((intptr_t)*p + (intptr_t)1);
        else
                BLI_edgehash_insert(edgehash, v1, v2, (void*)(intptr_t)1);
@@ -184,8 +184,8 @@ static void laplacian_triangle_area(LaplacianSystem *sys, int i1, int i2, int i3
        t3= cotan_weight(v3, v1, v2);
 
        if     (angle_v3v3v3(v2, v1, v3) > DEG2RADF(90.0f)) obtuse= 1;
-       else if(angle_v3v3v3(v1, v2, v3) > DEG2RADF(90.0f)) obtuse= 2;
-       else if(angle_v3v3v3(v1, v3, v2) > DEG2RADF(90.0f)) obtuse= 3;
+       else if (angle_v3v3v3(v1, v2, v3) > DEG2RADF(90.0f)) obtuse= 2;
+       else if (angle_v3v3v3(v1, v3, v2) > DEG2RADF(90.0f)) obtuse= 3;
 
        if (obtuse > 0) {
                area= area_tri_v3(v1, v2, v3);
@@ -237,7 +237,7 @@ static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, int
        nlMatrixAdd(i3, i1, -t2*varea[i3]);
        nlMatrixAdd(i1, i3, -t2*varea[i1]);
 
-       if(sys->storeweights) {
+       if (sys->storeweights) {
                sys->fweights[f][0]= t1*varea[i1];
                sys->fweights[f][1]= t2*varea[i2];
                sys->fweights[f][2]= t3*varea[i3];
@@ -263,7 +263,7 @@ static LaplacianSystem *laplacian_system_construct_begin(int totvert, int totfac
        /* create opennl context */
        nlNewContext();
        nlSolverParameteri(NL_NB_VARIABLES, totvert);
-       if(lsq)
+       if (lsq)
                nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
 
        sys->context= nlGetCurrent();
@@ -296,39 +296,39 @@ static void laplacian_system_construct_end(LaplacianSystem *sys)
        sys->varea= MEM_callocN(sizeof(float)*totvert, "LaplacianSystemVarea");
 
        sys->edgehash= BLI_edgehash_new();
-       for(a=0, face=sys->faces; a<sys->totface; a++, face++) {
+       for (a=0, face=sys->faces; a<sys->totface; a++, face++) {
                laplacian_increase_edge_count(sys->edgehash, (*face)[0], (*face)[1]);
                laplacian_increase_edge_count(sys->edgehash, (*face)[1], (*face)[2]);
                laplacian_increase_edge_count(sys->edgehash, (*face)[2], (*face)[0]);
        }
 
-       if(sys->areaweights)
-               for(a=0, face=sys->faces; a<sys->totface; a++, face++)
+       if (sys->areaweights)
+               for (a=0, face=sys->faces; a<sys->totface; a++, face++)
                        laplacian_triangle_area(sys, (*face)[0], (*face)[1], (*face)[2]);
        
-       for(a=0; a<totvert; a++) {
-               if(sys->areaweights) {
-                       if(sys->varea[a] != 0.0f)
+       for (a=0; a<totvert; a++) {
+               if (sys->areaweights) {
+                       if (sys->varea[a] != 0.0f)
                                sys->varea[a]= 0.5f/sys->varea[a];
                }
                else
                        sys->varea[a]= 1.0f;
 
                /* for heat weighting */
-               if(sys->heat.H)
+               if (sys->heat.H)
                        nlMatrixAdd(a, a, sys->heat.H[a]);
        }
 
-       if(sys->storeweights)
+       if (sys->storeweights)
                sys->fweights= MEM_callocN(sizeof(float)*3*totface, "LaplacianFWeight");
        
-       for(a=0, face=sys->faces; a<totface; a++, face++)
+       for (a=0, face=sys->faces; a<totface; a++, face++)
                laplacian_triangle_weights(sys, a, (*face)[0], (*face)[1], (*face)[2]);
 
        MEM_freeN(sys->faces);
        sys->faces= NULL;
 
-       if(sys->varea) {
+       if (sys->varea) {
                MEM_freeN(sys->varea);
                sys->varea= NULL;
        }
@@ -339,11 +339,11 @@ static void laplacian_system_construct_end(LaplacianSystem *sys)
 
 static void laplacian_system_delete(LaplacianSystem *sys)
 {
-       if(sys->verts) MEM_freeN(sys->verts);
-       if(sys->varea) MEM_freeN(sys->varea);
-       if(sys->vpinned) MEM_freeN(sys->vpinned);
-       if(sys->faces) MEM_freeN(sys->faces);
-       if(sys->fweights) MEM_freeN(sys->fweights);
+       if (sys->verts) MEM_freeN(sys->verts);
+       if (sys->varea) MEM_freeN(sys->varea);
+       if (sys->vpinned) MEM_freeN(sys->vpinned);
+       if (sys->faces) MEM_freeN(sys->faces);
+       if (sys->fweights) MEM_freeN(sys->fweights);
 
        nlDeleteContext(sys->context);
        MEM_freeN(sys);
@@ -356,9 +356,9 @@ void laplacian_begin_solve(LaplacianSystem *sys, int index)
        if (!sys->nlbegun) {
                nlBegin(NL_SYSTEM);
 
-               if(index >= 0) {
-                       for(a=0; a<sys->totvert; a++) {
-                               if(sys->vpinned[a]) {
+               if (index >= 0) {
+                       for (a=0; a<sys->totvert; a++) {
+                               if (sys->vpinned[a]) {
                                        nlSetVariable(0, a, sys->verts[a][index]);
                                        nlLockVariable(a);
                                }
@@ -415,9 +415,9 @@ static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray
 
        mul_v3_v3fl(dir, data->vec, hit->dist);
 
-       if(isect_ray_tri_v3(data->start, dir, verts[mf->v1], verts[mf->v2], verts[mf->v3], &lambda, uv)) {
+       if (isect_ray_tri_v3(data->start, dir, verts[mf->v1], verts[mf->v2], verts[mf->v3], &lambda, uv)) {
                normal_tri_v3(n, verts[mf->v1], verts[mf->v2], verts[mf->v3]);
-               if(lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
+               if (lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
                        hit->index = index;
                        hit->dist *= lambda;
                }
@@ -425,9 +425,9 @@ static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray
 
        mul_v3_v3fl(dir, data->vec, hit->dist);
 
-       if(isect_ray_tri_v3(data->start, dir, verts[mf->v1], verts[mf->v3], verts[mf->v4], &lambda, uv)) {
+       if (isect_ray_tri_v3(data->start, dir, verts[mf->v1], verts[mf->v3], verts[mf->v4], &lambda, uv)) {
                normal_tri_v3(n, verts[mf->v1], verts[mf->v3], verts[mf->v4]);
-               if(lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
+               if (lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
                        hit->index = index;
                        hit->dist *= lambda;
                }
@@ -446,7 +446,7 @@ static void heat_ray_tree_create(LaplacianSystem *sys)
        sys->heat.bvhtree = BLI_bvhtree_new(totface, 0.0f, 4, 6);
        sys->heat.vface = MEM_callocN(sizeof(MFace*)*totvert, "HeatVFaces");
 
-       for(a=0; a<totface; a++) {
+       for (a=0; a<totface; a++) {
                MFace *mf = mface+a;
                float bb[6];
 
@@ -454,7 +454,7 @@ static void heat_ray_tree_create(LaplacianSystem *sys)
                DO_MINMAX(verts[mf->v1], bb, bb+3);
                DO_MINMAX(verts[mf->v2], bb, bb+3);
                DO_MINMAX(verts[mf->v3], bb, bb+3);
-               if(mf->v4) {
+               if (mf->v4) {
                        DO_MINMAX(verts[mf->v4], bb, bb+3);
                }
 
@@ -464,7 +464,7 @@ static void heat_ray_tree_create(LaplacianSystem *sys)
                sys->heat.vface[mf->v1]= mf;
                sys->heat.vface[mf->v2]= mf;
                sys->heat.vface[mf->v3]= mf;
-               if(mf->v4) sys->heat.vface[mf->v4]= mf;
+               if (mf->v4) sys->heat.vface[mf->v4]= mf;
        }
 
        BLI_bvhtree_balance(sys->heat.bvhtree); 
@@ -479,13 +479,13 @@ static int heat_ray_source_visible(LaplacianSystem *sys, int vertex, int source)
        int visible;
 
        mface= sys->heat.vface[vertex];
-       if(!mface)
+       if (!mface)
                return 1;
 
        data.sys= sys;
        copy_v3_v3(data.start, sys->heat.verts[vertex]);
 
-       if(sys->heat.root) /* bone */
+       if (sys->heat.root) /* bone */
                closest_to_line_segment_v3(end, data.start,
                        sys->heat.root[source], sys->heat.tip[source]);
        else /* vertex */
@@ -509,7 +509,7 @@ static float heat_source_distance(LaplacianSystem *sys, int vertex, int source)
        float closest[3], d[3], dist, cosine;
        
        /* compute euclidian distance */
-       if(sys->heat.root) /* bone */
+       if (sys->heat.root) /* bone */
                closest_to_line_segment_v3(closest, sys->heat.verts[vertex],
                        sys->heat.root[source], sys->heat.tip[source]);
        else /* vertex */
@@ -530,8 +530,8 @@ static int heat_source_closest(LaplacianSystem *sys, int vertex, int source)
 
        dist= heat_source_distance(sys, vertex, source);
 
-       if(dist <= sys->heat.mindist[vertex]*(1.0f + DISTANCE_EPSILON))
-               if(heat_ray_source_visible(sys, vertex, source))
+       if (dist <= sys->heat.mindist[vertex]*(1.0f + DISTANCE_EPSILON))
+               if (heat_ray_source_visible(sys, vertex, source))
                        return 1;
                
        return 0;
@@ -545,24 +545,24 @@ static void heat_set_H(LaplacianSystem *sys, int vertex)
        mindist= 1e10;
 
        /* compute minimum distance */
-       for(j=0; j<sys->heat.numsource; j++) {
+       for (j=0; j<sys->heat.numsource; j++) {
                dist= heat_source_distance(sys, vertex, j);
 
-               if(dist < mindist)
+               if (dist < mindist)
                        mindist= dist;
        }
 
        sys->heat.mindist[vertex]= mindist;
 
        /* count number of sources with approximately this minimum distance */
-       for(j=0; j<sys->heat.numsource; j++)
-               if(heat_source_closest(sys, vertex, j))
+       for (j=0; j<sys->heat.numsource; j++)
+               if (heat_source_closest(sys, vertex, j))
                        numclosest++;
 
        sys->heat.p[vertex]= (numclosest > 0)? 1.0f/numclosest: 0.0f;
 
        /* compute H entry */
-       if(numclosest > 0) {
+       if (numclosest > 0) {
                mindist= maxf(mindist, 1e-4f);
                h= numclosest*C_WEIGHT/(mindist*mindist);
        }
@@ -579,7 +579,7 @@ static void heat_calc_vnormals(LaplacianSystem *sys)
 
        sys->heat.vnors= MEM_callocN(sizeof(float)*3*sys->totvert, "HeatVNors");
 
-       for(a=0, face=sys->faces; a<sys->totface; a++, face++) {
+       for (a=0, face=sys->faces; a<sys->totface; a++, face++) {
                v1= (*face)[0];
                v2= (*face)[1];
                v3= (*face)[2];
@@ -591,7 +591,7 @@ static void heat_calc_vnormals(LaplacianSystem *sys)
                add_v3_v3(sys->heat.vnors[v3], fnor);
        }
 
-       for(a=0; a<sys->totvert; a++)
+       for (a=0; a<sys->totvert; a++)
                normalize_v3(sys->heat.vnors[a]);
 }
 
@@ -608,19 +608,19 @@ static void heat_laplacian_create(LaplacianSystem *sys)
        sys->heat.p= MEM_callocN(sizeof(float)*totvert, "HeatP");
 
        /* add verts and faces to laplacian */
-       for(a=0; a<totvert; a++)
+       for (a=0; a<totvert; a++)
                laplacian_add_vertex(sys, sys->heat.verts[a], 0);
 
-       for(a=0, mf=mface; a<totface; a++, mf++) {
+       for (a=0, mf=mface; a<totface; a++, mf++) {
                laplacian_add_triangle(sys, mf->v1, mf->v2, mf->v3);
-               if(mf->v4)
+               if (mf->v4)
                        laplacian_add_triangle(sys, mf->v1, mf->v3, mf->v4);
        }
 
        /* for distance computation in set_H */
        heat_calc_vnormals(sys);
 
-       for(a=0; a<totvert; a++)
+       for (a=0; a<totvert; a++)
                heat_set_H(sys, a);
 }
 
@@ -639,10 +639,10 @@ static float heat_limit_weight(float weight)
 {
        float t;
 
-       if(weight < WEIGHT_LIMIT_END) {
+       if (weight < WEIGHT_LIMIT_END) {
                return 0.0f;
        }
-       else if(weight < WEIGHT_LIMIT_START) {
+       else if (weight < WEIGHT_LIMIT_START) {
                t= (weight - WEIGHT_LIMIT_END)/(WEIGHT_LIMIT_START - WEIGHT_LIMIT_END);
                return t*WEIGHT_LIMIT_START;
        }
@@ -667,15 +667,15 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
        *err_str= NULL;
 
        /* count triangles and create mask */
-       if(     (use_face_sel= (me->editflag & ME_EDIT_PAINT_MASK) != 0) ||
+       if (     (use_face_sel= (me->editflag & ME_EDIT_PAINT_MASK) != 0) ||
                (use_vert_sel= ((me->editflag & ME_EDIT_VERT_SEL) != 0)))
        {
                mask= MEM_callocN(sizeof(int)*me->totvert, "heat_bone_weighting mask");
        }
 
-       for(a = 0, mp=me->mpoly; a < me->totpoly; mp++, a++) {
+       for (a = 0, mp=me->mpoly; a < me->totpoly; mp++, a++) {
                /*  (added selectedVerts content for vertex mask, they used to just equal 1) */
-               if(use_vert_sel) {
+               if (use_vert_sel) {
                        for (j = 0, ml = me->mloop + mp->loopstart; j < mp->totloop; j++, ml++) {
                                if (use_vert_sel) {
                                        mask[ml->v] = (mvert[ml->v].flag & SELECT) != 0;
@@ -694,9 +694,9 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
        /* bone heat needs triangulated faces */
        BKE_mesh_tessface_ensure(me);
 
-       for(tottri = 0, a = 0, mf = me->mface; a < me->totface; mf++, a++) {
+       for (tottri = 0, a = 0, mf = me->mface; a < me->totface; mf++, a++) {
                tottri++;
-               if(mf->v4) tottri++;
+               if (mf->v4) tottri++;
        }
 
        /* create laplacian */
@@ -715,15 +715,15 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
 
        laplacian_system_construct_end(sys);
 
-       if(dgroupflip) {
+       if (dgroupflip) {
                vertsflipped = MEM_callocN(sizeof(int)*me->totvert, "vertsflipped");
-               for(a=0; a<me->totvert; a++)
+               for (a=0; a<me->totvert; a++)
                        vertsflipped[a] = mesh_get_x_mirror_vert(ob, a);
        }
        
        /* compute weights per bone */
-       for(j=0; j<numsource; j++) {
-               if(!selected[j])
+       for (j=0; j<numsource; j++) {
+               if (!selected[j])
                        continue;
 
                firstsegment= (j == 0 || dgrouplist[j-1] != dgrouplist[j]);
@@ -731,13 +731,13 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
                bbone= !(firstsegment && lastsegment);
 
                /* clear weights */
-               if(bbone && firstsegment) {
-                       for(a=0; a<me->totvert; a++) {
-                               if(mask && !mask[a])
+               if (bbone && firstsegment) {
+                       for (a=0; a<me->totvert; a++) {
+                               if (mask && !mask[a])
                                        continue;
 
                                ED_vgroup_vert_remove(ob, dgrouplist[j], a);
-                               if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0)
+                               if (vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0)
                                        ED_vgroup_vert_remove(ob, dgroupflip[j], vertsflipped[a]);
                        }
                }
@@ -745,28 +745,28 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
                /* fill right hand side */
                laplacian_begin_solve(sys, -1);
 
-               for(a=0; a<me->totvert; a++)
-                       if(heat_source_closest(sys, a, j))
+               for (a=0; a<me->totvert; a++)
+                       if (heat_source_closest(sys, a, j))
                                laplacian_add_right_hand_side(sys, a,
                                        sys->heat.H[a]*sys->heat.p[a]);
 
                /* solve */
-               if(laplacian_system_solve(sys)) {
+               if (laplacian_system_solve(sys)) {
                        /* load solution into vertex groups */
-                       for(a=0; a<me->totvert; a++) {
-                               if(mask && !mask[a])
+                       for (a=0; a<me->totvert; a++) {
+                               if (mask && !mask[a])
                                        continue;
 
                                solution= laplacian_system_get_solution(a);
                                
-                               if(bbone) {
-                                       if(solution > 0.0f)
+                               if (bbone) {
+                                       if (solution > 0.0f)
                                                ED_vgroup_vert_add(ob, dgrouplist[j], a, solution,
                                                        WEIGHT_ADD);
                                }
                                else {
                                        weight= heat_limit_weight(solution);
-                                       if(weight > 0.0f)
+                                       if (weight > 0.0f)
                                                ED_vgroup_vert_add(ob, dgrouplist[j], a, weight,
                                                        WEIGHT_REPLACE);
                                        else
@@ -774,15 +774,15 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
                                }
 
                                /* do same for mirror */
-                               if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
-                                       if(bbone) {
-                                               if(solution > 0.0f)
+                               if (vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
+                                       if (bbone) {
+                                               if (solution > 0.0f)
                                                        ED_vgroup_vert_add(ob, dgroupflip[j], vertsflipped[a],
                                                                solution, WEIGHT_ADD);
                                        }
                                        else {
                                                weight= heat_limit_weight(solution);
-                                               if(weight > 0.0f)
+                                               if (weight > 0.0f)
                                                        ED_vgroup_vert_add(ob, dgroupflip[j], vertsflipped[a],
                                                                weight, WEIGHT_REPLACE);
                                                else
@@ -791,26 +791,26 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
                                }
                        }
                }
-               else if(*err_str == NULL) {
+               else if (*err_str == NULL) {
                        *err_str= "Bone Heat Weighting: failed to find solution for one or more bones";
                        break;
                }
 
                /* remove too small vertex weights */
-               if(bbone && lastsegment) {
-                       for(a=0; a<me->totvert; a++) {
-                               if(mask && !mask[a])
+               if (bbone && lastsegment) {
+                       for (a=0; a<me->totvert; a++) {
+                               if (mask && !mask[a])
                                        continue;
 
                                weight= ED_vgroup_vert_weight(ob, dgrouplist[j], a);
                                weight= heat_limit_weight(weight);
-                               if(weight <= 0.0f)
+                               if (weight <= 0.0f)
                                        ED_vgroup_vert_remove(ob, dgrouplist[j], a);
 
-                               if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
+                               if (vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
                                        weight= ED_vgroup_vert_weight(ob, dgroupflip[j], vertsflipped[a]);
                                        weight= heat_limit_weight(weight);
-                                       if(weight <= 0.0f)
+                                       if (weight <= 0.0f)
                                                ED_vgroup_vert_remove(ob, dgroupflip[j], vertsflipped[a]);
                                }
                        }
@@ -818,8 +818,8 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
        }
 
        /* free */
-       if(vertsflipped) MEM_freeN(vertsflipped);
-       if(mask) MEM_freeN(mask);
+       if (vertsflipped) MEM_freeN(vertsflipped);
+       if (mask) MEM_freeN(mask);
 
        heat_system_free(sys);
 
@@ -903,7 +903,7 @@ void rigid_deform_iteration()
        EditFace *efa;
        int a, i;
 
-       if(!sys)
+       if (!sys)
                return;
        
        nlMakeCurrent(sys->context);
@@ -913,12 +913,12 @@ void rigid_deform_iteration()
        memset(sys->rigid.R, 0, sizeof(float)*3*3*sys->totvert);
        memset(sys->rigid.rhs, 0, sizeof(float)*3*sys->totvert);
 
-       for(a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
+       for (a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
                rigid_add_edge_to_R(sys, efa->v1, efa->v2, sys->fweights[a][2]);
                rigid_add_edge_to_R(sys, efa->v2, efa->v3, sys->fweights[a][0]);
                rigid_add_edge_to_R(sys, efa->v3, efa->v1, sys->fweights[a][1]);
 
-               if(efa->v4) {
+               if (efa->v4) {
                        a++;
                        rigid_add_edge_to_R(sys, efa->v1, efa->v3, sys->fweights[a][2]);
                        rigid_add_edge_to_R(sys, efa->v3, efa->v4, sys->fweights[a][0]);
@@ -926,18 +926,18 @@ void rigid_deform_iteration()
                }
        }
 
-       for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
+       for (a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
                rigid_orthogonalize_R(sys->rigid.R[a]);
                eve->tmp.l= a;
        }
        
        /* compute right hand sides for solving */
-       for(a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
+       for (a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
                rigid_add_edge_to_rhs(sys, efa->v1, efa->v2, sys->fweights[a][2]);
                rigid_add_edge_to_rhs(sys, efa->v2, efa->v3, sys->fweights[a][0]);
                rigid_add_edge_to_rhs(sys, efa->v3, efa->v1, sys->fweights[a][1]);
 
-               if(efa->v4) {
+               if (efa->v4) {
                        a++;
                        rigid_add_edge_to_rhs(sys, efa->v1, efa->v3, sys->fweights[a][2]);
                        rigid_add_edge_to_rhs(sys, efa->v3, efa->v4, sys->fweights[a][0]);
@@ -946,19 +946,19 @@ void rigid_deform_iteration()
        }
 
        /* solve for positions, for X,Y and Z separately */
-       for(i=0; i<3; i++) {
+       for (i=0; i<3; i++) {
                laplacian_begin_solve(sys, i);
 
-               for(a=0; a<sys->totvert; a++)
-                       if(!sys->vpinned[a])
+               for (a=0; a<sys->totvert; a++)
+                       if (!sys->vpinned[a])
                                laplacian_add_right_hand_side(sys, a, sys->rigid.rhs[a][i]);
 
-               if(laplacian_system_solve(sys)) {
-                       for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
+               if (laplacian_system_solve(sys)) {
+                       for (a=0, eve=em->verts.first; eve; eve=eve->next, a++)
                                eve->co[i]= laplacian_system_get_solution(a);
                }
                else {
-                       if(!sys->rigid.thrownerror) {
+                       if (!sys->rigid.thrownerror) {
                                error("RigidDeform: failed to find solution");
                                sys->rigid.thrownerror= 1;
                        }
@@ -975,15 +975,15 @@ static void rigid_laplacian_create(LaplacianSystem *sys)
        int a;
 
        /* add verts and faces to laplacian */
-       for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
+       for (a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
                laplacian_add_vertex(sys, eve->co, eve->pinned);
                eve->tmp.l= a;
        }
 
-       for(efa=em->faces.first; efa; efa=efa->next) {
+       for (efa=em->faces.first; efa; efa=efa->next) {
                laplacian_add_triangle(sys,
                        efa->v1->tmp.l, efa->v2->tmp.l, efa->v3->tmp.l);
-               if(efa->v4)
+               if (efa->v4)
                        laplacian_add_triangle(sys,
                                efa->v1->tmp.l, efa->v3->tmp.l, efa->v4->tmp.l);
        }
@@ -997,12 +997,12 @@ void rigid_deform_begin(EditMesh *em)
        int a, totvert, totface;
 
        /* count vertices, triangles */
-       for(totvert=0, eve=em->verts.first; eve; eve=eve->next)
+       for (totvert=0, eve=em->verts.first; eve; eve=eve->next)
                totvert++;
 
-       for(totface=0, efa=em->faces.first; efa; efa=efa->next) {
+       for (totface=0, efa=em->faces.first; efa; efa=efa->next) {
                totface++;
-               if(efa->v4) totface++;
+               if (efa->v4) totface++;
        }
 
        /* create laplacian */
@@ -1013,7 +1013,7 @@ void rigid_deform_begin(EditMesh *em)
        sys->rigid.rhs = MEM_callocN(sizeof(float)*3*totvert, "RigidDeformRHS");
        sys->rigid.origco = MEM_callocN(sizeof(float)*3*totvert, "RigidDeformCo");
 
-       for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
+       for (a=0, eve=em->verts.first; eve; eve=eve->next, a++)
                copy_v3_v3(sys->rigid.origco[a], eve->co);
 
        sys->areaweights= 0;
@@ -1030,19 +1030,19 @@ void rigid_deform_end(int cancel)
 {
        LaplacianSystem *sys = RigidDeformSystem;
 
-       if(sys) {
+       if (sys) {
                EditMesh *em = sys->rigid.mesh;
                EditVert *eve;
                int a;
 
-               if(cancel)
-                       for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
-                               if(!eve->pinned)
+               if (cancel)
+                       for (a=0, eve=em->verts.first; eve; eve=eve->next, a++)
+                               if (!eve->pinned)
                                        copy_v3_v3(eve->co, sys->rigid.origco[a]);
 
-               if(sys->rigid.R) MEM_freeN(sys->rigid.R);
-               if(sys->rigid.rhs) MEM_freeN(sys->rigid.rhs);
-               if(sys->rigid.origco) MEM_freeN(sys->rigid.origco);
+               if (sys->rigid.R) MEM_freeN(sys->rigid.R);
+               if (sys->rigid.rhs) MEM_freeN(sys->rigid.rhs);
+               if (sys->rigid.origco) MEM_freeN(sys->rigid.origco);
 
                /* free */
                laplacian_system_delete(sys);
@@ -1176,10 +1176,10 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
        /* check if it is within the length of the line segment */
        sub_v3_v3v3(isectdir, isectco, orig);
 
-       if(dot_v3v3(dir, isectdir) < -EPSILON)
+       if (dot_v3v3(dir, isectdir) < -EPSILON)
                return 0;
        
-       if(dot_v3v3(dir, dir) + EPSILON < dot_v3v3(isectdir, isectdir))
+       if (dot_v3v3(dir, dir) + EPSILON < dot_v3v3(isectdir, isectdir))
                return 0;
 
        return 1;
@@ -1198,16 +1198,16 @@ static int meshdeform_intersect(MeshDeformBind *mdb, MeshDeformIsect *isec)
 
        add_v3_v3v3(end, isec->start, isec->vec);
 
-       for(f=0; f<totface; f++, mface++) {
+       for (f=0; f<totface; f++, mface++) {
                copy_v3_v3(face[0], mdb->cagecos[mface->v1]);
                copy_v3_v3(face[1], mdb->cagecos[mface->v2]);
                copy_v3_v3(face[2], mdb->cagecos[mface->v3]);
 
-               if(mface->v4) {
+               if (mface->v4) {
                        copy_v3_v3(face[3], mdb->cagecos[mface->v4]);
                        hit = meshdeform_tri_intersect(isec->start, end, face[0], face[1], face[2], co, uvw);
 
-                       if(hit) {
+                       if (hit) {
                                normal_tri_v3( nor,face[0], face[1], face[2]);
                        }
                        else {
@@ -1220,9 +1220,9 @@ static int meshdeform_intersect(MeshDeformBind *mdb, MeshDeformIsect *isec)
                        normal_tri_v3( nor,face[0], face[1], face[2]);
                }
 
-               if(hit) {
+               if (hit) {
                        len= len_v3v3(isec->start, co)/len_v3v3(isec->start, end);
-                       if(len < isec->labda) {
+                       if (len < isec->labda) {
                                isec->labda= len;
                                isec->face = mface;
                                isec->isect= (dot_v3v3(isec->vec, nor) <= 0.0f);
@@ -1251,7 +1251,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
        add_v3_v3v3(end, co2, epsilon);
        sub_v3_v3v3(isec.vec, end, isec.start);
 
-       if(meshdeform_intersect(mdb, &isec)) {
+       if (meshdeform_intersect(mdb, &isec)) {
                len= isec.labda;
                mface=(MFace*)isec.face;
 
@@ -1264,7 +1264,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
                isect->co[2]= co1[2] + isec.vec[2]*len;
 
                isect->len= len_v3v3(co1, isect->co);
-               if(isect->len < MESHDEFORM_LEN_THRESHOLD)
+               if (isect->len < MESHDEFORM_LEN_THRESHOLD)
                        isect->len= MESHDEFORM_LEN_THRESHOLD;
 
                isect->v[0]= mface->v1;
@@ -1280,7 +1280,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
                copy_v3_v3(vert[0], cagecos[mface->v1]);
                copy_v3_v3(vert[1], cagecos[mface->v2]);
                copy_v3_v3(vert[2], cagecos[mface->v3]);
-               if(mface->v4) copy_v3_v3(vert[3], cagecos[mface->v4]);
+               if (mface->v4) copy_v3_v3(vert[3], cagecos[mface->v4]);
                interp_weights_poly_v3( isect->uvw,vert, isect->nvert, isect->co);
 
                return isect;
@@ -1295,7 +1295,7 @@ static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co)
        float outside[3], start[3], dir[3];
        int i;
 
-       for(i=1; i<=6; i++) {
+       for (i=1; i<=6; i++) {
                outside[0] = co[0] + (mdb->max[0] - mdb->min[0] + 1.0f)*MESHDEFORM_OFFSET[i][0];
                outside[1] = co[1] + (mdb->max[1] - mdb->min[1] + 1.0f)*MESHDEFORM_OFFSET[i][1];
                outside[2] = co[2] + (mdb->max[2] - mdb->min[2] + 1.0f)*MESHDEFORM_OFFSET[i][2];
@@ -1305,7 +1305,7 @@ static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co)
                normalize_v3(dir);
                
                isect = meshdeform_ray_tree_intersect(mdb, start, outside);
-               if(isect && !isect->facing)
+               if (isect && !isect->facing)
                        return 1;
        }
 
@@ -1322,11 +1322,11 @@ static int meshdeform_index(MeshDeformBind *mdb, int x, int y, int z, int n)
        y += MESHDEFORM_OFFSET[n][1];
        z += MESHDEFORM_OFFSET[n][2];
 
-       if(x < 0 || x >= mdb->size)
+       if (x < 0 || x >= mdb->size)
                return -1;
-       if(y < 0 || y >= mdb->size)
+       if (y < 0 || y >= mdb->size)
                return -1;
-       if(z < 0 || z >= mdb->size)
+       if (z < 0 || z >= mdb->size)
                return -1;
 
        return x + y*size + z*size*size;
@@ -1353,14 +1353,14 @@ static void meshdeform_add_intersections(MeshDeformBind *mdb, int x, int y, int
        meshdeform_cell_center(mdb, x, y, z, 0, center);
 
        /* check each outgoing edge for intersection */
-       for(i=1; i<=6; i++) {
-               if(meshdeform_index(mdb, x, y, z, i) == -1)
+       for (i=1; i<=6; i++) {
+               if (meshdeform_index(mdb, x, y, z, i) == -1)
                        continue;
 
                meshdeform_cell_center(mdb, x, y, z, i, ncenter);
 
                isect= meshdeform_ray_tree_intersect(mdb, center, ncenter);
-               if(isect) {
+               if (isect) {
                        mdb->boundisect[a][i-1]= isect;
                        mdb->tag[a]= MESHDEFORM_TAG_BOUNDARY;
                }
@@ -1380,18 +1380,18 @@ static void meshdeform_bind_floodfill(MeshDeformBind *mdb)
        stacksize= 1;
 
        /* floodfill exterior tag */
-       while(stacksize > 0) {
+       while (stacksize > 0) {
                a= stack[--stacksize];
 
                xyz[2]= a/(size*size);
                xyz[1]= (a - xyz[2]*size*size)/size;
                xyz[0]= a - xyz[1]*size - xyz[2]*size*size;
 
-               for(i=1; i<=6; i++) {
+               for (i=1; i<=6; i++) {
                        b= meshdeform_index(mdb, xyz[0], xyz[1], xyz[2], i);
 
-                       if(b != -1) {
-                               if(tag[b] == MESHDEFORM_TAG_UNTYPED ||
+                       if (b != -1) {
+                               if (tag[b] == MESHDEFORM_TAG_UNTYPED ||
                                   (tag[b] == MESHDEFORM_TAG_BOUNDARY && !mdb->boundisect[a][i-1])) {
                                        tag[b]= MESHDEFORM_TAG_EXTERIOR;
                                        stack[stacksize++]= b;
@@ -1401,23 +1401,23 @@ static void meshdeform_bind_floodfill(MeshDeformBind *mdb)
        }
 
        /* other cells are interior */
-       for(a=0; a<size*size*size; a++)
-               if(tag[a]==MESHDEFORM_TAG_UNTYPED)
+       for (a=0; a<size*size*size; a++)
+               if (tag[a]==MESHDEFORM_TAG_UNTYPED)
                        tag[a]= MESHDEFORM_TAG_INTERIOR;
 
 #if 0
        {
                int tb, ti, te, ts;
                tb= ti= te= ts= 0;
-               for(a=0; a<size*size*size; a++)
-                       if(tag[a]==MESHDEFORM_TAG_BOUNDARY)
+               for (a=0; a<size*size*size; a++)
+                       if (tag[a]==MESHDEFORM_TAG_BOUNDARY)
                                tb++;
-                       else if(tag[a]==MESHDEFORM_TAG_INTERIOR)
+                       else if (tag[a]==MESHDEFORM_TAG_INTERIOR)
                                ti++;
-                       else if(tag[a]==MESHDEFORM_TAG_EXTERIOR) {
+                       else if (tag[a]==MESHDEFORM_TAG_EXTERIOR) {
                                te++;
 
-                               if(mdb->semibound[a])
+                               if (mdb->semibound[a])
                                        ts++;
                        }
                
@@ -1432,8 +1432,8 @@ static float meshdeform_boundary_phi(MeshDeformBind *UNUSED(mdb), MDefBoundIsect
 {
        int a;
 
-       for(a=0; a<isect->nvert; a++)
-               if(isect->v[a] == cagevert)
+       for (a=0; a<isect->nvert; a++)
+               if (isect->v[a] == cagevert)
                        return isect->uvw[a];
        
        return 0.0f;
@@ -1445,19 +1445,19 @@ static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *UNU
        float weight, totweight= 0.0f;
        int i, a, x, y, z;
 
-       for(i=0; i<3; i++) {
+       for (i=0; i<3; i++) {
                ivec[i]= (int)gridvec[i];
                dvec[i]= gridvec[i] - ivec[i];
        }
 
-       for(i=0; i<8; i++) {
-               if(i & 1) { x= ivec[0]+1; wx= dvec[0]; }
+       for (i=0; i<8; i++) {
+               if (i & 1) { x= ivec[0]+1; wx= dvec[0]; }
                else { x= ivec[0]; wx= 1.0f-dvec[0]; } 
 
-               if(i & 2) { y= ivec[1]+1; wy= dvec[1]; }
+               if (i & 2) { y= ivec[1]+1; wy= dvec[1]; }
                else { y= ivec[1]; wy= 1.0f-dvec[1]; } 
 
-               if(i & 4) { z= ivec[2]+1; wz= dvec[2]; }
+               if (i & 4) { z= ivec[2]+1; wz= dvec[2]; }
                else { z= ivec[2]; wz= 1.0f-dvec[2]; } 
 
                CLAMP(x, 0, mdb->size-1);
@@ -1470,7 +1470,7 @@ static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *UNU
                totweight += weight;
        }
 
-       if(totweight > 0.0f)
+       if (totweight > 0.0f)
                result /= totweight;
 
        return result;
@@ -1481,11 +1481,11 @@ static void meshdeform_check_semibound(MeshDeformBind *mdb, int x, int y, int z)
        int i, a;
 
        a= meshdeform_index(mdb, x, y, z, 0);
-       if(mdb->tag[a] != MESHDEFORM_TAG_EXTERIOR)
+       if (mdb->tag[a] != MESHDEFORM_TAG_EXTERIOR)
                return;
 
-       for(i=1; i<=6; i++)
-               if(mdb->boundisect[a][i-1]) 
+       for (i=1; i<=6; i++)
+               if (mdb->boundisect[a][i-1]) 
                        mdb->semibound[a]= 1;
 }
 
@@ -1497,13 +1497,13 @@ static float meshdeform_boundary_total_weight(MeshDeformBind *mdb, int x, int y,
        a= meshdeform_index(mdb, x, y, z, 0);
 
        /* count weight for neighbor cells */
-       for(i=1; i<=6; i++) {
-               if(meshdeform_index(mdb, x, y, z, i) == -1)
+       for (i=1; i<=6; i++) {
+               if (meshdeform_index(mdb, x, y, z, i) == -1)
                        continue;
 
-               if(mdb->boundisect[a][i-1])
+               if (mdb->boundisect[a][i-1])
                        weight= 1.0f/mdb->boundisect[a][i-1]->len;
-               else if(!mdb->semibound[a])
+               else if (!mdb->semibound[a])
                        weight= 1.0f/mdb->width[0];
                else
                        weight= 0.0f;
@@ -1521,15 +1521,15 @@ static void meshdeform_matrix_add_cell(MeshDeformBind *mdb, int x, int y, int z)
        int i, a, acenter;
 
        acenter= meshdeform_index(mdb, x, y, z, 0);
-       if(mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
+       if (mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
                return;
 
        nlMatrixAdd(mdb->varidx[acenter], mdb->varidx[acenter], 1.0f);
        
        totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
-       for(i=1; i<=6; i++) {
+       for (i=1; i<=6; i++) {
                a= meshdeform_index(mdb, x, y, z, i);
-               if(a == -1 || mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)
+               if (a == -1 || mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)
                        continue;
 
                isect= mdb->boundisect[acenter][i-1];
@@ -1547,13 +1547,13 @@ static void meshdeform_matrix_add_rhs(MeshDeformBind *mdb, int x, int y, int z,
        int i, a, acenter;
 
        acenter= meshdeform_index(mdb, x, y, z, 0);
-       if(mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
+       if (mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
                return;
 
        totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
-       for(i=1; i<=6; i++) {
+       for (i=1; i<=6; i++) {
                a= meshdeform_index(mdb, x, y, z, i);
-               if(a == -1)
+               if (a == -1)
                        continue;
 
                isect= mdb->boundisect[acenter][i-1];
@@ -1573,13 +1573,13 @@ static void meshdeform_matrix_add_semibound_phi(MeshDeformBind *mdb, int x, int
        int i, a;
 
        a= meshdeform_index(mdb, x, y, z, 0);
-       if(!mdb->semibound[a])
+       if (!mdb->semibound[a])
                return;
        
        mdb->phi[a]= 0.0f;
 
        totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
-       for(i=1; i<=6; i++) {
+       for (i=1; i<=6; i++) {
                isect= mdb->boundisect[a][i-1];
 
                if (isect) {
@@ -1596,21 +1596,21 @@ static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y
        int i, a, acenter;
 
        acenter= meshdeform_index(mdb, x, y, z, 0);
-       if(mdb->tag[acenter] != MESHDEFORM_TAG_EXTERIOR || mdb->semibound[acenter])
+       if (mdb->tag[acenter] != MESHDEFORM_TAG_EXTERIOR || mdb->semibound[acenter])
                return;
 
        phi= 0.0f;
        totweight= 0.0f;
-       for(i=1; i<=6; i++) {
+       for (i=1; i<=6; i++) {
                a= meshdeform_index(mdb, x, y, z, i);
 
-               if(a != -1 && mdb->semibound[a]) {
+               if (a != -1 && mdb->semibound[a]) {
                        phi += mdb->phi[a];
                        totweight += 1.0f;
                }
        }
 
-       if(totweight != 0.0f)
+       if (totweight != 0.0f)
                mdb->phi[acenter]= phi/totweight;
 }
 
@@ -1623,10 +1623,10 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
 
        /* setup variable indices */
        mdb->varidx= MEM_callocN(sizeof(int)*mdb->size3, "MeshDeformDSvaridx");
-       for(a=0, totvar=0; a<mdb->size3; a++)
+       for (a=0, totvar=0; a<mdb->size3; a++)
                mdb->varidx[a]= (mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)? -1: totvar++;
 
-       if(totvar == 0) {
+       if (totvar == 0) {
                MEM_freeN(mdb->varidx);
                return;
        }
@@ -1645,22 +1645,22 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
        nlBegin(NL_MATRIX);
 
        /* build matrix */
-       for(z=0; z<mdb->size; z++)
-               for(y=0; y<mdb->size; y++)
-                       for(x=0; x<mdb->size; x++)
+       for (z=0; z<mdb->size; z++)
+               for (y=0; y<mdb->size; y++)
+                       for (x=0; x<mdb->size; x++)
                                meshdeform_matrix_add_cell(mdb, x, y, z);
 
        /* solve for each cage vert */
-       for(a=0; a<mdb->totcagevert; a++) {
-               if(a != 0) {
+       for (a=0; a<mdb->totcagevert; a++) {
+               if (a != 0) {
                        nlBegin(NL_SYSTEM);
                        nlBegin(NL_MATRIX);
                }
 
                /* fill in right hand side and solve */
-               for(z=0; z<mdb->size; z++)
-                       for(y=0; y<mdb->size; y++)
-                               for(x=0; x<mdb->size; x++)
+               for (z=0; z<mdb->size; z++)
+                       for (y=0; y<mdb->size; y++)
+                               for (x=0; x<mdb->size; x++)
                                        meshdeform_matrix_add_rhs(mdb, x, y, z, a);
 
                nlEnd(NL_MATRIX);
@@ -1670,27 +1670,27 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
                nlPrintMatrix();
 #endif
 
-               if(nlSolveAdvanced(NULL, NL_TRUE)) {
-                       for(z=0; z<mdb->size; z++)
-                               for(y=0; y<mdb->size; y++)
-                                       for(x=0; x<mdb->size; x++)
+               if (nlSolveAdvanced(NULL, NL_TRUE)) {
+                       for (z=0; z<mdb->size; z++)
+                               for (y=0; y<mdb->size; y++)
+                                       for (x=0; x<mdb->size; x++)
                                                meshdeform_matrix_add_semibound_phi(mdb, x, y, z, a);
 
-                       for(z=0; z<mdb->size; z++)
-                               for(y=0; y<mdb->size; y++)
-                                       for(x=0; x<mdb->size; x++)
+                       for (z=0; z<mdb->size; z++)
+                               for (y=0; y<mdb->size; y++)
+                                       for (x=0; x<mdb->size; x++)
                                                meshdeform_matrix_add_exterior_phi(mdb, x, y, z, a);
 
-                       for(b=0; b<mdb->size3; b++) {
-                               if(mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
+                       for (b=0; b<mdb->size3; b++) {
+                               if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
                                        mdb->phi[b]= nlGetVariable(0, mdb->varidx[b]);
                                mdb->totalphi[b] += mdb->phi[b];
                        }
 
-                       if(mdb->weights) {
+                       if (mdb->weights) {
                                /* static bind : compute weights for each vertex */
-                               for(b=0; b<mdb->totvert; b++) {
-                                       if(mdb->inside[b]) {
+                               for (b=0; b<mdb->totvert; b++) {
+                                       if (mdb->inside[b]) {
                                                copy_v3_v3(vec, mdb->vertexcos[b]);
                                                gridvec[0]= (vec[0] - mdb->min[0] - mdb->halfwidth[0])/mdb->width[0];
                                                gridvec[1]= (vec[1] - mdb->min[1] - mdb->halfwidth[1])/mdb->width[1];
@@ -1704,8 +1704,8 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
                                MDefBindInfluence *inf;
 
                                /* dynamic bind */
-                               for(b=0; b<mdb->size3; b++) {
-                                       if(mdb->phi[b] >= MESHDEFORM_MIN_INFLUENCE) {
+                               for (b=0; b<mdb->size3; b++) {
+                                       if (mdb->phi[b] >= MESHDEFORM_MIN_INFLUENCE) {
                                                inf= BLI_memarena_alloc(mdb->memarena, sizeof(*inf));
                                                inf->vertex= a;
                                                inf->weight= mdb->phi[b];
@@ -1727,9 +1727,9 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
 
 #if 0
        /* sanity check */
-       for(b=0; b<mdb->size3; b++)
-               if(mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
-                       if(fabs(mdb->totalphi[b] - 1.0f) > 1e-4)
+       for (b=0; b<mdb->size3; b++)
+               if (mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
+                       if (fabs(mdb->totalphi[b] - 1.0f) > 1e-4)
                                printf("totalphi deficiency [%s|%d] %d: %.10f\n",
                                        (mdb->tag[b] == MESHDEFORM_TAG_INTERIOR)? "interior": "boundary", mdb->semibound[b], mdb->varidx[b], mdb->totalphi[b]);
 #endif
@@ -1751,7 +1751,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
        /* compute bounding box of the cage mesh */
        INIT_MINMAX(mdb->min, mdb->max);
 
-       for(a=0; a<mdb->totcagevert; a++)
+       for (a=0; a<mdb->totcagevert; a++)
                DO_MINMAX(mdb->cagecos[a], mdb->min, mdb->max);
 
        /* allocate memory */
@@ -1765,7 +1765,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
 
        mdb->inside= MEM_callocN(sizeof(int)*mdb->totvert, "MDefInside");
 
-       if(mmd->flag & MOD_MDEF_DYNAMIC_BIND)
+       if (mmd->flag & MOD_MDEF_DYNAMIC_BIND)
                mdb->dyngrid= MEM_callocN(sizeof(MDefBindInfluence*)*mdb->size3, "MDefDynGrid");
        else
                mdb->weights= MEM_callocN(sizeof(float)*mdb->totvert*mdb->totcagevert, "MDefWeights");
@@ -1776,11 +1776,11 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
        /* make bounding box equal size in all directions, add padding, and compute
         * width of the cells */
        maxwidth = -1.0f;
-       for(a=0; a<3; a++)
-               if(mdb->max[a]-mdb->min[a] > maxwidth)
+       for (a=0; a<3; a++)
+               if (mdb->max[a]-mdb->min[a] > maxwidth)
                        maxwidth= mdb->max[a]-mdb->min[a];
 
-       for(a=0; a<3; a++) {
+       for (a=0; a<3; a++) {
                center[a]= (mdb->min[a]+mdb->max[a])*0.5f;
                mdb->min[a]= center[a] - maxwidth*0.5f;
                mdb->max[a]= center[a] + maxwidth*0.5f;
@@ -1796,10 +1796,10 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
        progress_bar(0, "Setting up mesh deform system");
 
        totinside= 0;
-       for(a=0; a<mdb->totvert; a++) {
+       for (a=0; a<mdb->totvert; a++) {
                copy_v3_v3(vec, mdb->vertexcos[a]);
                mdb->inside[a]= meshdeform_inside_cage(mdb, vec);
-               if(mdb->inside[a])
+               if (mdb->inside[a])
                        totinside++;
        }
 
@@ -1808,53 +1808,53 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
        mdb->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "harmonic coords arena");
 
        /* start with all cells untyped */
-       for(a=0; a<mdb->size3; a++)
+       for (a=0; a<mdb->size3; a++)
                mdb->tag[a]= MESHDEFORM_TAG_UNTYPED;
        
        /* detect intersections and tag boundary cells */
-       for(z=0; z<mdb->size; z++)
-               for(y=0; y<mdb->size; y++)
-                       for(x=0; x<mdb->size; x++)
+       for (z=0; z<mdb->size; z++)
+               for (y=0; y<mdb->size; y++)
+                       for (x=0; x<mdb->size; x++)
                                meshdeform_add_intersections(mdb, x, y, z);
 
        /* compute exterior and interior tags */
        meshdeform_bind_floodfill(mdb);
 
-       for(z=0; z<mdb->size; z++)
-               for(y=0; y<mdb->size; y++)
-                       for(x=0; x<mdb->size; x++)
+       for (z=0; z<mdb->size; z++)
+               for (y=0; y<mdb->size; y++)
+                       for (x=0; x<mdb->size; x++)
                                meshdeform_check_semibound(mdb, x, y, z);
 
        /* solve */
        meshdeform_matrix_solve(mmd, mdb);
 
        /* assign results */
-       if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
+       if (mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
                mmd->totinfluence= 0;
-               for(a=0; a<mdb->size3; a++)
-                       for(inf=mdb->dyngrid[a]; inf; inf=inf->next)
+               for (a=0; a<mdb->size3; a++)
+                       for (inf=mdb->dyngrid[a]; inf; inf=inf->next)
                                mmd->totinfluence++;
 
                /* convert MDefBindInfluences to smaller MDefInfluences */
                mmd->dyngrid= MEM_callocN(sizeof(MDefCell)*mdb->size3, "MDefDynGrid");
                mmd->dyninfluences= MEM_callocN(sizeof(MDefInfluence)*mmd->totinfluence, "MDefInfluence");
                offset= 0;
-               for(a=0; a<mdb->size3; a++) {
+               for (a=0; a<mdb->size3; a++) {
                        cell= &mmd->dyngrid[a];
                        cell->offset= offset;
 
                        totweight= 0.0f;
                        mdinf= mmd->dyninfluences + cell->offset;
-                       for(inf=mdb->dyngrid[a]; inf; inf=inf->next, mdinf++) {
+                       for (inf=mdb->dyngrid[a]; inf; inf=inf->next, mdinf++) {
                                mdinf->weight= inf->weight;
                                mdinf->vertex= inf->vertex;
                                totweight += mdinf->weight;
                                cell->totinfluence++;
                        }
 
-                       if(totweight > 0.0f) {
+                       if (totweight > 0.0f) {
                                mdinf= mmd->dyninfluences + cell->offset;
-                               for(b=0; b<cell->totinfluence; b++, mdinf++)
+                               for (b=0; b<cell->totinfluence; b++, mdinf++)
                                        mdinf->weight /= totweight;
                        }
 
@@ -1893,9 +1893,9 @@ static void heat_weighting_bind(Scene *scene, DerivedMesh *dm, MeshDeformModifie
        mdb->weights= MEM_callocN(sizeof(float)*mdb->totvert*mdb->totcagevert, "MDefWeights");
 
        /* count triangles */
-       for(tottri=0, a=0, mf=mface; a<totface; a++, mf++) {
+       for (tottri=0, a=0, mf=mface; a<totface; a++, mf++) {
                tottri++;
-               if(mf->v4) tottri++;
+               if (mf->v4) tottri++;
        }
 
        /* create laplacian */
@@ -1914,27 +1914,27 @@ static void heat_weighting_bind(Scene *scene, DerivedMesh *dm, MeshDeformModifie
        laplacian_system_construct_end(sys);
 
        /* compute weights per bone */
-       for(j=0; j<mdb->totcagevert; j++) {
+       for (j=0; j<mdb->totcagevert; j++) {
                /* fill right hand side */
                laplacian_begin_solve(sys, -1);
 
-               for(a=0; a<totvert; a++)
-                       if(heat_source_closest(sys, a, j))
+               for (a=0; a<totvert; a++)
+                       if (heat_source_closest(sys, a, j))
                                laplacian_add_right_hand_side(sys, a,
                                        sys->heat.H[a]*sys->heat.p[a]);
 
                /* solve */
-               if(laplacian_system_solve(sys)) {
+               if (laplacian_system_solve(sys)) {
                        /* load solution into vertex groups */
-                       for(a=0; a<totvert; a++) {
+                       for (a=0; a<totvert; a++) {
                                solution= laplacian_system_get_solution(a);
                                
                                weight= heat_limit_weight(solution);
-                               if(weight > 0.0f)
+                               if (weight > 0.0f)
                                        mdb->weights[a*mdb->totcagevert + j] = weight;
                        }
                }
-               else if(!thrownerror) {
+               else if (!thrownerror) {
                        error("Mesh Deform Heat Weighting:"
                                " failed to find solution for one or more vertices");
                        thrownerror= 1;
@@ -1971,14 +1971,14 @@ void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexco
        copy_m4_m4(mdb.cagemat, cagemat);
 
        mvert= mdb.cagedm->getVertArray(mdb.cagedm);
-       for(a=0; a<mdb.totcagevert; a++)
+       for (a=0; a<mdb.totcagevert; a++)
                copy_v3_v3(mdb.cagecos[a], mvert[a].co);
-       for(a=0; a<mdb.totvert; a++)
+       for (a=0; a<mdb.totvert; a++)
                mul_v3_m4v3(mdb.vertexcos[a], mdb.cagemat, vertexcos + a*3);
 
        /* solve */
 #if 0
-       if(mmd->mode == MOD_MDEF_VOLUME)
+       if (mmd->mode == MOD_MDEF_VOLUME)
                harmonic_coordinates_bind(scene, mmd, &mdb);
        else
                heat_weighting_bind(scene, dm, mmd, &mdb);
@@ -1993,7 +1993,7 @@ void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexco
        copy_m4_m4(mmd->bindmat, mmd->object->obmat);
 
        /* transform bindcagecos to world space */
-       for(a=0; a<mdb.totcagevert; a++)
+       for (a=0; a<mdb.totcagevert; a++)
                mul_m4_v3(mmd->object->obmat, mmd->bindcagecos+a*3);
 
        /* free */
index de7a243..be520d1 100644 (file)
@@ -1102,7 +1102,7 @@ static void pose_propagate_fcurve (wmOperator *op, Object *ob, FCurve *fcu,
         * doesn't need to firstly keyframe the pose (though this doesn't mean that 
         * they can't either)
         */
-       if( !pose_propagate_get_refVal(ob, fcu, &refVal))
+       if ( !pose_propagate_get_refVal(ob, fcu, &refVal))
                return;
        
        /* find the first keyframe to start propagating from 
index 2689ec6..3d33930 100644 (file)
@@ -109,7 +109,7 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
 
 void ED_armature_exit_posemode(bContext *C, Base *base)
 {
-       if(base) {
+       if (base) {
                Object *ob= base->object;
                
                ob->restore_mode = ob->mode;
@@ -154,18 +154,18 @@ static int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan, int level)
        
        /* No need to check if constraint is active (has influence),
         * since all constraints with CONSTRAINT_IK_AUTO are active */
-       for(con= pchan->constraints.first; con; con= con->next) {
-               if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
+       for (con= pchan->constraints.first; con; con= con->next) {
+               if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
                        bKinematicConstraint *data= con->data;
-                       if(data->rootbone == 0 || data->rootbone > level) {
-                               if((data->flag & CONSTRAINT_IK_AUTO)==0)
+                       if (data->rootbone == 0 || data->rootbone > level) {
+                               if ((data->flag & CONSTRAINT_IK_AUTO)==0)
                                        return 1;
                        }
                }
        }
-       for(bone= pchan->bone->childbase.first; bone; bone= bone->next) {
+       for (bone= pchan->bone->childbase.first; bone; bone= bone->next) {
                pchan= get_pose_channel(ob->pose, bone->name);
-               if(pchan && pose_channel_in_IK_chain(ob, pchan, level + 1))
+               if (pchan && pose_channel_in_IK_chain(ob, pchan, level + 1))
                        return 1;
        }
        return 0;
@@ -338,7 +338,7 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
                                        for (ct= targets.first; ct; ct= ct->next) {
                                                if ((ct->tar == ob) && (ct->subtarget[0])) {
                                                        bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget);
-                                                       if((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) {
+                                                       if ((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) {
                                                                pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
                                                                found= 1;
                                                        }
@@ -687,23 +687,23 @@ static int pose_bone_flip_active_exec (bContext *C, wmOperator *UNUSED(op))
        Object *ob_act= CTX_data_active_object(C);
        Object *ob= object_pose_armature_get(ob_act);
 
-       if(ob && (ob->mode & OB_MODE_POSE)) {
+       if (ob && (ob->mode & OB_MODE_POSE)) {
                bArmature *arm= ob->data;
 
-               if(arm->act_bone) {
+               if (arm->act_bone) {
                        bPoseChannel *pchanf;
                        char name[MAXBONENAME];
                        flip_side_name(name, arm->act_bone->name, TRUE);
 
                        pchanf= get_pose_channel(ob->pose, name);
-                       if(pchanf && pchanf->bone != arm->act_bone) {
+                       if (pchanf && pchanf->bone != arm->act_bone) {
                                arm->act_bone->flag &= ~BONE_SELECTED;
                                pchanf->bone->flag |= BONE_SELECTED;
 
                                arm->act_bone= pchanf->bone;
 
                                /* in weightpaint we select the associated vertex group too */
-                               if(ob_act->mode & OB_MODE_WEIGHT_PAINT) {
+                               if (ob_act->mode & OB_MODE_WEIGHT_PAINT) {
                                        ED_vgroup_select_by_name(ob_act, name);
                                        DAG_id_tag_update(&ob_act->id, OB_RECALC_DATA);
                                }
@@ -876,7 +876,7 @@ static void pose_copy_menu(Scene *scene)
                BLI_duplicatelist(&const_copy, &(pchanact->constraints));
                
                /* build the puplist of constraints */
-               for (con = pchanact->constraints.first, i=0; con; con=con->next, i++){
+               for (con = pchanact->constraints.first, i=0; con; con=con->next, i++) {
                        const_toggle[i]= 1;
 //                     add_numbut(i, TOG|INT, con->name, 0, 0, &(const_toggle[i]), "");
                }
@@ -946,7 +946,7 @@ void free_posebuf(void)
                bPoseChannel *pchan;
                
                for (pchan= g_posebuf->chanbase.first; pchan; pchan= pchan->next) {
-                       if(pchan->prop) {
+                       if (pchan->prop) {
                                IDP_FreeProperty(pchan->prop);
                                MEM_freeN(pchan->prop);
                        }
@@ -968,8 +968,8 @@ static void set_pose_keys (Object *ob)
        bArmature *arm= ob->data;
        bPoseChannel *chan;
 
-       if (ob->pose){
-               for (chan=ob->pose->chanbase.first; chan; chan=chan->next){
+       if (ob->pose) {
+               for (chan=ob->pose->chanbase.first; chan; chan=chan->next) {
                        Bone *bone= chan->bone;
                        if ((bone) && (bone->flag & BONE_SELECTED) && (arm->layer & bone->layer))
                                chan->flag |= POSE_KEY; 
@@ -1789,7 +1789,7 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op)
        CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
        {
                BLI_strncpy(newname, pchan->name, sizeof(newname));
-               if(bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]))
+               if (bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]))
                        ED_armature_bone_rename(arm, pchan->name, newname);
        }
        CTX_DATA_END;
@@ -2046,7 +2046,7 @@ static int pose_bone_layers_exec (bContext *C, wmOperator *op)
        PointerRNA ptr;
        int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */
 
-       if(ob==NULL || ob->data==NULL) {
+       if (ob==NULL || ob->data==NULL) {
                return OPERATOR_CANCELLED;
        }
 
index e832247..30f929c 100644 (file)
@@ -126,7 +126,7 @@ static VertexData *allocVertexData(EditMesh *em)
        
        data = MEM_callocN(sizeof(VertexData) * totvert, "VertexData");
 
-       for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
+       for (index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
        {
                data[index].i = index;
                data[index].w = 0;
@@ -183,7 +183,7 @@ void REEB_freeGraph(ReebGraph *rg)
        ReebNode *node;
        
        // free nodes
-       for( node = rg->nodes.first; node; node = node->next )
+       for ( node = rg->nodes.first; node; node = node->next )
        {
                BLI_freeNode((BGraph*)rg, (BNode*)node);
        }
@@ -191,7 +191,7 @@ void REEB_freeGraph(ReebGraph *rg)
        
        // free arcs
        arc = rg->arcs.first;
-       while( arc )
+       while ( arc )
        {
                ReebArc *next = arc->next;
                REEB_freeArc((BArc*)arc);
@@ -407,7 +407,7 @@ ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node)
 {
        ReebGraph *multi_rg = rg;
        
-       while(multi_rg && multi_rg->multi_level != node->multi_level)
+       while (multi_rg && multi_rg->multi_level != node->multi_level)
        {
                multi_rg = multi_rg->link_up;
        }
@@ -436,7 +436,7 @@ static void printArc(ReebArc *arc)
        ReebNode *tail = (ReebNode*)arc->tail;
        printf("arc: (%i) %f -> (%i) %f\n", head->index, head->weight, tail->index, tail->weight);
        
-       for(edge = arc->edges.first; edge ; edge = edge->next)
+       for (edge = arc->edges.first; edge ; edge = edge->next)
        {
                printf("\tedge (%i, %i)\n", edge->v1->index, edge->v2->index);
        }
@@ -484,12 +484,12 @@ void repositionNodes(ReebGraph *rg)
        BNode *node = NULL;
        
        // Reset node positions
-       for(node = rg->nodes.first; node; node = node->next)
+       for (node = rg->nodes.first; node; node = node->next)
        {
                node->p[0] = node->p[1] = node->p[2] = 0;
        }
        
-       for(arc = rg->arcs.first; arc; arc = arc->next)
+       for (arc = rg->arcs.first; arc; arc = arc->next)
        {
                if (((ReebArc*)arc)->bcount > 0)
                {
@@ -512,10 +512,10 @@ void verifyNodeDegree(ReebGraph *rg)
        ReebNode *node = NULL;
        ReebArc *arc = NULL;
 
-       for(node = rg->nodes.first; node; node = node->next)
+       for (node = rg->nodes.first; node; node = node->next)
        {
                int count = 0;
-               for(arc = rg->arcs.first; arc; arc = arc->next)
+               for (arc = rg->arcs.first; arc; arc = arc->next)
                {
                        if (arc->head == node || arc->tail == node)
                        {
@@ -542,7 +542,7 @@ static void verifyBucketsArc(ReebGraph *UNUSED(rg), ReebArc *arc)
        if (arc->bcount > 0)
        {
                int i;
-               for(i = 0; i < arc->bcount; i++)
+               for (i = 0; i < arc->bcount; i++)
                {
                        if (arc->buckets[i].nv == 0)
                        {
@@ -568,7 +568,7 @@ void verifyBuckets(ReebGraph *rg)
 {
 #ifdef DEBUG_REEB
        ReebArc *arc = NULL;
-       for(arc = rg->arcs.first; arc; arc = arc->next)
+       for (arc = rg->arcs.first; arc; arc = arc->next)
        {
                verifyBucketsArc(rg, arc);
        }
@@ -580,7 +580,7 @@ void verifyFaces(ReebGraph *rg)
 #ifdef DEBUG_REEB
        int total = 0;
        ReebArc *arc = NULL;
-       for(arc = rg->arcs.first; arc; arc = arc->next)
+       for (arc = rg->arcs.first; arc; arc = arc->next)
        {
                total += BLI_ghash_size(arc->faces);
        }
@@ -667,17 +667,17 @@ static void mergeArcBuckets(ReebArc *aDst, ReebArc *aSrc, float start, float end
                
                start = MAX3(start, aDst->buckets[0].val, aSrc->buckets[0].val);
                
-               while(indexDst < aDst->bcount && aDst->buckets[indexDst].val < start)
+               while (indexDst < aDst->bcount && aDst->buckets[indexDst].val < start)
                {
                        indexDst++;
                }
 
-               while(indexSrc < aSrc->bcount && aSrc->buckets[indexSrc].val < start)
+               while (indexSrc < aSrc->bcount && aSrc->buckets[indexSrc].val < start)
                {
                        indexSrc++;
                }
                
-               for( ;  indexDst < aDst->bcount &&
+               for ( ; indexDst < aDst->bcount &&
                                indexSrc < aSrc->bcount &&
                                aDst->buckets[indexDst].val <= end &&
                                aSrc->buckets[indexSrc].val <= end
@@ -718,7 +718,7 @@ static void allocArcBuckets(ReebArc *arc)
        {
                arc->buckets = MEM_callocN(sizeof(EmbedBucket) * arc->bcount, "embed bucket");
                
-               for(i = 0; i < arc->bcount; i++)
+               for (i = 0; i < arc->bcount; i++)
                {
                        arc->buckets[i].val = start + i;
                }
@@ -779,7 +779,7 @@ static void reweightBuckets(ReebArc *arc)
        
        if (arc->bcount > 0)
        {
-               for(i = 0; i < arc->bcount; i++)
+               for (i = 0; i < arc->bcount; i++)
                {
                        arc->buckets[i].val = start + i;
                }
@@ -810,7 +810,7 @@ static void fillArcEmptyBuckets(ReebArc *arc)
        
        start_p = arc->head->p;
        
-       for(i = 0; i < arc->bcount; i++)
+       for (i = 0; i < arc->bcount; i++)
        {
                EmbedBucket *bucket = arc->buckets + i;
                
@@ -1013,12 +1013,12 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
                        bucket2 = IT_next(iter2);
                
                        /* Make sure they both start at the same value */       
-                       while(bucket1 && bucket2 && bucket1->val < bucket2->val)
+                       while (bucket1 && bucket2 && bucket1->val < bucket2->val)
                        {
                                bucket1 = IT_next(iter1);
                        }
                        
-                       while(bucket1 && bucket2 && bucket2->val < bucket1->val)
+                       while (bucket1 && bucket2 && bucket2->val < bucket1->val)
                        {
                                bucket2 = IT_next(iter2);
                        }
@@ -1075,12 +1075,12 @@ void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
                        bucket2 = IT_next(iter2);
                
                        /* Make sure they both start at the same value */       
-                       while(bucket1 && bucket1->val < bucket2->val)
+                       while (bucket1 && bucket1->val < bucket2->val)
                        {
                                bucket1 = IT_next(iter1);
                        }
                        
-                       while(bucket2 && bucket2->val < bucket1->val)
+                       while (bucket2 && bucket2->val < bucket1->val)
                        {
                                bucket2 = IT_next(iter2);
                        }
@@ -1136,12 +1136,12 @@ void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BAr
                bucket2 = IT_next(iter2);
        
                /* Make sure they both start at the same value */       
-               while(bucket1 && bucket1->val < bucket2->val)
+               while (bucket1 && bucket1->val < bucket2->val)
                {
                        bucket1 = IT_next(iter1);
                }
                
-               while(bucket2 && bucket2->val < bucket1->val)
+               while (bucket2 && bucket2->val < bucket1->val)
                {
                        bucket2 = IT_next(iter2);
                }
@@ -1194,13 +1194,13 @@ void postprocessGraph(ReebGraph *rg, char mode)
                return;
        }
        
-       for(arc = rg->arcs.first; arc; arc = arc->next)
+       for (arc = rg->arcs.first; arc; arc = arc->next)
        {
                EmbedBucket *buckets = arc->buckets;
                int bcount = arc->bcount;
                int index;
 
-               for(index = 1; index < bcount - 1; index++)
+               for (index = 1; index < bcount - 1; index++)
                {
                        interp_v3_v3v3(buckets[index].p, buckets[index].p, buckets[index - 1].p, fac1 / (fac1 + fac2));
                        interp_v3_v3v3(buckets[index].p, buckets[index].p, buckets[index + 1].p, fac3 / (fac1 + fac2 + fac3));
@@ -1511,7 +1511,7 @@ static void filterArc(ReebGraph *rg, ReebNode *newNode, ReebNode *removedNode, R
        if (merging)
        {
                /* first pass, merge buckets for arcs that spawned the two nodes into the source arc*/
-               for(arc = rg->arcs.first; arc; arc = arc->next)
+               for (arc = rg->arcs.first; arc; arc = arc->next)
                {
                        if (arc->head == srcArc->head && arc->tail == srcArc->tail && arc != srcArc)
                        {
@@ -1524,7 +1524,7 @@ static void filterArc(ReebGraph *rg, ReebNode *newNode, ReebNode *removedNode, R
 
        /* second pass, replace removedNode by newNode, remove arcs that are collapsed in a loop */
        arc = rg->arcs.first;
-       while(arc)
+       while (arc)
        {
                nextArc = arc->next;
                
@@ -1587,7 +1587,7 @@ void filterNullReebGraph(ReebGraph *rg)
        ReebArc *arc = NULL, *nextArc = NULL;
        
        arc = rg->arcs.first;
-       while(arc)
+       while (arc)
        {
                nextArc = arc->next;
                // Only collapse arcs too short to have any embed bucket
@@ -1749,14 +1749,14 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
 #ifdef DEBUG_REEB
        {       
                EditFace *efa;
-               for(efa=G.editMesh->faces.first; efa; efa=efa->next) {
+               for (efa=G.editMesh->faces.first; efa; efa=efa->next) {
                        efa->tmp.fp = -1;
                }
        }
 #endif
 
        arc = rg->arcs.first;
-       while(arc)
+       while (arc)
        {
                nextArc = arc->next;
                
@@ -1772,7 +1772,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold))
                        float avg_angle = 0;
                        float avg_vec[3] = {0,0,0};
                        
-                       for(BLI_ghashIterator_init(&ghi, arc->faces);
+                       for (BLI_ghashIterator_init(&ghi, arc->faces);
                                !BLI_ghashIterator_isDone(&ghi);
                                BLI_ghashIterator_step(&ghi))
                        {
@@ -1963,7 +1963,7 @@ static void finalizeGraph(ReebGraph *rg, char passes, char method)
        
        sortArcs(rg);
        
-       for(i = 0; i <  passes; i++)
+       for (i = 0; i <  passes; i++)
        {
                postprocessGraph(rg, method);
        }
@@ -2001,17 +2001,17 @@ static void spreadWeight(EditMesh *em)
        
        verts = MEM_callocN(sizeof(EditVert*) * totvert, "verts array");
        
-       for(eve = em->verts.first, i = 0; eve; eve = eve->next, i++)
+       for (eve = em->verts.first, i = 0; eve; eve = eve->next, i++)
        {
                verts[i] = eve;
        }
        
-       while(work_needed == 1)
+       while (work_needed == 1)
        {
                work_needed = 0;
                qsort(verts, totvert, sizeof(EditVert*), compareVerts);
                
-               for(i = 0; i < totvert; i++)
+               for (i = 0; i < totvert; i++)
                {
                        eve = verts[i];
                        
@@ -2053,14 +2053,14 @@ void REEB_exportGraph(ReebGraph *rg, int count)
        }
        f = BLI_fopen(filename, "w");
 
-       for(arc = rg->arcs.first; arc; arc = arc->next)
+       for (arc = rg->arcs.first; arc; arc = arc->next)
        {
                int i;
                float p[3];
                
                exportNode(f, "v1", arc->head);
                
-               for(i = 0; i < arc->bcount; i++)
+               for (i = 0; i < arc->bcount; i++)
                {
                        fprintf(f, "b nv:%i %f %f %f\n", arc->buckets[i].nv, arc->buckets[i].p[0], arc->buckets[i].p[1], arc->buckets[i].p[2]);
                }
@@ -2098,7 +2098,7 @@ void removeNormalNodes(ReebGraph *rg)
        ReebArc *arc, *nextArc;
        
        // Merge degree 2 nodes
-       for(arc = rg->arcs.first; arc; arc = nextArc)
+       for (arc = rg->arcs.first; arc; arc = nextArc)
        {
                nextArc = arc->next;
                
@@ -2176,7 +2176,7 @@ static ReebArc *nextArcMappedToEdge(ReebArc *arc, ReebEdge *e)
        ReebArc *result = NULL;
 
        /* Find the ReebEdge in the edge list */
-       for(edge = arc->edges.first; edge && !edgeEquals(edge, e); edge = edge->next)
+       for (edge = arc->edges.first; edge && !edgeEquals(edge, e); edge = edge->next)
        {       }
        
        nextEdge = edge->nextEdge;
@@ -2198,7 +2198,7 @@ void mergeArcFaces(ReebGraph *UNUSED(rg), ReebArc *aDst, ReebArc *aSrc)
 {
        GHashIterator ghi;
        
-       for(BLI_ghashIterator_init(&ghi, aSrc->faces);
+       for (BLI_ghashIterator_init(&ghi, aSrc->faces);
                !BLI_ghashIterator_isDone(&ghi);
                BLI_ghashIterator_step(&ghi))
        {
@@ -2213,7 +2213,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d
        
        if (direction == MERGE_APPEND)
        {
-               for(e = aSrc->edges.first; e; e = e->next)
+               for (e = aSrc->edges.first; e; e = e->next)
                {
                        e->arc = aDst; // Edge is stolen by new arc
                }
@@ -2222,7 +2222,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d
        }
        else
        {
-               for(e = aSrc->edges.first; e; e = e->next)
+               for (e = aSrc->edges.first; e; e = e->next)
                {
                        ReebEdge *newEdge = copyEdge(e);
 
@@ -2246,7 +2246,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d
                                {
                                        ReebEdge *previous = (ReebEdge*)*p;
                                        
-                                       while(previous->nextEdge != e)
+                                       while (previous->nextEdge != e)
                                        {
                                                previous = previous->nextEdge;
                                        }
@@ -2497,7 +2497,7 @@ static ReebEdge * createArc(ReebGraph *rg, ReebNode *node1, ReebNode *node2)
                        addVertToBucket(&(arc->buckets[arc->bcount - 1]), arc->tail->co);
                }
 #else
-               for(i = 0; i < arc->bcount; i++)
+               for (i = 0; i < arc->bcount; i++)
                {
                        float co[3];
                        float f = (arc->buckets[i].val - offset) / len;
@@ -2595,7 +2595,7 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions)
        renormalizeWeight(em, (float)rg->resolution);
 
        /* Adding vertice */
-       for(index = 0, eve = em->verts.first; eve; eve = eve->next)
+       for (index = 0, eve = em->verts.first; eve; eve = eve->next)
        {
                if (eve->h == 0)
                {
@@ -2606,7 +2606,7 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions)
        }
        
        /* Adding face, edge per edge */
-       for(efa = em->faces.first; efa; efa = efa->next)
+       for (efa = em->faces.first; efa; efa = efa->next)
        {
                if (efa->h == 0)
                {
@@ -2656,7 +2656,7 @@ void renormalizeWeight(EditMesh *em, float newmax)
        eve = em->verts.first;
        minimum = weightData(eve);
        maximum = minimum;
-       for(; eve; eve = eve->next)
+       for (; eve; eve = eve->next)
        {
                maximum = MAX2(maximum, weightData(eve));
                minimum = MIN2(minimum, weightData(eve));
@@ -2665,7 +2665,7 @@ void renormalizeWeight(EditMesh *em, float newmax)
        range = maximum - minimum;
 
        /* Normalize weights */
-       for(eve = em->verts.first; eve; eve = eve->next)
+       for (eve = em->verts.first; eve; eve = eve->next)
        {
                float weight = (weightData(eve) - minimum) / range * newmax;
                weightSetData(eve, weight);
@@ -2681,7 +2681,7 @@ int weightFromLoc(EditMesh *em, int axis)
                return 0;
 
        /* Copy coordinate in weight */
-       for(eve = em->verts.first; eve; eve = eve->next)
+       for (eve = em->verts.first; eve; eve = eve->next)
        {
                weightSetData(eve, eve->co[axis]);
        }
@@ -2745,7 +2745,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
        int rval;
        
        /* Find local extrema */
-       for(eve = em->verts.first; eve; eve = eve->next)
+       for (eve = em->verts.first; eve; eve = eve->next)
        {
                totvert++;
        }
@@ -2759,7 +2759,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
        nlBegin(NL_SYSTEM);
        
        /* Find local extrema */
-       for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
+       for (index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
        {
                if (eve->h == 0)
                {
@@ -2768,7 +2768,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
                        int minimum = 1;
                        
                        NextEdgeForVert(indexed_edges, -1); /* Reset next edge */
-                       for(eed = NextEdgeForVert(indexed_edges, index); eed && (maximum || minimum); eed = NextEdgeForVert(indexed_edges, index))
+                       for (eed = NextEdgeForVert(indexed_edges, index); eed && (maximum || minimum); eed = NextEdgeForVert(indexed_edges, index))
                        {
                                EditVert *eve2;
                                
@@ -2813,13 +2813,13 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
        nlBegin(NL_MATRIX);
 
        /* Zero edge weight */
-       for(eed = em->edges.first; eed; eed = eed->next)
+       for (eed = em->edges.first; eed; eed = eed->next)
        {
                eed->tmp.l = 0;
        }
        
        /* Add faces count to the edge weight */
-       for(efa = em->faces.first; efa; efa = efa->next)
+       for (efa = em->faces.first; efa; efa = efa->next)
        {
                if (efa->h == 0)
                {
@@ -2835,7 +2835,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
        }
 
        /* Add faces angle to the edge weight */
-       for(efa = em->faces.first; efa; efa = efa->next)
+       for (efa = em->faces.first; efa; efa = efa->next)
        {
                if (efa->h == 0)
                {
@@ -2860,7 +2860,7 @@ int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
        if (success)
        {
                rval = 1;
-               for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
+               for (index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
                {
                        weightSetData(eve, nlGetVariable(0, index));
                }
@@ -2916,7 +2916,7 @@ static void shortestPathsFromVert(EditMesh *em, EditVert *starting_vert, EdgeInd
        BLI_heap_insert(edge_heap, FLT_MAX, NULL);
 
        /* Initialize edge flag */
-       for(eed= em->edges.first; eed; eed= eed->next)
+       for (eed= em->edges.first; eed; eed= eed->next)
        {
                eed->f1 = 0;
        }
@@ -2929,7 +2929,7 @@ static void shortestPathsFromVert(EditMesh *em, EditVert *starting_vert, EdgeInd
                
                /* Add all new edges connected to current_eve to the list */
                NextEdgeForVert(indexed_edges, -1); // Reset next edge
-               for(eed = NextEdgeForVert(indexed_edges, indexData(current_eve)); eed; eed = NextEdgeForVert(indexed_edges, indexData(current_eve)))
+               for (eed = NextEdgeForVert(indexed_edges, indexData(current_eve)); eed; eed = NextEdgeForVert(indexed_edges, indexData(current_eve)))
                { 
                        if (eed->f1 == 0)
                        {
@@ -2983,7 +2983,7 @@ static void buildIndexedEdges(EditMesh *em, EdgeIndex *indexed_edges)
 
        indexed_edges->offset = MEM_callocN(totvert * sizeof(int), "EdgeIndex offset");
 
-       for(eed = em->edges.first; eed; eed = eed->next)
+       for (eed = em->edges.first; eed; eed = eed->next)
        {
                if (eed->v1->h == 0 && eed->v2->h == 0)
                {
@@ -2998,7 +2998,7 @@ static void buildIndexedEdges(EditMesh *em, EdgeIndex *indexed_edges)
        indexed_edges->edges = MEM_callocN(tot_indexed * sizeof(EditEdge*), "EdgeIndex edges");
 
        /* setting vert offsets */
-       for(eve = em->verts.first; eve; eve = eve->next)
+       for (eve = em->verts.first; eve; eve = eve->next)
        {
                if (eve->h == 0)
                {
@@ -3009,7 +3009,7 @@ static void buildIndexedEdges(EditMesh *em, EdgeIndex *indexed_edges)
        }
 
        /* adding edges in array */
-       for(eed = em->edges.first; eed; eed= eed->next)
+       for (eed = em->edges.first; eed; eed= eed->next)
        {
                if (eed->v1->h == 0 && eed->v2->h == 0)
                {
@@ -3057,7 +3057,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
        }
        
        /* Initialize vertice flag and find at least one selected vertex */
-       for(eve = em->verts.first; eve; eve = eve->next)
+       for (eve = em->verts.first; eve; eve = eve->next)
        {
                eve->f1 = 0;
                if (eve->f & SELECT)
@@ -3076,7 +3076,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
                int allDone = 0;
 
                /* Calculate edge weight */
-               for(eed = em->edges.first; eed; eed= eed->next)
+               for (eed = em->edges.first; eed; eed= eed->next)
                {
                        if (eed->v1->h == 0 && eed->v2->h == 0)
                        {
@@ -3085,7 +3085,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
                }
 
                /* Apply dijkstra spf for each selected vert */
-               for(eve = em->verts.first; eve; eve = eve->next)
+               for (eve = em->verts.first; eve; eve = eve->next)
                {
                        if (eve->f & SELECT)
                        {
@@ -3137,7 +3137,7 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
                }
        }
 
-       for(eve = em->verts.first; eve && vCount == 0; eve = eve->next)
+       for (eve = em->verts.first; eve && vCount == 0; eve = eve->next)
        {
                if (eve->f1 == 0)
                {
index 7b85539..fbcda86 100644 (file)
@@ -117,7 +117,7 @@ static float nurbcircle[8][2]= {
 
 ListBase *object_editcurve_get(Object *ob)
 {
-       if(ob && ELEM(ob->type, OB_CURVE, OB_SURF)) {
+       if (ob && ELEM(ob->type, OB_CURVE, OB_SURF)) {
                Curve *cu= ob->data;
                return &cu->editnurb->nurbs;
        }
@@ -129,7 +129,7 @@ static void set_actNurb(Object *obedit, Nurb *nu)
 {
        Curve *cu= obedit->data;
        
-       if(nu==NULL)
+       if (nu==NULL)
                cu->actnu = -1;
        else {
                ListBase *nurbs= curve_editnurbs(cu);
@@ -157,9 +157,9 @@ static Nurb *get_actNurb(Object *obedit)
 /* returns 1 in case (de)selection was successful */
 static short select_beztriple(BezTriple *bezt, short selstatus, short flag, short hidden)
 {      
-       if(bezt) {
-               if((bezt->hide==0) || (hidden==1)) {
-                       if(selstatus==1) { /* selects */                        
+       if (bezt) {
+               if ((bezt->hide==0) || (hidden==1)) {
+                       if (selstatus==1) { /* selects */                       
                                bezt->f1 |= flag;
                                bezt->f2 |= flag;
                                bezt->f3 |= flag;
@@ -180,9 +180,9 @@ static short select_beztriple(BezTriple *bezt, short selstatus, short flag, shor
 /* returns 1 in case (de)selection was successful */
 static short select_bpoint(BPoint *bp, short selstatus, short flag, short hidden) 
 {      
-       if(bp) {
-               if((bp->hide==0) || (hidden==1)) {
-                       if(selstatus==1) {
+       if (bp) {
+               if ((bp->hide==0) || (hidden==1)) {
+                       if (selstatus==1) {
                                bp->f1 |= flag;
                                return 1;
                        }
@@ -198,7 +198,7 @@ static short select_bpoint(BPoint *bp, short selstatus, short flag, short hidden
 
 static short swap_selection_beztriple(BezTriple *bezt)
 {
-       if(bezt->f2 & SELECT)
+       if (bezt->f2 & SELECT)
                return select_beztriple(bezt, DESELECT, 1, VISIBLE);
        else
                return select_beztriple(bezt, SELECT, 1, VISIBLE);
@@ -206,7 +206,7 @@ static short swap_selection_beztriple(BezTriple *bezt)
 
 static short swap_selection_bpoint(BPoint *bp)
 {
-       if(bp->f1 & SELECT)
+       if (bp->f1 & SELECT)
                return select_bpoint(bp, DESELECT, 1, VISIBLE);
        else
                return select_bpoint(bp, SELECT, 1, VISIBLE);
@@ -218,19 +218,19 @@ int isNurbsel(Nurb *nu)
        BPoint *bp;
        int a;
 
-       if(nu->type == CU_BEZIER) {
+       if (nu->type == CU_BEZIER) {
                bezt= nu->bezt;
                a= nu->pntsu;
-               while(a--) {
-                       if( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) return 1;
+               while (a--) {
+                       if ( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) return 1;
                        bezt++;
                }
        }
        else {
                bp= nu->bp;
                a= nu->pntsu*nu->pntsv;
-               while(a--) {
-                       if( (bp->f1 & SELECT) ) return 1;
+               while (a--) {
+                       if ( (bp->f1 & SELECT) ) return 1;
                        bp++;
                }
        }
@@ -243,10 +243,10 @@ static int isNurbsel_count(Curve *cu, Nurb *nu)
        BPoint *bp;
        int a, sel=0;
 
-       if(nu->type == CU_BEZIER) {
+       if (nu->type == CU_BEZIER) {
                bezt= nu->bezt;
                a= nu->pntsu;
-               while(a--) {
+               while (a--) {
                        if (BEZSELECTED_HIDDENHANDLES(cu, bezt)) sel++;
                        bezt++;
                }
@@ -254,8 +254,8 @@ static int isNurbsel_count(Curve *cu, Nurb *nu)
        else {
                bp= nu->bp;
                a= nu->pntsu*nu->pntsv;
-               while(a--) {
-                       if( (bp->f1 & SELECT) ) sel++;
+               while (a--) {
+                       if ( (bp->f1 & SELECT) ) sel++;
                        bp++;
                }
        }
@@ -270,15 +270,15 @@ void printknots(Object *obedit)
        Nurb *nu;
        int a, num;
 
-       for(nu= editnurb->first; nu; nu= nu->next) {
-               if(isNurbsel(nu) &&  nu->type == CU_NURBS) {
-                       if(nu->knotsu) {
+       for (nu= editnurb->first; nu; nu= nu->next) {
+               if (isNurbsel(nu) &&  nu->type == CU_NURBS) {
+                       if (nu->knotsu) {
                                num= KNOTSU(nu);
-                               for(a=0;a<num;a++) printf("knotu %d: %f\n", a, nu->knotsu[a]);
+                               for (a=0;a<num;a++) printf("knotu %d: %f\n", a, nu->knotsu[a]);
                        }
-                       if(nu->knotsv) {
+                       if (nu->knotsv) {
                                num= KNOTSV(nu);
-                               for(a=0;a<num;a++) printf("knotv %d: %f\n", a, nu->knotsv[a]);
+                               for (a=0;a<num;a++) printf("knotv %d: %f\n", a, nu->knotsv[a]);
                        }
                }
        }
@@ -310,7 +310,7 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
        CVKeyIndex *keyIndex;
        int a, key_index= 0, nu_index= 0, pt_index= 0;
 
-       if(editnurb->keyindex) return;
+       if (editnurb->keyindex) return;
 
        gh= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "editNurb keyIndex");
 
@@ -328,7 +328,8 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
                                origbezt++;
                                pt_index++;
                        }
-               } else {
+               }
+               else {
                        a= orignu->pntsu * orignu->pntsv;
                        bp= nu->bp;
                        origbp= orignu->bp;
@@ -424,7 +425,8 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu)
                        BLI_ghash_remove(editnurb->keyindex, bezt, NULL, (GHashValFreeFP)MEM_freeN);
                        ++bezt;
                }
-       } else {
+       }
+       else {
                BPoint *bp= nu->bp;
                a= nu->pntsu * nu->pntsv;
 
@@ -487,7 +489,8 @@ static void keyIndex_updateNurb(EditNurb *editnurb, Nurb *nu, Nurb *newnu)
 {
        if (nu->bezt) {
                keyIndex_updateBezt(editnurb, nu->bezt, newnu->bezt, newnu->pntsu);
-       } else {
+       }
+       else {
                keyIndex_updateBP(editnurb, nu->bp, newnu->bp, newnu->pntsu * newnu->pntsv);
        }
 }
@@ -500,8 +503,8 @@ static void keyIndex_swap(EditNurb *editnurb, void *a, void *b)
        BLI_ghash_remove(editnurb->keyindex, a, NULL, NULL);
        BLI_ghash_remove(editnurb->keyindex, b, NULL, NULL);
 
-       if(index2) BLI_ghash_insert(editnurb->keyindex, a, index2);
-       if(index1) BLI_ghash_insert(editnurb->keyindex, b, index1);
+       if (index2) BLI_ghash_insert(editnurb->keyindex, a, index2);
+       if (index1) BLI_ghash_insert(editnurb->keyindex, b, index1);
 }
 
 static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
@@ -525,18 +528,19 @@ static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
                        index1= getCVKeyIndex(editnurb, bezt1);
                        index2= getCVKeyIndex(editnurb, bezt2);
 
-                       if(index1) index1->switched= !index1->switched;
+                       if (index1) index1->switched= !index1->switched;
 
                        if (bezt1 != bezt2) {
                                keyIndex_swap(editnurb, bezt1, bezt2);
 
-                               if(index2) index2->switched= !index2->switched;
+                               if (index2) index2->switched= !index2->switched;
                        }
 
                        bezt1++;
                        bezt2--;
                }
-       } else {
+       }
+       else {
                BPoint *bp1, *bp2;
 
                if (nu->pntsv == 1) {
@@ -544,14 +548,14 @@ static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
                        bp1= nu->bp;
                        bp2= bp1+(a-1);
                        a/= 2;
-                       while(bp1!=bp2 && a>0) {
+                       while (bp1!=bp2 && a>0) {
                                index1= getCVKeyIndex(editnurb, bp1);
                                index2= getCVKeyIndex(editnurb, bp2);
 
-                               if(index1) index1->switched= !index1->switched;
+                               if (index1) index1->switched= !index1->switched;
 
                                if (bp1 != bp2) {
-                                       if(index2) index2->switched= !index2->switched;
+                                       if (index2) index2->switched= !index2->switched;
 
                                        keyIndex_swap(editnurb, bp1, bp2);
                                }
@@ -560,24 +564,25 @@ static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
                                bp1++;
                                bp2--;
                        }
-               } else {
+               }
+               else {
                        int b;
 
-                       for(b=0; b<nu->pntsv; b++) {
+                       for (b=0; b<nu->pntsv; b++) {
 
                                bp1= nu->bp+b*nu->pntsu;
                                a= nu->pntsu;
                                bp2= bp1+(a-1);
                                a/= 2;
 
-                               while(bp1!=bp2 && a>0) {
+                               while (bp1!=bp2 && a>0) {
                                        index1= getCVKeyIndex(editnurb, bp1);
                                        index2= getCVKeyIndex(editnurb, bp2);
 
-                                       if(index1) index1->switched= !index1->switched;
+                                       if (index1) index1->switched= !index1->switched;
 
                                        if (bp1 != bp2) {
-                                               if(index2) index2->switched= !index2->switched;
+                                               if (index2) index2->switched= !index2->switched;
 
                                                keyIndex_swap(editnurb, bp1, bp2);
                                        }
@@ -602,7 +607,7 @@ static void switch_keys_direction(Curve *cu, Nurb *actnu)
        int a;
 
        currkey = cu->key->block.first;
-       while(currkey) {
+       while (currkey) {
                fp= currkey->data;
 
                nu= nubase->first;
@@ -612,26 +617,29 @@ static void switch_keys_direction(Curve *cu, Nurb *actnu)
                                a= nu->pntsu;
                                if (nu == actnu) {
                                        while (a--) {
-                                               if(getKeyIndexOrig_bezt(editnurb, bezt)) {
+                                               if (getKeyIndexOrig_bezt(editnurb, bezt)) {
                                                        swap_v3_v3(fp, fp + 6);
                                                        *(fp+9) = -*(fp+9);
                                                        fp += 12;
                                                }
                                                bezt++;
                                        }
-                               } else fp += a * 12;
-                       } else {
+                               }
+                               else fp += a * 12;
+                       }
+                       else {
                                BPoint *bp= nu->bp;
                                a= nu->pntsu * nu->pntsv;
                                if (nu == actnu) {
                                        while (a--) {
-                                               if(getKeyIndexOrig_bp(editnurb, bp)) {
+                                               if (getKeyIndexOrig_bp(editnurb, bp)) {
                                                        *(fp+3) = -*(fp+3);
                                                        fp += 4;
                                                }
                                                bp++;
                                        }
-                               } else fp += a * 4;
+                               }
+                               else fp += a * 4;
                        }
 
                        nu= nu->next;
@@ -651,7 +659,7 @@ static void keyData_switchDirectionNurb(Curve *cu, Nurb *nu)
        }
 
        keyIndex_switchDirection(editnurb, nu);
-       if(cu->key)
+       if (cu->key)
                switch_keys_direction(cu, nu);
 }
 
@@ -662,7 +670,7 @@ static GHash *dupli_keyIndexHash(GHash *keyindex)
 
        gh= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "dupli_keyIndex gh");
 
-       for(hashIter = BLI_ghashIterator_new(keyindex);
+       for (hashIter = BLI_ghashIterator_new(keyindex);
                                   !BLI_ghashIterator_isDone(hashIter);
                                   BLI_ghashIterator_step(hashIter)) {
                void *cv = BLI_ghashIterator_getKey(hashIter);
@@ -710,10 +718,11 @@ static void calc_keyHandles(ListBase *nurb, float *key)
                        a= nu->pntsu;<