diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 2344ebfa81b..81c7c700cc2 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1301,7 +1301,7 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata, } } - /* Get distance to mesh surface from both within and outside grid (mantaflow phi grid) */ + /* Get distance to mesh surface from both within and outside grid (mantaflow phi grid). */ if (data->distances_map) { update_mesh_distances(index, data->distances_map, @@ -1310,8 +1310,8 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata, data->mes->surface_distance, data->mes->flags & FLUID_FLOW_USE_PLANE_INIT); - /* Ensure that num objects are also counted inside object. But dont count twice (see object - * inc for nearest point) */ + /* Ensure that num objects are also counted inside object. + * But don't count twice (see object inc for nearest point). */ if (data->distances_map[index] < 0 && !has_inc_obj) { data->num_objects[index]++; } @@ -1579,7 +1579,7 @@ static void update_obstacles(Depsgraph *depsgraph, scene->r.subframe); # endif /* TODO (sebbas): Using BKE_scene_frame_get(scene) instead of new DEG_get_ctime(depsgraph) as - * subframes dont work with the latter yet. */ + * subframes don't work with the latter yet. */ BKE_object_modifier_update_subframe( depsgraph, scene, coll_ob, true, 5, BKE_scene_frame_get(scene), eModifierType_Fluid); @@ -2125,8 +2125,8 @@ static void emit_from_particles(Object *flow_ob, else if (valid_particles > 0) { // FLUID_FLOW_USE_PART_SIZE int min[3], max[3], res[3]; const float hr = 1.0f / ((float)hires_multiplier); - /* slightly adjust high res antialias smoothness based on number of divisions - * to allow smaller details but yet not differing too much from the low res size */ + /* Slightly adjust high res anti-alias smoothness based on number of divisions + * to allow smaller details but yet not differing too much from the low res size. */ const float hr_smooth = smooth * powf(hr, 1.0f / 3.0f); /* setup loop bounds */ @@ -2201,8 +2201,8 @@ static void update_mesh_distances(int index, return; } - /* First pass: Raycasts in 26 directions (6 main axis + 12 quadrant diagonals (2D) + 8 octant - * diagonals (3D)). */ + /* First pass: Ray-casts in 26 directions + * (6 main axis + 12 quadrant diagonals (2D) + 8 octant diagonals (3D)). */ float ray_dirs[26][3] = { {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {-1.0f, 0.0f, 0.0f}, {0.0f, -1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 1.0f, 0.0f}, {1.0f, -1.0f, 0.0f}, @@ -2257,7 +2257,7 @@ static void update_mesh_distances(int index, /* Update global distance array but ensure that older entries are not overridden. */ mesh_distances[index] = MIN2(mesh_distances[index], min_dist); - /* Second pass: Use nearest neighbour search on mesh surface. */ + /* Second pass: Use nearest neighbor search on mesh surface. */ BVHTreeNearest nearest = {0}; nearest.index = -1; nearest.dist_sq = 5; @@ -2285,7 +2285,7 @@ static void update_mesh_distances(int index, min_dist = (-1.0f) * fabsf(min_dist); } - /* Update distance value with more accurate one from this nearest neighbour search. + /* Update distance value with more accurate one from this nearest neighbor search. * Skip if new value would be outside and current value has inside value already. */ if (!(min_dist > 0 && mesh_distances[index] <= 0)) { mesh_distances[index] = min_dist; @@ -3055,8 +3055,8 @@ BLI_INLINE void apply_inflow_fields(FluidFlowSettings *mfs, if (heat && heat_in) { if (emission_value > 0.0f) { heat_in[index] = ADD_IF_LOWER(heat[index], mfs->temperature); - /* Scale inflow by dt/framelength. This is to ensure that adaptive steps don't apply too much - * emission. */ + /* Scale inflow by dt/frame-length. + * This is to ensure that adaptive steps don't apply too much emission. */ } else { heat_in[index] = heat[index]; @@ -3112,8 +3112,7 @@ BLI_INLINE void apply_inflow_fields(FluidFlowSettings *mfs, /* set fire reaction coordinate */ if (fuel && fuel_in) { - /* instead of using 1.0 for all new fuel add slight falloff - * to reduce flow blockiness */ + /* Instead of using 1.0 for all new fuel add slight falloff to reduce flow blocky-ness. */ float value = 1.0f - pow2f(1.0f - emission_value); if (fuel[index] > FLT_EPSILON && value > react[index]) { @@ -3327,7 +3326,7 @@ static void update_flowsfluids(struct Depsgraph *depsgraph, /* Update frame time, this is considering current subframe fraction * BLI_mutex_lock() called in manta_step(), so safe to update subframe here * TODO (sebbas): Using BKE_scene_frame_get(scene) instead of new DEG_get_ctime(depsgraph) - * as subframes dont work with the latter yet */ + * as subframes don't work with the latter yet */ BKE_object_modifier_update_subframe( depsgraph, scene, flowobj, true, 5, BKE_scene_frame_get(scene), eModifierType_Fluid); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index d4a61c83911..41ca44fbcd9 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4288,8 +4288,8 @@ static void particles_fluid_step(ParticleSimulationData *sim, printf("system type is %d and particle type is %d\n", part->type, flagActivePart); # endif - /* Type of particle must matche current particle system type (only important for snd - * particles). */ + /* Type of particle must match current particle system type + * (only important for snd particles). */ if ((flagActivePart & PARTICLE_TYPE_SPRAY) && (part->type & PART_FLUID_SPRAY) == 0) { continue; } @@ -4306,7 +4306,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, /* Debugging: Print type of particle system and current particles. */ printf("system type is %d and particle type is %d\n", part->type, flagActivePart); # endif - /* Particle system has allocated tottypeparts particles - so break early before exceeded. + /* Particle system has allocated 'tottypepart' particles - so break early before exceeded. */ if (activeParts >= tottypepart) { break; @@ -4330,7 +4330,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, madd_v3fl_v3fl_v3fl_v3i(max, mds->p0, cell_size_scaled, mds->res_max); sub_v3_v3v3(size, max, min); - /* Biggest dimension will be used for upscaling. */ + /* Biggest dimension will be used for up-scaling. */ max_size = MAX3(size[0] / (float)upres, size[1] / (float)upres, size[2] / (float)upres); /* Set particle position. */ @@ -4418,12 +4418,16 @@ static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNU return totpart - oldtotpart; } -/* Calculates the next state for all particles of the system - * In particles code most fra-ending are frames, time-ending are fra*timestep (seconds) +/** + * Calculates the next state for all particles of the system. + * In particles code most 'cfra - ending' are frames, + * 'time - ending' are 'cfra * timestep' (seconds). + * * 1. Emit particles * 2. Check cache (if used) and return if frame is cached * 3. Do dynamics - * 4. Save to cache */ + * 4. Save to cache + */ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_render_params) { ParticleSystem *psys = sim->psys; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f8723b495f7..cfd3c87327a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5593,8 +5593,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb, const Object *ob) if (mmd->domain->point_cache[1]) { PointCache *cache = newdataadr(fd, mmd->domain->point_cache[1]); if (cache->flag & PTCACHE_FAKE_SMOKE) { - /* Mantasim / smoke was already saved in "new format" and this cache is a fake one. - */ + /* Manta-sim/smoke was already saved in "new format" and this cache is a fake one. */ } else { printf( diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index e30a288ff44..44bcab7d41a 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -590,8 +590,8 @@ static void rna_Fluid_domaintype_set(struct PointerRNA *ptr, int value) Object *ob = (Object *)ptr->owner_id; if (value != settings->type) { - /* Set common values for liquid/smoke domain: cache type, border collision and viewport - * drawtype. */ + /* Set common values for liquid/smoke domain: cache type, + * border collision and viewport draw-type. */ if (value == FLUID_DOMAIN_TYPE_GAS) { rna_Fluid_cachetype_mesh_set(ptr, FLUID_DOMAIN_FILE_BIN_OBJECT); rna_Fluid_cachetype_data_set(ptr, FLUID_DOMAIN_FILE_UNI); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 17e34cd60ad..68e3e522dff 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -4506,7 +4506,7 @@ static void def_sh_tex_voronoi(StructRNA *srna) "SMOOTH_F1", 0, "Smooth F1", - "Smoothed version of F1. Weighted sum of neighbour voronoi cells"}, + "Smoothed version of F1. Weighted sum of neighbor voronoi cells"}, {SHD_VORONOI_DISTANCE_TO_EDGE, "DISTANCE_TO_EDGE", 0, diff --git a/source/creator/creator.c b/source/creator/creator.c index 32377da5284..58d12527f1c 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -113,13 +113,14 @@ void main_python_exit(void); #endif #ifdef WITH_USD -/* Workaround to make it possible to pass a path at runtime to USD. +/** + * Workaround to make it possible to pass a path at runtime to USD. * * USD requires some JSON files, and it uses a static constructor to determine the possible - * filesystem paths to find those files. This made it impossible for Blender to pass a path to the + * file-system paths to find those files. This made it impossible for Blender to pass a path to the * USD library at runtime, as the constructor would run before Blender's main() function. We have * patched USD (see usd.diff) to avoid that particular static constructor, and have an - * initialisation function instead. + * initialization function instead. * * This function is implemented in the USD source code, pxr/base/lib/plug/initConfig.cpp. */ diff --git a/tests/gtests/blenloader/blendfile_loading_base_test.cc b/tests/gtests/blenloader/blendfile_loading_base_test.cc index 5a1a7f9aae5..7af3293d706 100644 --- a/tests/gtests/blenloader/blendfile_loading_base_test.cc +++ b/tests/gtests/blenloader/blendfile_loading_base_test.cc @@ -89,7 +89,7 @@ void BlendfileLoadingBaseTest::TearDownTestCase() } /* Copied from WM_exit_ex() in wm_init_exit.c, and cherry-picked those lines that match the - * allocation/initialisation done in SetUpTestCase(). */ + * allocation/initialization done in SetUpTestCase(). */ BKE_blender_free(); RNA_exit();