Cleanup: spelling in comments

This commit is contained in:
Campbell Barton 2023-01-16 13:57:10 +11:00
parent eeb6a3dc05
commit 2467becade
21 changed files with 55 additions and 53 deletions

View File

@ -681,7 +681,7 @@ typedef struct CustomDataTransferLayerMap {
/** If non-NULL, array of weights, one for each dest item, replaces mix_factor. */
const float *mix_weights;
/** Data source array (can be regular CD data, vertices/edges/etc., keyblocks...). */
/** Data source array (can be regular CD data, vertices/edges/etc., key-blocks...). */
const void *data_src;
/** Data dest array (same type as dat_src). */
void *data_dst;
@ -699,7 +699,7 @@ typedef struct CustomDataTransferLayerMap {
/** For bit-flag transfer, flag(s) to affect in transferred data. */
uint64_t data_flag;
/** Opaque pointer, to be used by specific interp callback (e.g. transformspace for normals). */
/** Opaque pointer, to be used by specific interp callback (e.g. transform-space for normals). */
void *interp_data;
cd_datatransfer_interp interp;

View File

@ -210,10 +210,12 @@ typedef struct ParticleCollision {
ParticleCollisionElement pce;
/* total_time is the amount of time in this subframe
* inv_total_time is the opposite
* inv_timestep is the inverse of the amount of time in this frame */
float total_time, inv_total_time, inv_timestep;
/** The amount of time in this sub-frame. */
float total_time;
/** The inverse of `total_time`. */
float inv_total_time;
/** The inverse of the amount of time in this frame. */
float inv_timestep;
float radius;
float co1[3], co2[3];

View File

@ -124,7 +124,7 @@ bConstraintOb *BKE_constraints_make_evalob(
/* create regardless of whether we have any data! */
cob = MEM_callocN(sizeof(bConstraintOb), "bConstraintOb");
/* for system time, part of deglobalization, code nicer later with local time (ton) */
/* NOTE(@ton): For system time, part of de-globalization, code nicer later with local time. */
cob->scene = scene;
cob->depsgraph = depsgraph;
@ -236,7 +236,7 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob)
}
}
/* free tempolary struct */
/* Free temporary struct. */
MEM_freeN(cob);
}
@ -3842,7 +3842,7 @@ static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar
* be used that doesn't lazy initialize to avoid thread safety issues in the future. */
BKE_object_minmax(ct->tar, curveMin, curveMax, true);
/* get targetmatrix */
/* Get target-matrix. */
if (data->tar->runtime.curve_cache && data->tar->runtime.curve_cache->anim_path_accum_length) {
float vec[4], totmat[4][4];
float curvetime;

View File

@ -507,7 +507,7 @@ static float mixColors(
static void scene_setSubframe(Scene *scene, float subframe)
{
/* dynamic paint subframes must be done on previous frame */
/* Dynamic paint sub-frames must be done on previous frame. */
scene->r.cfra -= 1;
scene->r.subframe = subframe;
}
@ -1139,7 +1139,7 @@ bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, str
brush->smudge_strength = 0.3f;
brush->max_velocity = 1.0f;
/* Paint proximity falloff colorramp. */
/* Paint proximity falloff color-ramp. */
{
CBData *ramp;
@ -1659,7 +1659,7 @@ static void dynamicPaint_setInitialColor(const Scene *scene, DynamicPaintSurface
/* vertex color layer */
else if (surface->init_color_type == MOD_DPAINT_INITIAL_VERTEXCOLOR) {
/* for vertex surface, just copy colors from mcol */
/* For vertex surface, just copy colors from #MLoopCol. */
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
const MLoop *mloop = BKE_mesh_loops(mesh);
const int totloop = mesh->totloop;
@ -2787,7 +2787,7 @@ int dynamicPaint_createUVSurface(Scene *scene,
float *progress,
bool *do_update)
{
/* Antialias jitter point relative coords */
/* Anti-alias jitter point relative coords. */
const int aa_samples = (surface->flags & MOD_DPAINT_ANTIALIAS) ? 5 : 1;
char uvname[MAX_CUSTOMDATA_LAYER_NAME];
uint32_t active_points = 0;
@ -5333,7 +5333,7 @@ static void dynamic_paint_effect_drip_cb(void *__restrict userdata,
const uint n_trgt = (uint)n_target[n_idx];
/* Sort of spinlock, but only for given ePoint.
/* Sort of spin-lock, but only for given ePoint.
* Since the odds a same ePoint is modified at the same time by several threads is very low,
* this is much more efficient than a global spin lock. */
const uint epointlock_idx = n_trgt / 8;

View File

@ -448,9 +448,9 @@ struct IslandResult {
* This only concerns loops, currently (because of islands), and 'sampled' edges/polys norproj.
*/
/* At most n raycasts per 'real' ray. */
/** At most N ray-casts per 'real' ray. */
#define MREMAP_RAYCAST_APPROXIMATE_NR 3
/* Each approximated raycasts will have n times bigger radius than previous one. */
/** Each approximated ray-casts will have n times bigger radius than previous one. */
#define MREMAP_RAYCAST_APPROXIMATE_FAC 5.0f
/* min 16 rays/face, max 400. */

View File

@ -316,9 +316,10 @@ static void distribute_grid(Mesh *mesh, ParticleSystem *psys)
}
}
/* modified copy from rayshade.c */
static void hammersley_create(float *out, int n, int seed, float amount)
{
/* This code is originally from a modified copy from `rayshade.c`
* (a file that's no longer included). */
RNG *rng;
double ofs[2], t;
@ -917,7 +918,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx,
}
/* XXX This distribution code is totally broken in case from == PART_FROM_CHILD,
* it's always using finaldm even if use_modifier_stack is unset...
* it's always using `final_mesh` even if use_modifier_stack is unset...
* But making things consistent here break all existing edited
* hair systems, so better wait for complete rewrite. */

View File

@ -377,7 +377,7 @@ static void ccd_mesh_update(Object *ob, ccd_Mesh *pccd_M)
pccd_M->bbmin[0] = pccd_M->bbmin[1] = pccd_M->bbmin[2] = 1e30f;
pccd_M->bbmax[0] = pccd_M->bbmax[1] = pccd_M->bbmax[2] = -1e30f;
/* blow it up with forcefield ranges */
/* Blow it up with force-field ranges. */
hull = max_ff(ob->pd->pdef_sbift, ob->pd->pdef_sboft);
/* rotate current to previous */
@ -848,7 +848,7 @@ static void renew_softbody(Object *ob, int totpoint, int totspring)
}
else {
bp->goal = 0.0f;
/* so this will definily be below SOFTGOALSNAP */
/* So this will definitely be below #SOFTGOALSNAP. */
}
bp->nofsprings = 0;
@ -1793,7 +1793,7 @@ static int sb_detect_vertex_collisionCached(float opco[3],
return deflected;
}
/* sandbox to plug in various deflection algos */
/* Sandbox to plug in various deflection algorithms. */
static int sb_deflect_face(Object *ob,
float *actpos,
float *facenormal,

View File

@ -1465,7 +1465,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
} /* sequencer changes */
}
if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */
if (bmain->versionfile <= 251) { /* 2.5.1 had no sub-versions */
bScreen *screen;
/* Blender 2.5.2 - subversion 0 introduced a new setting: V3D_HIDE_OVERLAYS.

View File

@ -1101,9 +1101,8 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
continue;
}
/* The substep method changed from "per second" to "per frame".
* To get the new value simply divide the old bullet sim fps with the scene fps.
*/
/* The sub-step method changed from "per second" to "per frame".
* To get the new value simply divide the old bullet sim FPS with the scene FPS. */
rbw->substeps_per_frame /= FPS;
if (rbw->substeps_per_frame <= 0) {

View File

@ -3843,8 +3843,8 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
LISTBASE_FOREACH (Light *, light, &bmain->lights) {
light->radius = light->area_size;
}
/* Grease Pencil Build modifier: Set default value for new natural drawspeed factor and maximum
* gap. */
/* Grease Pencil Build modifier:
* Set default value for new natural draw-speed factor and maximum gap. */
if (!DNA_struct_elem_find(fd->filesdna, "BuildGpencilModifierData", "float", "speed_fac") ||
!DNA_struct_elem_find(fd->filesdna, "BuildGpencilModifierData", "float", "speed_maxgap")) {
LISTBASE_FOREACH (Object *, ob, &bmain->objects) {

View File

@ -494,7 +494,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
return;
}
/* Workspaces. */
/* Work-spaces. */
LISTBASE_FOREACH (wmWindowManager *, wm, &bmain->wm) {
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {

View File

@ -1474,7 +1474,7 @@ void DRW_draw_callbacks_post_scene(void)
/* XXX: Or should we use a proper draw/overlay engine for this case? */
if (do_annotations) {
GPU_depth_test(GPU_DEPTH_NONE);
/* XXX: as scene->gpd is not copied for COW yet */
/* XXX: as `scene->gpd` is not copied for COW yet. */
ED_annotation_draw_view3d(DEG_get_input_scene(depsgraph), depsgraph, v3d, region, true);
GPU_depth_test(GPU_DEPTH_LESS_EQUAL);
}

View File

@ -343,8 +343,8 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
/* we only include bones that are part of a continual connected chain */
do {
/* here, we set ik-settings for bone from pchan->protectflag */
/* XXX: careful with quats/axis-angle rotations where we're locking 4d components. */
/* Here, we set IK-settings for bone from `pchan->protectflag`. */
/* XXX: careful with quaternion/axis-angle rotations where we're locking 4D components. */
if (pchan->protectflag & OB_LOCK_ROTX) {
pchan->ikflag |= BONE_IK_NO_XDOF_TEMP;
}

View File

@ -268,10 +268,8 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2]))
ElementResize(t, tc, td, mat);
}
/* In proportional edit it can happen that */
/* vertices in the radius of the brush end */
/* outside the clipping area */
/* XXX HACK - dg */
/* XXX(@dg): In proportional edit it can happen that vertices
* in the radius of the brush end outside the clipping area. */
if (t->flag & T_PROP_EDIT) {
clipUVData(t);
}

View File

@ -278,7 +278,7 @@ static void build_sequential(Object *ob,
/* Recycled counter. */
size_t i;
Scene *scene = DEG_get_evaluated_scene(depsgraph);
/* Framerate of scene. */
/* Frame-rate of scene. */
const float fps = (((float)scene->r.frs_sec) / scene->r.frs_sec_base);
/* 1) Determine which strokes to start with (& adapt total number of strokes to build). */
@ -379,9 +379,9 @@ static void build_sequential(Object *ob,
float deltatime = fabs(cell->gps->points[j].time - last_pointtime);
/* Do we need to sanitize previous points? */
if (0 < zeropoints) {
/* Only correct if timegap bigger than MIN_CORRECTGAP. */
/* Only correct if time-gap bigger than #GP_BUILD_CORRECTGAP. */
if (GP_BUILD_CORRECTGAP < deltatime) {
/* Cycling backwards through zeropoints to fix them. */
/* Cycling backwards through zero-points to fix them. */
for (int k = 0; k < zeropoints; k++) {
float linear_fill = interpf(
deltatime, 0, ((float)k + 1) / (zeropoints + 1)); /* Factor = Proportion. */
@ -393,7 +393,7 @@ static void build_sequential(Object *ob,
}
}
/* Normal behaviour with time data */
/* Normal behavior with time data. */
idx_times[curpoint] = sumtime + deltatime;
sumtime = idx_times[curpoint];
last_pointtime = cell->gps->points[j].time;

View File

@ -654,8 +654,8 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
if (collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
uint grouped_vertex_count = mp->getGroupedVertexElementsCount();
for (uint group_index = 0; group_index < grouped_vertex_count; group_index++) {
uint first_vertex = position_indices[0]; /* Store first trifan vertex */
uint first_normal = normal_indices[0]; /* Store first trifan vertex normal */
uint first_vertex = position_indices[0]; /* Store first triangle-fan vertex. */
uint first_normal = normal_indices[0]; /* Store first triangle-fan vertex normal. */
uint vertex_count = mp->getGroupedVerticesVertexCount(group_index);
for (uint vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++) {

View File

@ -431,7 +431,7 @@ typedef struct ImageFormatData {
/** OpenEXR. */
char exr_codec;
/** Cineon. */
/** CINEON. */
char cineon_flag;
short cineon_white, cineon_black;
float cineon_gamma;
@ -657,7 +657,7 @@ typedef struct RenderData {
/** Frames as in 'images'. */
int cfra, sfra, efra;
/** Subframe offset from cfra, in 0.0-1.0. */
/** Sub-frame offset from `cfra`, in 0.0-1.0. */
float subframe;
/** Start+end frames of preview range. */
int psfra, pefra;
@ -719,13 +719,13 @@ typedef struct RenderData {
/**
* What to do with the sky/background.
* Picks sky/premul blending for the background.
* Picks sky/pre-multiply blending for the background.
*/
char alphamode;
char _pad0[1];
/** Render border to render sub-resions. */
/** Render border to render sub-regions. */
rctf border;
/* Information on different layers to be rendered. */
@ -1928,7 +1928,7 @@ typedef struct Scene {
void *sound_scrub_handle;
void *speaker_handles;
/** (runtime) info/cache used for presenting playback framerate info to the user. */
/** (runtime) info/cache used for presenting playback frame-rate info to the user. */
void *fps_info;
/** None of the dependency graph vars is mean to be saved. */
@ -2000,7 +2000,7 @@ typedef struct Scene {
/* Use preview range. */
#define SCER_PRV_RANGE (1 << 0)
#define SCER_LOCK_FRAME_SELECTION (1 << 1)
/* Show/use subframes (for checking motion blur). */
/** Show/use sub-frames (for checking motion blur). */
#define SCER_SHOW_SUBFRAME (1 << 3)
/** #RenderData.mode. */
@ -2560,7 +2560,7 @@ typedef enum eGPencil_Flags {
GP_TOOL_FLAG_PAINT_ONBACK = (1 << 2),
/** Show compact list of colors. */
GP_TOOL_FLAG_THUMBNAIL_LIST = (1 << 3),
/** Generate wheight data for new strokes. */
/** Generate weight data for new strokes. */
GP_TOOL_FLAG_CREATE_WEIGHTS = (1 << 4),
/** Auto-merge with last stroke. */
GP_TOOL_FLAG_AUTOMERGE_STROKE = (1 << 5),

View File

@ -2976,7 +2976,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "effector_amount", PROP_INT, PROP_UNSIGNED);
/* In theory PROP_ANIMATABLE perhaps should be cleared,
* but animating this can give some interesting results! */
RNA_def_property_range(prop, 0, 10000); /* 10000 effectors will bel SLOW, but who knows */
RNA_def_property_range(prop, 0, 10000); /* 10000 effectors will be SLOW, but who knows */
RNA_def_property_ui_range(prop, 0, 100, 1, -1);
RNA_def_property_ui_text(
prop, "Effector Number", "How many particles are effectors (0 is all particles)");
@ -4015,7 +4015,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_function_output(func, parm);
/* extract hair mcols */
/* Extract hair vertex-colors. */
func = RNA_def_function(srna, "mcol_on_emitter", "rna_ParticleSystem_mcol_on_emitter");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Obtain mcol for all particles");

View File

@ -366,7 +366,7 @@ static Mesh *doOcean(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mes
float(*positions)[3] = BKE_mesh_vert_positions_for_write(result);
const MPoly *polys = BKE_mesh_polys(result);
/* add vcols before displacement - allows lookup based on position */
/* Add vertex-colors before displacement: allows lookup based on position. */
if (omd->flag & MOD_OCEAN_GENERATE_FOAM) {
const int polys_num = result->totpoly;

View File

@ -352,7 +352,7 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex
* (so that winding of copied face get reversed, so that normals get reversed
* and point in expected direction...).
* If we also copy data here, then this data get overwritten
* (and allocated memory becomes memleak). */
* (and allocated memory becomes a memory leak). */
CustomData_copy_data(&mesh->pdata, &result->pdata, 0, 0, (int)polys_num);
CustomData_copy_data(&mesh->pdata, &result->pdata, 0, (int)polys_num, (int)polys_num);

View File

@ -2666,7 +2666,9 @@ static int wm_handler_fileselect_do(bContext *C,
wm_window_close(C, wm, win);
CTX_wm_window_set(C, root_win); /* #wm_window_close() nullptrs. */
/* #wm_window_close() sets the context's window to null. */
CTX_wm_window_set(C, root_win);
/* Some operators expect a drawable context (for #EVT_FILESELECT_EXEC). */
wm_window_make_drawable(wm, root_win);
/* Ensure correct cursor position, otherwise, popups may close immediately after