[Bf-blender-cvs] [0c8b9cd7d10] sculpt-dev: Cleanup: Clang format

Pablo Dobarro noreply at git.blender.org
Wed Jan 13 23:00:31 CET 2021


Commit: 0c8b9cd7d10597419d45e3b8c27d4aa290e0ad6c
Author: Pablo Dobarro
Date:   Wed Jan 13 20:28:09 2021 +0100
Branches: sculpt-dev
https://developer.blender.org/rB0c8b9cd7d10597419d45e3b8c27d4aa290e0ad6c

Cleanup: Clang format

===================================================================

M	source/blender/blenkernel/intern/mesh_fair.cc
M	source/blender/editors/sculpt_paint/sculpt_cloth.c

===================================================================

diff --git a/source/blender/blenkernel/intern/mesh_fair.cc b/source/blender/blenkernel/intern/mesh_fair.cc
index 5644a32bda6..eac164985c0 100644
--- a/source/blender/blenkernel/intern/mesh_fair.cc
+++ b/source/blender/blenkernel/intern/mesh_fair.cc
@@ -233,10 +233,10 @@ class MeshFairingContext : public FairingContext {
 
     /* Deformation coords. */
     if (deform_mverts) {
-        deform_mvert_ = deform_mverts;
+      deform_mvert_ = deform_mverts;
     }
     else {
-        deform_mvert_ = mesh->mvert;
+      deform_mvert_ = mesh->mvert;
     }
 
     loop_to_poly_map_.resize(mesh->totloop);
@@ -255,12 +255,14 @@ class MeshFairingContext : public FairingContext {
     MEM_SAFE_FREE(elmap_mem_);
   }
 
-  float *vertex_deformation_co_get(const int v) {
-      return deform_mvert_[v].co;
+  float *vertex_deformation_co_get(const int v)
+  {
+    return deform_mvert_[v].co;
   }
 
-  void vertex_deformation_co_set(const int v, const float co[3]) {
-      copy_v3_v3(deform_mvert_[v].co, co);
+  void vertex_deformation_co_set(const int v, const float co[3])
+  {
+    copy_v3_v3(deform_mvert_[v].co, co);
   }
 
   void adjacents_coords_from_loop(const int loop,
@@ -351,12 +353,14 @@ class BMeshFairingContext : public FairingContext {
     MEM_SAFE_FREE(vlmap_mem_);
   }
 
-  float *vertex_deformation_co_get(const int v) {
-      return BM_vert_at_index(bm, v)->co;
+  float *vertex_deformation_co_get(const int v)
+  {
+    return BM_vert_at_index(bm, v)->co;
   }
 
-  void vertex_deformation_co_set(const int v, const float co[3]) {
-      copy_v3_v3(BM_vert_at_index(bm, v)->co, co);
+  void vertex_deformation_co_set(const int v, const float co[3])
+  {
+    copy_v3_v3(BM_vert_at_index(bm, v)->co, co);
   }
 
   void adjacents_coords_from_loop(const int loop,
diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c
index 7572f1b5894..1a6ff117dc7 100644
--- a/source/blender/editors/sculpt_paint/sculpt_cloth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c
@@ -103,7 +103,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-
 /* Experimental features. */
 
 #define USE_SOLVER_RIPPLE_CONSTRAINT false
@@ -470,17 +469,17 @@ static void do_cloth_brush_build_constraints_task_cb_ex(
   BKE_pbvh_vertex_iter_end;
 }
 
-static void cloth_brush_constraint_pos_to_line(SculptClothSimulation *cloth_sim, const int v) {
-    if (!USE_SOLVER_RIPPLE_CONSTRAINT) {
-        return;
-    }
-    float line_points[2][3];
-    copy_v3_v3(line_points[0], cloth_sim->init_pos[v]);
-    add_v3_v3v3(line_points[1], cloth_sim->init_pos[v], cloth_sim->init_normal[v]);
-    closest_to_line_v3(cloth_sim->pos[v], cloth_sim->pos[v], line_points[0], line_points[1]);
+static void cloth_brush_constraint_pos_to_line(SculptClothSimulation *cloth_sim, const int v)
+{
+  if (!USE_SOLVER_RIPPLE_CONSTRAINT) {
+    return;
+  }
+  float line_points[2][3];
+  copy_v3_v3(line_points[0], cloth_sim->init_pos[v]);
+  add_v3_v3v3(line_points[1], cloth_sim->init_pos[v], cloth_sim->init_normal[v]);
+  closest_to_line_v3(cloth_sim->pos[v], cloth_sim->pos[v], line_points[0], line_points[1]);
 }
 
-
 static void cloth_brush_apply_force_to_vertex(SculptSession *UNUSED(ss),
                                               SculptClothSimulation *cloth_sim,
                                               const float force[3],
@@ -892,7 +891,6 @@ static void do_cloth_brush_solve_simulation_task_cb_ex(
   cloth_sim->node_state[node_index] = SCULPT_CLOTH_NODE_INACTIVE;
 }
 
-
 static void cloth_brush_satisfy_constraints(SculptSession *ss,
                                             Brush *brush,
                                             SculptClothSimulation *cloth_sim)
@@ -1160,13 +1158,11 @@ SculptClothSimulation *SCULPT_cloth_brush_simulation_create(SculptSession *ss,
   }
 
   if (USE_SOLVER_RIPPLE_CONSTRAINT) {
-  cloth_sim->init_normal = MEM_calloc_arrayN(
-      totverts, sizeof(float) * 3, "init noramls");
-  for (int i = 0; i < totverts; i++) {
+    cloth_sim->init_normal = MEM_calloc_arrayN(totverts, sizeof(float) * 3, "init noramls");
+    for (int i = 0; i < totverts; i++) {
       SCULPT_vertex_normal_get(ss, i, cloth_sim->init_normal[i]);
+    }
   }
-  }
-
 
   cloth_sim->mass = cloth_mass;
   cloth_sim->damping = cloth_damping;



More information about the Bf-blender-cvs mailing list