[Bf-blender-cvs] [814a11be59d] master: Cleanup: use snake case variable & function names

Campbell Barton noreply at git.blender.org
Tue Dec 17 04:08:02 CET 2019


Commit: 814a11be59d3f846fdb160d90ddf09bac12069ae
Author: Campbell Barton
Date:   Tue Dec 17 11:45:35 2019 +1100
Branches: master
https://developer.blender.org/rB814a11be59d3f846fdb160d90ddf09bac12069ae

Cleanup: use snake case variable & function names

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

M	source/blender/blenkernel/intern/fluid.c
M	source/blender/editors/physics/physics_fluid.c

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

diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 876a91a2bd3..708137ba5c4 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -313,7 +313,7 @@ void BKE_fluid_reallocate_copy_fluid(FluidDomainSettings *mds,
 
 void BKE_fluid_cache_free(FluidDomainSettings *mds, Object *ob, int cache_map)
 {
-  char tmpDir[FILE_MAX];
+  char temp_dir[FILE_MAX];
   int flags = mds->cache_flag;
 
   /* Ensure cache directory is not relative */
@@ -322,48 +322,49 @@ void BKE_fluid_cache_free(FluidDomainSettings *mds, Object *ob, int cache_map)
 
   if (cache_map & FLUID_DOMAIN_OUTDATED_DATA) {
     flags &= ~(FLUID_DOMAIN_BAKING_DATA | FLUID_DOMAIN_BAKED_DATA | FLUID_DOMAIN_OUTDATED_DATA);
-    tmpDir[0] = '\0';
-    BLI_path_join(tmpDir, sizeof(tmpDir), mds->cache_directory, FLUID_DOMAIN_DIR_CONFIG, NULL);
-    if (BLI_exists(tmpDir)) {
-      BLI_delete(tmpDir, true, true);
+    temp_dir[0] = '\0';
+    BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_CONFIG, NULL);
+    if (BLI_exists(temp_dir)) {
+      BLI_delete(temp_dir, true, true);
     }
-    tmpDir[0] = '\0';
-    BLI_path_join(tmpDir, sizeof(tmpDir), mds->cache_directory, FLUID_DOMAIN_DIR_DATA, NULL);
-    if (BLI_exists(tmpDir)) {
-      BLI_delete(tmpDir, true, true);
+    temp_dir[0] = '\0';
+    BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_DATA, NULL);
+    if (BLI_exists(temp_dir)) {
+      BLI_delete(temp_dir, true, true);
     }
-    tmpDir[0] = '\0';
-    BLI_path_join(tmpDir, sizeof(tmpDir), mds->cache_directory, FLUID_DOMAIN_DIR_SCRIPT, NULL);
-    if (BLI_exists(tmpDir)) {
-      BLI_delete(tmpDir, true, true);
+    temp_dir[0] = '\0';
+    BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_SCRIPT, NULL);
+    if (BLI_exists(temp_dir)) {
+      BLI_delete(temp_dir, true, true);
     }
     mds->cache_frame_pause_data = 0;
   }
   if (cache_map & FLUID_DOMAIN_OUTDATED_NOISE) {
     flags &= ~(FLUID_DOMAIN_BAKING_NOISE | FLUID_DOMAIN_BAKED_NOISE | FLUID_DOMAIN_OUTDATED_NOISE);
-    tmpDir[0] = '\0';
-    BLI_path_join(tmpDir, sizeof(tmpDir), mds->cache_directory, FLUID_DOMAIN_DIR_NOISE, NULL);
-    if (BLI_exists(tmpDir)) {
-      BLI_delete(tmpDir, true, true);
+    temp_dir[0] = '\0';
+    BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_NOISE, NULL);
+    if (BLI_exists(temp_dir)) {
+      BLI_delete(temp_dir, true, true);
     }
     mds->cache_frame_pause_noise = 0;
   }
   if (cache_map & FLUID_DOMAIN_OUTDATED_MESH) {
     flags &= ~(FLUID_DOMAIN_BAKING_MESH | FLUID_DOMAIN_BAKED_MESH | FLUID_DOMAIN_OUTDATED_MESH);
-    tmpDir[0] = '\0';
-    BLI_path_join(tmpDir, sizeof(tmpDir), mds->cache_directory, FLUID_DOMAIN_DIR_MESH, NULL);
-    if (BLI_exists(tmpDir)) {
-      BLI_delete(tmpDir, true, true);
+    temp_dir[0] = '\0';
+    BLI_path_join(temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_MESH, NULL);
+    if (BLI_exists(temp_dir)) {
+      BLI_delete(temp_dir, true, true);
     }
     mds->cache_frame_pause_mesh = 0;
   }
   if (cache_map & FLUID_DOMAIN_OUTDATED_PARTICLES) {
     flags &= ~(FLUID_DOMAIN_BAKING_PARTICLES | FLUID_DOMAIN_BAKED_PARTICLES |
                FLUID_DOMAIN_OUTDATED_PARTICLES);
-    tmpDir[0] = '\0';
-    BLI_path_join(tmpDir, sizeof(tmpDir), mds->cache_directory, FLUID_DOMAIN_DIR_PARTICLES, NULL);
-    if (BLI_exists(tmpDir)) {
-      BLI_delete(tmpDir, true, true);
+    temp_dir[0] = '\0';
+    BLI_path_join(
+        temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_PARTICLES, NULL);
+    if (BLI_exists(temp_dir)) {
+      BLI_delete(temp_dir, true, true);
     }
     mds->cache_frame_pause_particles = 0;
   }
@@ -371,10 +372,11 @@ void BKE_fluid_cache_free(FluidDomainSettings *mds, Object *ob, int cache_map)
   if (cache_map & FLUID_DOMAIN_OUTDATED_GUIDING) {
     flags &= ~(FLUID_DOMAIN_BAKING_GUIDING | FLUID_DOMAIN_BAKED_GUIDING |
                FLUID_DOMAIN_OUTDATED_GUIDING);
-    tmpDir[0] = '\0';
-    BLI_path_join(tmpDir, sizeof(tmpDir), mds->cache_directory, FLUID_DOMAIN_DIR_GUIDING, NULL);
-    if (BLI_exists(tmpDir)) {
-      BLI_delete(tmpDir, true, true);
+    temp_dir[0] = '\0';
+    BLI_path_join(
+        temp_dir, sizeof(temp_dir), mds->cache_directory, FLUID_DOMAIN_DIR_GUIDING, NULL);
+    if (BLI_exists(temp_dir)) {
+      BLI_delete(temp_dir, true, true);
     }
     mds->cache_frame_pause_guiding = 0;
   }
@@ -1154,10 +1156,10 @@ void BKE_fluid_modifier_copy(const struct FluidModifierData *mmd,
 // forward declaration
 static void manta_smoke_calc_transparency(FluidDomainSettings *mds, ViewLayer *view_layer);
 static float calc_voxel_transp(
-    float *result, float *input, int res[3], int *pixel, float *tRay, float correct);
+    float *result, float *input, int res[3], int *pixel, float *t_ray, float correct);
 static void update_mesh_distances(int index,
                                   float *mesh_distances,
-                                  BVHTreeFromMesh *treeData,
+                                  BVHTreeFromMesh *tree_data,
                                   const float ray_start[3],
                                   float surface_thickness,
                                   int use_plane_init);
@@ -1200,7 +1202,7 @@ typedef struct ObstaclesFromDMData {
 
   bool has_velocity;
   float *vert_vel;
-  float *velocityX, *velocityY, *velocityZ;
+  float *velocity_x, *velocity_y, *velocity_z;
   int *num_objects;
   float *distances_map;
 } ObstaclesFromDMData;
@@ -1227,7 +1229,7 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata,
       nearest.index = -1;
       nearest.dist_sq = surface_distance *
                         surface_distance; /* find_nearest uses squared distance */
-      bool hasIncObj = false;
+      bool has_inc_obj = false;
 
       /* find the nearest point on the mesh */
       if (BLI_bvhtree_find_nearest(
@@ -1247,7 +1249,7 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata,
         if (data->has_velocity) {
           /* increase object count */
           data->num_objects[index]++;
-          hasIncObj = true;
+          has_inc_obj = true;
 
           /* apply object velocity */
           float hit_vel[3];
@@ -1263,39 +1265,39 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata,
 
             switch (data->mes->guiding_mode) {
               case FLUID_EFFECTOR_GUIDING_AVERAGED:
-                data->velocityX[index] = (data->velocityX[index] + hit_vel[0]) * 0.5f;
-                data->velocityY[index] = (data->velocityY[index] + hit_vel[1]) * 0.5f;
-                data->velocityZ[index] = (data->velocityZ[index] + hit_vel[2]) * 0.5f;
+                data->velocity_x[index] = (data->velocity_x[index] + hit_vel[0]) * 0.5f;
+                data->velocity_y[index] = (data->velocity_y[index] + hit_vel[1]) * 0.5f;
+                data->velocity_z[index] = (data->velocity_z[index] + hit_vel[2]) * 0.5f;
                 break;
               case FLUID_EFFECTOR_GUIDING_OVERRIDE:
-                data->velocityX[index] = hit_vel[0];
-                data->velocityY[index] = hit_vel[1];
-                data->velocityZ[index] = hit_vel[2];
+                data->velocity_x[index] = hit_vel[0];
+                data->velocity_y[index] = hit_vel[1];
+                data->velocity_z[index] = hit_vel[2];
                 break;
               case FLUID_EFFECTOR_GUIDING_MINIMUM:
-                data->velocityX[index] = MIN2(fabsf(hit_vel[0]), fabsf(data->velocityX[index]));
-                data->velocityY[index] = MIN2(fabsf(hit_vel[1]), fabsf(data->velocityY[index]));
-                data->velocityZ[index] = MIN2(fabsf(hit_vel[2]), fabsf(data->velocityZ[index]));
+                data->velocity_x[index] = MIN2(fabsf(hit_vel[0]), fabsf(data->velocity_x[index]));
+                data->velocity_y[index] = MIN2(fabsf(hit_vel[1]), fabsf(data->velocity_y[index]));
+                data->velocity_z[index] = MIN2(fabsf(hit_vel[2]), fabsf(data->velocity_z[index]));
                 break;
               case FLUID_EFFECTOR_GUIDING_MAXIMUM:
               default:
-                data->velocityX[index] = MAX2(fabsf(hit_vel[0]), fabsf(data->velocityX[index]));
-                data->velocityY[index] = MAX2(fabsf(hit_vel[1]), fabsf(data->velocityY[index]));
-                data->velocityZ[index] = MAX2(fabsf(hit_vel[2]), fabsf(data->velocityZ[index]));
+                data->velocity_x[index] = MAX2(fabsf(hit_vel[0]), fabsf(data->velocity_x[index]));
+                data->velocity_y[index] = MAX2(fabsf(hit_vel[1]), fabsf(data->velocity_y[index]));
+                data->velocity_z[index] = MAX2(fabsf(hit_vel[2]), fabsf(data->velocity_z[index]));
                 break;
             }
           }
           else {
             /* Apply (i.e. add) effector object velocity */
-            data->velocityX[index] += (data->mes->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
-                                          hit_vel[0] * data->mes->vel_multi :
-                                          hit_vel[0];
-            data->velocityY[index] += (data->mes->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
-                                          hit_vel[1] * data->mes->vel_multi :
-                                          hit_vel[1];
-            data->velocityZ[index] += (data->mes->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
-                                          hit_vel[2] * data->mes->vel_multi :
-                                          hit_vel[2];
+            data->velocity_x[index] += (data->mes->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
+                                           hit_vel[0] * data->mes->vel_multi :
+                                           hit_vel[0];
+            data->velocity_y[index] += (data->mes->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
+                                           hit_vel[1] * data->mes->vel_multi :
+                                           hit_vel[1];
+            data->velocity_z[index] += (data->mes->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
+                                

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list