svn merge ^/trunk/blender -r46340:46350
authorOve Murberg Henriksen <sorayasilvermoon@hotmail.com>
Mon, 7 May 2012 23:27:27 +0000 (23:27 +0000)
committerOve Murberg Henriksen <sorayasilvermoon@hotmail.com>
Mon, 7 May 2012 23:27:27 +0000 (23:27 +0000)
15 files changed:
1  2 
source/blender/editors/mesh/editmesh_knife.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_weightvgproximity.c

index 2fce6b2373fcd0309f70d8b23f8a9c68e068f25e,39344aad5a91f2b2b4569aa0b982b681e4d03ba1..259be95523e7a2ebe07a303b44b75db9bd6bd57a
@@@ -112,8 -112,8 +112,8 @@@ static void VertexIt_Fill(CSG_IteratorP
  
  static void VertexIt_Step(CSG_IteratorPtr it)
  {
-       VertexIt * iterator = (VertexIt *)it;
+       VertexIt *iterator = (VertexIt *)it;
 -      iterator->pos++;
 +      iterator->pos ++;
  } 
   
  static void VertexIt_Reset(CSG_IteratorPtr it)
@@@ -206,8 -206,8 +206,8 @@@ static void FaceIt_Fill(CSG_IteratorPt
  
  static void FaceIt_Step(CSG_IteratorPtr it)
  {
-       FaceIt * face_it = (FaceIt *)it;                
+       FaceIt *face_it = (FaceIt *)it;
 -      face_it->pos++;
 +      face_it->pos ++;
  }
  
  static void FaceIt_Reset(CSG_IteratorPtr it)
@@@ -600,8 -600,8 +600,8 @@@ int NewBooleanMesh(Scene *scene, Base *
        dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
        dm_select = mesh_create_derived_view(scene, ob_select, 0); // no modifiers in editmode ??
  
-       maxmat= ob->totcol + ob_select->totcol;
+       maxmat = ob->totcol + ob_select->totcol;
 -      mat = (Material **)MEM_mallocN(sizeof(Material *) * maxmat, "NewBooleanMeshMat");
 +      mat= (Material**)MEM_mallocN(sizeof(Material*)*maxmat, "NewBooleanMeshMat");
        
        /* put some checks in for nice user feedback */
        if (dm == NULL || dm_select == NULL) {
index f65789013d9eeaf9e3527803147a9b527e715bee,eb4511ddaec3a152b15d42fdffff9e18f1382965..50ebd69401a3f926266426cbb23c7ee681f53e3f
@@@ -136,9 -136,9 +136,9 @@@ static void deformVerts(ModifierData *m
                if (G.rt > 0)
                        printf("current_time %f, collmd->time_xnew %f\n", current_time, collmd->time_xnew);
                
-               numverts = dm->getNumVerts (dm);
+               numverts = dm->getNumVerts(dm);
                
 -              if ((current_time > collmd->time_xnew) || (BKE_ptcache_get_continue_physics())) {
 +              if ((current_time > collmd->time_xnew)|| (BKE_ptcache_get_continue_physics())) {
                        unsigned int i;
  
                        // check if mesh has changed
index f55faf9c18342b15db341f063596fda1e9c9ee78,b28a4a942ac5b0b178b656773b5022e10ec110ff..5e8673705c7a0b7038bf2a357cd51158377abe7d
@@@ -158,11 -158,11 +158,11 @@@ static DerivedMesh *applyModifier(Modif
                                copy_v3_v3(mv->co, vbCo);
                        }
  
-                       if (lod.vertex_num>2) {
+                       if (lod.vertex_num > 2) {
                                mface = CDDM_get_tessfaces(result);
 -                              for (a = 0; a < lod.face_num; a++) {
 +                              for (a=0; a<lod.face_num; a++) {
                                        MFace *mf = &mface[a];
-                                       int *tri = &lod.triangle_index_buffer[a*3];
+                                       int *tri = &lod.triangle_index_buffer[a * 3];
                                        mf->v1 = tri[0];
                                        mf->v2 = tri[1];
                                        mf->v3 = tri[2];
index 773b5d04a17f4dcbd5f212f5383464db40243ef7,9acf556fc371dc60a491d1410724a3ec29acd154..48c2208f1bea222e201f118b11b281aba74cb7ba
@@@ -226,8 -226,8 +226,8 @@@ static void deformVerts_do(HookModifier
                        }
                }
        }
-       else if (dvert) {       /* vertex group hook */
+       else if (dvert) {  /* vertex group hook */
 -              const float fac_orig = hmd->force;
 +              const float fac_orig= hmd->force;
                
                for (i = 0; i < max_dvert; i++, dvert++) {
                        float fac;
index aee8dd21903e22091906e7e7047ab3ba941a5805,c6f53b49175d6b24b8ff080fba457f81a1e5a524..ea5b6e19cc3286a03958fe7f16899bd4b38fcff6
@@@ -138,40 -138,40 +138,40 @@@ static float meshdeform_dynamic_bind(Me
        int i, j, a, x, y, z, size;
  
        zero_v3(co);
-       totweight= 0.0f;
-       size= mmd->dyngridsize;
+       totweight = 0.0f;
+       size = mmd->dyngridsize;
  
-       for (i=0; i<3; i++) {
-               gridvec[i]= (vec[i] - mmd->dyncellmin[i] - mmd->dyncellwidth*0.5f)/mmd->dyncellwidth;
-               ivec[i]= (int)gridvec[i];
-               dvec[i]= gridvec[i] - ivec[i];
+       for (i = 0; i < 3; i++) {
+               gridvec[i] = (vec[i] - mmd->dyncellmin[i] - mmd->dyncellwidth * 0.5f) / mmd->dyncellwidth;
+               ivec[i] = (int)gridvec[i];
+               dvec[i] = gridvec[i] - ivec[i];
        }
  
-       for (i=0; i<8; i++) {
-               if (i & 1) { x= ivec[0]+1; wx= dvec[0]; }
-               else { x= ivec[0]; wx= 1.0f-dvec[0]; } 
+       for (i = 0; i < 8; i++) {
+               if (i & 1) { x = ivec[0] + 1; wx = dvec[0]; }
+               else {       x = ivec[0]; wx = 1.0f - dvec[0]; }
  
-               if (i & 2) { y= ivec[1]+1; wy= dvec[1]; }
-               else { y= ivec[1]; wy= 1.0f-dvec[1]; } 
+               if (i & 2) { y = ivec[1] + 1; wy = dvec[1]; }
+               else {       y = ivec[1];     wy = 1.0f - dvec[1]; }
  
-               if (i & 4) { z= ivec[2]+1; wz= dvec[2]; }
-               else { z= ivec[2]; wz= 1.0f-dvec[2]; } 
+               if (i & 4) { z = ivec[2] + 1; wz = dvec[2]; }
+               else {       z = ivec[2];     wz = 1.0f - dvec[2]; }
  
 -              CLAMP(x, 0, size - 1);
 -              CLAMP(y, 0, size - 1);
 -              CLAMP(z, 0, size - 1);
 +              CLAMP(x, 0, size-1);
 +              CLAMP(y, 0, size-1);
 +              CLAMP(z, 0, size-1);
  
-               a= x + y*size + z*size*size;
-               weight= wx*wy*wz;
-               cell= &mmd->dyngrid[a];
-               inf= mmd->dyninfluences + cell->offset;
-               for (j=0; j<cell->totinfluence; j++, inf++) {
-                       cageco= dco[inf->vertex];
-                       cageweight= weight*inf->weight;
-                       co[0] += cageweight*cageco[0];
-                       co[1] += cageweight*cageco[1];
-                       co[2] += cageweight*cageco[2];
+               a = x + y * size + z * size * size;
+               weight = wx * wy * wz;
+               cell = &mmd->dyngrid[a];
+               inf = mmd->dyninfluences + cell->offset;
+               for (j = 0; j < cell->totinfluence; j++, inf++) {
+                       cageco = dco[inf->vertex];
+                       cageweight = weight * inf->weight;
+                       co[0] += cageweight * cageco[0];
+                       co[1] += cageweight * cageco[1];
+                       co[2] += cageweight * cageco[2];
                        totweight += cageweight;
                }
        }
@@@ -308,14 -308,14 +308,14 @@@ static void meshdeformModifier_do
                if (mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
                        /* transform coordinate into cage's local space */
                        mul_v3_m4v3(co, cagemat, vertexCos[b]);
-                       totweight= meshdeform_dynamic_bind(mmd, dco, co);
+                       totweight = meshdeform_dynamic_bind(mmd, dco, co);
                }
                else {
-                       totweight= 0.0f;
+                       totweight = 0.0f;
                        zero_v3(co);
  
 -                      for (a = offsets[b]; a < offsets[b + 1]; a++) {
 +                      for (a=offsets[b]; a<offsets[b+1]; a++) {
-                               weight= influences[a].weight;
+                               weight = influences[a].weight;
                                madd_v3_v3fl(co, dco[influences[a].vertex], weight);
                                totweight += weight;
                        }
@@@ -394,31 -394,31 +394,31 @@@ void modifier_mdef_compact_influences(M
        }
  
        /* allocate bind influences */
 -      mmd->bindinfluences = MEM_callocN(sizeof(MDefInfluence) * mmd->totinfluence, "MDefBindInfluence");
 -      mmd->bindoffsets = MEM_callocN(sizeof(int) * (totvert + 1), "MDefBindOffset");
 +      mmd->bindinfluences= MEM_callocN(sizeof(MDefInfluence)*mmd->totinfluence, "MDefBindInfluence");
 +      mmd->bindoffsets= MEM_callocN(sizeof(int)*(totvert+1), "MDefBindOffset");
  
        /* write influences */
-       totinfluence= 0;
+       totinfluence = 0;
  
-       for (b=0; b<totvert; b++) {
-               mmd->bindoffsets[b]= totinfluence;
-               totweight= 0.0f;
+       for (b = 0; b < totvert; b++) {
+               mmd->bindoffsets[b] = totinfluence;
+               totweight = 0.0f;
  
                /* sum total weight */
-               for (a=0; a<totcagevert; a++) {
-                       weight= weights[a + b*totcagevert];
+               for (a = 0; a < totcagevert; a++) {
+                       weight = weights[a + b * totcagevert];
  
                        if (weight > MESHDEFORM_MIN_INFLUENCE)
                                totweight += weight;
                }
  
                /* assign weights normalized */
-               for (a=0; a<totcagevert; a++) {
-                       weight= weights[a + b*totcagevert];
+               for (a = 0; a < totcagevert; a++) {
+                       weight = weights[a + b * totcagevert];
  
                        if (weight > MESHDEFORM_MIN_INFLUENCE) {
 -                              mmd->bindinfluences[totinfluence].weight = weight / totweight;
 -                              mmd->bindinfluences[totinfluence].vertex = a;
 +                              mmd->bindinfluences[totinfluence].weight= weight/totweight;
 +                              mmd->bindinfluences[totinfluence].vertex= a;
                                totinfluence++;
                        }
                }
index d3e54651eea1859a484b3d4637b9bd2ef9622190,96c84f5abbeb87fed95525ef2ca39baf6c8a71b5..2735dc993a14bfa3e7779a97607ac453483e8a1b
@@@ -639,13 -647,13 +647,13 @@@ static DerivedMesh *applyModifier(Modif
                                ml[j++].e = eidx;
  
                                ml[j].v = ed->v1;
-                               ml[j++].e = numEdges*2 + old_vert_arr[ed->v1];
+                               ml[j++].e = numEdges * 2 + old_vert_arr[ed->v1];
  
-                               ml[j].v = ed->v1+numVerts;
-                               ml[j++].e = eidx+numEdges;
+                               ml[j].v = ed->v1 + numVerts;
+                               ml[j++].e = eidx + numEdges;
  
 -                              ml[j].v = ed->v2 + numVerts;
 -                              ml[j++].e = numEdges * 2 + old_vert_arr[ed->v2];
 +                              ml[j].v = ed->v2+numVerts;
 +                              ml[j++].e = numEdges*2 + old_vert_arr[ed->v2];
                        }
                        
                        if (edge_origIndex) {
index 8694d7bf37dc296045128dba1a79342a2a23c80b,ccfda6af59f30a499714a300209728565cc9fffb..760fc8f722ad20cdf827b28f51c5fb381d22b1a0
@@@ -193,18 -193,18 +193,18 @@@ static DerivedMesh *uvprojectModifier_d
                if (projectors[i].ob->type == OB_CAMERA) {
                        
                        cam = (Camera *)projectors[i].ob->data;
 -                      if (cam->type == CAM_PANO) {
 +                      if (cam->flag & CAM_PANORAMA) {
-                               projectors[i].uci= BLI_uvproject_camera_info(projectors[i].ob, NULL, aspx, aspy);
+                               projectors[i].uci = BLI_uvproject_camera_info(projectors[i].ob, NULL, aspx, aspy);
                                BLI_uvproject_camera_info_scale(projectors[i].uci, scax, scay);
-                               free_uci= 1;
+                               free_uci = 1;
                        }
                        else {
-                               float sensor= BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
-                               int sensor_fit= BKE_camera_sensor_fit(cam->sensor_fit, aspx, aspy);
-                               float scale= (cam->type == CAM_PERSP) ? cam->clipsta * sensor / cam->lens : cam->ortho_scale;
+                               float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
+                               int sensor_fit = BKE_camera_sensor_fit(cam->sensor_fit, aspx, aspy);
+                               float scale = (cam->type == CAM_PERSP) ? cam->clipsta * sensor / cam->lens : cam->ortho_scale;
                                float xmax, xmin, ymax, ymin;
  
-                               if (sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+                               if (sensor_fit == CAMERA_SENSOR_FIT_HOR) {
                                        xmax = 0.5f * scale;
                                        ymax = xmax / aspect;
                                }