diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-01 01:09:24 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-01 01:36:25 +0300 |
commit | 5777bd719b01f56e52d618a3260bd4cdf223d5cd (patch) | |
tree | f0f9e80c3a44ca542939ee03010b66a255fd01e7 /source | |
parent | 94a4dddb1b64ec0912b7b2ac5b2264e86cd3d955 (diff) |
Cleanup: use doxygen comments, correct spelling
Also move eDupli_ID_Flags doc-string to it's declaration.
Diffstat (limited to 'source')
14 files changed, 80 insertions, 62 deletions
diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c index 862266b696c..ce36bfe81be 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.c +++ b/source/blender/blenkernel/intern/blendfile_link_append.c @@ -930,9 +930,9 @@ static int foreach_libblock_link_append_callback(LibraryIDLinkCallbackData *cb_d * shape-key referencing the shape-key itself). * NOTE: in case both IDs (owner and 'used' ones) are non-linkable, we can assume we can break * the dependency here. Indeed, either they are both linked in another way (through their own - * meshes for shape keys e.g.), or this is an unsupported case (two shapekeys depending on - * each-other need to be also 'linked' in by their respective meshes, independant shapekeys are - * not allowed). ref T96048. */ + * meshes for shape keys e.g.), or this is an unsupported case (two shape-keys depending on + * each-other need to be also 'linked' in by their respective meshes, independent shape-keys + * are not allowed). ref T96048. */ if (id != cb_data->id_self && BKE_idtype_idcode_is_linkable(GS(cb_data->id_self->name))) { BKE_library_foreach_ID_link( cb_data->bmain, id, foreach_libblock_link_append_callback, data, IDWALK_NOP); @@ -1454,7 +1454,7 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, BlendfileLinkAppendContextItem *item; /* We remove it from current Main, and add it to items to link... */ - /* Note that non-linkable IDs (like e.g. shapekeys) are also explicitly linked here... */ + /* Note that non-linkable IDs (like e.g. shape-keys) are also explicitly linked here... */ BLI_remlink(lbarray[lba_idx], id); /* Usual special code for ShapeKeys snowflakes... */ Key *old_key = BKE_key_from_id(id); diff --git a/source/blender/blenkernel/intern/mesh_validate.cc b/source/blender/blenkernel/intern/mesh_validate.cc index cc7404e2a11..fb526354305 100644 --- a/source/blender/blenkernel/intern/mesh_validate.cc +++ b/source/blender/blenkernel/intern/mesh_validate.cc @@ -1437,7 +1437,7 @@ static void mesh_calc_edges_mdata(MVert *UNUSED(allvert), med++; } else { - /* equal edge, we merge the drawflag */ + /* Equal edge, merge the draw-flag. */ (ed + 1)->is_draw |= ed->is_draw; } } diff --git a/source/blender/blenkernel/intern/subdiv_modifier.c b/source/blender/blenkernel/intern/subdiv_modifier.c index 95a5946d7d3..34dfdaf7595 100644 --- a/source/blender/blenkernel/intern/subdiv_modifier.c +++ b/source/blender/blenkernel/intern/subdiv_modifier.c @@ -89,7 +89,7 @@ bool BKE_subsurf_modifier_force_disable_gpu_evaluation_for_mesh(const SubsurfMod const Mesh *mesh) { if ((U.gpu_flag & USER_GPU_FLAG_SUBDIVISION_EVALUATION) == 0) { - /* GPU subdivision is explicitely disabled, so we don't force it. */ + /* GPU subdivision is explicitly disabled, so we don't force it. */ return false; } diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 3e045c9c43a..4b6f5e4cac6 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -1090,11 +1090,11 @@ void animviz_calc_motionpaths(struct Depsgraph *depsgraph, bool restore); /** - * Update motion path computation range (in ob.avs or armature.avs) from user choice in - * ob.avs.path_range or arm.avs.path_range, depending on active user mode. + * Update motion path computation range (in `ob.avs` or `armature.avs`) from user choice in + * `ob.avs.path_range` or `arm.avs.path_range`, depending on active user mode. * - * @param ob: Object to compute range for (must be provided) - * @param scene: Used when scene range is choosen + * \param ob: Object to compute range for (must be provided). + * \param scene: Used when scene range is chosen. */ void animviz_motionpath_compute_range(struct Object *ob, struct Scene *scene); diff --git a/source/blender/editors/include/ED_keyframes_keylist.h b/source/blender/editors/include/ED_keyframes_keylist.h index 39f050c9739..fd3d35e1df7 100644 --- a/source/blender/editors/include/ED_keyframes_keylist.h +++ b/source/blender/editors/include/ED_keyframes_keylist.h @@ -132,8 +132,10 @@ const struct ActKeyColumn *ED_keylist_find_any_between(const struct AnimKeylist bool ED_keylist_is_empty(const struct AnimKeylist *keylist); const struct ListBase /* ActKeyColumn */ *ED_keylist_listbase(const struct AnimKeylist *keylist); bool ED_keylist_all_keys_frame_range(const struct AnimKeylist *keylist, Range2f *r_frame_range); -/* Return the selected keyframe's range. If none are selected, return False and does not affect - * the frame range. */ +/** + * Return the selected key-frame's range. + * \return False If none are selected and does not affect the frame range. + */ bool ED_keylist_selected_keys_frame_range(const struct AnimKeylist *keylist, Range2f *r_frame_range); const ActKeyColumn *ED_keylist_array(const struct AnimKeylist *keylist); @@ -187,10 +189,10 @@ void mask_to_keylist(struct bDopeSheet *ads, /* ActKeyColumn API ---------------- */ -/* Checks if ActKeyColumn has any block data */ +/** Checks if #ActKeyColumn has any block data. */ bool actkeyblock_is_valid(const ActKeyColumn *ac); -/* Checks if ActKeyColumn can be used as a block (i.e. drawn/used to detect "holds") */ +/** Checks if #ActKeyColumn can be used as a block (i.e. drawn/used to detect "holds"). */ int actkeyblock_get_valid_hold(const ActKeyColumn *ac); #ifdef __cplusplus diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a9a68be2d48..bbd2a64bab4 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -3087,11 +3087,11 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str) PointerRNA rptr; /* This is kind of hackish, in theory think we could only ever use the second member of - * this if/else, since ui_searchbox_apply() is supposed to always set that pointer when + * this if/else, since #ui_searchbox_apply() is supposed to always set that pointer when * we are storing pointers... But keeping str search first for now, * to try to break as little as possible existing code. All this is band-aids anyway. - * Fact remains, using editstr as main 'reference' over whole search button thingy - * is utterly weak and should be redesigned imho, but that's not a simple task. */ + * Fact remains, using `editstr` as main 'reference' over whole search button thingy + * is utterly weak and should be redesigned IMHO, but that's not a simple task. */ if (search_but && search_but->rnasearchprop && RNA_property_collection_lookup_string( &search_but->rnasearchpoin, search_but->rnasearchprop, str, &rptr)) { diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 5638a98b33b..d1f3843c643 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -4293,7 +4293,7 @@ static void widget_tab( const bool is_active = (state & UI_SELECT); /* Draw shaded outline - Disabled for now, - * seems incorrect and also looks nicer without it imho ;) */ + * seems incorrect and also looks nicer without it IMHO ;). */ // #define USE_TAB_SHADED_HIGHLIGHT uchar theme_col_tab_highlight[3]; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 9757dd1367f..2577218d6a9 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -9641,13 +9641,13 @@ static int edbm_smooth_normals_exec(bContext *C, wmOperator *op) float(*smooth_normal)[3] = MEM_callocN(sizeof(*smooth_normal) * lnors_ed_arr->totloop, __func__); - /* This is weird choice of operation, taking all loops of faces of current vertex. - * Could lead to some rather far away loops weighting as much as very close ones + /* NOTE(@mont29): This is weird choice of operation, taking all loops of faces of current + * vertex. Could lead to some rather far away loops weighting as much as very close ones * (topologically speaking), with complex polygons. * Using topological distance here (rather than geometrical one) - * makes sense imho, but would rather go with a more consistent and flexible code, - * we could even add max topological distance to take into account, * and a weighting curve. - * Would do that later though, think for now we can live with that choice. --mont29. */ + * makes sense IMHO, but would rather go with a more consistent and flexible code, + * we could even add max topological distance to take into account, and a weighting curve. + * Would do that later though, think for now we can live with that choice. */ BMLoopNorEditData *lnor_ed = lnors_ed_arr->lnor_editdata; for (int i = 0; i < lnors_ed_arr->totloop; i++, lnor_ed++) { l = lnor_ed->loop; diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index ef11337254c..19db09961e8 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -2573,7 +2573,7 @@ static void object_data_convert_ensure_curve_cache(Depsgraph *depsgraph, Scene * * (all its caches have been nuked then). */ if (ELEM(ob->type, OB_SURF, OB_CURVES_LEGACY, OB_FONT)) { - /* We need 'for render' ON here, to enable computing bevel dipslist if needed. + /* We need 'for render' ON here, to enable computing bevel #DispList if needed. * Also makes sense anyway, we would not want e.g. to lose hidden parts etc. */ BKE_displist_make_curveTypes(depsgraph, scene, ob, true); } @@ -2650,8 +2650,8 @@ static Base *duplibase_for_convert( /* XXX: An ugly hack needed because if we re-run depsgraph with some new meta-ball objects * having same 'family name' as orig ones, they will affect end result of meta-ball computation. - * For until we get rid of that name-based thingy in MBalls, that should do the trick - * (this is weak, but other solution (to change name of `obn`) is even worse imho). + * For until we get rid of that name-based thingy in meta-balls, that should do the trick + * (this is weak, but other solution (to change name of `obn`) is even worse IMHO). * See T65996. */ const bool is_meta_ball = (obn->type == OB_MBALL); void *obdata = obn->data; @@ -3204,7 +3204,7 @@ static int object_convert_exec(bContext *C, wmOperator *op) } // XXX ED_object_editmode_enter(C, 0); - // XXX exit_editmode(C, EM_FREEDATA|); /* freedata, but no undo */ + // XXX exit_editmode(C, EM_FREEDATA|); /* free data, but no undo */ if (basact) { /* active base was changed */ @@ -3302,16 +3302,11 @@ void OBJECT_OT_convert(wmOperatorType *ot) /** \name Duplicate Object Operator * \{ */ -/* - * dupflag: a flag made from constants declared in DNA_userdef_types.h - * The flag tells adduplicate() whether to copy data linked to the object, - * or to reference the existing data. - * U.dupflag for default operations or you can construct a flag as python does - * if the dupflag is 0 then no data will be copied (linked duplicate). */ - -/* used below, assumes id.new is correct */ -/* leaves selection of base/object unaltered */ -/* Does set ID->newid pointers. */ +/** + * - Assumes `id.new` is correct. + * - Leaves selection of base/object unaltered. + * - Sets #ID.newid pointers. + */ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer *view_layer, diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 96970c3e208..82b14787d9b 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1460,8 +1460,6 @@ void OBJECT_OT_paths_clear(wmOperatorType *ot) /** \} */ -/** \} */ - /* -------------------------------------------------------------------- */ /** \name Object Shade Smooth/Flat Operator * \{ */ diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 3b3d968aed6..daa4b53803f 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -2245,7 +2245,7 @@ FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index, const cache->misc_entries_indices[cache->misc_cursor] = index; cache->misc_cursor = (cache->misc_cursor + 1) % cache_size; -#if 0 /* Actually no, only block cached entries should have preview imho. */ +#if 0 /* Actually no, only block cached entries should have preview IMHO. */ if (cache->previews_pool) { filelist_cache_previews_push(filelist, ret, index); } diff --git a/source/blender/makesdna/DNA_userdef_enums.h b/source/blender/makesdna/DNA_userdef_enums.h index bb061e73c9c..e90aa0e0f07 100644 --- a/source/blender/makesdna/DNA_userdef_enums.h +++ b/source/blender/makesdna/DNA_userdef_enums.h @@ -10,7 +10,14 @@ extern "C" { #endif -/** #UserDef.dupflag */ +/** + * #UserDef.dupflag + * + * The flag tells #BKE_object_duplicate() whether to copy data linked to the object, + * or to reference the existing data. + * #U.dupflag should be used for default operations or you can construct a flag as Python does. + * If #eDupli_ID_Flags is 0 then no data will be copied (linked duplicate). + */ typedef enum eDupli_ID_Flags { USER_DUP_MESH = (1 << 0), USER_DUP_CURVE = (1 << 1), diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index 1aa51c93ee8..fd65cc464f2 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -218,7 +218,7 @@ bool RNA_property_copy( /* IDprops: destination may not exist, if source does and is set, try to create it. */ /* NOTE: this is sort of quick hack/bandage to fix the issue, - * we need to rethink how IDProps are handled in 'diff' RNA code completely, imho... */ + * we need to rethink how IDProps are handled in 'diff' RNA code completely, IMHO. */ if (prop_src != NULL && prop_dst == NULL && RNA_property_is_set(fromptr, prop)) { BLI_assert(prop_src->magic != RNA_MAGIC); IDProperty *idp_dst = RNA_struct_idprops(ptr, true); diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc index c58bab239e6..1ceab18c01b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc @@ -57,9 +57,9 @@ struct IndexAttributes { StrongAnonymousAttributeID duplicate_index; }; -/* -------------------------------------------------------------------- - * Attribute Copy/Creation Functions. - */ +/* -------------------------------------------------------------------- */ +/** \name Attribute Copy/Creation Functions + * \{ */ static void gather_attributes_without_id(const GeometrySet &geometry_set, const GeometryComponentType component_type, @@ -131,7 +131,7 @@ static void threaded_id_offset_copy(const Span<int> offsets, }); } -/* Create the copy indices for the duplication domain. */ +/** Create the copy indices for the duplication domain. */ static void create_duplicate_index_attribute(GeometryComponent &component, const AttributeDomain output_domain, const IndexMask selection, @@ -151,8 +151,10 @@ static void create_duplicate_index_attribute(GeometryComponent &component, copy_attribute.save(); } -/* Copy the stable ids to the first duplicate and create new ids based on a hash of the original id - * and the duplicate number. This function is used for the point domain elements. */ +/** + * Copy the stable ids to the first duplicate and create new ids based on a hash of the original id + * and the duplicate number. This function is used for the point domain elements. + */ static void copy_stable_id_point(const Span<int> offsets, const GeometryComponent &src_component, GeometryComponent &dst_component) @@ -173,7 +175,8 @@ static void copy_stable_id_point(const Span<int> offsets, dst_attribute.save(); } -/* Copy the stable ids to the first duplicate and create new ids based on a hash of the original id +/** + * Copy the stable ids to the first duplicate and create new ids based on a hash of the original id * and the duplicate number. This function is used for points when duplicating the edge domain. */ static void copy_stable_id_edges(const Mesh &mesh, @@ -216,11 +219,12 @@ static void copy_stable_id_edges(const Mesh &mesh, dst_attribute.save(); } -/* Copy the stable ids to the first duplicate and create new ids based on a hash of the original id +/** + * Copy the stable ids to the first duplicate and create new ids based on a hash of the original id * and the duplicate number. This function is used for points when duplicating the face domain. * * This function could be threaded in the future, but since it is only 1 attribute and the - * face->edge->vert mapping would mean creating a 1/1 mapping to allow for it, is it worth it? + * `face->edge->vert` mapping would mean creating a 1/1 mapping to allow for it, is it worth it? */ static void copy_stable_id_faces(const Mesh &mesh, const IndexMask selection, @@ -266,10 +270,12 @@ static void copy_stable_id_faces(const Mesh &mesh, dst_attribute.save(); } -/* Copy the stable ids to the first duplicate and create new ids based on a hash of the original id +/** + * Copy the stable ids to the first duplicate and create new ids based on a hash of the original id * and the duplicate number. In the spline case, copy the entire spline's points to the * destination, - * then loop over the remaining ones point by point, hashing their ids to the new ids. */ + * then loop over the remaining ones point by point, hashing their ids to the new ids. + */ static void copy_stable_id_splines(const CurveEval &curve, const IndexMask selection, const Span<int> curve_offsets, @@ -359,8 +365,10 @@ static void copy_point_attributes_without_id(GeometrySet &geometry_set, } } -/* Copies the attributes for spline duplciates. If copying the spline domain, the attributes are - * copied with an offset fill, otherwise a mapping is used. */ +/** + * Copies the attributes for spline duplicates. If copying the spline domain, the attributes are + * copied with an offset fill, otherwise a mapping is used. + */ static void copy_spline_attributes_without_id(const GeometrySet &geometry_set, const Span<int> point_mapping, const Span<int> offsets, @@ -409,8 +417,10 @@ static void copy_spline_attributes_without_id(const GeometrySet &geometry_set, } } -/* Copies the attributes for edge duplciates. If copying the edge domain, the attributes are - * copied with an offset fill, for point domain a mapping is used. */ +/** + * Copies the attributes for edge duplicates. If copying the edge domain, the attributes are + * copied with an offset fill, for point domain a mapping is used. + */ static void copy_edge_attributes_without_id(GeometrySet &geometry_set, const Span<int> point_mapping, const Span<int> offsets, @@ -456,8 +466,10 @@ static void copy_edge_attributes_without_id(GeometrySet &geometry_set, } } -/* Copies the attributes for face duplciates. If copying the face domain, the attributes are - * copied with an offset fill, otherwise a mapping is used. */ +/** + * Copies the attributes for face duplicates. If copying the face domain, the attributes are + * copied with an offset fill, otherwise a mapping is used. + */ static void copy_face_attributes_without_id(GeometrySet &geometry_set, const Span<int> edge_mapping, const Span<int> vert_mapping, @@ -512,9 +524,11 @@ static void copy_face_attributes_without_id(GeometrySet &geometry_set, } } -/* -------------------------------------------------------------------- - * Duplication Functions. - */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Duplication Functions + * \{ */ static void duplicate_splines(GeometrySet &geometry_set, const Field<int> &count_field, @@ -1101,3 +1115,5 @@ void register_node_type_geo_duplicate_elements() ntype.declare = file_ns::node_declare; nodeRegisterType(&ntype); } + +/** \} */ |