Cleanup: code-comments

This commit is contained in:
Campbell Barton 2023-07-07 15:11:19 +10:00
parent 6d608cc6b5
commit 23acedd432
32 changed files with 63 additions and 58 deletions

View File

@ -89,7 +89,7 @@ static inline BL::Mesh object_to_mesh(BL::BlendData & /*data*/,
if (b_ob_info.is_real_object_data()) {
if (mesh) {
/* Make a copy to split faces if we use autosmooth, otherwise not needed.
/* Make a copy to split faces if we use auto-smooth, otherwise not needed.
* Also in edit mode do we need to make a copy, to ensure data layers like
* UV are not empty. */
if (mesh.is_editmode() ||

View File

@ -50,7 +50,7 @@ enum {
IDWALK_CB_DIRECT_WEAK_LINK = (1 << 3),
/**
* That ID is used as mere sub-data by its owner (only case currently: those root nodetrees in
* That ID is used as mere sub-data by its owner (only case currently: those root node-trees in
* materials etc., and the Scene's master collections).
* This means callback shall not *do* anything, only use this as informative data if it needs it.
*/

View File

@ -989,9 +989,10 @@ void BKE_pchan_bbone_spline_params_get(bPoseChannel *pchan,
/* Transform previous point inside this bone space. */
if (bone->bbone_prev_type == BBONE_HANDLE_RELATIVE) {
/* Use delta movement (from restpose), and apply this relative to the current bone's head. */
/* Use delta movement (from rest-pose),
* and apply this relative to the current bone's head. */
if (rest) {
/* In restpose, arm_head == pose_head */
/* In rest-pose, arm_head == pose_head */
zero_v3(param->prev_h);
done = true;
}
@ -1043,9 +1044,10 @@ void BKE_pchan_bbone_spline_params_get(bPoseChannel *pchan,
/* Transform next point inside this bone space. */
if (bone->bbone_next_type == BBONE_HANDLE_RELATIVE) {
/* Use delta movement (from restpose), and apply this relative to the current bone's tail. */
/* Use delta movement (from rest-pose),
* and apply this relative to the current bone's tail. */
if (rest) {
/* In restpose, arm_head == pose_head */
/* In rest-pose, arm_head == pose_head */
copy_v3_fl3(param->next_h, 0.0f, param->length, 0.0);
done = true;
}
@ -1091,12 +1093,12 @@ void BKE_pchan_bbone_spline_params_get(bPoseChannel *pchan,
* - These properties allow users to hand-animate the
* bone curve/shape, without having to resort to using
* extra bones
* - The "bone" level offsets are for defining the restpose
* - The "bone" level offsets are for defining the rest-pose
* shape of the bone (e.g. for curved eyebrows for example).
* -> In the viewport, it's needed to define what the rest pose
* looks like
* -> For "rest == 0", we also still need to have it present
* so that we can "cancel out" this restpose when it comes
* so that we can "cancel out" this rest-pose when it comes
* time to deform some geometry, it won't cause double transforms.
* - The "pchan" level offsets are the ones that animators actually
* end up animating

View File

@ -1439,7 +1439,7 @@ static int followpath_get_tars(bConstraint *con, ListBase *list)
bFollowPathConstraint *data = con->data;
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints without subtargets */
/* Standard target-getting macro for single-target constraints without sub-targets. */
SINGLETARGETNS_GET_TARS(con, data->tar, ct, list);
return 1;
@ -3787,7 +3787,7 @@ static int clampto_get_tars(bConstraint *con, ListBase *list)
bClampToConstraint *data = con->data;
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints without subtargets */
/* Standard target-getting macro for single-target constraints without sub-targets. */
SINGLETARGETNS_GET_TARS(con, data->tar, ct, list);
return 1;
@ -4609,7 +4609,7 @@ static int splineik_get_tars(bConstraint *con, ListBase *list)
bSplineIKConstraint *data = con->data;
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints without subtargets */
/* Standard target-getting macro for single-target constraints without sub-targets. */
SINGLETARGETNS_GET_TARS(con, data->tar, ct, list);
return 1;

View File

@ -1098,7 +1098,7 @@ static char *get_rna_access(ID *id,
propname = "eval_time";
break;
/* XXX problematic blocktypes */
/* XXX problematic block-types. */
case ID_SEQ: /* sequencer strip */
/* SEQ_FAC1: */
switch (adrcode) {

View File

@ -185,7 +185,7 @@ static int foreach_libblock_remap_callback(LibraryIDLinkCallbackData *cb_data)
IDRemap *id_remap_data = cb_data->user_data;
/* Those asserts ensure the general sanity of ID tags regarding 'embedded' ID data (root
* nodetrees and co). */
* node-trees and co). */
BLI_assert(id_owner == id_remap_data->id_owner);
BLI_assert(id_self == id_owner || (id_self->flag & LIB_EMBEDDED_DATA) != 0);

View File

@ -881,22 +881,22 @@ bool BKE_ocean_init(Ocean *o,
o->_Lz = 0.001f;
}
/* the +ve components and DC */
/* The +VE components and DC. */
for (i = 0; i <= o->_M / 2; i++) {
o->_kx[i] = 2.0f * (float)M_PI * i / o->_Lx;
}
/* the -ve components */
/* The -VE components. */
for (i = o->_M - 1, ii = 0; i > o->_M / 2; i--, ii++) {
o->_kx[i] = -2.0f * (float)M_PI * ii / o->_Lx;
}
/* the +ve components and DC */
/* The +VE components and DC. */
for (i = 0; i <= o->_N / 2; i++) {
o->_kz[i] = 2.0f * (float)M_PI * i / o->_Lz;
}
/* the -ve components */
/* The -VE components. */
for (i = o->_N - 1, ii = 0; i > o->_N / 2; i--, ii++) {
o->_kz[i] = -2.0f * (float)M_PI * ii / o->_Lz;
}

View File

@ -2717,7 +2717,7 @@ void BKE_pbvh_raycast_project_ray_root(
float dist = max[2] - min[2];
/* Build ray interval from z dimen of bounds. */
/* Build ray interval from z dimension of bounds. */
mid_v3_v3v3(cent, bb_min_root, bb_max_root);
madd_v3_v3v3fl(ray_start_new, cent, ray_normal, -dist);
madd_v3_v3v3fl(ray_end_new, cent, ray_normal, dist);

View File

@ -487,7 +487,7 @@ void BLI_bilinear_interpolation_wrap_char(const uchar *buffer,
* by Ned Greene and Paul S. Heckbert (1986)
***************************************************************************/
/* Table of (exp(ar) - exp(a)) / (1 - exp(a)) for r in range [0, 1] and a = -2
/* Table of `(exp(ar) - exp(a)) / (1 - exp(a))` for `r` in range [0, 1] and `a = -2`.
* used instead of actual gaussian,
* otherwise at high texture magnifications circular artifacts are visible. */
#define EWA_MAXIDX 255

View File

@ -2484,16 +2484,16 @@ static void bevel_harden_normals(BevelParams *bp, BMesh *bm)
int cd_clnors_offset = CustomData_get_offset(&bm->ldata, CD_CUSTOMLOOPNORMAL);
/* If there is not already a custom split normal layer then making one (with BM_lnorspace_update)
* will not respect the autosmooth angle between smooth faces. To get that to happen, we have
* to mark the sharpen the edges that are only sharp because of the angle test -- otherwise would
* be smooth. */
/* If there is not already a custom split normal layer then making one
* (with #BM_lnorspace_update) will not respect the auto-smooth angle between smooth faces.
* To get that to happen, we have to mark the sharpen the edges that are only sharp because
* of the angle test -- otherwise would be smooth. */
if (cd_clnors_offset == -1) {
BM_edges_sharp_from_angle_set(bm, bp->smoothresh);
bevel_edges_sharp_boundary(bm, bp);
}
/* Ensure that bm->lnor_spacearr has properly stored loop normals.
/* Ensure that `bm->lnor_spacearr` has properly stored loop normals.
* Side effect: ensures loop indices. */
BM_lnorspace_update(bm);

View File

@ -120,7 +120,7 @@ enum class OperationCode {
/* Bone. ---------------------------------------------------------------- */
/* Bone local transforms - entry point */
BONE_LOCAL,
/* Pose-space conversion (includes parent + restpose, */
/* Pose-space conversion (includes parent + rest-pose. */
BONE_POSE_PARENT,
/* Constraints */
BONE_CONSTRAINTS,

View File

@ -828,7 +828,7 @@ typedef struct IdDdtTemplate {
static bool id_type_can_have_drawdata(const short id_type)
{
/* Only some ID-blocks have this info for now */
/* TODO: finish adding this for the other blocktypes */
/* TODO: finish adding this for the other block-types. */
switch (id_type) {
/* has DrawData */
case ID_OB:

View File

@ -856,7 +856,7 @@ enum {
* This helper function determines if visual-keyframing should be used when
* inserting keyframes for the given channel. As visual-keyframing only works
* on Object and Pose-Channel blocks, this should only get called for those
* blocktypes, when using "standard" keying but 'Visual Keying' option in Auto-Keying
* block-types, when using "standard" keying but 'Visual Keying' option in Auto-Keying
* settings is on.
*/
static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)

View File

@ -1054,9 +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 subtargets that might have been duplicated. */
updateDuplicateSubtarget(ebone, arm->edbo, ob, false);
}
}
@ -1315,9 +1313,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
ebone->bbone_prev_flag = ebone_iter->bbone_prev_flag;
ebone->bbone_next_flag = ebone_iter->bbone_next_flag;
/* 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, obedit, true);
/* Try to update constraint options so that they are mirrored as well
* (need to supply bone_iter as well in case we are working with existing bones) */

View File

@ -109,7 +109,7 @@ static void joined_armature_fix_links_constraints(Main *bmain,
}
}
/* userdata for joined_armature_fix_animdata_cb() */
/** User-data for #joined_armature_fix_animdata_cb(). */
struct tJoinArmature_AdtFixData {
Main *bmain;

View File

@ -598,8 +598,8 @@ static void armature_finalize_restpose(ListBase *bonelist, ListBase *editbonelis
for (curBone = static_cast<Bone *>(bonelist->first); curBone; curBone = curBone->next) {
/* Set bone's local head/tail.
* Note that it's important to use final parent's restpose (arm_mat) here,
* instead of setting those values from editbone's matrix (see #46010). */
* Note that it's important to use final parent's rest-pose (arm_mat) here,
* instead of setting those values from edit-bone's matrix (see #46010). */
if (curBone->parent) {
float parmat_inv[4][4];
@ -617,7 +617,7 @@ static void armature_finalize_restpose(ListBase *bonelist, ListBase *editbonelis
copy_v3_v3(curBone->tail, curBone->arm_tail);
}
/* Set local matrix and arm_mat (restpose).
/* Set local matrix and arm_mat (rest-pose).
* Do not recurse into children here, armature_finalize_restpose() is already recursive. */
BKE_armature_where_is_bone(curBone, curBone->parent, false);
@ -772,7 +772,7 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm)
}
}
/* Finalize definition of restpose data (roll, bone_mat, arm_mat, head/tail...). */
/* Finalize definition of rest-pose data (roll, bone_mat, arm_mat, head/tail...). */
armature_finalize_restpose(&arm->bonebase, arm->edbo);
BKE_armature_bone_hash_make(arm);

View File

@ -503,9 +503,10 @@ void POSE_OT_armature_apply(wmOperatorType *ot)
/* -------------------------------------------------------------------- */
/** \name Apply Visual Transform Operator
*
* Set the current pose as the rest-pose.
* \{ */
/* set the current pose as the restpose */
static int pose_visual_transform_apply_exec(bContext *C, wmOperator * /*op*/)
{
const Scene *scene = CTX_data_scene(C);

View File

@ -377,7 +377,7 @@ static int gpencil_analyze_strokes(tGPencilPointCache *src_array,
for (i = 0; i < totpoints; i++) {
sort_pt = &src_array[i];
/* avoid dups */
/* Avoid duplicates. */
if (BLI_ghash_haskey(all_strokes, sort_pt->gps)) {
continue;
}

View File

@ -338,7 +338,7 @@ static bool edbm_bevel_calc(wmOperator *op)
Mesh *me = static_cast<Mesh *>(obedit->data);
if (harden_normals && !(me->flag & ME_AUTOSMOOTH)) {
/* harden_normals only has a visible effect if autosmooth is on, so turn it on */
/* `harden_normals` only has a visible effect if auto-smooth is on, so turn it on. */
me->flag |= ME_AUTOSMOOTH;
}
@ -446,7 +446,7 @@ static void edbm_bevel_cancel(bContext *C, wmOperator *op)
edbm_bevel_exit(C, op);
/* need to force redisplay or we may still view the modified result */
/* Need to force re-display or we may still view the modified result. */
ED_region_tag_redraw(CTX_wm_region(C));
}

View File

@ -862,7 +862,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
EDBM_op_callf(
vc.em, op, "rotate verts=%hv cent=%v matrix=%m3", BM_ELEM_SELECT, local_center, mat);
/* also project the source, for retopo workflow */
/* Also project the source, for retopology workflow. */
if (use_proj) {
EDBM_project_snap_verts(C, depsgraph, vc.region, vc.obedit, vc.em);
}

View File

@ -1679,7 +1679,7 @@ static void knife_add_to_vert_edges(KnifeTool_OpData *kcd, KnifeEdge *kfe)
knife_append_list(kcd, &kfe->v2->edges, kfe);
}
/* Add faces of an edge to a KnifeVert's faces list. No checks for dups. */
/* Add faces of an edge to a KnifeVert's faces list. No checks for duplicates. */
static void knife_add_edge_faces_to_vert(KnifeTool_OpData *kcd, KnifeVert *kfv, BMEdge *e)
{
BMIter bmiter;

View File

@ -2423,7 +2423,7 @@ static int constraint_add_exec(
int scriptint = 0;
/* popup a list of usable scripts */
menustr = buildmenu_pyconstraints(bmain, nullptr, &scriptint);
/* XXX scriptint = pupmenu(menustr); */
// scriptint = pupmenu(menustr); /* XXX */
MEM_freeN(menustr);
/* only add constraint if a script was chosen */

View File

@ -332,7 +332,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
keymap = WM_keymap_ensure(keyconf, "Object Non-modal", 0, 0);
/* Object Mode ---------------------------------------------------------------- */
/* NOTE: this keymap gets disabled in non-objectmode. */
/* NOTE: this keymap gets disabled in non-object-mode. */
keymap = WM_keymap_ensure(keyconf, "Object Mode", 0, 0);
keymap->poll = object_mode_poll;
}

View File

@ -2199,8 +2199,8 @@ static void make_local_material_tag(Material *ma)
ma->id.tag &= ~LIB_TAG_PRE_EXISTING;
make_local_animdata_tag(BKE_animdata_from_id(&ma->id));
/* About nodetrees: root one is made local together with material, * others we keep linked
* for now... */
/* About node-trees: root one is made local together with material,
* others we keep linked (for now). */
}
}

View File

@ -161,10 +161,12 @@ static bool object_shape_key_mirror(
/* half but found up odd value */
const int pntsu_half = (lt->pntsu / 2) + (lt->pntsu % 2);
/* currently editmode isn't supported by mesh so
* ignore here for now too */
/* if (lt->editlatt) lt = lt->editlatt->latt; */
/* Currently edit-mode isn't supported by mesh so ignore here for now too. */
#if 0
if (lt->editlatt) {
lt = lt->editlatt->latt;
}
#endif
for (w = 0; w < lt->pntsw; w++) {
for (v = 0; v < lt->pntsv; v++) {

View File

@ -259,7 +259,7 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW:
if (!has_restmat) {
/* Have no restpose matrix stored, try old style <= Blender 2.78 */
/* Have no rest-pose matrix stored, try old style <= Blender 2.78. */
bc_create_restpose_mat(this->export_settings, bone, bone_rest_mat, bone->arm_mat, true);

View File

@ -765,7 +765,7 @@ void RNA_define_fallback_property_update(int noteflag, const char *updatefunc)
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *rna_ext)
{
#ifdef RNA_RUNTIME
rna_ext->free(rna_ext->data); /* decref's the PyObject that the srna owns */
rna_ext->free(rna_ext->data); /* Decrefs the PyObject that the `srna` owns. */
RNA_struct_blender_type_set(srna, NULL); /* FIXME: this gets accessed again. */
/* NULL the srna's value so RNA_struct_free won't complain of a leak */

View File

@ -241,7 +241,7 @@ static void rna_ImageUser_update(Main *bmain, Scene *scene, PointerRNA *ptr)
if (id) {
if (GS(id->name) == ID_NT) {
/* Special update for nodetrees. */
/* Special update for node-trees. */
BKE_ntree_update_tag_image_user_changed((bNodeTree *)id, iuser);
ED_node_tree_propagate_change(nullptr, bmain, nullptr);
}

View File

@ -1117,7 +1117,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rotation Mode", "");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* Curved bones settings - Applied on top of restpose values */
/* Curved bones settings - Applied on top of rest-pose values. */
rna_def_bone_curved_common(srna, true, false);
/* Custom BBone next/prev sources */

View File

@ -486,7 +486,7 @@ static Mesh *normalEditModifier_do(NormalEditModifierData *enmd,
(enmd->mix_factor == 1.0f) && (enmd->defgrp_name[0] == '\0') &&
(enmd->mix_limit == float(M_PI)));
/* Do not run that modifier at all if autosmooth is disabled! */
/* Do not run that modifier at all if auto-smooth is disabled! */
if (!is_valid_target_with_error(ctx->object, enmd) || mesh->totloop == 0) {
return mesh;
}

View File

@ -8026,7 +8026,7 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item
Py_DECREF(args_fake); /* Free's py_srna_cobject too. */
}
else {
/* _must_ print before decreffing args_fake. */
/* _must_ print before decrefing args_fake. */
PyErr_Print();
PyErr_Clear();

View File

@ -129,6 +129,7 @@ dict_custom = {
"extrema",
"fallbacks",
"finalizer",
"flippable",
"flushable",
"formatter",
"formatters",
@ -265,6 +266,7 @@ dict_custom = {
"recursing",
"recursivity",
"redefinitions",
"redisplay",
"redistributions",
"registerable",
"reimplement",
@ -300,6 +302,7 @@ dict_custom = {
"sidedness",
"simplices",
"situationally",
"skinnable",
"skippable",
"sortable",
"stepsize",
@ -314,6 +317,7 @@ dict_custom = {
"subrange",
"subtractive",
"superset",
"symmetrizable",
"symmetrize",
"symmetrized",
"targetless",