style cleanup: follow style guide for/with/if spacing
authorCampbell Barton <ideasman42@gmail.com>
Sat, 24 Mar 2012 07:52:14 +0000 (07:52 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 24 Mar 2012 07:52:14 +0000 (07:52 +0000)
213 files changed:
source/blender/avi/intern/avi.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh_validate.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/threads.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationImporter.cpp
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/DocumentExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/EffectExporter.cpp
source/blender/collada/ExtraHandler.cpp
source/blender/collada/ExtraTags.cpp
source/blender/collada/GeometryExporter.cpp
source/blender/collada/ImageExporter.cpp
source/blender/collada/InstanceWriter.cpp
source/blender/collada/LightExporter.cpp
source/blender/collada/MaterialExporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/collada/SceneExporter.cpp
source/blender/collada/TransformWriter.cpp
source/blender/collada/collada.cpp
source/blender/collada/collada_internal.cpp
source/blender/collada/collada_utils.cpp
source/blender/editors/curve/editcurve.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_info/textview.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_text/text_python.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/gpu/intern/gpu_material.c
source/blender/ikplugin/intern/itasc_plugin.cpp
source/blender/imbuf/intern/dds/BlockDXT.cpp
source/blender/imbuf/intern/dds/ColorBlock.cpp
source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
source/blender/imbuf/intern/dds/dds_api.cpp
source/blender/imbuf/intern/filter.c
source/blender/imbuf/intern/imageprocess.c
source/blender/imbuf/intern/indexer.c
source/blender/imbuf/intern/iris.c
source/blender/imbuf/intern/moviecache.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/targa.c
source/blender/imbuf/intern/thumbs_blend.c
source/blender/makesrna/intern/makesrna.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/nodes/composite/nodes/node_composite_blur.c
source/blender/nodes/composite/nodes/node_composite_defocus.c
source/blender/nodes/composite/nodes/node_composite_scale.c
source/blender/nodes/shader/nodes/node_shader_dynamic.c
source/blender/nodes/texture/nodes/node_texture_output.c
source/blender/render/intern/raytrace/rayobject.cpp
source/blender/render/intern/raytrace/rayobject_blibvh.cpp
source/blender/render/intern/raytrace/rayobject_instance.cpp
source/blender/render/intern/raytrace/rayobject_octree.cpp
source/blender/render/intern/raytrace/rayobject_qbvh.cpp
source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
source/blender/render/intern/raytrace/rayobject_svbvh.cpp
source/blender/render/intern/raytrace/rayobject_vbvh.cpp
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/imagetexture.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/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/shadeoutput.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_operators.c
source/creator/creator.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/BL_System.cpp
source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_DeformableGameObject.cpp
source/gameengine/Converter/BL_MeshDeformer.cpp
source/gameengine/Converter/BL_ModifierDeformer.cpp
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Converter/BlenderWorldInfo.cpp
source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/KX_ConvertControllers.cpp
source/gameengine/Converter/KX_ConvertProperties.cpp
source/gameengine/Converter/KX_IpoConvert.cpp
source/gameengine/Converter/KX_SoftBodyDeformer.cpp
source/gameengine/Expressions/InputParser.cpp
source/gameengine/Expressions/IntValue.cpp
source/gameengine/Expressions/ListValue.cpp
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/Value.cpp
source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_JoystickManager.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_LogicManager.cpp
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GamePlayer/common/GPC_Canvas.cpp
source/gameengine/GamePlayer/common/GPC_Engine.cpp
source/gameengine/GamePlayer/common/GPC_RawImage.cpp
source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp
source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/BL_BlenderShader.cpp
source/gameengine/Ketsji/BL_Material.cpp
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/BL_Texture.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_Camera.cpp
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
source/gameengine/Ketsji/KX_Dome.cpp
source/gameengine/Ketsji/KX_FontObject.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_NavMeshObject.cpp
source/gameengine/Ketsji/KX_ObjectActuator.cpp
source/gameengine/Ketsji/KX_PolyProxy.cpp
source/gameengine/Ketsji/KX_PolygonMaterial.cpp
source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
source/gameengine/Ketsji/KX_PyMath.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_PythonInitTypes.cpp
source/gameengine/Ketsji/KX_PythonSeq.cpp
source/gameengine/Ketsji/KX_RayCast.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_SteeringActuator.cpp
source/gameengine/Ketsji/KX_TouchEventManager.cpp
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/KX_VertexProxy.cpp
source/gameengine/Physics/Bullet/CcdGraphicController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
source/gameengine/Rasterizer/RAS_BucketManager.cpp
source/gameengine/Rasterizer/RAS_FramingManager.cpp
source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
source/gameengine/Rasterizer/RAS_MeshObject.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_Polygon.cpp
source/gameengine/SceneGraph/SG_Tree.cpp
source/gameengine/VideoTexture/ImageRender.cpp
source/gameengine/VideoTexture/VideoFFmpeg.cpp
source/gameengine/VideoTexture/blendVideoTex.cpp

index a58189c..1fab96b 100644 (file)
@@ -53,7 +53,7 @@
 static int AVI_DEBUG=0;
 static char DEBUG_FCC[4];
 
-#define DEBUG_PRINT(x) if(AVI_DEBUG) printf("AVI DEBUG: " x);
+#define DEBUG_PRINT(x) if (AVI_DEBUG) printf("AVI DEBUG: " x);
 
 /* local functions */
 char *fcc_to_char (unsigned int fcc);
index f05ceb8..074ea74 100644 (file)
@@ -1165,7 +1165,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
                        if (indices) {
                                w = MEM_callocN(sizeof(float)*numVerts, "Temp weight array DM_update_weight_mcol");
                                i = num;
-                               while(i--)
+                               while (i--)
                                        w[indices[i]] = weights[i];
                        }
 
@@ -2906,7 +2906,7 @@ static void navmesh_drawColored(DerivedMesh *dm)
 #endif
 
        glDisable(GL_LIGHTING);
-       /*  if(GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
+       /*  if (GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
                DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" );
                //glShadeModel(GL_SMOOTH);
                glBegin(glmode = GL_QUADS);
index 993a33c..a14988d 100644 (file)
@@ -83,7 +83,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
        pd_point_from_particle(bbd->sim, pa, &pa->state, &epoint);
 
        /* first find out goal/predator with highest priority */
-       if (effectors) for(cur = effectors->first; cur; cur=cur->next) {
+       if (effectors) for (cur = effectors->first; cur; cur=cur->next) {
                Object *eob = cur->ob;
                PartDeflect *pd = cur->pd;
 
@@ -252,7 +252,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
        //check boids in own system
        if (acbr->options & BRULE_ACOLL_WITH_BOIDS) {
                neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
-               if (neighbors > 1) for(n=1; n<neighbors; n++) {
+               if (neighbors > 1) for (n=1; n<neighbors; n++) {
                        copy_v3_v3(co1, pa->prev_state.co);
                        copy_v3_v3(vel1, pa->prev_state.vel);
                        copy_v3_v3(co2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.co);
@@ -298,7 +298,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
 
                if (epsys) {
                        neighbors = BLI_kdtree_range_search(epsys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
-                       if (neighbors > 0) for(n=0; n<neighbors; n++) {
+                       if (neighbors > 0) for (n=0; n<neighbors; n++) {
                                copy_v3_v3(co1, pa->prev_state.co);
                                copy_v3_v3(vel1, pa->prev_state.vel);
                                copy_v3_v3(co2, (epsys->particles + ptn[n].index)->prev_state.co);
@@ -945,7 +945,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
 
        //planned for near future
        //cond = state->conditions.first;
-       //for(; cond; cond=cond->next) {
+       //for (; cond; cond=cond->next) {
        //      if (boid_condition_is_true(cond)) {
        //              pa->boid->state_id = cond->state_id;
        //              state = get_boid_state(boids, pa);
index e3be9c4..b457e71 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "GL/glew.h"
 
-#include "BLI_scanfill.h"
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 #include "BLI_edgehash.h"
@@ -45,6 +44,7 @@
 #include "BLI_array.h"
 #include "BLI_smallhash.h"
 #include "BLI_utildefines.h"
+#include "BLI_scanfill.h"
 
 #include "BKE_cdderivedmesh.h"
 #include "BKE_global.h"
@@ -629,13 +629,13 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
                        else {
                                if (index) {
                                        orig = *index++;
-                                       if (orig == ORIGINDEX_NONE)             { if(nors) nors += 3; continue; }
+                                       if (orig == ORIGINDEX_NONE)             { if (nors) nors += 3; continue; }
                                        if (drawParamsMapped) draw_option = drawParamsMapped(userData, orig);
-                                       else    { if(nors) nors += 3; continue; }
+                                       else    { if (nors) nors += 3; continue; }
                                }
                                else
                                        if (drawParamsMapped) draw_option = drawParamsMapped(userData, i);
-                                       else    { if(nors) nors += 3; continue; }
+                                       else    { if (nors) nors += 3; continue; }
                        }
                        
                        if (draw_option != DM_DRAW_OPTION_SKIP) {
index 9f3f3a7..a725b5f 100644 (file)
@@ -448,7 +448,7 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
         * loops requesting data from ourselfs in a context callback */
 
        /* Ok, this looks evil...
-        * if(ret) done= -(-ret | -done);
+        * if (ret) done= -(-ret | -done);
         *
         * Values in order of importance
         * (0, -1, 1) - Where 1 is highest priority
index c84db44..7aae0d5 100644 (file)
@@ -453,7 +453,7 @@ void freeNurb(Nurb *nu)
        nu->knotsu= NULL;
        if (nu->knotsv) MEM_freeN(nu->knotsv);
        nu->knotsv= NULL;
-       /* if(nu->trim.first) freeNurblist(&(nu->trim)); */
+       /* if (nu->trim.first) freeNurblist(&(nu->trim)); */
 
        MEM_freeN(nu);
 
@@ -1025,7 +1025,7 @@ void makeNurbcurve(Nurb *nu, float *coord_array, float *tilt_array, float *radiu
                        *fp= basisu[i]*bp->vec[3];
                        sumdiv+= *fp;
                }
-               if (sumdiv != 0.0f) if(sumdiv < 0.999f || sumdiv > 1.001f) {
+               if (sumdiv != 0.0f) if (sumdiv < 0.999f || sumdiv > 1.001f) {
                        /* is normalizing needed? */
                        fp= sum;
                        for (i= istart; i<=iend; i++, fp++) {
index 35824d8..783652e 100644 (file)
@@ -614,7 +614,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
 
                        effectors = pdInitEffectors(scene, ob, psys, part->effector_weights);
 
-                       if (effectors) for(eff = effectors->first; eff; eff=eff->next) {
+                       if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
                                if (eff->psys) {
                                        node2 = dag_get_node(dag, eff->ob);
                                        dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Particle Field");
index ff3eea8..cb8220c 100644 (file)
@@ -975,7 +975,7 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
        /* Cycle through collected objects, get total of (1/(gravity_strength * dist^gravity_power)) */
        /* Check for min distance here? (yes would be cool to add that, ton) */
        
-       if (effectors) for(eff = effectors->first; eff; eff=eff->next) {
+       if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
                /* object effectors were fully checked to be OK to evaluate! */
 
                get_effector_tot(eff, &efd, point, &tot, &p, &step);
index b696e10..3b91afb 100644 (file)
@@ -2055,7 +2055,7 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int f
                // printf("loaded new result %p\n", ima->rr);
                /* free result if new one found */
                if (ima->rr) {
-                       // if(oldrr) printf("freed previous result %p\n", oldrr);
+                       // if (oldrr) printf("freed previous result %p\n", oldrr);
                        if (oldrr) RE_FreeRenderResult(oldrr);
                }
                else {
index 2787674..32bdac9 100644 (file)
@@ -247,7 +247,7 @@ DO_INLINE float dot_lfvector(float (*fLongVectorA)[3], float (*fLongVectorB)[3],
 // due to non-commutative nature of floating point ops this makes the sim give
 // different results each time you run it!
 // schedule(guided, 2)
-//#pragma omp parallel for reduction(+: temp) if(verts > CLOTH_OPENMP_LIMIT)
+//#pragma omp parallel for reduction(+: temp) if (verts > CLOTH_OPENMP_LIMIT)
        for (i = 0; i < (long)verts; i++) {
                temp += dot_v3v3(fLongVectorA[i], fLongVectorB[i]);
        }
@@ -597,7 +597,7 @@ DO_INLINE void mul_bfmatrix_lfvector( float (*to)[3], fmatrix3x3 *from, lfVector
        
        zero_lfvector(to, vcount);
 
-#pragma omp parallel sections private(i) if(vcount > CLOTH_OPENMP_LIMIT)
+#pragma omp parallel sections private(i) if (vcount > CLOTH_OPENMP_LIMIT)
        {
 #pragma omp section
                {
@@ -978,7 +978,7 @@ DO_INLINE void BuildPPinv(fmatrix3x3 *lA, fmatrix3x3 *P, fmatrix3x3 *Pinv)
        unsigned int i = 0;
        
        // Take only the diagonal blocks of A
-// #pragma omp parallel for private(i) if(lA[0].vcount > CLOTH_OPENMP_LIMIT)
+// #pragma omp parallel for private(i) if (lA[0].vcount > CLOTH_OPENMP_LIMIT)
        for (i = 0; i<lA[0].vcount; i++)
        {
                // block diagonalizer
@@ -1472,7 +1472,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
        }
 
        /* gather velocities & density */
-       if (smoothfac > 0.0f) for(v = 0; v < numverts; v++) {
+       if (smoothfac > 0.0f) for (v = 0; v < numverts; v++) {
                i = HAIR_GRID_INDEX(lX[v], gmin, gmax, 0);
                j = HAIR_GRID_INDEX(lX[v], gmin, gmax, 1);
                k = HAIR_GRID_INDEX(lX[v], gmin, gmax, 2);
@@ -1486,7 +1486,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec
        }
 
        /* gather colliders */
-       if (colliders && collfac > 0.0f) for(col = colliders->first; col; col = col->next)
+       if (colliders && collfac > 0.0f) for (col = colliders->first; col; col = col->next)
        {
                MVert *loc0 = col->collmd->x;
                MVert *loc1 = col->collmd->xnew;
@@ -1695,7 +1695,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
        while (search)
        {
                // only handle active springs
-               // if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) {}
+               // if (((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) {}
                cloth_calc_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX, time);
 
                search = search->next;
@@ -1706,7 +1706,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
        while (search)
        {
                // only handle active springs
-               // if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED))  
+               // if (((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) 
                cloth_apply_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX);
                search = search->next;
        }
index 300198c..097e7a4 100644 (file)
@@ -410,7 +410,7 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl)
        k1=k[0]=k[1]=k[2]=k[3]= firstkey;
        t[0]=t[1]=t[2]=t[3]= k1->pos;
 
-       /* if(fac<0.0 || fac>1.0) return 1; */
+       /* if (fac<0.0 || fac>1.0) return 1; */
 
        if (k1->next==NULL) return 1;
 
index eb28e9f..2dcfb74 100644 (file)
@@ -1138,7 +1138,7 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
        char left[MAX_ID_NAME + 8], leftest[MAX_ID_NAME + 8];
 
        /* make sure input name is terminated properly */
-       /* if( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */
+       /* if ( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */
        /* removed since this is only ever called from one place - campbell */
 
        while (1) {
@@ -1452,7 +1452,7 @@ void test_idbutton(char *name)
        /* search for id */
        idtest= BLI_findstring(lb, name, offsetof(ID, name) + 2);
 
-       if (idtest) if( new_id(lb, idtest, name)==0 ) sort_alpha_id(lb, idtest);
+       if (idtest) if ( new_id(lb, idtest, name)==0 ) sort_alpha_id(lb, idtest);
 }
 
 void text_idbutton(struct ID *id, char *text)
index fe21295..da5e02c 100644 (file)
@@ -353,7 +353,7 @@ int is_basis_mball(Object *ob)
 }
 
 /* return nonzero if ob1 is a basis mball for ob */
-int is_mball_basis_for(Object *ob1, Object *ob2)
+int is_mball_basis_for (Object *ob1, Object *ob2)
 {
        int basis1nr, basis2nr;
        char basis1name[MAX_ID_NAME], basis2name[MAX_ID_NAME];
index c0f488f..cd49002 100644 (file)
@@ -93,7 +93,7 @@ static int search_polyloop_cmp(const void *v1, const void *v2)
        return sp1->loopstart > sp2->loopstart ? 1 : sp1->loopstart < sp2->loopstart ? -1 : 0;
 }
 
-#define PRINT if(do_verbose) printf
+#define PRINT if (do_verbose) printf
 
 int BKE_mesh_validate_arrays(Mesh *mesh,
                              MVert *mverts, unsigned int totvert,
index f9634ef..dd1546d 100644 (file)
@@ -2135,7 +2135,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
        float guidetime, radius, weight, angle, totstrength = 0.0f;
        float vec_to_point[3];
 
-       if (effectors) for(eff = effectors->first; eff; eff=eff->next) {
+       if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
                pd = eff->pd;
 
                if (pd->forcefield != PFIELD_GUIDE)
@@ -3747,9 +3747,9 @@ static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, co
        return 1;
 }
 
-#define SET_PARTICLE_TEXTURE(type, pvalue, texfac) if((event & mtex->mapto) & type) {pvalue = texture_value_blend(def, pvalue, value, texfac, blend);}
-#define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) if(event & type) { if(pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }
-#define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) if(event & type) { CLAMP(pvalue, -1.0f, 1.0f); }
+#define SET_PARTICLE_TEXTURE(type, pvalue, texfac) if ((event & mtex->mapto) & type) {pvalue = texture_value_blend(def, pvalue, value, texfac, blend);}
+#define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) if (event & type) { if (pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }
+#define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) if (event & type) { CLAMP(pvalue, -1.0f, 1.0f); }
 
 static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, const float fw[4], float *orco, ParticleTexture *ptex, int event, float cfra)
 {
index 4a1f0a4..445e34e 100644 (file)
@@ -920,7 +920,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
                                cpa->w[i]=0.0f;
                        }
 
-                       if (totw>0.0f) for(w=0; w<4; w++)
+                       if (totw>0.0f) for (w=0; w<4; w++)
                                cpa->w[w]/=totw;
 
                        cpa->parent=cpa->pa[0];
index 643dd21..63135ea 100644 (file)
@@ -965,7 +965,7 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
                        continue;
 
                /* hair needs to be included in id-list for cache edit mode to work */
-               /* if(psys->part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DYNAMICS)==0) */
+               /* if (psys->part->type == PART_HAIR && (psys->flag & PSYS_HAIR_DYNAMICS)==0) */
                /*      continue; */
                        
                if (psys->part->type == PART_FLUID)
@@ -2003,7 +2003,7 @@ static int ptcache_write(PTCacheID *pid, int cfra, int overwrite)
        if (cache->flag & PTCACHE_DISK_CACHE) {
                error += !ptcache_mem_frame_to_disk(pid, pm);
 
-               // if(pm) /* pm is always set */
+               // if (pm) /* pm is always set */
                {
                        ptcache_data_free(pm);
                        ptcache_extra_free(pm);
@@ -2839,7 +2839,7 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
                        cache->flag &= ~PTCACHE_BAKED;
                }
        }
-       else for(SETLOOPER(scene, sce_iter, base)) {
+       else for (SETLOOPER(scene, sce_iter, base)) {
                /* cache/bake everything in the scene */
                BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
 
@@ -2928,7 +2928,7 @@ void BKE_ptcache_bake(PTCacheBaker* baker)
                                BKE_ptcache_write(pid, 0);
                }
        }
-       else for(SETLOOPER(scene, sce_iter, base)) {
+       else for (SETLOOPER(scene, sce_iter, base)) {
                BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
 
                for (pid=pidlist.first; pid; pid=pid->next) {
index 21f7247..3aadfa3 100644 (file)
@@ -141,7 +141,7 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
        /* clear the error list */
        BLI_dynlib_get_error_as_string(NULL);
 
-       /* if(pis->handle) BLI_dynlib_close(pis->handle); */
+       /* if (pis->handle) BLI_dynlib_close(pis->handle); */
        /* pis->handle= 0; */
 
        /* open the needed object */
index cd1b059..3f40c2b 100644 (file)
@@ -109,7 +109,7 @@ void open_plugin_tex(PluginTex *pit)
        BLI_dynlib_get_error_as_string(NULL);
 
        /* no BLI_dynlib_close! multiple opened plugins... */
-       /* if(pit->handle) BLI_dynlib_close(pit->handle); */
+       /* if (pit->handle) BLI_dynlib_close(pit->handle); */
        /* pit->handle= 0; */
 
        /* open the needed object */
@@ -376,7 +376,7 @@ int do_colorband(const ColorBand *coba, float in, float out[4])
                        CBData left, right;
                        
                        /* we're looking for first pos > in */
-                       for (a=0; a<coba->tot; a++, cbd1++) if(cbd1->pos > in) break;
+                       for (a=0; a<coba->tot; a++, cbd1++) if (cbd1->pos > in) break;
                                
                        if (a==coba->tot) {
                                cbd2= cbd1-1;
index 24087d6..bdecc68 100644 (file)
@@ -1382,7 +1382,7 @@ int BKE_tracking_next(MovieTrackingContext *context)
        if (!ibuf_new)
                return 0;
 
-       #pragma omp parallel for private(a) shared(ibuf_new, ok) if(map_size>1)
+       #pragma omp parallel for private(a) shared(ibuf_new, ok) if (map_size>1)
        for (a= 0; a<map_size; a++) {
                TrackContext *track_context = NULL;
                MovieTrackingTrack *track;
index 90031d9..641d037 100644 (file)
@@ -657,7 +657,7 @@ static int scanfill(PolyFill *pf)
                        ed2= ed1->next;
                        
                        /* commented out... the ESC here delivers corrupted memory (and doesnt work during grab) */
-                       /* if(callLocalInterruptCallBack()) break; */
+                       /* if (callLocalInterruptCallBack()) break; */
                        if (totface>maxface) {
                                /* printf("Fill error: endless loop. Escaped at vert %d,  tot: %d.\n", a, verts); */
                                a= verts;
index cce1d21..01ebd1d 100644 (file)
@@ -262,7 +262,7 @@ static void bli_builddir(const char *dirname, const char *relname)
 
                        if (files) {
                                dlink = (struct dirlink *) dirbase->first;
-                               while(dlink) {
+                               while (dlink) {
                                        memset(&files[actnum], 0 , sizeof(struct direntry));
                                        files[actnum].relname = dlink->name;
                                        files[actnum].path = BLI_strdupcat(dirname, dlink->name);
index 17edc18..19d9c2a 100644 (file)
@@ -79,7 +79,7 @@ static void *thread_tls_data;
  *     BLI_init_threads(&lb, do_something_func, maxthreads);
  * 
  *     while (cont) {
- *         if(BLI_available_threads(&lb) && !(escape loop event)) {
+ *         if (BLI_available_threads(&lb) && !(escape loop event)) {
  *             // get new job (data pointer)
  *             // tag job 'processed 
  *             BLI_insert_thread(&lb, job);
@@ -88,17 +88,17 @@ static void *thread_tls_data;
  *         
  *         // find if a job is ready, this the do_something_func() should write in job somewhere
  *         cont= 0;
- *         for(go over all jobs)
- *             if(job is ready) {
- *                 if(job was not removed) {
+ *         for (go over all jobs)
+ *             if (job is ready) {
+ *                 if (job was not removed) {
  *                     BLI_remove_thread(&lb, job);
  *                 }
  *             }
  *             else cont= 1;
  *         }
  *         // conditions to exit loop 
- *         if(if escape loop event) {
- *             if(BLI_available_threadslots(&lb)==maxthreads)
+ *         if (if escape loop event) {
+ *             if (BLI_available_threadslots(&lb)==maxthreads)
  *                 break;
  *         }
  *     }
index 0026f3f..6f4ceb7 100644 (file)
@@ -432,7 +432,7 @@ static void add_main_to_main(Main *mainvar, Main *from)
 
        set_listbasepointers(mainvar, lbarray);
        a= set_listbasepointers(from, fromarray);
-       while(a--) {
+       while (a--) {
                BLI_movelisttolist(lbarray[a], fromarray[a]);
        }
 }
@@ -457,11 +457,11 @@ static void split_libdata(ListBase *lb, Main *first)
        Main *mainvar;
 
        id= lb->first;
-       while(id) {
+       while (id) {
                idnext= id->next;
                if (id->lib) {
                        mainvar= first;
-                       while(mainvar) {
+                       while (mainvar) {
                                if (mainvar->curlib==id->lib) {
                                        lbn= which_libbase(mainvar, GS(id->name));
                                        BLI_remlink(lb, id);
@@ -495,7 +495,7 @@ void blo_split_main(ListBase *mainlist, Main *main)
        }
 
        i= set_listbasepointers(main, lbarray);
-       while(i--)
+       while (i--)
                split_libdata(lbarray[i], main->next);
 }
 
@@ -908,7 +908,7 @@ static int fd_read_from_memfile(FileData *filedata, void *buffer, unsigned int s
                chunk= filedata->memfile->chunks.first;
                seek= 0;
                
-               while(chunk) {
+               while (chunk) {
                        if (seek + chunk->size > (unsigned) filedata->seek) break;
                        seek+= chunk->size;
                        chunk= chunk->next;
@@ -946,7 +946,7 @@ static int fd_read_from_memfile(FileData *filedata, void *buffer, unsigned int s
                        totread += readsize;
                        filedata->seek += readsize;
                        seek += readsize;
-               } while(totread < size);
+               } while (totread < size);
                
                return totread;
        }
@@ -1363,7 +1363,7 @@ void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd)
        
        for (ptr= ptr->next; ptr; ptr= ptr->next) {
                int i= set_listbasepointers(ptr, lbarray);
-               while(i--) {
+               while (i--) {
                        ID *id;
                        for (id= lbarray[i]->first; id; id= id->next)
                                oldnewmap_insert(fd->libmap, id, id, GS(id->name));
@@ -1384,7 +1384,7 @@ static void switch_endian_structs(struct SDNA *filesdna, BHead *bhead)
        blocksize= filesdna->typelens[ filesdna->structs[bhead->SDNAnr][0] ];
 
        nblocks= bhead->nr;
-       while(nblocks--) {
+       while (nblocks--) {
                DNA_struct_switch_endian(filesdna, bhead->SDNAnr, data);
 
                data+= blocksize;
@@ -1423,7 +1423,7 @@ static void link_list(FileData *fd, ListBase *lb)         /* only direct data */
        lb->first= newdataadr(fd, lb->first);
        ln= lb->first;
        prev= NULL;
-       while(ln) {
+       while (ln) {
                ln->next= newdataadr(fd, ln->next);
                ln->prev= prev;
                prev= ln;
@@ -1446,7 +1446,7 @@ static void link_glob_list(FileData *fd, ListBase *lb)            /* for glob data */
 
        ln= lb->first;
        prev= NULL;
-       while(ln) {
+       while (ln) {
                poin= newdataadr(fd, ln->next);
                if (ln->next) {
                        oldnewmap_insert(fd->globmap, ln->next, poin, 0);
@@ -1480,7 +1480,7 @@ static void test_pointer_array(FileData *fd, void **mat)
                        ipoin=imat= MEM_mallocN( len*4, "newmatar");
                        lpoin= *mat;
 
-                       while(len-- > 0) {
+                       while (len-- > 0) {
                                if ((fd->flags & FD_FLAGS_SWITCH_ENDIAN))
                                        SWITCH_LONGINT(*lpoin);
                                *ipoin= (int) ((*lpoin) >> 3);
@@ -1495,7 +1495,7 @@ static void test_pointer_array(FileData *fd, void **mat)
                        lpoin=lmat= MEM_mallocN( len*8, "newmatar");
                        ipoin= *mat;
 
-                       while(len-- > 0) {
+                       while (len-- > 0) {
                                *lpoin= *ipoin;
                                ipoin++;
                                lpoin++;
@@ -1724,7 +1724,7 @@ static void lib_link_ipo(FileData *fd, Main *main)
        Ipo *ipo;
 
        ipo= main->ipo.first;
-       while(ipo) {
+       while (ipo) {
                if (ipo->id.flag & LIB_NEEDLINK) {
                        IpoCurve *icu;
                        for (icu= ipo->curve.first; icu; icu= icu->next) {
@@ -1744,7 +1744,7 @@ static void direct_link_ipo(FileData *fd, Ipo *ipo)
 
        link_list(fd, &(ipo->curve));
        icu= ipo->curve.first;
-       while(icu) {
+       while (icu) {
                icu->bezt= newdataadr(fd, icu->bezt);
                icu->bp= newdataadr(fd, icu->bp);
                icu->driver= newdataadr(fd, icu->driver);
@@ -2582,7 +2582,7 @@ static void lib_link_armature(FileData *fd, Main *main)
 
        arm= main->armature.first;
 
-       while(arm) {
+       while (arm) {
                if (arm->id.flag & LIB_NEEDLINK) {
                        if (arm->adt) lib_link_animdata(fd, &arm->id, arm->adt);
                        arm->id.flag -= LIB_NEEDLINK;
@@ -2636,7 +2636,7 @@ static void lib_link_camera(FileData *fd, Main *main)
        Camera *ca;
 
        ca= main->camera.first;
-       while(ca) {
+       while (ca) {
                if (ca->id.flag & LIB_NEEDLINK) {
                        if (ca->adt) lib_link_animdata(fd, &ca->id, ca->adt);
                        
@@ -2666,7 +2666,7 @@ static void lib_link_lamp(FileData *fd, Main *main)
        int a;
 
        la= main->lamp.first;
-       while(la) {
+       while (la) {
                if (la->id.flag & LIB_NEEDLINK) {
                        if (la->adt) lib_link_animdata(fd, &la->id, la->adt);
                        
@@ -2718,7 +2718,7 @@ static void lib_link_key(FileData *fd, Main *main)
        Key *key;
 
        key= main->key.first;
-       while(key) {
+       while (key) {
                /*check if we need to generate unique ids for the shapekeys*/
                if (!key->uidgen) {
                        KeyBlock *block;
@@ -2754,14 +2754,14 @@ static void switch_endian_keyblock(Key *key, KeyBlock *kb)
                cp= key->elemstr;
                poin= data;
 
-               while( cp[0] ) {        /* cp[0]==amount */
+               while ( cp[0] ) {       /* cp[0]==amount */
 
                        switch(cp[1]) {         /* cp[1]= type */
                        case IPO_FLOAT:
                        case IPO_BPOINT:
                        case IPO_BEZTRIPLE:
                                b= cp[0];
-                               while(b--) {
+                               while (b--) {
                                        SWITCH_INT((*poin));
                                        poin+= 4;
                                }
@@ -2787,7 +2787,7 @@ static void direct_link_key(FileData *fd, Key *key)
        key->refkey= newdataadr(fd, key->refkey);
 
        kb= key->block.first;
-       while(kb) {
+       while (kb) {
 
                kb->data= newdataadr(fd, kb->data);
                
@@ -2806,7 +2806,7 @@ static void lib_link_mball(FileData *fd, Main *main)
        int a;
 
        mb= main->mball.first;
-       while(mb) {
+       while (mb) {
                if (mb->id.flag & LIB_NEEDLINK) {
                        if (mb->adt) lib_link_animdata(fd, &mb->id, mb->adt);
                        
@@ -2846,7 +2846,7 @@ static void lib_link_world(FileData *fd, Main *main)
        int a;
 
        wrld= main->world.first;
-       while(wrld) {
+       while (wrld) {
                if (wrld->id.flag & LIB_NEEDLINK) {
                        if (wrld->adt) lib_link_animdata(fd, &wrld->id, wrld->adt);
                        
@@ -2895,7 +2895,7 @@ static void lib_link_vfont(FileData *UNUSED(fd), Main *main)
        VFont *vf;
 
        vf= main->vfont.first;
-       while(vf) {
+       while (vf) {
                if (vf->id.flag & LIB_NEEDLINK) {
                        vf->id.flag -= LIB_NEEDLINK;
                }
@@ -2916,7 +2916,7 @@ static void lib_link_text(FileData *UNUSED(fd), Main *main)
        Text *text;
 
        text= main->text.first;
-       while(text) {
+       while (text) {
                if (text->id.flag & LIB_NEEDLINK) {
                        text->id.flag -= LIB_NEEDLINK;
                }
@@ -2950,7 +2950,7 @@ static void direct_link_text(FileData *fd, Text *text)
        text->sell= newdataadr(fd, text->sell);
 
        ln= text->lines.first;
-       while(ln) {
+       while (ln) {
                ln->line= newdataadr(fd, ln->line);
                ln->format= NULL;
                
@@ -2993,7 +2993,7 @@ static void link_ibuf_list(FileData *fd, ListBase *lb)
        lb->first= newimaadr(fd, lb->first);
        ln= lb->first;
        prev= NULL;
-       while(ln) {
+       while (ln) {
                ln->next= newimaadr(fd, ln->next);
                ln->prev= prev;
                prev= ln;
@@ -3046,7 +3046,7 @@ static void lib_link_curve(FileData *fd, Main *main)
        int a;
 
        cu= main->curve.first;
-       while(cu) {
+       while (cu) {
                if (cu->id.flag & LIB_NEEDLINK) {
                        if (cu->adt) lib_link_animdata(fd, &cu->id, cu->adt);
 
@@ -3076,13 +3076,13 @@ static void switch_endian_knots(Nurb *nu)
 
        if (nu->knotsu) {
                len= KNOTSU(nu);
-               while(len--) {
+               while (len--) {
                        SWITCH_INT(nu->knotsu[len]);
                }
        }
        if (nu->knotsv) {
                len= KNOTSV(nu);
-               while(len--) {
+               while (len--) {
                        SWITCH_INT(nu->knotsv[len]);
                }
        }
@@ -3129,7 +3129,7 @@ static void direct_link_curve(FileData *fd, Curve *cu)
        cu->editfont= NULL;
        
        nu= cu->nurb.first;
-       while(nu) {
+       while (nu) {
                nu->bezt= newdataadr(fd, nu->bezt);
                nu->bp= newdataadr(fd, nu->bp);
                nu->knotsu= newdataadr(fd, nu->knotsu);
@@ -3152,7 +3152,7 @@ static void lib_link_texture(FileData *fd, Main *main)
        Tex *tex;
 
        tex= main->tex.first;
-       while(tex) {
+       while (tex) {
                if (tex->id.flag & LIB_NEEDLINK) {
                        if (tex->adt) lib_link_animdata(fd, &tex->id, tex->adt);
 
@@ -3238,7 +3238,7 @@ static void lib_link_material(FileData *fd, Main *main)
        int a;
 
        ma= main->mat.first;
-       while(ma) {
+       while (ma) {
                if (ma->id.flag & LIB_NEEDLINK) {
                        if (ma->adt) lib_link_animdata(fd, &ma->id, ma->adt);
 
@@ -3383,7 +3383,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
        int a;
 
        part= main->particle.first;
-       while(part) {
+       while (part) {
                if (part->id.flag & LIB_NEEDLINK) {
                        if (part->adt) lib_link_animdata(fd, &part->id, part->adt);
                        part->ipo= newlibadr_us(fd, part->id.lib, part->ipo); // XXX depreceated - old animation system
@@ -3679,7 +3679,7 @@ static void lib_link_mesh(FileData *fd, Main *main)
        Mesh *me;
 
        me= main->mesh.first;
-       while(me) {
+       while (me) {
                if (me->id.flag & LIB_NEEDLINK) {
                        int i;
 
@@ -3951,7 +3951,7 @@ static void lib_link_latt(FileData *fd, Main *main)
        Lattice *lt;
        
        lt= main->latt.first;
-       while(lt) {
+       while (lt) {
                if (lt->id.flag & LIB_NEEDLINK) {
                        if (lt->adt) lib_link_animdata(fd, &lt->id, lt->adt);
                        
@@ -4006,7 +4006,7 @@ static void lib_link_object(FileData *fd, Main *main)
        int warn=0, a;
 
        ob= main->object.first;
-       while(ob) {
+       while (ob) {
                if (ob->id.flag & LIB_NEEDLINK) {
                        if (ob->id.properties) IDP_LibLinkProperty(ob->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
                        if (ob->adt) lib_link_animdata(fd, &ob->id, ob->adt);
@@ -4095,7 +4095,7 @@ static void lib_link_object(FileData *fd, Main *main)
                        }                               
 
                        sens= ob->sensors.first;
-                       while(sens) {
+                       while (sens) {
                                for (a=0; a<sens->totlinks; a++)
                                        sens->links[a]= newglobadr(fd, sens->links[a]);
 
@@ -4112,7 +4112,7 @@ static void lib_link_object(FileData *fd, Main *main)
                        }
 
                        cont= ob->controllers.first;
-                       while(cont) {
+                       while (cont) {
                                for (a=0; a<cont->totlinks; a++)
                                        cont->links[a]= newglobadr(fd, cont->links[a]);
 
@@ -4127,7 +4127,7 @@ static void lib_link_object(FileData *fd, Main *main)
                        }
 
                        act= ob->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act->type==ACT_SOUND) {
                                        bSoundActuator *sa= act->data;
                                        sa->sound= newlibadr_us(fd, ob->id.lib, sa->sound);
@@ -4591,7 +4591,7 @@ static void direct_link_object(FileData *fd, Object *ob)
        
        link_list(fd, &ob->effect);
        paf= ob->effect.first;
-       while(paf) {
+       while (paf) {
                if (paf->type==EFF_PARTICLE) {
                        paf->keys= NULL;
                }
@@ -4674,7 +4674,7 @@ static void direct_link_object(FileData *fd, Object *ob)
        
        link_list(fd, &ob->prop);
        prop= ob->prop.first;
-       while(prop) {
+       while (prop) {
                prop->poin= newdataadr(fd, prop->poin);
                if (prop->poin==NULL) prop->poin= &prop->data;
                prop= prop->next;
@@ -4682,7 +4682,7 @@ static void direct_link_object(FileData *fd, Object *ob)
 
        link_list(fd, &ob->sensors);
        sens= ob->sensors.first;
-       while(sens) {
+       while (sens) {
                sens->data= newdataadr(fd, sens->data);
                sens->links= newdataadr(fd, sens->links);
                test_pointer_array(fd, (void **)&sens->links);
@@ -4700,7 +4700,7 @@ static void direct_link_object(FileData *fd, Object *ob)
                ob->state = 1;
        }
        cont= ob->controllers.first;
-       while(cont) {
+       while (cont) {
                cont->data= newdataadr(fd, cont->data);
                cont->links= newdataadr(fd, cont->links);
                test_pointer_array(fd, (void **)&cont->links);
@@ -4711,7 +4711,7 @@ static void direct_link_object(FileData *fd, Object *ob)
 
        link_glob_list(fd, &ob->actuators);
        act= ob->actuators.first;
-       while(act) {
+       while (act) {
                act->data= newdataadr(fd, act->data);
                act= act->next;
        }
@@ -4793,7 +4793,7 @@ static void lib_link_scene(FileData *fd, Main *main)
        TimeMarker *marker;
        
        sce= main->scene.first;
-       while(sce) {
+       while (sce) {
                if (sce->id.flag & LIB_NEEDLINK) {
                        /*Link ID Properties -- and copy this comment EXACTLY for easy finding
                        of library blocks that implement this.*/
@@ -5227,7 +5227,7 @@ static void lib_link_screen(FileData *fd, Main *main)
                        sc->animtimer= NULL; /* saved in rare cases */
                        
                        sa= sc->areabase.first;
-                       while(sa) {
+                       while (sa) {
                                SpaceLink *sl;
                                
                                sa->full= newlibadr(fd, sc->id.lib, sa->full);
@@ -5398,7 +5398,7 @@ static void *restore_pointer_by_name(Main *mainp, ID *id, int user)
                        ID *idn= lb->first;
                        char *name= id->name+2;
                        
-                       while(idn) {
+                       while (idn) {
                                if (idn->name[2]==name[0] && strcmp(idn->name+2, name)==0) {
                                        if (idn->lib==id->lib) {
                                                if (user && idn->us==0) idn->us++;
@@ -5471,7 +5471,7 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
                copy_v3_v3(sc->scene->cursor, oldscene->cursor);
 
                sa= sc->areabase.first;
-               while(sa) {
+               while (sa) {
                        SpaceLink *sl;
 
                        for (sl= sa->spacedata.first; sl; sl= sl->next) {
@@ -5906,7 +5906,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
                                link_list(fd, &sconsole->scrollback);
                                link_list(fd, &sconsole->history);
                                
-                               //for(cl= sconsole->scrollback.first; cl; cl= cl->next)
+                               //for (cl= sconsole->scrollback.first; cl; cl= cl->next)
                                //      cl->line= newdataadr(fd, cl->line);
                                
                                /*comma expressions, (e.g. expr1, expr2, expr3) evalutate each expression,
@@ -6032,7 +6032,7 @@ static void lib_link_speaker(FileData *fd, Main *main)
        Speaker *spk;
 
        spk= main->speaker.first;
-       while(spk) {
+       while (spk) {
                if (spk->id.flag & LIB_NEEDLINK) {
                        if (spk->adt) lib_link_animdata(fd, &spk->id, spk->adt);
 
@@ -6080,7 +6080,7 @@ static void lib_link_sound(FileData *fd, Main *main)
        bSound *sound;
 
        sound= main->sound.first;
-       while(sound) {
+       while (sound) {
                if (sound->id.flag & LIB_NEEDLINK) {
                        sound->id.flag -= LIB_NEEDLINK;
                        sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system
@@ -6103,14 +6103,14 @@ static void lib_link_group(FileData *fd, Main *main)
        GroupObject *go;
        int add_us;
        
-       while(group) {
+       while (group) {
                if (group->id.flag & LIB_NEEDLINK) {
                        group->id.flag -= LIB_NEEDLINK;
                        
                        add_us= 0;
                        
                        go= group->gobject.first;
-                       while(go) {
+                       while (go) {
                                go->ob= newlibadr(fd, group->id.lib, go->ob);
                                if (go->ob) {
                                        go->ob->flag |= OB_FROMGROUP;
@@ -6142,7 +6142,7 @@ static void direct_link_movieTracks(FileData *fd, ListBase *tracksbase)
        link_list(fd, tracksbase);
 
        track= tracksbase->first;
-       while(track) {
+       while (track) {
                track->markers= newdataadr(fd, track->markers);
 
                track= track->next;
@@ -6178,7 +6178,7 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip)
        link_list(fd, &tracking->objects);
 
        object= tracking->objects.first;
-       while(object) {
+       while (object) {
                direct_link_movieTracks(fd, &object->tracks);
                direct_link_movieReconstruction(fd, &object->reconstruction);
 
@@ -6191,7 +6191,7 @@ static void lib_link_movieclip(FileData *fd, Main *main)
        MovieClip *clip;
 
        clip= main->movieclip.first;
-       while(clip) {
+       while (clip) {
                if (clip->id.flag & LIB_NEEDLINK) {
                        if (clip->adt)
                                lib_link_animdata(fd, &clip->id, clip->adt);
@@ -6248,7 +6248,7 @@ static BHead *read_data_into_oldnewmap(FileData *fd, BHead *bhead, const char *a
 {
        bhead = blo_nextbhead(fd, bhead);
 
-       while(bhead && bhead->code==DATA) {
+       while (bhead && bhead->code==DATA) {
                void *data;
 #if 0
                /* XXX DUMB DEBUGGING OPTION TO GIVE NAMES for guarded malloc errors */
@@ -6615,7 +6615,7 @@ static void sort_shape_fix(Main *main)
        KeyBlock *kb;
        int sorted= 0;
        
-       while(sorted==0) {
+       while (sorted==0) {
                sorted= 1;
                for (key= main->key.first; key; key= key->id.next) {
                        for (kb= key->block.first; kb; kb= kb->next) {
@@ -7303,7 +7303,7 @@ static PartEff *do_version_give_parteff_245(Object *ob)
        PartEff *paf;
 
        paf= ob->effect.first;
-       while(paf) {
+       while (paf) {
                if (paf->type==EFF_PARTICLE) return paf;
                paf= paf->next;
        }
@@ -7324,7 +7324,7 @@ static void do_version_free_effects_245(ListBase *lb)
        Effect *eff;
 
        eff= lb->first;
-       while(eff) {
+       while (eff) {
                BLI_remlink(lb, eff);
                do_version_free_effect_245(eff);
                eff= lb->first;
@@ -7471,7 +7471,7 @@ static void do_versions_seq_unique_name_all_strips(
 {
        Sequence * seq = seqbasep->first;
 
-       while(seq) {
+       while (seq) {
                seqbase_unique_name_recursive(&sce->ed->seqbase, seq);
                if (seq->seqbase.first) {
                        do_versions_seq_unique_name_all_strips(
@@ -7812,7 +7812,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile == 100) {
                /* tex->extend and tex->imageflag have changed: */
                Tex *tex = main->tex.first;
-               while(tex) {
+               while (tex) {
                        if (tex->id.flag & LIB_NEEDLINK) {
 
                                if (tex->extend==0) {
@@ -7830,7 +7830,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 101) {
                /* frame mapping */
                Scene *sce = main->scene.first;
-               while(sce) {
+               while (sce) {
                        sce->r.framapto= 100;
                        sce->r.images= 100;
                        sce->r.framelen= 1.0;
@@ -7840,7 +7840,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 102) {
                /* init halo's at 1.0 */
                Material *ma = main->mat.first;
-               while(ma) {
+               while (ma) {
                        ma->add= 1.0;
                        ma= ma->id.next;
                }
@@ -7849,7 +7849,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                /* new variable in object: colbits */
                Object *ob = main->object.first;
                int a;
-               while(ob) {
+               while (ob) {
                        ob->colbits= 0;
                        if (ob->totcol) {
                                for (a=0; a<ob->totcol; a++) {
@@ -7862,7 +7862,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 104) {
                /* timeoffs moved */
                Object *ob = main->object.first;
-               while(ob) {
+               while (ob) {
                        if (ob->transflag & 1) {
                                ob->transflag -= 1;
                                //ob->ipoflag |= OB_OFFS_OB;
@@ -7872,7 +7872,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        }
        if (main->versionfile <= 105) {
                Object *ob = main->object.first;
-               while(ob) {
+               while (ob) {
                        ob->dupon= 1; ob->dupoff= 0;
                        ob->dupsta= 1; ob->dupend= 100;
                        ob= ob->id.next;
@@ -7881,7 +7881,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 106) {
                /* mcol changed */
                Mesh *me = main->mesh.first;
-               while(me) {
+               while (me) {
                        if (me->mcol) vcol_to_fcol(me);
                        me= me->id.next;
                }
@@ -7890,12 +7890,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 107) {
                Object *ob;
                Scene *sce = main->scene.first;
-               while(sce) {
+               while (sce) {
                        sce->r.mode |= R_GAMMA;
                        sce= sce->id.next;
                }
                ob= main->object.first;
-               while(ob) {
+               while (ob) {
                        //ob->ipoflag |= OB_OFFS_PARENT;
                        if (ob->dt==0) ob->dt= OB_SOLID;
                        ob= ob->id.next;
@@ -7905,9 +7905,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 109) {
                /* new variable: gridlines */
                bScreen *sc = main->screen.first;
-               while(sc) {
+               while (sc) {
                        ScrArea *sa= sc->areabase.first;
-                       while(sa) {
+                       while (sa) {
                                SpaceLink *sl= sa->spacedata.first;
                                while (sl) {
                                        if (sl->spacetype==SPACE_VIEW3D) {
@@ -7924,7 +7924,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        }
        if (main->versionfile <= 113) {
                Material *ma = main->mat.first;
-               while(ma) {
+               while (ma) {
                        if (ma->flaresize==0.0f) ma->flaresize= 1.0f;
                        ma->subsize= 1.0f;
                        ma->flareboost= 1.0f;
@@ -7963,21 +7963,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        }
        if (main->versionfile <= 153) {
                Scene *sce = main->scene.first;
-               while(sce) {
+               while (sce) {
                        if (sce->r.blurfac==0.0f) sce->r.blurfac= 1.0f;
                        sce= sce->id.next;
                }
        }
        if (main->versionfile <= 163) {
                Scene *sce = main->scene.first;
-               while(sce) {
+               while (sce) {
                        if (sce->r.frs_sec==0) sce->r.frs_sec= 25;
                        sce= sce->id.next;
                }
        }
        if (main->versionfile <= 164) {
                Mesh *me= main->mesh.first;
-               while(me) {
+               while (me) {
                        me->smoothresh= 30;
                        me= me->id.next;
                }
@@ -7988,11 +7988,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                int nr;
                char *cp;
 
-               while(me) {
+               while (me) {
                        if (me->tface) {
                                nr= me->totface;
                                tface= me->tface;
-                               while(nr--) {
+                               while (nr--) {
                                        cp= (char *)&tface->col[0];
                                        if (cp[1]>126) cp[1]= 255; else cp[1]*=2;
                                        if (cp[2]>126) cp[2]= 255; else cp[2]*=2;
@@ -8019,7 +8019,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
        if (main->versionfile <= 169) {
                Mesh *me= main->mesh.first;
-               while(me) {
+               while (me) {
                        if (me->subdiv==0) me->subdiv= 1;
                        me= me->id.next;
                }
@@ -8027,11 +8027,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
        if (main->versionfile <= 169) {
                bScreen *sc= main->screen.first;
-               while(sc) {
+               while (sc) {
                        ScrArea *sa= sc->areabase.first;
-                       while(sa) {
+                       while (sa) {
                                SpaceLink *sl= sa->spacedata.first;
-                               while(sl) {
+                               while (sl) {
                                        if (sl->spacetype==SPACE_IPO) {
                                                SpaceIpo *sipo= (SpaceIpo*) sl;
                                                sipo->v2d.max[0]= 15000.0;
@@ -8060,11 +8060,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
        if (main->versionfile <= 171) {
                bScreen *sc= main->screen.first;
-               while(sc) {
+               while (sc) {
                        ScrArea *sa= sc->areabase.first;
-                       while(sa) {
+                       while (sa) {
                                SpaceLink *sl= sa->spacedata.first;
-                               while(sl) {
+                               while (sl) {
                                        if (sl->spacetype==SPACE_TEXT) {
                                                SpaceText *st= (SpaceText*) sl;
                                                st->lheight= 12;
@@ -8080,7 +8080,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 173) {
                int a, b;
                Mesh *me= main->mesh.first;
-               while(me) {
+               while (me) {
                        if (me->tface) {
                                TFace *tface= me->tface;
                                for (a=0; a<me->totface; a++, tface++) {
@@ -8099,12 +8099,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Material *ma = main->mat.first;
 
                /* let faces have default add factor of 0.0 */
-               while(ma) {
+               while (ma) {
                  if (!(ma->mode & MA_HALO)) ma->add = 0.0;
                  ma = ma->id.next;
                }
 
-               while(ob) {
+               while (ob) {
                        ob->mass= 1.0f;
                        ob->damping= 0.1f;
                        /*ob->quat[1]= 1.0f;*/ /* quats arnt used yet */
@@ -8114,7 +8114,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
        if (main->versionfile <= 193) {
                Object *ob= main->object.first;
-               while(ob) {
+               while (ob) {
                        ob->inertia= 1.0f;
                        ob->rdamping= 0.1f;
                        ob= ob->id.next;
@@ -8124,7 +8124,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 196) {
                Mesh *me= main->mesh.first;
                int a, b;
-               while(me) {
+               while (me) {
                        if (me->tface) {
                                TFace *tface= me->tface;
                                for (a=0; a<me->totface; a++, tface++) {
@@ -8140,7 +8140,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
        if (main->versionfile <= 200) {
                Object *ob= main->object.first;
-               while(ob) {
+               while (ob) {
                        ob->scaflag = ob->gameflag & (OB_DO_FH|OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
                                /* 64 is do_fh */
                        ob->gameflag &= ~(OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
@@ -8194,9 +8194,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Object *ob= main->object.first;
                bActuator *act;
                bObjectActuator *oa;
-               while(ob) {
+               while (ob) {
                        act= ob->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act->type==ACT_OBJECT) {
                                        oa= act->data;
                                        oa->flag &= ~(ACT_TORQUE_LOCAL|ACT_DROT_LOCAL);         /* this actuator didn't do local/glob rot before */
@@ -8213,13 +8213,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                bActuator *act;
                bObjectActuator *oa;
                bSound *sound;
-               while(ob) {
+               while (ob) {
 
                        /* please check this for demo20 files like
                         * original Egypt levels etc.  converted
                         * rotation factor of 50 is not workable */
                        act= ob->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act->type==ACT_OBJECT) {
                                        oa= act->data;
 
@@ -8253,7 +8253,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                bEditObjectActuator *oa;
                bRaySensor *rs;
                bCollisionSensor *cs;
-               while(ob) {
+               while (ob) {
                        /* Set anisotropic friction off for old objects,
                         * values to 1.0.  */
                        ob->gameflag &= ~OB_ANISOTROPIC_FRICTION;
@@ -8262,7 +8262,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        ob->anisotropicFriction[2] = 1.0;
 
                        act= ob->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act->type==ACT_EDIT_OBJECT) {
                                        /* Zero initial velocity for newly
                                         * added objects */
@@ -8323,16 +8323,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
                /* added alpha in obcolor */
                ob= main->object.first;
-               while(ob) {
+               while (ob) {
                        ob->col[3]= 1.0;
                        ob= ob->id.next;
                }
 
                /* added alpha in obcolor */
                ob= main->object.first;
-               while(ob) {
+               while (ob) {
                        act= ob->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act->type==ACT_OBJECT) {
                                        /* multiply velocity with 50 in old files */
                                        oa= act->data;
@@ -8381,7 +8381,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
                while (ob) {
                        prop= ob->prop.first;
-                       while(prop) {
+                       while (prop) {
                                if (prop->type == GPROP_TIME) {
                                        // convert old GPROP_TIME values from int to float
                                        *((float *)&prop->data) = (float) prop->data;
@@ -8466,7 +8466,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Scene *sce= main->scene.first;
 
                // new variables for std-alone player and runtime
-               while(sce) {
+               while (sce) {
 
                        sce->r.xplay= 640;
                        sce->r.yplay= 480;
@@ -8480,7 +8480,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Scene *sce= main->scene.first;
 
                // new variables for std-alone player and runtime
-               while(sce) {
+               while (sce) {
 
                        sce->r.depth= 32;
 
@@ -8803,9 +8803,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        if (main->versionfile <= 231) {
                /* new bit flags for showing/hiding grid floor and axes */
                bScreen *sc = main->screen.first;
-               while(sc) {
+               while (sc) {
                        ScrArea *sa= sc->areabase.first;
-                       while(sa) {
+                       while (sa) {
                                SpaceLink *sl= sa->spacedata.first;
                                while (sl) {
                                        if (sl->spacetype==SPACE_VIEW3D) {
@@ -8833,7 +8833,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                World *wrld;
 
                /* introduction of raytrace */
-               while(ma) {
+               while (ma) {
                        if (ma->fresnel_tra_i==0.0f) ma->fresnel_tra_i= 1.25f;
                        if (ma->fresnel_mir_i==0.0f) ma->fresnel_mir_i= 1.25f;
 
@@ -8846,12 +8846,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        ma= ma->id.next;
                }
                sce= main->scene.first;
-               while(sce) {
+               while (sce) {
                        if (sce->r.gauss==0.0f) sce->r.gauss= 1.0f;
                        sce= sce->id.next;
                }
                la= main->lamp.first;
-               while(la) {
+               while (la) {
                        if (la->k==0.0f) la->k= 1.0;
                        if (la->ray_samp==0) la->ray_samp= 1;
                        if (la->ray_sampy==0) la->ray_sampy= 1;
@@ -8862,7 +8862,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        la= la->id.next;
                }
                wrld= main->world.first;
-               while(wrld) {
+               while (wrld) {
                        if (wrld->range==0.0f) {
                                wrld->range= 1.0f/wrld->exposure;
                        }
@@ -8871,9 +8871,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
                /* new bit flags for showing/hiding grid floor and axes */
 
-               while(sc) {
+               while (sc) {
                        ScrArea *sa= sc->areabase.first;
-                       while(sa) {
+                       while (sa) {
                                SpaceLink *sl= sa->spacedata.first;
                                while (sl) {
                                        if (sl->spacetype==SPACE_VIEW3D) {
@@ -8899,7 +8899,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                bScreen *sc;
                Scene *sce;
 
-               while(tex) {
+               while (tex) {
                        if ((tex->flag & (TEX_CHECKER_ODD+TEX_CHECKER_EVEN))==0) {
                                tex->flag |= TEX_CHECKER_ODD;
                        }
@@ -8921,7 +8921,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        tex= tex->id.next;
                }
 
-               while(wrld) {
+               while (wrld) {
                        if (wrld->aodist==0.0f) {
                                wrld->aodist= 10.0f;
                                wrld->aobias= 0.05f;
@@ -8950,7 +8950,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
                }
                sce= main->scene.first;
-               while(sce) {
+               while (sce) {
                        if (sce->r.ocres==0) sce->r.ocres= 64;
                        sce= sce->id.next;
                }
@@ -8961,7 +8961,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Material *ma= main->mat.first;
                /* Object *ob= main->object.first; */
                
-               while(ma) {
+               while (ma) {
                        if (ma->rampfac_col==0.0f) ma->rampfac_col= 1.0;
                        if (ma->rampfac_spec==0.0f) ma->rampfac_spec= 1.0;
                        if (ma->pr_lamp==0) ma->pr_lamp= 3;
@@ -8970,7 +8970,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                
                /* this should have been done loooong before! */
 #if 0   /* deprecated in 2.5+ */
-               while(ob) {
+               while (ob) {
                        if (ob->ipowin==0) ob->ipowin= ID_OB;
                        ob= ob->id.next;
                }
@@ -9024,11 +9024,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Sequence *seq;
                Editing *ed;
                
-               while(tex) {
+               while (tex) {
                        if (tex->nabla==0.0f) tex->nabla= 0.025f;
                        tex= tex->id.next;
                }
-               while(sce) {
+               while (sce) {
                        ed= sce->ed;
                        if (ed) {
                                SEQ_BEGIN(sce->ed, seq) {
@@ -9047,7 +9047,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Material *ma;
                bScreen *sc;
 
-               while(cam) {
+               while (cam) {
                        if (cam->ortho_scale==0.0f) {
                                cam->ortho_scale= 256.0f/cam->lens;
                                if (cam->type==CAM_ORTHO) printf("NOTE: ortho render has changed, tweak new Camera 'scale' value.\n");
@@ -9176,7 +9176,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Key *key;
                Scene *sce= main->scene.first;
 
-               while(sce) {
+               while (sce) {
                        if (sce->toolsettings == NULL) {
                                sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings),"Tool Settings Struct");    
                                sce->toolsettings->cornertype=0;
@@ -9506,7 +9506,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                for (sc= main->screen.first; sc; sc= sc->id.next) {
                        ScrArea *sa;
                        sa= sc->areabase.first;
-                       while(sa) {
+                       while (sa) {
                                SpaceLink *sl;
 
                                for (sl= sa->spacedata.first; sl; sl= sl->next) {
@@ -9832,7 +9832,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        for (sc= main->screen.first; sc; sc= sc->id.next) {
                                ScrArea *sa;
                                sa= sc->areabase.first;
-                               while(sa) {
+                               while (sa) {
                                        SpaceLink *sl;
 
                                        for (sl= sa->spacedata.first; sl; sl= sl->next) {
@@ -10810,7 +10810,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                Sequence *seq;
                Editing *ed;
                
-               while(sce) {
+               while (sce) {
                        ed= sce->ed;
                        if (ed) {
                                SEQP_BEGIN(ed, seq) {
@@ -10994,7 +10994,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
                        //BKE_ptcache_ids_from_object(&pidlist, ob);
 
-                       //for(pid=pidlist.first; pid; pid=pid->next)
+                       //for (pid=pidlist.first; pid; pid=pid->next)
                        //      pid->cache->flag |= PTCACHE_DISK_CACHE;
 
                        //BLI_freelistN(&pidlist);
@@ -11023,7 +11023,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                for (ob = main->object.first; ob; ob = ob->id.next) {
                        //BKE_ptcache_ids_from_object(&pidlist, ob);
 
-                       //for(pid=pidlist.first; pid; pid=pid->next) {
+                       //for (pid=pidlist.first; pid; pid=pid->next) {
                        //      if (pid->ptcaches->first == NULL)
                        //              pid->ptcaches->first = pid->ptcaches->last = pid->cache;
                        //}
@@ -11290,7 +11290,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
 
                /* Assign proper global gravity weights for dynamics (only z-coordinate is taken into account) */
-               if (do_gravity) for(part= main->particle.first; part; part= part->id.next)
+               if (do_gravity) for (part= main->particle.first; part; part= part->id.next)
                        part->effector_weights->global_gravity = part->acc[2]/-9.81f;
 
                for (ob = main->object.first; ob; ob = ob->id.next) {
@@ -11412,7 +11412,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        {
                {
                        Scene *sce= main->scene.first;
-                       while(sce) {
+                       while (sce) {
                                if (sce->r.frame_step==0)
                                        sce->r.frame_step= 1;
                                if (sce->r.mblur_samples==0)
@@ -11429,10 +11429,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                {
                        /* ensure all nodes have unique names */
                        bNodeTree *ntree= main->nodetree.first;
-                       while(ntree) {
+                       while (ntree) {
                                bNode *node=ntree->nodes.first;
                                
-                               while(node) {
+                               while (node) {
                                        nodeUniqueName(ntree, node);
                                        node= node->next;
                                }
@@ -11487,7 +11487,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
                        
                        if (convert) {
-                               while(ma) {
+                               while (ma) {
                                        if (ma->ramp_col) {
                                                ColorBand *band = (ColorBand *)ma->ramp_col;
                                                for (i=0; i<band->tot; i++) {
@@ -11510,7 +11510,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                        ma=ma->id.next;
                                }
                                
-                               while(tex) {
+                               while (tex) {
                                        if (tex->coba) {
                                                ColorBand *band = (ColorBand *)tex->coba;
                                                for (i=0; i<band->tot; i++) {
@@ -11521,7 +11521,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                        tex=tex->id.next;
                                }
                                
-                               while(wo) {
+                               while (wo) {
                                        srgb_to_linearrgb_v3_v3(&wo->ambr, &wo->ambr);
                                        srgb_to_linearrgb_v3_v3(&wo->horr, &wo->horr);
                                        srgb_to_linearrgb_v3_v3(&wo->zenr, &wo->zenr);
@@ -11967,7 +11967,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        if (scene->nodetree) {
                                bNode *node=scene->nodetree->nodes.first;
                                
-                               while(node) {
+                               while (node) {
                                        if (node->type == CMP_NODE_COLORBALANCE) {
                                                NodeColorBalance *n= (NodeColorBalance *)node->storage;
                                                n->lift[0] += 1.f;
@@ -11982,7 +11982,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                for (ntree= main->nodetree.first; ntree; ntree=ntree->id.next) {
                        bNode *node=ntree->nodes.first;
                        
-                       while(node) {
+                       while (node) {
                                if (node->type == CMP_NODE_COLORBALANCE) {
                                        NodeColorBalance *n= (NodeColorBalance *)node->storage;
                                        n->lift[0] += 1.f;
@@ -12331,7 +12331,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                 * since before blender went opensource this strange scalar was used: (1 / 0.02) * 2 * math.pi/360 */
                for (ob= main->object.first; ob; ob= ob->id.next) {
                        bActuator *act= ob->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act->type==ACT_OBJECT) {
                                        /* multiply velocity with 50 in old files */
                                        bObjectActuator *oa= act->data;
@@ -12383,7 +12383,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                /* Fix for sample line scope initializing with no height */
                for (sc= main->screen.first; sc; sc= sc->id.next) {
                        sa= sc->areabase.first;
-                       while(sa) {
+                       while (sa) {
                                SpaceLink *sl;
                                for (sl= sa->spacedata.first; sl; sl= sl->next) {
                                        if (sl->spacetype==SPACE_IMAGE) {
@@ -12954,7 +12954,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                        clip->tracking.camera.pixel_aspect= 1.f;
 
                                track= clip->tracking.tracks.first;
-                               while(track) {
+                               while (track) {
                                        if (track->pyramid_levels==0)
                                                track->pyramid_levels= 2;
 
@@ -13100,7 +13100,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                if (tracking->objects.first == NULL)
                                        BKE_tracking_new_object(tracking, "Camera");
 
-                               while(tracking_object) {
+                               while (tracking_object) {
                                        if (!tracking_object->scale)
                                                tracking_object->scale= 1.0f;
 
@@ -13472,7 +13472,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
        bfd->type= BLENFILETYPE_BLEND;
        BLI_strncpy(bfd->main->name, filepath, sizeof(bfd->main->name));
 
-       while(bhead) {
+       while (bhead) {
                switch(bhead->code) {
                case DATA:
                case DNA1:
@@ -13651,7 +13651,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
                                if (id==NULL) {
                                        read_libblock(fd, ptr, bhead, LIB_READ+LIB_INDIRECT, NULL);
                                        // commented because this can print way too much
-                                       // if(G.f & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name);
+                                       // if (G.f & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name);
                                        
                                        /* for outliner dependency only */
                                        ptr->curlib->parent= mainvar->curlib;
@@ -13671,7 +13671,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
                                        
                                        change_idid_adr_fd(fd, bhead->old, id);
                                        // commented because this can print way too much
-                                       // if(G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
+                                       // if (G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
                                }
                                
                                MEM_freeN(lib);
@@ -13687,7 +13687,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
                                   happens which invokes same ID... in that case the lookup table needs this entry */
                                oldnewmap_insert(fd->libmap, bhead->old, id, 1);
                                // commented because this can print way too much
-                               // if(G.f & G_DEBUG) printf("expand: already read %s\n", id->name);
+                               // if (G.f & G_DEBUG) printf("expand: already read %s\n", id->name);
                        }
                }
        }
@@ -14174,7 +14174,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
                expand_doit(fd, mainvar, psys->part);
 
        sens= ob->sensors.first;
-       while(sens) {
+       while (sens) {
                if (sens->type==SENS_TOUCH) {
                        bTouchSensor *ts= sens->data;
                        expand_doit(fd, mainvar, ts->ma);
@@ -14187,7 +14187,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
        }
 
        cont= ob->controllers.first;
-       while(cont) {
+       while (cont) {
                if (cont->type==CONT_PYTHON) {
                        bPythonCont *pc= cont->data;
                        expand_doit(fd, mainvar, pc->text);
@@ -14196,7 +14196,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
        }
 
        act= ob->actuators.first;
-       while(act) {
+       while (act) {
                if (act->type==ACT_SOUND) {
                        bSoundActuator *sa= act->data;
                        expand_doit(fd, mainvar, sa->sound);
@@ -14357,14 +14357,14 @@ static void expand_main(FileData *fd, Main *mainvar)
 
        if (fd==NULL) return;
 
-       while(doit) {
+       while (doit) {
                doit= 0;
 
                a= set_listbasepointers(mainvar, lbarray);
-               while(a--) {
+               while (a--) {
                        id= lbarray[a]->first;
 
-                       while(id) {
+                       while (id) {
                                if (id->flag & LIB_TEST) {
 
                                        switch(GS(id->name)) {
@@ -14770,7 +14770,7 @@ static int mainvar_count_libread_blocks(Main *mainvar)
        int a, tot= 0;
 
        a= set_listbasepointers(mainvar, lbarray);
-       while(a--) {
+       while (a--) {
                ID *id;
 
                for (id= lbarray[a]->first; id; id= id->next)
@@ -14787,12 +14787,12 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
        ListBase *lbarray[MAX_LIBARRAY];
        int a, doit= 1;
 
-       while(doit) {
+       while (doit) {
                doit= 0;
 
                /* test 1: read libdata */
                mainptr= mainl->next;
-               while(mainptr) {
+               while (mainptr) {
                        int tot= mainvar_count_libread_blocks(mainptr);
                        
                        // printf("found LIB_READ %s\n", mainptr->curlib->name);
@@ -14810,7 +14810,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
                                        
                                        /* allow typing in a new lib path */
                                        if (G.rt==-666) {
-                                               while(fd==NULL) {
+                                               while (fd==NULL) {
                                                        char newlib_path[FILE_MAX] = { 0 };
                                                        printf("Missing library...'\n");
                                                        printf("        current file: %s\n", G.main->name);
@@ -14857,10 +14857,10 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
                                if (fd) {
                                        doit= 1;
                                        a= set_listbasepointers(mainptr, lbarray);
-                                       while(a--) {
+                                       while (a--) {
                                                ID *id= lbarray[a]->first;
 
-                                               while(id) {
+                                               while (id) {
                                                        ID *idn= id->next;
                                                        if (id->flag & LIB_READ) {
                                                                ID *realid= NULL;
@@ -14886,7 +14886,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
                                        
                                        /* dang FileData... now new libraries need to be appended to original filedata,
                                         * it is not a good replacement for the old global (ton) */
-                                       while( fd->mainlist.first ) {
+                                       while ( fd->mainlist.first ) {
                                                Main *mp= fd->mainlist.first;
                                                BLI_remlink(&fd->mainlist, mp);
                                                BLI_addtail(&basefd->mainlist, mp);
@@ -14901,9 +14901,9 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
        /* test if there are unread libblocks */
        for (mainptr= mainl->next; mainptr; mainptr= mainptr->next) {
                a= set_listbasepointers(mainptr, lbarray);
-               while(a--) {
+               while (a--) {
                        ID *id= lbarray[a]->first;
-                       while(id) {
+                       while (id) {
                                ID *idn= id->next;
                                if (id->flag & LIB_READ) {
                                        BLI_remlink(lbarray[a], id);
index bb66fa2..32af95c 100644 (file)
@@ -267,7 +267,7 @@ static void mywrite( WriteData *wd, void *adr, int len)
                        writedata_do_write(wd, adr, writelen);
                        adr = (char*)adr + writelen;
                        len -= writelen;
-               } while(len > 0);
+               } while (len > 0);
 
                return;
        }
@@ -853,7 +853,7 @@ static void write_boid_state(WriteData *wd, BoidState *state)
                                break;
                }
        }
-       //for(; cond; cond=cond->next)
+       //for (; cond; cond=cond->next)
        //      writestruct(wd, DATA, "BoidCondition", 1, cond);
 }
 
@@ -915,7 +915,7 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
        int a;
 
        part= idbase->first;
-       while(part) {
+       while (part) {
                if (part->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_PA, "ParticleSettings", 1, part);
@@ -931,7 +931,7 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
                                dw->index = 0;
                                if (part->dup_group) { /* can be NULL if lining fails or set to None */
                                        go = part->dup_group->gobject.first;
-                                       while(go && go->ob != dw->ob) {
+                                       while (go && go->ob != dw->ob) {
                                                go=go->next;
                                                dw->index++;
                                        }
@@ -1004,7 +1004,7 @@ static void write_properties(WriteData *wd, ListBase *lb)
        bProperty *prop;
 
        prop= lb->first;
-       while(prop) {
+       while (prop) {
                writestruct(wd, DATA, "bProperty", 1, prop);
 
                if (prop->poin && prop->poin != &prop->data)
@@ -1019,7 +1019,7 @@ static void write_sensors(WriteData *wd, ListBase *lb)
        bSensor *sens;
 
        sens= lb->first;
-       while(sens) {
+       while (sens) {
                writestruct(wd, DATA, "bSensor", 1, sens);
 
                writedata(wd, DATA, sizeof(void *)*sens->totlinks, sens->links);
@@ -1080,7 +1080,7 @@ static void write_controllers(WriteData *wd, ListBase *lb)
        bController *cont;
 
        cont= lb->first;
-       while(cont) {
+       while (cont) {
                writestruct(wd, DATA, "bController", 1, cont);
 
                writedata(wd, DATA, sizeof(void *)*cont->totlinks, cont->links);
@@ -1105,7 +1105,7 @@ static void write_actuators(WriteData *wd, ListBase *lb)
        bActuator *act;
 
        act= lb->first;
-       while(act) {
+       while (act) {
                writestruct(wd, DATA, "bActuator", 1, act);
 
                switch(act->type) {
@@ -1412,7 +1412,7 @@ static void write_objects(WriteData *wd, ListBase *idbase)
        Object *ob;
        
        ob= idbase->first;
-       while(ob) {
+       while (ob) {
                if (ob->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_OB, "Object", 1, ob);
@@ -1469,7 +1469,7 @@ static void write_vfonts(WriteData *wd, ListBase *idbase)
        PackedFile * pf;
 
        vf= idbase->first;
-       while(vf) {
+       while (vf) {
                if (vf->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_VF, "VFont", 1, vf);
@@ -1495,7 +1495,7 @@ static void write_keys(WriteData *wd, ListBase *idbase)
        KeyBlock *kb;
 
        key= idbase->first;
-       while(key) {
+       while (key) {
                if (key->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_KE, "Key", 1, key);
@@ -1505,7 +1505,7 @@ static void write_keys(WriteData *wd, ListBase *idbase)
                        
                        /* direct data */
                        kb= key->block.first;
-                       while(kb) {
+                       while (kb) {
                                writestruct(wd, DATA, "KeyBlock", 1, kb);
                                if (kb->data) writedata(wd, DATA, kb->totelem*key->elemsize, kb->data);
                                kb= kb->next;
@@ -1523,7 +1523,7 @@ static void write_cameras(WriteData *wd, ListBase *idbase)
        Camera *cam;
 
        cam= idbase->first;
-       while(cam) {
+       while (cam) {
                if (cam->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_CA, "Camera", 1, cam);
@@ -1542,7 +1542,7 @@ static void write_mballs(WriteData *wd, ListBase *idbase)
        MetaElem *ml;
 
        mb= idbase->first;
-       while(mb) {
+       while (mb) {
                if (mb->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_MB, "MetaBall", 1, mb);
@@ -1553,7 +1553,7 @@ static void write_mballs(WriteData *wd, ListBase *idbase)
                        if (mb->adt) write_animdata(wd, mb->adt);
 
                        ml= mb->elems.first;
-                       while(ml) {
+                       while (ml) {
                                writestruct(wd, DATA, "MetaElem", 1, ml);
                                ml= ml->next;
                        }
@@ -1575,7 +1575,7 @@ static void write_curves(WriteData *wd, ListBase *idbase)
        Nurb *nu;
 
        cu= idbase->first;
-       while(cu) {
+       while (cu) {
                if (cu->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_CU, "Curve", 1, cu);
@@ -1593,12 +1593,12 @@ static void write_curves(WriteData *wd, ListBase *idbase)
                        else {
                                /* is also the order of reading */
                                nu= cu->nurb.first;
-                               while(nu) {
+                               while (nu) {
                                        writestruct(wd, DATA, "Nurb", 1, nu);
                                        nu= nu->next;
                                }
                                nu= cu->nurb.first;
-                               while(nu) {
+                               while (nu) {
                                        if (nu->type == CU_BEZIER)
                                                writestruct(wd, DATA, "BezTriple", nu->pntsu, nu->bezt);
                                        else {
@@ -1705,7 +1705,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
 #endif
 
        mesh= idbase->first;
-       while(mesh) {
+       while (mesh) {
                if (mesh->id.us>0 || wd->current) {
                        /* write LibData */
                        if (!save_for_old_blender) {
@@ -1837,7 +1837,7 @@ static void write_lattices(WriteData *wd, ListBase *idbase)
        Lattice *lt;
        
        lt= idbase->first;
-       while(lt) {
+       while (lt) {
                if (lt->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_LT, "Lattice", 1, lt);
@@ -1888,7 +1888,7 @@ static void write_images(WriteData *wd, ListBase *idbase)
 
 
        ima= idbase->first;
-       while(ima) {
+       while (ima) {
                if (ima->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_IM, "Image", 1, ima);
@@ -1913,7 +1913,7 @@ static void write_textures(WriteData *wd, ListBase *idbase)
        Tex *tex;
 
        tex= idbase->first;
-       while(tex) {
+       while (tex) {
                if (tex->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_TE, "Tex", 1, tex);
@@ -1954,7 +1954,7 @@ static void write_materials(WriteData *wd, ListBase *idbase)
        int a;
 
        ma= idbase->first;
-       while(ma) {
+       while (ma) {
                if (ma->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_MA, "Material", 1, ma);
@@ -1992,7 +1992,7 @@ static void write_worlds(WriteData *wd, ListBase *idbase)
        int a;
 
        wrld= idbase->first;
-       while(wrld) {
+       while (wrld) {
                if (wrld->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_WO, "World", 1, wrld);
@@ -2022,7 +2022,7 @@ static void write_lamps(WriteData *wd, ListBase *idbase)
        int a;
 
        la= idbase->first;
-       while(la) {
+       while (la) {
                if (la->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_LA, "Lamp", 1, la);
@@ -2066,7 +2066,7 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
        ToolSettings *tos;
        
        sce= scebase->first;
-       while(sce) {
+       while (sce) {
                /* write LibData */
                writestruct(wd, ID_SCE, "Scene", 1, sce);
                if (sce->id.properties) IDP_WriteProperty(sce->id.properties, wd);
@@ -2076,7 +2076,7 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
                
                /* direct data */
                base= sce->base.first;
-               while(base) {
+               while (base) {
                        writestruct(wd, DATA, "Base", 1, base);
                        base= base->next;
                }
@@ -2279,7 +2279,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
        ScrEdge *se;
 
        sc= scrbase->first;
-       while(sc) {
+       while (sc) {
                
                /* write LibData */
                /* in 2.50+ files, the file identifier for screens is patched, forward compatibility */
@@ -2309,7 +2309,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
                        }
                        
                        sl= sa->spacedata.first;
-                       while(sl) {
+                       while (sl) {
                                for (ar= sl->regionbase.first; ar; ar= ar->next)
                                        write_region(wd, ar, sl->spacetype);
                                
@@ -2431,7 +2431,7 @@ static void write_libraries(WriteData *wd, Main *main)
 
                /* test: is lib being used */
                foundone= 0;
-               while(tot--) {
+               while (tot--) {
                        for (id= lbarray[tot]->first; id; id= id->next) {
                                if (id->us>0 && (id->flag & LIB_EXTERN)) {
                                        foundone= 1;
@@ -2444,7 +2444,7 @@ static void write_libraries(WriteData *wd, Main *main)
                if (foundone) {
                        writestruct(wd, ID_LI, "Library", 1, main->curlib);
 
-                       while(a--) {
+                       while (a--) {
                                for (id= lbarray[a]->first; id; id= id->next) {
                                        if (id->us>0 && (id->flag & LIB_EXTERN)) {
                                                writestruct(wd, ID_ID, "ID", 1, id);
@@ -2472,7 +2472,7 @@ static void write_bone(WriteData *wd, Bone* bone)
        
        // Write Children
        cbone= bone->childbase.first;
-       while(cbone) {
+       while (cbone) {
                write_bone(wd, cbone);
                cbone= cbone->next;
        }
@@ -2493,7 +2493,7 @@ static void write_armatures(WriteData *wd, ListBase *idbase)
 
                        /* Direct data */
                        bone= arm->bonebase.first;
-                       while(bone) {
+                       while (bone) {
                                write_bone(wd, bone);
                                bone=bone->next;
                        }
@@ -2512,7 +2512,7 @@ static void write_texts(WriteData *wd, ListBase *idbase)
        TextMarker *mrk;
 
        text= idbase->first;
-       while(text) {
+       while (text) {
                if ( (text->flags & TXT_ISMEM) && (text->flags & TXT_ISEXT)) text->flags &= ~TXT_ISEXT;
 
                /* write LibData */
@@ -2555,7 +2555,7 @@ static void write_speakers(WriteData *wd, ListBase *idbase)
        Speaker *spk;
 
        spk= idbase->first;
-       while(spk) {
+       while (spk) {
                if (spk->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_SPK, "Speaker", 1, spk);
@@ -2574,7 +2574,7 @@ static void write_sounds(WriteData *wd, ListBase *idbase)
        PackedFile * pf;
 
        sound= idbase->first;
-       while(sound) {
+       while (sound) {
                if (sound->id.us>0 || wd->current) {
                        /* write LibData */
                        writestruct(wd, ID_SO, "bSound", 1, sound);
@@ -2605,7 +2605,7 @@ static void write_groups(WriteData *wd, ListBase *idbase)
                        if (group->id.properties) IDP_WriteProperty(group->id.properties, wd);
 
                        go= group->gobject.first;
-                       while(go) {
+                       while (go) {
                                writestruct(wd, DATA, "GroupObject", 1, go);
                                go= go->next;
                        }
@@ -2663,7 +2663,7 @@ static void write_movieTracks(WriteData *wd, ListBase *tracks)
        MovieTrackingTrack *track;
 
        track= tracks->first;
-       while(track) {
+       while (track) {
                writestruct(wd, DATA, "MovieTrackingTrack", 1, track);
 
                if (track->markers)
@@ -2684,7 +2684,7 @@ static void write_movieclips(WriteData *wd, ListBase *idbase)
        MovieClip *clip;
 
        clip= idbase->first;
-       while(clip) {
+       while (clip) {
                if (clip->id.us>0 || wd->current) {
                        MovieTracking *tracking= &clip->tracking;
                        MovieTrackingObject *object;
@@ -2697,7 +2697,7 @@ static void write_movieclips(WriteData *wd, ListBase *idbase)
                        write_movieReconstruction(wd, &tracking->reconstruction);
 
                        object= tracking->objects.first;
-                       while(object) {
+                       while (object) {
                                writestruct(wd, DATA, "MovieTrackingObject", 1, object);
 
                                write_movieTracks(wd, &object->tracks);
@@ -2855,7 +2855,7 @@ static int do_history(const char *name, ReportList *reports)
                return 1;
        }
                
-       while(hisnr > 1) {
+       while (hisnr > 1) {
                BLI_snprintf(tempname1, sizeof(tempname1), "%s%d", name, hisnr-1);
                BLI_snprintf(tempname2, sizeof(tempname2), "%s%d", name, hisnr);
        
index d6eb406..5f8ceee 100644 (file)
@@ -40,7 +40,7 @@ void forEachObjectInScene(Scene *sce, Functor &f)
 
 void AnimationExporter::exportAnimations(Scene *sce)
 {
-       if(hasAnimations(sce)) {
+       if (hasAnimations(sce)) {
                this->scene = sce;
 
                openLibrary();
@@ -59,7 +59,7 @@ void AnimationExporter::operator() (Object *ob)
        /* bool isMatAnim = false; */ /* UNUSED */
 
        //Export transform animations
-       if(ob->adt && ob->adt->action)
+       if (ob->adt && ob->adt->action)
        {
                fcu = (FCurve*)ob->adt->action->curves.first;
 
@@ -88,7 +88,7 @@ void AnimationExporter::operator() (Object *ob)
        }
 
        //Export Lamp parameter animations
-       if( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
+       if ( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
        {
                fcu = (FCurve*)(((Lamp*)ob ->data)->adt->action->curves.first);
                while (fcu) {
@@ -102,7 +102,7 @@ void AnimationExporter::operator() (Object *ob)
        }
 
        //Export Camera parameter animations
-       if( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
+       if ( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
        {               
                fcu = (FCurve*)(((Camera*)ob ->data)->adt->action->curves.first);
                while (fcu) {
@@ -117,11 +117,11 @@ void AnimationExporter::operator() (Object *ob)
        }
 
        //Export Material parameter animations.
-       for(int a = 0; a < ob->totcol; a++)
+       for (int a = 0; a < ob->totcol; a++)
        {
                Material *ma = give_current_material(ob, a+1);
                if (!ma) continue;
-               if(ma->adt && ma->adt->action)
+               if (ma->adt && ma->adt->action)
                {
                        /* isMatAnim = true; */
                        fcu = (FCurve*)ma->adt->action->curves.first;
@@ -152,7 +152,7 @@ float * AnimationExporter::get_eul_source_for_quat(Object *ob )
        {
                char * transformName = extract_transform_name( fcu->rna_path );
 
-               if( !strcmp(transformName, "rotation_quaternion") )     { 
+               if ( !strcmp(transformName, "rotation_quaternion") )    { 
                        for ( int i = 0 ; i < fcu->totvert ; i++){
                                *(quat + ( i * 4 ) + fcu->array_index) = fcu->bezt[i].vec[1][1];
                        }
@@ -184,7 +184,7 @@ std::string AnimationExporter::getObjectBoneName( Object* ob,const FCurve* fcu )
        char* boneName = strtok((char *)rna_path.c_str(), "\"");
        boneName = strtok(NULL,"\"");
 
-       if( boneName != NULL )
+       if ( boneName != NULL )
                return /*id_name(ob) + "_" +*/ std::string(boneName);
        else            
                return id_name(ob);
@@ -257,7 +257,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
        std::string output_id;
 
        //quat rotations are skipped for now, because of complications with determining axis.
-       if(quatRotation) 
+       if (quatRotation) 
        {
                float * eul  = get_eul_source_for_quat(ob);
                float * eul_axis = (float*)MEM_callocN(sizeof(float) * fcu->totvert, "quat output source values");
@@ -317,7 +317,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
                        target = get_camera_id(ob)
                        + "/" + get_camera_param_sid(fcu->rna_path, -1, axis_name, true);
 
-               if( ma ) 
+               if ( ma ) 
                        target = translate_id(id_name(ma)) + "-effect"
                        +"/common/" /*profile common is only supported */ + get_transform_sid(fcu->rna_path, -1, axis_name, true);
        }
@@ -348,7 +348,7 @@ bool AnimationExporter::is_bone_deform_group(Bone * bone)
 {   
        bool is_def;
        //Check if current bone is deform
-       if((bone->flag & BONE_NO_DEFORM) == 0 ) return true;
+       if ((bone->flag & BONE_NO_DEFORM) == 0 ) return true;
        //Check child bones
        else 
        {   
@@ -374,11 +374,11 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B
        {
                std::string bone_name = getObjectBoneName(ob_arm,fcu);
                int val = BLI_strcasecmp((char*)bone_name.c_str(),bone->name);
-               if(val==0) break;
+               if (val==0) break;
                fcu = fcu->next;
        }
 
-       if(!(fcu)) return; 
+       if (!(fcu)) return; 
        bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name);
        if (!pchan)
                return;
@@ -779,7 +779,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
                // SECOND_LIFE_COMPATIBILITY
                // AFAIK animation to second life is via BVH, but no
                // reason to not have the collada-animation be correct
-               if(export_settings->second_life)
+               if (export_settings->second_life)
                {
                        float temp[4][4];
                        copy_m4_m4(temp, bone->arm_mat);
@@ -788,7 +788,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
 
                        mult_m4_m4m4(mat, mat, temp);
 
-                       if(bone->parent)
+                       if (bone->parent)
                        {
                                copy_m4_m4(temp, bone->parent->arm_mat);
                                temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
@@ -1134,21 +1134,21 @@ bool AnimationExporter::hasAnimations(Scene *sce)
 
                FCurve *fcu = 0;
                //Check for object transform animations
-               if(ob->adt && ob->adt->action)
+               if (ob->adt && ob->adt->action)
                        fcu = (FCurve*)ob->adt->action->curves.first;
                //Check for Lamp parameter animations
-               else if( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
+               else if ( (ob->type == OB_LAMP ) && ((Lamp*)ob ->data)->adt && ((Lamp*)ob ->data)->adt->action )
                        fcu = (FCurve*)(((Lamp*)ob ->data)->adt->action->curves.first);
                //Check for Camera parameter animations
-               else if( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
+               else if ( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
                        fcu = (FCurve*)(((Camera*)ob ->data)->adt->action->curves.first);
 
                //Check Material Effect parameter animations.
-               for(int a = 0; a < ob->totcol; a++)
+               for (int a = 0; a < ob->totcol; a++)
                {
                        Material *ma = give_current_material(ob, a+1);
                        if (!ma) continue;
-                       if(ma->adt && ma->adt->action)
+                       if (ma->adt && ma->adt->action)
                        {
                                fcu = (FCurve*)ma->adt->action->curves.first;   
                        }
index 097e990..0e66a29 100644 (file)
@@ -119,7 +119,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
                                        bez.vec[1][1] = bc_get_float_value(output, j * dim + i);
 
 
-                                       if( curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER ||
+                                       if ( curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER ||
                                                curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_STEP) 
                                        {
                                                COLLADAFW::FloatOrDoubleArray& intan = curve->getInTangentValues();
@@ -132,7 +132,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
                                                // outtangent
                                                bez.vec[2][0] = bc_get_float_value(outtan, (j * 2 * dim ) + (2 * i)) * fps;
                                                bez.vec[2][1] = bc_get_float_value(outtan, (j * 2 * dim )+ (2 * i) + 1);
-                                               if(curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER) 
+                                               if (curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER) 
                                                        bez.ipo = BEZT_IPO_BEZ;
                                                else 
                                                        bez.ipo = BEZT_IPO_CONST;
@@ -964,25 +964,25 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
                                if (ef != NULL) { /* can be NULL [#28909] */
                                        const COLLADAFW::CommonEffectPointerArray& commonEffects  =  ef->getCommonEffects();
                                        COLLADAFW::EffectCommon *efc = commonEffects[0];
-                                       if((animType->material & MATERIAL_SHININESS) != 0){
+                                       if ((animType->material & MATERIAL_SHININESS) != 0){
                                                const COLLADAFW::FloatOrParam *shin = &(efc->getShininess());
                                                const COLLADAFW::UniqueId& listid =  shin->getAnimationList();
                                                Assign_float_animations( listid, AnimCurves , "specular_hardness" );
                                        }
 
-                                       if((animType->material & MATERIAL_IOR) != 0){
+                                       if ((animType->material & MATERIAL_IOR) != 0){
                                                const COLLADAFW::FloatOrParam *ior = &(efc->getIndexOfRefraction());
                                                const COLLADAFW::UniqueId& listid =  ior->getAnimationList();
                                                Assign_float_animations( listid, AnimCurves , "raytrace_transparency.ior" );
                                        }
 
-                                       if((animType->material & MATERIAL_SPEC_COLOR) != 0){
+                                       if ((animType->material & MATERIAL_SPEC_COLOR) != 0){
                                                const COLLADAFW::ColorOrTexture *cot = &(efc->getSpecular());
                                                const COLLADAFW::UniqueId& listid =  cot->getColor().getAnimationList();
                                                Assign_color_animations( listid, AnimCurves , "specular_color" );
                                        }
 
-                                       if((animType->material & MATERIAL_DIFF_COLOR) != 0){
+                                       if ((animType->material & MATERIAL_DIFF_COLOR) != 0){
                                                const COLLADAFW::ColorOrTexture *cot = &(efc->getDiffuse());
                                                const COLLADAFW::UniqueId& listid =  cot->getColor().getAnimationList();
                                                Assign_color_animations( listid, AnimCurves , "diffuse_color" );
@@ -1185,7 +1185,7 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
                        const COLLADAFW::Effect *ef = (COLLADAFW::Effect *) (FW_object_map[matuid]);
                        if (ef != NULL) { /* can be NULL [#28909] */
                                const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
-                               if(!commonEffects.empty()) {
+                               if (!commonEffects.empty()) {
                                        COLLADAFW::EffectCommon *efc = commonEffects[0];
                                        types->material =  setAnimType(&(efc->getShininess()),(types->material), MATERIAL_SHININESS);
                                        types->material =  setAnimType(&(efc->getSpecular().getColor()),(types->material), MATERIAL_SPEC_COLOR);
index 47d41a9..743d3c2 100644 (file)
@@ -193,7 +193,7 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene* sce,
 
        while( i != child_objects.end() )
        {
-               if((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name)))
+               if ((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name)))
                {
                        float backup_parinv[4][4];
                        copy_m4_m4(backup_parinv, (*i)->parentinv);
@@ -210,7 +210,7 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene* sce,
                        // TODO: when such objects are animated as
                        // single matrix the tweak must be applied
                        // to the result.
-                       if(export_settings->second_life)
+                       if (export_settings->second_life)
                        {
                                // tweak objects parentinverse to match compatibility
                                float temp[4][4];
@@ -274,7 +274,7 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW:
        }
 
        // SECOND_LIFE_COMPATIBILITY
-       if(export_settings->second_life)
+       if (export_settings->second_life)
        {
                // Remove rotations vs armature from transform
                // parent_rest_rot * mat * irest_rot
@@ -285,7 +285,7 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW:
 
                mult_m4_m4m4(mat, mat, temp);
 
-               if(bone->parent)
+               if (bone->parent)
                {
                        copy_m4_m4(temp, bone->parent->arm_mat);
                        temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
@@ -370,18 +370,18 @@ void ArmatureExporter::export_controller(Object* ob, Object *ob_arm)
 
                        for (j = 0; j < vert->totweight; j++) {
                                int joint_index = joint_index_by_def_index[vert->dw[j].def_nr];
-                               if(joint_index != -1 && vert->dw[j].weight > 0.0f)
+                               if (joint_index != -1 && vert->dw[j].weight > 0.0f)
                                {
                                        jw[joint_index] += vert->dw[j].weight;
                                        sumw += vert->dw[j].weight;
                                }
                        }
 
-                       if(sumw > 0.0f)
+                       if (sumw > 0.0f)
                        {
                                float invsumw = 1.0f/sumw;
                                vcounts.push_back(jw.size());
-                               for(std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m)
+                               for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m)
                                {
                                        joints.push_back((*m).first);
                                        weights.push_back(invsumw*(*m).second);
@@ -502,7 +502,7 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase
                        float inv_bind_mat[4][4];
 
                        // SECOND_LIFE_COMPATIBILITY
-                       if(export_settings->second_life)
+                       if (export_settings->second_life)
                        {
                                // Only translations, no rotation vs armature
                                float temp[4][4];
@@ -560,7 +560,7 @@ std::string ArmatureExporter::add_weights_source(Mesh *me, const std::string& co
 
        source.prepareToAppendValues();
 
-       for(std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
+       for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
                source.appendValues(*i);
        }
 
@@ -597,7 +597,7 @@ void ArmatureExporter::add_vertex_weights_element(const std::string& weights_sou
 
        // write deformer index - weight index pairs
        int weight_index = 0;
-       for(std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i)
+       for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i)
        {
                weightselem.appendValues(*i, weight_index++);
        }
index 8a54617..50ec298 100644 (file)
@@ -278,7 +278,7 @@ void ArmatureImporter::add_leaf_bone(float mat[][4], EditBone *bone,  COLLADAFW:
        TagsMap::iterator etit;
        ExtraTags *et = 0;
        etit = uid_tags_map.find(node->getUniqueId().toAscii());
-       if(etit !=  uid_tags_map.end())
+       if (etit !=  uid_tags_map.end())
        {
                et = etit->second;
                //else return;
@@ -306,7 +306,7 @@ void ArmatureImporter::fix_leaf_bones( )
                float vec[3] = {0.0f, 0.0f, 0.1f};
                
                // if parent: take parent length and direction
-               if(leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head);
+               if (leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head);
 
                copy_v3_v3(leaf.bone->tail, leaf.bone->head);
                add_v3_v3v3(leaf.bone->tail, leaf.bone->head, vec);
@@ -767,7 +767,7 @@ Object *ArmatureImporter::get_armature_for_joint(COLLADAFW::Node *node)
 
        std::map<COLLADAFW::UniqueId, Object*>::iterator arm;
        for (arm = unskinned_armature_map.begin(); arm != unskinned_armature_map.end(); arm++) {
-               if(arm->first == node->getUniqueId() )
+               if (arm->first == node->getUniqueId() )
                        return arm->second;
        }
        return NULL;
index 6e04a17..647a871 100644 (file)
@@ -130,7 +130,7 @@ extern char build_rev[];
 char *bc_CustomData_get_layer_name(const struct CustomData *data, int type, int n)
 {
        int layer_index = CustomData_get_layer_index(data, type);
-       if(layer_index < 0) return NULL;
+       if (layer_index < 0) return NULL;
 
        return data->layers[layer_index+n].name;
 }
@@ -139,7 +139,7 @@ char *bc_CustomData_get_active_layer_name(const CustomData *data, int type)
 {
        /* get the layer index of the active layer of type */
        int layer_index = CustomData_get_active_layer_index(data, type);
-       if(layer_index < 0) return NULL;
+       if (layer_index < 0) return NULL;
 
        return data->layers[layer_index].name;
 }
@@ -178,30 +178,30 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
        switch(RNA_property_enum_get(&unit_settings, system)) {
                case USER_UNIT_NONE:
                case USER_UNIT_METRIC:
-                       if(linearmeasure == 0.001f) {
+                       if (linearmeasure == 0.001f) {
                                unitname = "millimeter";
                        }
-                       else if(linearmeasure == 0.01f) {
+                       else if (linearmeasure == 0.01f) {
                                unitname = "centimeter";
                        }
-                       else if(linearmeasure == 0.1f) {
+                       else if (linearmeasure == 0.1f) {
                                unitname = "decimeter";
                        }
-                       else if(linearmeasure == 1.0f) {
+                       else if (linearmeasure == 1.0f) {
                                unitname = "meter";
                        }
-                       else if(linearmeasure == 1000.0f) {
+                       else if (linearmeasure == 1000.0f) {
                                unitname = "kilometer";
                        }
                        break;
                case USER_UNIT_IMPERIAL:
-                       if(linearmeasure == 0.0254f) {
+                       if (linearmeasure == 0.0254f) {
                                unitname = "inch";
                        }
-                       else if(linearmeasure == 0.3048f) {
+                       else if (linearmeasure == 0.3048f) {
                                unitname = "foot";
                        }
-                       else if(linearmeasure == 0.9144f) {
+                       else if (linearmeasure == 0.9144f) {
                                unitname = "yard";
                        }
                        break;
@@ -211,7 +211,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
 
        asset.setUnit(unitname, linearmeasure);
        asset.setUpAxisType(COLLADASW::Asset::Z_UP);
-       if(U.author[0] != '\0') {
+       if (U.author[0] != '\0') {
                asset.getContributor().mAuthor = U.author;
        }
        else {
@@ -227,13 +227,13 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
        asset.add();
        
        // <library_cameras>
-       if(has_object_type(sce, OB_CAMERA)) {
+       if (has_object_type(sce, OB_CAMERA)) {
                CamerasExporter ce(&sw, this->export_settings);
                ce.exportCameras(sce);
        }
        
        // <library_lights>
-       if(has_object_type(sce, OB_LAMP)) {
+       if (has_object_type(sce, OB_LAMP)) {
                LightsExporter le(&sw, this->export_settings);
                le.exportLights(sce);
        }
@@ -251,7 +251,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
        me.exportMaterials(sce);
 
        // <library_geometries>
-       if(has_object_type(sce, OB_MESH)) {
+       if (has_object_type(sce, OB_MESH)) {
                GeometryExporter ge(&sw, this->export_settings);
                ge.exportGeom(sce);
        }
@@ -262,7 +262,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
 
        // <library_controllers>
        ArmatureExporter arm_exporter(&sw, this->export_settings);
-       if(has_object_type(sce, OB_ARMATURE)) {
+       if (has_object_type(sce, OB_ARMATURE)) {
                arm_exporter.export_controllers(sce);
        }
 
index 4ad79e0..9e60497 100644 (file)
@@ -126,7 +126,7 @@ bool DocumentImporter::import()
                return false;
        }
        
-       if(errorHandler.hasError())
+       if (errorHandler.hasError())
                return false;
        
        /** TODO set up scene graph and such here */
@@ -161,7 +161,7 @@ void DocumentImporter::start(){}
 
 void DocumentImporter::finish()
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return;
                
        /** TODO Break up and put into 2-pass parsing of DAE */
@@ -339,7 +339,7 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
                // transformation matrix and apply it to the newly instantiated
                // object to account for node hierarchy transforms in
                // .dae
-               if(source_node) {
+               if (source_node) {
                        COLLADABU::Math::Matrix4 mat4 = source_node->getTransformationMatrix();
                        COLLADABU::Math::Matrix4 bmat4 = mat4.transpose(); // transpose to get blender row-major order
                        float mat[4][4];
@@ -492,7 +492,7 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
        \return The writer should return true, if writing succeeded, false otherwise.*/
 bool DocumentImporter::writeVisualScene ( const COLLADAFW::VisualScene* visualScene ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        // this method called on post process after writeGeometry, writeMaterial, etc.
@@ -515,7 +515,7 @@ bool DocumentImporter::writeVisualScene ( const COLLADAFW::VisualScene* visualSc
        \return The writer should return true, if writing succeeded, false otherwise.*/
 bool DocumentImporter::writeLibraryNodes ( const COLLADAFW::LibraryNodes* libraryNodes ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        Scene *sce = CTX_data_scene(mContext);
@@ -533,7 +533,7 @@ bool DocumentImporter::writeLibraryNodes ( const COLLADAFW::LibraryNodes* librar
        \return The writer should return true, if writing succeeded, false otherwise.*/
 bool DocumentImporter::writeGeometry ( const COLLADAFW::Geometry* geom ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        return mesh_importer.write_geometry(geom);
@@ -543,7 +543,7 @@ bool DocumentImporter::writeGeometry ( const COLLADAFW::Geometry* geom )
        \return The writer should return true, if writing succeeded, false otherwise.*/
 bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        const std::string& str_mat_id = cmat->getName().size() ? cmat->getName() : cmat->getOriginalId();
@@ -699,10 +699,10 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
                }
        }
        
-       if(ef->getOpacity().isTexture()) {
+       if (ef->getOpacity().isTexture()) {
                COLLADAFW::Texture ctex = ef->getOpacity().getTexture();
                mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
-               if(mtex != NULL) {
+               if (mtex != NULL) {
                        mtex->mapto = MAP_ALPHA;
                        mtex->tex->imaflag |= TEX_USEALPHA;
                        i++;
@@ -732,7 +732,7 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
 
 bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
        
        const COLLADAFW::UniqueId& uid = effect->getUniqueId();
@@ -744,7 +744,7 @@ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect )
        
        Material *ma = uid_effect_map[uid];
        std::map<COLLADAFW::UniqueId, Material*>::iterator  iter;
-       for(iter = uid_material_map.begin(); iter != uid_material_map.end() ; iter++ )
+       for (iter = uid_material_map.begin(); iter != uid_material_map.end() ; iter++ )
        {
                if ( iter->second == ma ) {
                        this->FW_object_map[iter->first] = effect;
@@ -770,7 +770,7 @@ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect )
        \return The writer should return true, if writing succeeded, false otherwise.*/
 bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        Camera *cam = NULL;
@@ -886,7 +886,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
        \return The writer should return true, if writing succeeded, false otherwise.*/
 bool DocumentImporter::writeImage( const COLLADAFW::Image* image ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        // XXX maybe it is necessary to check if the path is absolute or relative
@@ -911,7 +911,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
        \return The writer should return true, if writing succeeded, false otherwise.*/
 bool DocumentImporter::writeLight( const COLLADAFW::Light* light ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
 
        Lamp *lamp = NULL;
@@ -920,7 +920,7 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
        TagsMap::iterator etit;
        ExtraTags *et = 0;
        etit = uid_tags_map.find(light->getUniqueId().toAscii());
-       if(etit != uid_tags_map.end())
+       if (etit != uid_tags_map.end())
                et = etit->second;
 
        la_id = light->getOriginalId();
@@ -934,7 +934,7 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
        }
 
        // if we find an ExtraTags for this, use that instead.
-       if(et && et->isProfile("blender")) {
+       if (et && et->isProfile("blender")) {
                et->setData("type", &(lamp->type));
                et->setData("flag", &(lamp->flag));
                et->setData("mode", &(lamp->mode));
@@ -1007,12 +1007,12 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
                        lamp->b = col.getBlue();
                }
 
-               if(IS_EQ(linatt, 0.0f) && quadatt > 0.0f) {
+               if (IS_EQ(linatt, 0.0f) && quadatt > 0.0f) {
                        att2 = quadatt;
                        d = sqrt(1.0f/quadatt);
                }
                // linear light
-               else if(IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
+               else if (IS_EQ(quadatt, 0.0f) && linatt > 0.0f) {
                        att1 = linatt;
                        d = (1.0f/linatt);
                }
@@ -1041,9 +1041,9 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
                                        lamp->type = LA_SPOT;
                                        lamp->att1 = att1;
                                        lamp->att2 = att2;
-                                       if(IS_EQ(att1, 0.0f) && att2 > 0)
+                                       if (IS_EQ(att1, 0.0f) && att2 > 0)
                                                lamp->falloff_type = LA_FALLOFF_INVSQUARE;
-                                       if(IS_EQ(att2, 0.0f) && att1 > 0)
+                                       if (IS_EQ(att2, 0.0f) && att1 > 0)
                                                lamp->falloff_type = LA_FALLOFF_INVLINEAR;
                                        lamp->spotsize = light->getFallOffAngle().getValue();
                                        lamp->spotblend = light->getFallOffExponent().getValue();
@@ -1061,9 +1061,9 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
                                        lamp->type = LA_LOCAL;
                                        lamp->att1 = att1;
                                        lamp->att2 = att2;
-                                       if(IS_EQ(att1, 0.0f) && att2 > 0)
+                                       if (IS_EQ(att1, 0.0f) && att2 > 0)
                                                lamp->falloff_type = LA_FALLOFF_INVSQUARE;
-                                       if(IS_EQ(att2, 0.0f) && att1 > 0)
+                                       if (IS_EQ(att2, 0.0f) && att1 > 0)
                                                lamp->falloff_type = LA_FALLOFF_INVLINEAR;
                                }
                                break;
@@ -1084,7 +1084,7 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
 // this function is called only for animations that pass COLLADAFW::validate
 bool DocumentImporter::writeAnimation( const COLLADAFW::Animation* anim ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        // return true;
@@ -1094,7 +1094,7 @@ bool DocumentImporter::writeAnimation( const COLLADAFW::Animation* anim )
 // called on post-process stage after writeVisualScenes
 bool DocumentImporter::writeAnimationList( const COLLADAFW::AnimationList* animationList ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        // return true;
@@ -1111,7 +1111,7 @@ bool DocumentImporter::writeSkinControllerData( const COLLADAFW::SkinControllerD
 // this is called on postprocess, before writeVisualScenes
 bool DocumentImporter::writeController( const COLLADAFW::Controller* controller ) 
 {
-       if(mImportStage!=General)
+       if (mImportStage!=General)
                return true;
                
        return armature_importer.write_controller(controller);
@@ -1129,7 +1129,7 @@ bool DocumentImporter::writeKinematicsScene( const COLLADAFW::KinematicsScene* k
 
 ExtraTags* DocumentImporter::getExtraTags(const COLLADAFW::UniqueId &uid)
 {
-       if(uid_tags_map.find(uid.toAscii())==uid_tags_map.end()) {
+       if (uid_tags_map.find(uid.toAscii())==uid_tags_map.end()) {
                return NULL;
        }
        return uid_tags_map[uid.toAscii()];
index 0dbd44f..dd20e7b 100644 (file)
@@ -63,7 +63,7 @@ bool EffectsExporter::hasEffects(Scene *sce)
        while(base) {
                Object *ob= base->object;
                int a;
-               for(a = 0; a < ob->totcol; a++)
+               for (a = 0; a < ob->totcol; a++)
                {
                        Material *ma = give_current_material(ob, a+1);
 
@@ -79,7 +79,7 @@ bool EffectsExporter::hasEffects(Scene *sce)
 
 void EffectsExporter::exportEffects(Scene *sce)
 {
-       if(hasEffects(sce)) {
+       if (hasEffects(sce)) {
                this->scene = sce;
                openLibrary();
                MaterialFunctor mf;
@@ -129,7 +129,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
        ep.setProfileType(COLLADASW::EffectProfile::COMMON);
        ep.openProfile();
        // set shader type - one of three blinn, phong or lambert
-       if(ma->spec>0.0f) {
+       if (ma->spec>0.0f) {
                if (ma->spec_shader == MA_SPEC_BLINN) {
                        writeBlinn(ep, ma);
                }
@@ -140,7 +140,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
                }
        }
        else {
-               if(ma->diff_shader == MA_DIFF_LAMBERT) {
+               if (ma->diff_shader == MA_DIFF_LAMBERT) {
                        writeLambert(ep, ma);
                }
                else {
@@ -177,7 +177,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
 
        // ambient
        /* ma->ambX is calculated only on render, so lets do it here manually and not rely on ma->ambX. */
-       if(this->scene->world)
+       if (this->scene->world)
                cot = getcol(this->scene->world->ambr*ma->amb, this->scene->world->ambg*ma->amb, this->scene->world->ambb*ma->amb, 1.0f);
        else
                cot = getcol(ma->amb, ma->amb, ma->amb, 1.0f);
@@ -220,7 +220,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
                Image *ima = t->tex->ima;
                
                // Image not set for texture
-               if(!ima) continue;
+               if (!ima) continue;
                
                std::string key(id_name(ima));
                key = translate_id(key);
@@ -266,7 +266,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
                Image *ima = t->tex->ima;
                
                // Image not set for texture
-               if(!ima) continue;
+               if (!ima) continue;
 
                // we assume map input is always TEXCO_UV
 
index d6d3aa8..6606fe1 100644 (file)
@@ -54,7 +54,7 @@ bool ExtraHandler::textData(const char* text, size_t textLength)
 {
        char buf[1024];
        
-       if(currentElement.length() == 0 || currentExtraTags == 0) return false;
+       if (currentElement.length() == 0 || currentExtraTags == 0) return false;
        
        BLI_snprintf(buf, textLength+1, "%s", text);
        currentExtraTags->addTag(currentElement, std::string(buf));
@@ -65,11 +65,11 @@ bool ExtraHandler::parseElement (
        const char* profileName, 
        const unsigned long& elementHash, 
        const COLLADAFW::UniqueId& uniqueId ) {
-               if(BLI_strcaseeq(profileName, "blender")) {
+               if (BLI_strcaseeq(profileName, "blender")) {
                        //printf("In parseElement for supported profile %s for id %s\n", profileName, uniqueId.toAscii().c_str());
                        currentUid = uniqueId;
                        ExtraTags *et = dimp->getExtraTags(uniqueId);
-                       if(!et) {
+                       if (!et) {
                                et = new ExtraTags(std::string(profileName));
                                dimp->addExtraTags(uniqueId, et);
                        }
index b1b1936..c5a1268 100644 (file)
@@ -56,7 +56,7 @@ bool ExtraTags::addTag( std::string tag,  std::string data)
 
 int ExtraTags::asInt( std::string tag, bool *ok)
 {
-       if(tags.find(tag) == tags.end()) {
+       if (tags.find(tag) == tags.end()) {
                *ok = false;
                return -1;
        }
@@ -66,7 +66,7 @@ int ExtraTags::asInt( std::string tag, bool *ok)
 
 float ExtraTags::asFloat( std::string tag, bool *ok)
 {
-       if(tags.find(tag) == tags.end()) {
+       if (tags.find(tag) == tags.end()) {
                *ok = false;
                return -1.0f;
        }
@@ -76,7 +76,7 @@ float ExtraTags::asFloat( std::string tag, bool *ok)
 
 std::string ExtraTags::asString( std::string tag, bool *ok)
 {
-       if(tags.find(tag) == tags.end()) {
+       if (tags.find(tag) == tags.end()) {
                *ok = false;
                return "";
        }
@@ -89,28 +89,28 @@ void ExtraTags::setData(std::string tag, short *data)
 {
        bool ok = false;
        int tmp = asInt(tag, &ok);
-       if(ok)
+       if (ok)
                *data = (short)tmp;
 }
 void ExtraTags::setData(std::string tag, int *data)
 {
        bool ok = false;
        int tmp = asInt(tag, &ok);
-       if(ok)
+       if (ok)
                *data = tmp;
 }
 void ExtraTags::setData(std::string tag, float *data)
 {
        bool ok = false;
        float tmp = asFloat(tag, &ok);
-       if(ok)
+       if (ok)
                *data = tmp;
 }
 void ExtraTags::setData(std::string tag, char *data)
 {
        bool ok = false;
        int tmp = asInt(tag, &ok);
-       if(ok)
+       if (ok)
                *data = (char)tmp;
 }
        
index 2af1df9..ca112ab 100644 (file)
@@ -109,7 +109,7 @@ void GeometryExporter::operator()(Object *ob)
 
        // XXX slow             
        if (ob->totcol) {
-               for(int a = 0; a < ob->totcol; a++)     {
+               for (int a = 0; a < ob->totcol; a++)    {
                        createPolylist(a, has_uvs, has_color, ob, geom_id, norind);
                }
        }
index 3926cb4..3775a63 100644 (file)
@@ -51,7 +51,7 @@ bool ImagesExporter::hasImages(Scene *sce)
        while(base) {
                Object *ob= base->object;
                int a;
-               for(a = 0; a < ob->totcol; a++)
+               for (a = 0; a < ob->totcol; a++)
                {
                        Material *ma = give_current_material(ob, a+1);
 
@@ -71,7 +71,7 @@ bool ImagesExporter::hasImages(Scene *sce)
 
 void ImagesExporter::exportImages(Scene *sce)
 {
-       if(hasImages(sce)) {
+       if (hasImages(sce)) {
                openLibrary();
                MaterialFunctor mf;
                mf.forEachMaterialInScene<ImagesExporter>(sce, *this, this->export_settings->selected);
index 40ca1bc..a605bde 100644 (file)
@@ -43,7 +43,7 @@
 
 void InstanceWriter::add_material_bindings(COLLADASW::BindMaterial& bind_material, Object *ob)
 {
-       for(int a = 0; a < ob->totcol; a++)     {
+       for (int a = 0; a < ob->totcol; a++)    {
                Material *ma = give_current_material(ob, a+1);
                        
                COLLADASW::InstanceMaterialList& iml = bind_material.getInstanceMaterialList();
index d74a1d1..51242b3 100644 (file)
@@ -73,7 +73,7 @@ void LightsExporter::operator()(Object *ob)
        
        constatt = 1.0f;
        
-       if(la->falloff_type==LA_FALLOFF_INVLINEAR) {
+       if (la->falloff_type==LA_FALLOFF_INVLINEAR) {
                linatt = 1.0f / d;
                quadatt = 0.0f;
        }
index b667799..1e3358c 100644 (file)
@@ -35,7 +35,7 @@ MaterialsExporter::MaterialsExporter(COLLADASW::StreamWriter *sw, const ExportSe
 
 void MaterialsExporter::exportMaterials(Scene *sce)
 {
-       if(hasMaterials(sce)) {
+       if (hasMaterials(sce)) {
                openLibrary();
 
                MaterialFunctor mf;
@@ -53,7 +53,7 @@ bool MaterialsExporter::hasMaterials(Scene *sce)
        while(base) {
                Object *ob= base->object;
                int a;
-               for(a = 0; a < ob->totcol; a++)
+               for (a = 0; a < ob->totcol; a++)
                {
                        Material *ma = give_current_material(ob, a+1);
 
index 2539756..e500056 100644 (file)
@@ -145,7 +145,7 @@ void WVDataWrapper::print()
 void UVDataWrapper::getUV(int uv_index, float *uv)
 {
        int stride = mVData->getStride(0);
-       if(stride==0) stride = 2;
+       if (stride==0) stride = 2;
 
        switch(mVData->getType()) {
        case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT:
@@ -281,7 +281,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)      // checks if mesh has sup
                        COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons*)mp;
                        COLLADAFW::Polygons::VertexCountArray& vca = mpvc->getGroupedVerticesVertexCountArray();
                        
-                       for(unsigned int j = 0; j < vca.getCount(); j++){
+                       for (unsigned int j = 0; j < vca.getCount(); j++){
                                int count = vca[j];
                                if (count < 3) {
                                        fprintf(stderr, "Primitive %s in %s has at least one face with vertex count < 3\n",
@@ -291,7 +291,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)      // checks if mesh has sup
                        }
                                
                }
-               else if(type != COLLADAFW::MeshPrimitive::TRIANGLES && type!= COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
+               else if (type != COLLADAFW::MeshPrimitive::TRIANGLES && type!= COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
                        fprintf(stderr, "Primitive type %s is not supported.\n", type_str);
                        return false;
                }
@@ -310,7 +310,7 @@ void MeshImporter::read_vertices(COLLADAFW::Mesh *mesh, Mesh *me)
        // vertices
        COLLADAFW::MeshVertexData& pos = mesh->getPositions();
        int stride = pos.getStride(0);
-       if(stride==0) stride = 3;
+       if (stride==0) stride = 3;
        
        me->totvert = mesh->getPositions().getFloatValues()->getCount() / stride;
        me->mvert = (MVert*)CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
@@ -742,12 +742,12 @@ MTex *MeshImporter::assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBindi
        size_t setindex = ctexture.getSetIndex();
        std::string uvname = ctexture.getSemantic();
        
-       if(setindex==-1) return NULL;
+       if (setindex==-1) return NULL;
        
        const CustomData *data = &me->fdata;
        int layer_index = CustomData_get_layer_index(data, CD_MTFACE);
 
-       if(layer_index == -1) return NULL;
+       if (layer_index == -1) return NULL;
 
        CustomDataLayer *cdl = &data->layers[layer_index+setindex];
        
@@ -798,7 +798,7 @@ MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmateri
        std::multimap<COLLADAFW::UniqueId, COLLADAFW::UniqueId>::iterator it;
        it=materials_mapped_to_geom.find(*geom_uid);
        while(it!=materials_mapped_to_geom.end()) {
-               if(it->second == ma_uid && it->first == *geom_uid) return NULL; // do nothing if already found
+               if (it->second == ma_uid && it->first == *geom_uid) return NULL; // do nothing if already found
                it++;
        }
        // first time we get geom_uid, ma_uid pair. Save for later check.
@@ -913,7 +913,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
        // loop through geom's materials
        for (unsigned int i = 0; i < mat_array.getCount(); i++) {
                
-               if(mat_array[i].getReferencedMaterial().isValid()) {
+               if (mat_array[i].getReferencedMaterial().isValid()) {
                        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);
index b6be8a5..9010fd5 100644 (file)
@@ -47,7 +47,7 @@ void SceneExporter::exportHierarchy(Scene *sce)
                Object *ob = base->object;
 
                if (!ob->parent) {
-                       if(sce->lay & ob->lay) {
+                       if (sce->lay & ob->lay) {
                                switch(ob->type) {
                                        case OB_MESH:
                                        case OB_CAMERA:
@@ -144,17 +144,17 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
 
        // empty object
        else if (ob->type == OB_EMPTY) { // TODO: handle groups (OB_DUPLIGROUP
-               if((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) {
+               if ((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) {
                        GroupObject *go = NULL;
                        Group *gr = ob->dup_group;
                        /* printf("group detected '%s'\n", gr->id.name+2); */
-                       for(go = (GroupObject*)(gr->gobject.first); go; go=go->next) {
+                       for (go = (GroupObject*)(gr->gobject.first); go; go=go->next) {
                                printf("\t%s\n", go->ob->id.name);
                        }
                }
        }
 
-       for(std::list<Object*>::iterator i= child_objects.begin(); i != child_objects.end(); ++i)
+       for (std::list<Object*>::iterator i= child_objects.begin(); i != child_objects.end(); ++i)
        {
                writeNodes(*i, sce);
        }
index 10a9653..f441833 100644 (file)
@@ -95,18 +95,18 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
        */
 
        /* Using parentinv should allow use of existing curves */
-       if(ob->parent)
+       if (ob->parent)
        {
                // If parentinv is identity don't add it.
                bool add_parinv = false;
 
-               for(int i = 0; i < 16; ++i)
+               for (int i = 0; i < 16; ++i)
                {
                        float f = (i % 4 == i / 4) ? 1.0f : 0.0f;
                        add_parinv |= (ob->parentinv[i % 4][i / 4] != f);
                }
 
-               if(add_parinv)
+               if (add_parinv)
                {
                        double dmat[4][4];
                        UnitConverter converter;
index 39114f6..70bf055 100644 (file)
@@ -44,7 +44,7 @@ extern "C"
        int collada_import(bContext *C, const char *filepath)
        {
                DocumentImporter imp (C, filepath);
-               if(imp.import()) return 1;
+               if (imp.import()) return 1;
 
                return 0;
        }
@@ -58,9 +58,9 @@ extern "C"
                export_settings.filepath = (char *)filepath;
 
                /* annoying, collada crashes if file cant be created! [#27162] */
-               if(!BLI_exists(filepath)) {
+               if (!BLI_exists(filepath)) {
                        BLI_make_existing_file(filepath); /* makes the dir if its not there */
-                       if(BLI_file_touch(filepath) == 0) {
+                       if (BLI_file_touch(filepath) == 0) {
                                return 0;
                        }
                }
index d7263e0..fc4093b 100644 (file)
@@ -206,7 +206,7 @@ std::string translate_id(const std::string &id)
        {
                id_translated[i] = translate_name_map[(unsigned int)id_translated[i]];
        }
-       // It's so much workload now, the if() should speed up things.
+       // It's so much workload now, the if () should speed up things.
        if (id_translated != id)
        {
                // Search duplicates
index c3aa735..4aed29d 100644 (file)
@@ -61,8 +61,8 @@ int bc_test_parent_loop(Object *par, Object *ob)
 {
        /* test if 'ob' is a parent somewhere in par's parents */
        
-       if(par == NULL) return 0;
-       if(ob == par) return 1;
+       if (par == NULL) return 0;
+       if (ob == par) return 1;
        
        return bc_test_parent_loop(par->parent, ob);
 }
index fbcda86..aeab4f2 100644 (file)
@@ -3673,7 +3673,7 @@ static int is_u_selected(Nurb *nu, int u)
        /* what about resolu == 2? */
        bp= nu->bp+u;
        for (v=0; v<nu->pntsv-1; v++, bp+=nu->pntsu) {
-               if (v) if(bp->f1 & SELECT) return 1;
+               if (v) if (bp->f1 & SELECT) return 1;
        }
        
        return 0;
@@ -6376,7 +6376,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
                                        bp->vec[0]+= fac*grid;
                                        fac= (float)b -1.5f;
                                        bp->vec[1]+= fac*grid;
-                                       if (a==1 || a==2) if(b==1 || b==2) {
+                                       if (a==1 || a==2) if (b==1 || b==2) {
                                                bp->vec[2]+= grid;
                                        }
                                        mul_m4_v3(mat,bp->vec);
index b900264..b6821ab 100644 (file)
@@ -81,7 +81,7 @@
 
 /* avoid unneeded calls to ui_get_but_val */
 #define UI_BUT_VALUE_UNSET DBL_MAX
-#define UI_GET_BUT_VALUE_INIT(_but, _value) if(_value == DBL_MAX) {  (_value)= ui_get_but_val(_but); }
+#define UI_GET_BUT_VALUE_INIT(_but, _value) if (_value == DBL_MAX) {  (_value)= ui_get_but_val(_but); }
 
 /* 
  * a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt
index 25c616c..a2f253c 100644 (file)
@@ -161,12 +161,12 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
        glGetFloatv(GL_CURRENT_COLOR, color);
 
        /* 'shade' defines strength of shading */       
-       coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f;
-       coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f;
-       coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f;
-       coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f;
-       coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f;
-       coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f;
+       coltop[0]= color[0]+shadetop; if (coltop[0]>1.0f) coltop[0]= 1.0f;
+       coltop[1]= color[1]+shadetop; if (coltop[1]>1.0f) coltop[1]= 1.0f;
+       coltop[2]= color[2]+shadetop; if (coltop[2]>1.0f) coltop[2]= 1.0f;
+       coldown[0]= color[0]+shadedown; if (coldown[0]<0.0f) coldown[0]= 0.0f;
+       coldown[1]= color[1]+shadedown; if (coldown[1]<0.0f) coldown[1]= 0.0f;
+       coldown[2]= color[2]+shadedown; if (coldown[2]<0.0f) coldown[2]= 0.0f;
 
        glShadeModel(GL_SMOOTH);
        glBegin(mode);
@@ -269,12 +269,12 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
        glGetFloatv(GL_CURRENT_COLOR, color);
 
        /* 'shade' defines strength of shading */       
-       colLeft[0]= color[0]+shadeLeft; if(colLeft[0]>1.0f) colLeft[0]= 1.0f;
-       colLeft[1]= color[1]+shadeLeft; if(colLeft[1]>1.0f) colLeft[1]= 1.0f;
-       colLeft[2]= color[2]+shadeLeft; if(colLeft[2]>1.0f) colLeft[2]= 1.0f;
-       colRight[0]= color[0]+shadeRight; if(colRight[0]<0.0f) colRight[0]= 0.0f;
-       colRight[1]= color[1]+shadeRight; if(colRight[1]<0.0f) colRight[1]= 0.0f;
-       colRight[2]= color[2]+shadeRight; if(colRight[2]<0.0f) colRight[2]= 0.0f;
+       colLeft[0]= color[0]+shadeLeft; if (colLeft[0]>1.0f) colLeft[0]= 1.0f;
+       colLeft[1]= color[1]+shadeLeft; if (colLeft[1]>1.0f) colLeft[1]= 1.0f;
+       colLeft[2]= color[2]+shadeLeft; if (colLeft[2]>1.0f) colLeft[2]= 1.0f;
+       colRight[0]= color[0]+shadeRight; if (colRight[0]<0.0f) colRight[0]= 0.0f;
+       colRight[1]= color[1]+shadeRight; if (colRight[1]<0.0f) colRight[1]= 0.0f;
+       colRight[2]= color[2]+shadeRight; if (colRight[2]<0.0f) colRight[2]= 0.0f;
 
        glShadeModel(GL_SMOOTH);
        glBegin(mode);
index ff72c13..1396277 100644 (file)
@@ -1342,8 +1342,8 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
                        dir1 &= (UI_TOP|UI_DOWN);
                }
 
-               if (dir2==0) if(dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN;
-               if (dir2==0) if(dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT;
+               if (dir2==0) if (dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN;
+               if (dir2==0) if (dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT;
                
                /* no space at all? don't change */
                if (left || right) {
index d47bd44..91ff400 100644 (file)
@@ -953,7 +953,7 @@ static void do_constraint_panels(bContext *C, void *ob_pt, int event)
        // if there are problems because of this, then rna needs changed update functions.
        // 
        // object_test_constraints(ob);
-       // if(ob->pose) update_pose_constraint_flags(ob->pose);
+       // if (ob->pose) update_pose_constraint_flags(ob->pose);
        
        if (ob->type==OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
        else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
index 22ecf61..3717591 100644 (file)
@@ -908,7 +908,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
        
        CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
 
-               /* if(base->object->type==OB_LAMP) islamp= 1; */
+               /* if (base->object->type==OB_LAMP) islamp= 1; */
 
                /* deselect object -- it could be used in other scenes */
                base->object->flag &= ~SELECT;
index 906ee65..341ba36 100644 (file)
@@ -1115,7 +1115,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
                        base->object->lay= lay;
                        base->object->flag &= ~SELECT;
                        base->flag &= ~SELECT;
-                       /* if(base->object->type==OB_LAMP) islamp= 1; */
+                       /* if (base->object->type==OB_LAMP) islamp= 1; */
                }
                CTX_DATA_END;
        }
@@ -1127,7 +1127,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
                        local= base->lay & 0xFF000000;  
                        base->lay= lay + local;
                        base->object->lay= lay;
-                       /* if(base->object->type==OB_LAMP) islamp= 1; */
+                       /* if (base->object->type==OB_LAMP) islamp= 1; */
                }
                CTX_DATA_END;
        }
index 36571fc..959bda2 100644 (file)
@@ -227,7 +227,7 @@ static int object_shape_key_mirror(bContext *C, Object *ob)
                        /* currently editmode isn't supported by mesh so
                         * ignore here for now too */
 
-                       /* if(lt->editlatt) lt= lt->editlatt->latt; */
+                       /* if (lt->editlatt) lt= lt->editlatt->latt; */
 
                        for (w=0; w<lt->pntsw; w++) {
                                for (v=0; v<lt->pntsv; v++) {
index 68d464d..bf3a9ff 100644 (file)
@@ -90,15 +90,15 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys);
 #define KEY_K                                  PTCacheEditKey *key; int k
 #define POINT_P                                        PTCacheEditPoint *point; int p
 #define LOOP_POINTS                            for (p=0, point=edit->points; p<edit->totpoint; p++, point++)
-#define LOOP_VISIBLE_POINTS            for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!(point->flag & PEP_HIDE))
-#define LOOP_SELECTED_POINTS   for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point_is_selected(point))
-#define LOOP_UNSELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(!point_is_selected(point))
-#define LOOP_EDITED_POINTS             for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_EDIT_RECALC)
-#define LOOP_TAGGED_POINTS             for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if(point->flag & PEP_TAG)
+#define LOOP_VISIBLE_POINTS            for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (!(point->flag & PEP_HIDE))
+#define LOOP_SELECTED_POINTS   for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point_is_selected(point))
+#define LOOP_UNSELECTED_POINTS for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (!point_is_selected(point))
+#define LOOP_EDITED_POINTS             for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point->flag & PEP_EDIT_RECALC)
+#define LOOP_TAGGED_POINTS             for (p=0, point=edit->points; p<edit->totpoint; p++, point++) if (point->flag & PEP_TAG)
 #define LOOP_KEYS                              for (k=0, key=point->keys; k<point->totkey; k++, key++)
-#define LOOP_VISIBLE_KEYS              for (k=0, key=point->keys; k<point->totkey; k++, key++) if(!(key->flag & PEK_HIDE))
-#define LOOP_SELECTED_KEYS             for (k=0, key=point->keys; k<point->totkey; k++, key++) if((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE))
-#define LOOP_TAGGED_KEYS               for (k=0, key=point->keys; k<point->totkey; k++, key++) if(key->flag & PEK_TAG)
+#define LOOP_VISIBLE_KEYS              for (k=0, key=point->keys; k<point->totkey; k++, key++) if (!(key->flag & PEK_HIDE))
+#define LOOP_SELECTED_KEYS             for (k=0, key=point->keys; k<point->totkey; k++, key++) if ((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE))
+#define LOOP_TAGGED_KEYS               for (k=0, key=point->keys; k<point->totkey; k++, key++) if (key->flag & PEK_TAG)
 
 #define KEY_WCO                                        (key->flag & PEK_USE_WCO ? key->world_co : key->co)
 
@@ -2152,7 +2152,7 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys)
 
                        hkey= pa->hair;
                        LOOP_KEYS {
-                               while(key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) {
+                               while (key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) {
                                        key++;
                                        hkey++;
                                }
@@ -2366,7 +2366,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
                /* remove tagged particles - don't do mirror here! */
                remove_tagged_particles(ob, psys, 0);
                totremoved += removed;
-       } while(removed);
+       } while (removed);
 
        if (totremoved == 0)
                return OPERATOR_CANCELLED;
@@ -2645,7 +2645,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
                        newpa->fuv[1]= pa->fuv[1];
                        newpa->fuv[2]= pa->fuv[0];
                        newpa->fuv[3]= pa->fuv[3];
-                       while(rotation-- > 0)
+                       while (rotation-- > 0)
                                if (me->mface[pa->num].v4) {
                                        SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3]);
                                }
@@ -3214,7 +3214,7 @@ static int brush_add(PEData *data, short number)
        for (i=0; i<number; i++) {
                if (number>1) {
                        dmx=dmy=size;
-                       while(dmx*dmx+dmy*dmy>size2) {
+                       while (dmx*dmx+dmy*dmy>size2) {
                                dmx=(short)((2.0f*BLI_frand()-1.0f)*size);
                                dmy=(short)((2.0f*BLI_frand()-1.0f)*size);
                        }
@@ -3891,7 +3891,7 @@ void PE_undo_push(Scene *scene, const char *str)
        if (!edit) return;
 
        /* remove all undos after (also when curundo==NULL) */
-       while(edit->undo.last != edit->curundo) {
+       while (edit->undo.last != edit->curundo) {
                undo= edit->undo.last;
                BLI_remlink(&edit->undo, undo);
                free_PTCacheUndo(undo);
@@ -3906,13 +3906,13 @@ void PE_undo_push(Scene *scene, const char *str)
        /* and limit amount to the maximum */
        nr= 0;
        undo= edit->undo.last;
-       while(undo) {
+       while (undo) {
                nr++;
                if (nr==U.undosteps) break;
                undo= undo->prev;
        }
        if (undo) {
-               while(edit->undo.first!=undo) {
+               while (edit->undo.first!=undo) {
                        PTCacheUndo *first= edit->undo.first;
                        BLI_remlink(&edit->undo, first);
                        free_PTCacheUndo(first);
@@ -3973,7 +3973,7 @@ static void PTCacheUndo_clear(PTCacheEdit *edit)
        if (edit==NULL) return;
        
        undo= edit->undo.first;
-       while(undo) {
+       while (undo) {
                free_PTCacheUndo(undo);
                undo= undo->next;
        }
index 48b1afa..9deb64e 100644 (file)
@@ -599,11 +599,11 @@ void select_connected_scredge(bScreen *sc, ScrEdge *edge)
                oneselected= 0;
                while (se) {
                        if (se->v1->flag + se->v2->flag==1) {
-                               if (dir=='h') if(se->v1->vec.y==se->v2->vec.y) {
+                               if (dir=='h') if (se->v1->vec.y==se->v2->vec.y) {
                                        se->v1->flag= se->v2->flag= 1;
                                        oneselected= 1;
                                }
-                                       if (dir=='v') if(se->v1->vec.x==se->v2->vec.x) {
+                                       if (dir=='v') if (se->v1->vec.x==se->v2->vec.x) {
                                                se->v1->flag= se->v2->flag= 1;
                                                oneselected= 1;
                                        }
index 3508f8e..8cdacea 100644 (file)
@@ -229,7 +229,7 @@ static void imapaint_tri_weights(Object *ob,
        h[1]= (co[1] - view[1])*2.0f/view[3] - 1;
        h[2]= 1.0f;
 
-       /* solve for(w1,w2,w3)/perspdiv in:
+       /* solve for (w1,w2,w3)/perspdiv in:
         * h * perspdiv = Project * Model * (w1 * v1 + w2 * v2 + w3 * v3) */
 
        wmat[0][0]= pv1[0];  wmat[1][0]= pv2[0];  wmat[2][0]= pv3[0];
index 1ca3ac1..425cee3 100644 (file)
@@ -393,7 +393,7 @@ static int console_insert_exec(bContext *C, wmOperator *op)
 
 static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
-       // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
+       // if (!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
        if (!RNA_string_length(op->ptr, "text")) {
                /* if alt/ctrl/super are pressed pass through */
                if (event->ctrl || event->oskey) {
@@ -512,12 +512,12 @@ static int console_clear_exec(bContext *C, wmOperator *op)
        /*ConsoleLine *ci= */ console_history_verify(C);
        
        if (scrollback) { /* last item in mistory */
-               while(sc->scrollback.first)
+               while (sc->scrollback.first)
                        console_scrollback_free(sc, sc->scrollback.first);
        }
        
        if (history) {
-               while(sc->history.first)
+               while (sc->history.first)
                        console_history_free(sc, sc->history.first);
        }
 
@@ -577,7 +577,7 @@ static int console_history_cycle_exec(bContext *C, wmOperator *op)
 
        {       /* add a duplicate of the new arg and remove all other instances */
                ConsoleLine *cl;
-               while((cl= console_history_find(sc, ci->line, ci)))
+               while ((cl= console_history_find(sc, ci->line, ci)))
                        console_history_free(sc, cl);
 
                console_history_add(C, (ConsoleLine *)sc->history.last);
@@ -626,7 +626,7 @@ static int console_history_append_exec(bContext *C, wmOperator *op)
        if (rem_dupes) {
                ConsoleLine *cl;
 
-               while((cl= console_history_find(sc, ci->line, ci)))
+               while ((cl= console_history_find(sc, ci->line, ci)))
                        console_history_free(sc, cl);
 
                if (strcmp(str, ci->line)==0) {
@@ -815,7 +815,7 @@ static int console_paste_exec(bContext *C, wmOperator *UNUSED(op))
 
        buf_step= buf_str;
 
-       while((buf_next=buf_step) && buf_next[0] != '\0') {
+       while ((buf_next=buf_step) && buf_next[0] != '\0') {
                buf_step= strchr(buf_next, '\n');
                if (buf_step) {
                        *buf_step= '\0';
index 202a82b..71ead48 100644 (file)
@@ -1179,7 +1179,7 @@ void filelist_from_main(struct FileList *filelist)
                
                id= lb->first;
                filelist->numfiles= 0;
-               while(id) {
+               while (id) {
                        if (!filelist->hide_dot || id->name[2] != '.') {
                                filelist->numfiles++;
                        }
@@ -1204,7 +1204,7 @@ void filelist_from_main(struct FileList *filelist)
                id= lb->first;
                totlib= totbl= 0;
                
-               while(id) {
+               while (id) {
                        ok = 1;
                        if (ok) {
                                if (!filelist->hide_dot || id->name[2] != '.') {
index 5de0dd3..be53b03 100644 (file)
@@ -2260,7 +2260,7 @@ static int image_record_composite_exec(bContext *C, wmOperator *op)
        if (!image_record_composite_init(C, op))
                return OPERATOR_CANCELLED;
        
-       while(image_record_composite_apply(C, op))
+       while (image_record_composite_apply(C, op))
                ;
        
        image_record_composite_exit(C, op);
index 04bb97e..c55ba06 100644 (file)
@@ -292,7 +292,7 @@ int textview_draw(TextViewContext *tvc, int draw, int mval[2], void **mouse_pick
 
                        tvc->iter_index++;
 
-               } while(tvc->step(tvc));
+               } while (tvc->step(tvc));
        }
 
        tvc->end(tvc);
index 23272a5..37b284a 100644 (file)
@@ -152,22 +152,22 @@ void make_unique_prop_names(bContext *C, char *str)
        for (a=0; a<obcount; a++) {
                ob= (Object *)idar[a];
                prop= ob->prop.first;
-               while(prop) {
+               while (prop) {
                        names[nr++]= prop->name;
                        prop= prop->next;
                }
                sens= ob->sensors.first;
-               while(sens) {
+               while (sens) {
                        names[nr++]= sens->name;
                        sens= sens->next;
                }
                cont= ob->controllers.first;
-               while(cont) {
+               while (cont) {
                        names[nr++]= cont->name;
                        cont= cont->next;
                }
                act= ob->actuators.first;
-               while(act) {
+               while (act) {
                        names[nr++]= act->name;
                        act= act->next;
                }
@@ -211,10 +211,10 @@ static void old_sca_move_sensor(bContext *C, void *datav, void *move_up)
        if (val>0) {
                /* now find out which object has this ... */
                base= FIRSTBASE;
-               while(base) {
+               while (base) {
                
                        sens= base->object->sensors.first;
-                       while(sens) {
+                       while (sens) {
                                if (sens == sens_to_delete) break;
                                sens= sens->next;
                        }
@@ -264,10 +264,10 @@ static void old_sca_move_controller(bContext *C, void *datav, void *move_up)
        if (val>0) {
                /* now find out which object has this ... */
                base= FIRSTBASE;
-               while(base) {
+               while (base) {
                
                        cont= base->object->controllers.first;
-                       while(cont) {
+                       while (cont) {
                                if (cont == controller_to_del) break;
                                cont= cont->next;
                        }
@@ -276,7 +276,7 @@ static void old_sca_move_controller(bContext *C, void *datav, void *move_up)
                                if ( val==1 && cont->prev) {
                                        /* locate the controller that has the same state mask but is earlier in the list */
                                        tmp = cont->prev;
-                                       while(tmp) {
+                                       while (tmp) {
                                                if (tmp->state_mask & cont->state_mask)
                                                        break;
                                                tmp = tmp->prev;
@@ -288,7 +288,7 @@ static void old_sca_move_controller(bContext *C, void *datav, void *move_up)
                                }
                                else if ( val==2 && cont->next) {
                                        tmp = cont->next;
-                                       while(tmp) {
+                                       while (tmp) {
                                                if (tmp->state_mask & cont->state_mask)
                                                        break;
                                                tmp = tmp->next;
@@ -320,10 +320,10 @@ static void old_sca_move_actuator(bContext *C, void *datav, void *move_up)
        if (val>0) {
                /* now find out which object has this ... */
                base= FIRSTBASE;
-               while(base) {
+               while (base) {
                
                        act= base->object->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act == actuator_to_move) break;
                                act= act->next;
                        }
@@ -401,7 +401,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
        case B_CHANGE_SENS:
                for (ob=bmain->object.first; ob; ob=ob->id.next) {
                        sens= ob->sensors.first;
-                       while(sens) {
+                       while (sens) {
                                if (sens->type != sens->otype) {
                                        init_sensor(sens);
                                        sens->otype= sens->type;
@@ -415,7 +415,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
        case B_DEL_SENS:
                for (ob=bmain->object.first; ob; ob=ob->id.next) {
                        sens= ob->sensors.first;
-                       while(sens) {
+                       while (sens) {
                                if (sens->flag & SENS_DEL) {
                                        BLI_remlink(&(ob->sensors), sens);
                                        free_sensor(sens);
@@ -475,7 +475,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
        case B_CHANGE_CONT:
                for (ob=bmain->object.first; ob; ob=ob->id.next) {
                        cont= ob->controllers.first;
-                       while(cont) {
+                       while (cont) {
                                if (cont->type != cont->otype) {
                                        init_controller(cont);
                                        cont->otype= cont->type;
@@ -490,7 +490,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
        case B_DEL_CONT:
                for (ob=bmain->object.first; ob; ob=ob->id.next) {
                        cont= ob->controllers.first;
-                       while(cont) {
+                       while (cont) {
                                if (cont->flag & CONT_DEL) {
                                        BLI_remlink(&(ob->controllers), cont);
                                        unlink_controller(cont);
@@ -519,7 +519,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
        case B_CHANGE_ACT:
                for (ob=bmain->object.first; ob; ob=ob->id.next) {
                        act= ob->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act->type != act->otype) {
                                        init_actuator(act);
                                        act->otype= act->type;
@@ -533,7 +533,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
        case B_DEL_ACT:
                for (ob=bmain->object.first; ob; ob=ob->id.next) {
                        act= ob->actuators.first;
-                       while(act) {
+                       while (act) {
                                if (act->flag & ACT_DEL) {
                                        BLI_remlink(&(ob->actuators), act);
                                        unlink_actuator(act);
@@ -551,7 +551,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
                didit= 0;
                for (ob=bmain->object.first; ob; ob=ob->id.next) {
                        act= ob->actuators.first;
-                       while(act)
+                       while (act)
                        {
                                if (act->type==ACT_SOUND)
                                {
@@ -567,7 +567,7 @@ static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
                                                        break;
                                                }
 
-                                               while(sound)
+                                               while (sound)
                                                {
                                                        if (nr==sa->sndnr)
                                                                break;
@@ -759,12 +759,12 @@ static void set_sca_ob(Object *ob)
        bActuator *act;
 
        cont= ob->controllers.first;
-       while(cont) {
+       while (cont) {
                cont->mynew= (bController *)ob;
                cont= cont->next;
        }
        act= ob->actuators.first;
-       while(act) {
+       while (act) {
                act->mynew= (bActuator *)ob;
                act= act->next;
        }
@@ -791,7 +791,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
        if (scene==NULL) return NULL;
        
        ob= bmain->object.first;
-       while(ob) {
+       while (ob) {
                ob->scavisflag= 0;
                set_sca_ob(ob);
                ob= ob->id.next;
@@ -801,7 +801,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
        lay= scene->lay;
        
        base= FIRSTBASE;
-       while(base) {
+       while (base) {
                if (base->lay & lay) {
                        if (base->flag & SELECT) {
                                if (scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS;
@@ -821,16 +821,16 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
        /* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */
        if (scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) {
                doit= 1;
-               while(doit) {
+               while (doit) {
                        doit= 0;
                        
                        ob= bmain->object.first;
-                       while(ob) {
+                       while (ob) {
                        
                                /* 1st case: select sensor when controller selected */
                                if ((scavisflag & (BUTS_SENS_LINK|BUTS_SENS_STATE)) && (ob->scavisflag & OB_VIS_SENS)==0) {
                                        sens= ob->sensors.first;
-                                       while(sens) {
+                                       while (sens) {
                                                for (a=0; a<sens->totlinks; a++) {
                                                        if (sens->links[a]) {
                                                                obt= (Object *)sens->links[a]->mynew;
@@ -849,7 +849,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
                                /* 2nd case: select cont when act selected */
                                if ((scavisflag & BUTS_CONT_LINK)  && (ob->scavisflag & OB_VIS_CONT)==0) {
                                        cont= ob->controllers.first;
-                                       while(cont) {
+                                       while (cont) {
                                                for (a=0; a<cont->totlinks; a++) {
                                                        if (cont->links[a]) {
                                                                obt= (Object *)cont->links[a]->mynew;
@@ -868,7 +868,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
                                /* 3rd case: select controller when sensor selected */
                                if ((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_SENS)) {
                                        sens= ob->sensors.first;
-                                       while(sens) {
+                                       while (sens) {
                                                for (a=0; a<sens->totlinks; a++) {
                                                        if (sens->links[a]) {
                                                                obt= (Object *)sens->links[a]->mynew;
@@ -885,7 +885,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
                                /* 4th case: select actuator when controller selected */
                                if ( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE))  && (ob->scavisflag & OB_VIS_CONT)) {
                                        cont= ob->controllers.first;
-                                       while(cont) {
+                                       while (cont) {
                                                for (a=0; a<cont->totlinks; a++) {
                                                        if (cont->links[a]) {
                                                                obt= (Object *)cont->links[a]->mynew;
@@ -906,7 +906,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
        
        /* now we count */
        ob= bmain->object.first;
-       while(ob) {
+       while (ob) {
                if ( ob->scavisflag ) (*count)++;
                ob= ob->id.next;
        }
@@ -925,7 +925,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
                nr++;
        }
 
-       while(ob) {
+       while (ob) {
                if ( (ob->scavisflag) && (ob != obact)) {
                        idar[nr]= (ID *)ob;
                        nr++;
@@ -2973,7 +2973,7 @@ static void do_sensor_menu(bContext *C, void *UNUSED(arg), int event)
        for (a=0; a<count; a++) {
                ob= (Object *)idar[a];
                sens= ob->sensors.first;
-               while(sens) {
+               while (sens) {
                        if (event==2) sens->flag |= SENS_SHOW;
                        else if (event==3) sens->flag &= ~SENS_SHOW;
                        sens= sens->next;
@@ -3022,7 +3022,7 @@ static void do_controller_menu(bContext *C, void *UNUSED(arg), int event)
        for (a=0; a<count; a++) {
                ob= (Object *)idar[a];
                cont= ob->controllers.first;
-               while(cont) {
+               while (cont) {
                        if (event==2) cont->flag |= CONT_SHOW;
                        else if (event==3) cont->flag &= ~CONT_SHOW;
                        cont= cont->next;
@@ -3071,7 +3071,7 @@ static void do_actuator_menu(bContext *C, void *UNUSED(arg), int event)
        for (a=0; a<count; a++) {
                ob= (Object *)idar[a];
                act= ob->actuators.first;
-               while(act) {
+               while (act) {
                        if (event==2) act->flag |= ACT_SHOW;
                        else if (event==3) act->flag &= ~ACT_SHOW;
                        act= act->next;
@@ -4511,20 +4511,20 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
                
                /* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that we can determine which is actually linked/visible */
                act = ob->actuators.first;
-               while(act) {
+               while (act) {
                        act->flag &= ~(ACT_LINKED|ACT_VISIBLE);
                        act = act->next;
                }
                /* same for sensors */
                sens= ob->sensors.first;
-               while(sens) {
+               while (sens) {
                        sens->flag &= ~(SENS_VISIBLE);
                        sens = sens->next;
                }
 
                /* mark the linked and visible actuators */
                cont= ob->controllers.first;
-               while(cont) {
+               while (cont) {
                        flag = ACT_LINKED;
 
                        /* this controller is visible, mark all its actuator */
@@ -4826,13 +4826,13 @@ void logic_buttons(bContext *C, ARegion *ar)
        for (a=0; a<count; a++) {
                ob= (Object *)idar[a];
                act= ob->actuators.first;
-               while(act) {
+               while (act) {
                        act->flag &= ~(ACT_LINKED|ACT_VISIBLE);
                        act = act->next;
                }
                /* same for sensors */
                sens= ob->sensors.first;
-               while(sens) {
+               while (sens) {
                        sens->flag &= ~(SENS_VISIBLE);
                        sens = sens->next;
                }
@@ -4871,7 +4871,7 @@ void logic_buttons(bContext *C, ARegion *ar)
                /* note that some of these actuators could be from objects that are not in the display list.