Cleanup: spelling in comments

This commit is contained in:
Campbell Barton 2023-07-09 21:22:31 +10:00
parent 043d23e9c6
commit 6290451712
31 changed files with 58 additions and 57 deletions

View File

@ -27,7 +27,7 @@ ccl_device void spot_light_uv(const float3 ray,
ccl_private float *u,
ccl_private float *v)
{
/* Ensures that the spot light projects the full image regarless of the spot angle. */
/* Ensures that the spot light projects the full image regardless of the spot angle. */
const float factor = half_cot_half_spot_angle / ray.z;
/* NOTE: Return barycentric coordinates in the same notation as Embree and OptiX. */

View File

@ -151,10 +151,10 @@ ccl_device_inline void sample_uniform_cone_concentric(const float3 N,
* hemisphere doesn't change the radius. For the latter, r_cone(rand) =
* sin_from_cos(mix(cos_angle, 1, rand)).
*
* So, to remap, we just invert r_disk (-> rand(r_disk) = r_disk^2) and insert it into r_cone:
* r_cone(r_disk) = r_cone(rand(r_disk)) = sin_from_cos(mix(cos_angle, 1, r_disk^2)). In
* practise, we need to replace `rand` with `1 - rand` to preserve the stratification, but
* since it's uniform, that's fine. */
* So, to remap, we just invert r_disk `(-> rand(r_disk) = r_disk^2)` and insert it into
* r_cone: `r_cone(r_disk) = r_cone(rand(r_disk)) = sin_from_cos(mix(cos_angle, 1, r_disk^2))`.
* In practice, we need to replace `rand` with `1 - rand` to preserve the stratification,
* but since it's uniform, that's fine. */
float2 xy = concentric_sample_disk(rand);
const float r2 = len_squared(xy);

View File

@ -845,7 +845,7 @@ void node_type_storage(struct bNodeType *ntype,
*
* - nodetree:
* The actual bNodeTree data block.
* Check nodetree->idname or nodetree->typeinfo to use only specific types.
* Check `nodetree->idname` or `nodetree->typeinfo` to use only specific types.
*
* - id:
* The owner of the bNodeTree data block.

View File

@ -108,7 +108,7 @@ static void action_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src,
for (fcurve_src = action_src->curves.first; fcurve_src; fcurve_src = fcurve_src->next) {
/* Duplicate F-Curve. */
/* XXX TODO: pass subdata flag?
/* XXX TODO: pass sub-data flag?
* But surprisingly does not seem to be doing any ID reference-counting. */
fcurve_dst = BKE_fcurve_copy(fcurve_src);

View File

@ -1352,7 +1352,7 @@ void BKE_animdata_fix_paths_rename_all_ex(Main *bmain,
} \
(void)0
/* another version of this macro for nodetrees */
/* Another version of this macro for node-trees. */
#define RENAMEFIX_ANIM_NODETREE_IDS(first, NtId_Type) \
for (id = first; id; id = id->next) { \
AnimData *adt = BKE_animdata_from_id(id); \

View File

@ -4003,11 +4003,11 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, float
} \
(void)0
/* another macro for the "embedded" nodetree cases
* - this is like EVAL_ANIM_IDS, but this handles the case "embedded nodetrees"
* (i.e. scene/material/texture->nodetree) which we need a special exception
* for, otherwise they'd get skipped
* - 'ntp' stands for "node tree parent" = data-block where node tree stuff resides
/* Another macro for the "embedded" node-tree cases
* - This is like #EVAL_ANIM_IDS, but this handles the case "embedded node-trees"
* (i.e. `scene/material/texture->nodetree`) which we need a special exception
* for, otherwise they'd get skipped.
* - `ntp` stands for "node tree parent" = data-block where node tree stuff resides.
*/
#define EVAL_ANIM_NODETREE_IDS(first, NtId_Type, aflag) \
for (id = first; id; id = id->next) { \

View File

@ -466,7 +466,7 @@ void BKE_idtype_id_foreach_cache(ID *id,
type_info = BKE_idtype_get_info_from_id(&nodetree->id);
if (type_info == NULL) {
/* Very old .blend file seem to have empty names for their embedded node trees, see
* `blo_do_versions_250()`. Assume those are nodetrees then. */
* `blo_do_versions_250()`. Assume those are node-trees then. */
type_info = BKE_idtype_get_info_from_idcode(ID_NT);
}
if (type_info->foreach_cache != NULL) {

View File

@ -593,7 +593,7 @@ static int id_copy_libmanagement_cb(LibraryIDLinkCallbackData *cb_data)
/* Remap self-references to new copied ID. */
if (id == data->id_src) {
/* We cannot use self_id here, it is not *always* id_dst (thanks to $£!+@#&/? nodetrees). */
/* We cannot use self_id here, it is not *always* id_dst (thanks to confounded node-trees!). */
id = *id_pointer = data->id_dst;
}
@ -713,15 +713,15 @@ ID *BKE_id_copy_for_duplicate(Main *bmain,
ID_NEW_SET(key, key_new);
}
/* NOTE: embedded data (root nodetrees and master collections) should never be referenced by
/* NOTE: embedded data (root node-trees and master collections) should never be referenced by
* anything else, so we do not need to set their newid pointer and flag. */
BKE_animdata_duplicate_id_action(bmain, id_new, duplicate_flags);
if (key_new != NULL) {
BKE_animdata_duplicate_id_action(bmain, key_new, duplicate_flags);
}
/* Note that actions of embedded data (root nodetrees and master collections) are handled
* by `BKE_animdata_duplicate_id_action` as well. */
/* Note that actions of embedded data (root node-trees and master collections) are handled
* by #BKE_animdata_duplicate_id_action as well. */
}
return id->newid;
}
@ -1436,7 +1436,7 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int ori
/* the duplicate should get a copy of the animdata */
if ((flag & LIB_ID_COPY_NO_ANIMDATA) == 0) {
/* Note that even though horrors like root nodetrees are not in bmain, the actions they use
/* Note that even though horrors like root node-trees are not in bmain, the actions they use
* in their anim data *are* in bmain... super-mega-hooray. */
BLI_assert((copy_data_flag & LIB_ID_COPY_ACTIONS) == 0 ||
(copy_data_flag & LIB_ID_CREATE_NO_MAIN) == 0);
@ -1837,7 +1837,7 @@ void BKE_library_make_local(Main *bmain,
BLI_linklist_prepend_arena(&todo_ids, id, linklist_mem);
id->tag |= LIB_TAG_DOIT;
/* Tag those nasty non-ID nodetrees,
/* Tag those nasty non-ID node-trees,
* but do not add them to todo list, making them local is handled by 'owner' ID.
* This is needed for library_make_local_copying_check() to work OK at step 2. */
if (ntree != NULL) {

View File

@ -160,7 +160,7 @@ static void material_free_data(ID *id)
static void material_foreach_id(ID *id, LibraryForeachIDData *data)
{
Material *material = (Material *)id;
/* Nodetrees **are owned by IDs**, treat them as mere sub-data and not real ID! */
/* Node-trees **are owned by IDs**, treat them as mere sub-data and not real ID! */
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&material->nodetree));
if (material->texpaintslot != nullptr) {

View File

@ -1063,7 +1063,7 @@ template<typename T> void twoface2_test()
EXPECT_EQ(out.edge.size(), 18);
EXPECT_EQ(out.face.size(), 9);
if (out.vert.size() == 10 && out.edge.size() == 18 && out.face.size() == 9) {
/* Input verts have no dups, so expect output ones match input ones. */
/* Input verts have no duplicates, so expect output ones match input ones. */
for (int i = 0; i < 6; i++) {
EXPECT_EQ(get_orig_index(out.vert_orig, i), i);
}

View File

@ -1754,7 +1754,7 @@ if (!MAIN_VERSION_ATLEAST(bmain, 266, 3)) {
{
/* Fix for a very old issue:
* Node names were nominally made unique in r24478 (2.50.8), but the do_versions check
* to update existing node names only applied to bmain->nodetree (i.e. group nodes).
* to update existing node names only applied to `bmain->nodetree` (i.e. group nodes).
* Uniqueness is now required for proper preview mapping,
* so do this now to ensure old files don't break.
*/

View File

@ -68,7 +68,7 @@ const char *nodeTypeAsString(NodeType type)
return "OBJECT_FROM_LAYER";
case NodeType::HIERARCHY:
return "HIERARCHY";
/* **** Evaluation-Related Outer Types (with Subdata) **** */
/* **** Evaluation-Related Outer Types (with Sub-data) **** */
case NodeType::EVAL_POSE:
return "EVAL_POSE";
case NodeType::BONE:

View File

@ -103,7 +103,7 @@ enum class NodeType {
* properly evaluated. Example of this is custom shapes for bones. */
VISIBILITY,
/* **** Evaluation-Related Outer Types (with Subdata) **** */
/* **** Evaluation-Related Outer Types (with Sub-data) **** */
/* Pose Component - Owner/Container of Bones Eval */
EVAL_POSE,

View File

@ -134,7 +134,7 @@ class ReflectionProbeModule {
/**
* Remove reflection probe data from the module.
* Ensures that data_buf is sequential and cubemaps are relinked to its corresponding data.
* Ensures that data_buf is sequential and cube-maps are relinked to its corresponding data.
*/
void remove_reflection_probe_data(int reflection_probe_data_index);

View File

@ -20,9 +20,9 @@ class Instance;
/* -------------------------------------------------------------------- */
/** \name Default World Node-Tree
*
* In order to support worlds without nodetree we reuse and configure a standalone nodetree that
* In order to support worlds without node-tree we reuse and configure a standalone node-tree that
* we pass for shader generation. The GPUMaterial is still stored inside the World even if
* it does not use a nodetree.
* it does not use a node-tree.
* \{ */
class DefaultWorldNodeTree {

View File

@ -41,9 +41,9 @@ void main()
velocity_local_pos_get(pos, vert_idx, prv, nxt);
/* FIXME(fclem): Evaluating before displacement avoid displacement being treated as motion but
* ignores motion from animated displacement. Supporting animated displacement motion vectors
* would require evaluating the nodetree multiple time with different nodetree UBOs evaluated at
* different times, but also with different attributes (maybe we could assume static attribute at
* least). */
* would require evaluating the node-tree multiple time with different node-tree UBOs evaluated
* at different times, but also with different attributes (maybe we could assume static attribute
* at least). */
velocity_vertex(prv, pos, nxt, motion.prev, motion.next);
#endif

View File

@ -38,9 +38,9 @@ void main()
vec3 lP_curr = transform_point(ModelMatrixInverse, interp.P);
/* FIXME(fclem): Evaluating before displacement avoid displacement being treated as motion but
* ignores motion from animated displacement. Supporting animated displacement motion vectors
* would require evaluating the nodetree multiple time with different nodetree UBOs evaluated at
* different times, but also with different attributes (maybe we could assume static attribute at
* least). */
* would require evaluating the node-tree multiple time with different node-tree UBOs evaluated
* at different times, but also with different attributes (maybe we could assume static attribute
* at least). */
velocity_vertex(lP_curr, lP_curr, lP_curr, motion.prev, motion.next);
#endif

View File

@ -80,9 +80,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
* which isn't so clear with option 2.
*/
/* For structname:
/* For struct-name:
* - As base, we use a custom name from the structs if one is available
* - However, if we're showing subdata of bones
* - However, if we're showing sub-data of bones
* (probably there will be other exceptions later).
* need to include that info too since it gets confusing otherwise.
* - If a pointer just refers to the ID-block, then don't repeat this info

View File

@ -361,7 +361,7 @@ TimeMarker *ED_markers_get_first_selected(ListBase *markers)
void debug_markers_print_list(ListBase *markers)
{
/* NOTE: do NOT make static or put in if-defs as "unused code".
/* NOTE: do NOT make static or use `ifdef`'s as "unused code".
* That's too much trouble when we need to use for quick debugging! */
TimeMarker *marker;
@ -780,7 +780,7 @@ static void MARKER_OT_add(wmOperatorType *ot)
* \{ */
/* operator state vars used:
* frs: delta movement
* frames: delta movement
*
* functions:
*
@ -957,7 +957,7 @@ static int ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *eve
/* add temp handler */
WM_event_add_modal_handler(C, op);
/* reset frs delta */
/* Reset frames delta. */
RNA_int_set(op->ptr, "frames", 0);
ed_marker_move_update_header(C, op);
@ -1144,7 +1144,7 @@ static void MARKER_OT_move(wmOperatorType *ot)
* \{ */
/* operator state vars used:
* frs: delta movement
* frames: delta movement
*
* functions:
*
@ -1201,7 +1201,7 @@ static void ed_marker_duplicate_apply(bContext *C)
static int ed_marker_duplicate_exec(bContext *C, wmOperator *op)
{
ed_marker_duplicate_apply(C);
ed_marker_move_exec(C, op); /* assumes frs delta set */
ed_marker_move_exec(C, op); /* Assumes frame delta set. */
return OPERATOR_FINISHED;
}

View File

@ -1054,7 +1054,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
ebone->bbone_next = ebone_iter->bbone_next->temp.ebone;
}
/* Lets try to fix any constraint subtargets that might have been duplicated. */
/* Lets try to fix any constraint sub-targets that might have been duplicated. */
updateDuplicateSubtarget(ebone, arm->edbo, ob, false);
}
}

View File

@ -236,8 +236,9 @@ static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEven
return WM_operator_props_dialog_popup(C, op, 270);
}
/* For the object with pose/action: create path curves for selected bones
* This recalculates the WHOLE path within the pchan->pathsf and pchan->pathef range
/**
* For the object with pose/action: create path curves for selected bones
* This recalculates the WHOLE path within the `pchan->pathsf` and `pchan->pathef` range.
*/
static int pose_calculate_paths_exec(bContext *C, wmOperator *op)
{
@ -272,7 +273,7 @@ static int pose_calculate_paths_exec(bContext *C, wmOperator *op)
TIMEIT_START(recalc_pose_paths);
#endif
/* Calculate the bones that now have motionpaths. */
/* Calculate the bones that now have motion-paths. */
/* TODO: only make for the selected bones? */
ED_pose_recalculate_paths(C, scene, ob, POSE_PATH_CALC_RANGE_FULL);

View File

@ -75,7 +75,7 @@ static void make_prim_finish(bContext *C,
* to push this up to edges & faces. */
EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX);
/* only recalc editmode tessface if we are staying in editmode */
/* Only recalculate edit-mode tessellation if we are staying in edit-mode. */
EDBMUpdate_Params params{};
params.calc_looptri = !exit_editmode;
params.calc_normals = false;

View File

@ -374,8 +374,8 @@ static bool edbm_bevel_calc(wmOperator *op)
BMO_op_exec(em->bm, &bmop);
if (offset != 0.0f) {
/* not essential, but we may have some loose geometry that
* won't get bevel'd and better not leave it selected */
/* Not essential, but we may have some loose geometry that
* won't get beveled and better not leave it selected. */
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
BMO_slot_buffer_hflag_enable(
em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);

View File

@ -354,7 +354,7 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot)
/** \name Extrude Operator
* \{ */
/* generic extern called extruder */
/** Implement generic externally called extrude function. */
static bool edbm_extrude_mesh(Object *obedit, BMEditMesh *em, wmOperator *op)
{
const bool use_normal_flip = RNA_boolean_get(op->ptr, "use_normal_flip");

View File

@ -195,7 +195,7 @@ static void ringsel_finish(bContext *C, wmOperator *op)
use_only_quads,
0);
/* when used in a macro the tessfaces will be recalculated anyway,
/* When used in a macro the tessellation will be recalculated anyway,
* this is needed here because modifiers depend on updated tessellation, see #45920 */
EDBMUpdate_Params params{};
params.calc_looptri = true;

View File

@ -213,7 +213,7 @@ bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, Rep
return false;
}
/* We need to unset nodetrees before removing the layer, otherwise its index will be -1. */
/* We need to unset node-trees before removing the layer, otherwise its index will be -1. */
view_layer_remove_unset_nodetrees(bmain, scene, layer);
BLI_remlink(&scene->view_layers, layer);

View File

@ -372,7 +372,7 @@ static void slider_draw(const bContext *UNUSED(C), ARegion *region, void *arg)
static void slider_update_factor(tSlider *slider, const wmEvent *event)
{
/* Normalize so no matter the factor bounds, the mouse distance travelled from min to max is
/* Normalize so no matter the factor bounds, the mouse distance traveled from min to max is
* constant. */
const float slider_range = slider->factor_bounds[1] - slider->factor_bounds[0];
const float factor_delta = (event->xy[0] - slider->last_cursor[0]) /

View File

@ -3402,7 +3402,7 @@ static IDFilterEnumPropertyItem rna_enum_space_file_id_filter_categories[] = {
"category_shading",
ICON_MATERIAL_DATA,
"Shading",
"Show materials, nodetrees, textures and Freestyle's linestyles"},
"Show materials, node-trees, textures and Freestyle's line-styles"},
{FILTER_ID_IM | FILTER_ID_MC | FILTER_ID_MSK | FILTER_ID_SO,
"category_image",
ICON_IMAGE_DATA,

View File

@ -279,8 +279,8 @@ static void BMD_mesh_intersection(BMesh *bm,
BooleanModifierData *bmd = (BooleanModifierData *)md;
/* main bmesh intersection setup */
/* create tessface & intersect */
/* Main BMesh intersection setup. */
/* Create tessellation & intersect. */
const int looptris_tot = poly_to_tri_count(bm->totface, bm->totloop);
BMLoop *(*looptris)[3] = (BMLoop * (*)[3])
MEM_malloc_arrayN(looptris_tot, sizeof(*looptris), __func__);

View File

@ -714,7 +714,7 @@ static bool node_composit_poll_rlayers(const bNodeType * /*ntype*/,
Scene *scene;
/* XXX ugly: check if ntree is a local scene node tree.
* Render layers node can only be used in local scene->nodetree,
* Render layers node can only be used in local `scene->nodetree`,
* since it directly links to the scene.
*/
for (scene = (Scene *)G.main->scenes.first; scene; scene = (Scene *)scene->id.next) {

View File

@ -46,7 +46,7 @@ wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent
gesture->event_modifier = event->modifier;
gesture->event_keymodifier = event->keymodifier;
gesture->winrct = region->winrct;
gesture->user_data.use_free = true; /* Free if userdata is set. */
gesture->user_data.use_free = true; /* Free if user-data is set. */
gesture->modal_state = GESTURE_MODAL_NOP;
gesture->move = false;