From c49e6a7dd4e48af473a13541fb9d8a27304af1c8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Apr 2025 15:20:19 +1000 Subject: [PATCH] Cleanup: reference operators as symbols, spelling in comments --- source/blender/editors/asset/intern/asset_ops.cc | 2 +- source/blender/editors/include/UI_interface_c.hh | 2 +- .../editors/interface/eyedroppers/eyedropper_intern.hh | 2 +- source/blender/editors/interface/interface_layout.cc | 2 +- source/blender/editors/interface/interface_ops.cc | 2 +- source/blender/editors/object/object_data_transfer.cc | 9 +++++---- source/blender/editors/render/render_preview.cc | 4 ++-- source/blender/editors/space_buttons/buttons_context.cc | 2 +- source/blender/editors/space_file/file_ops.cc | 2 +- source/blender/editors/space_graph/graph_ops.cc | 8 ++++---- source/blender/editors/space_image/image_ops.cc | 2 +- source/blender/editors/space_node/node_ops.cc | 2 +- source/blender/editors/space_outliner/outliner_edit.cc | 2 +- source/blender/editors/space_sequencer/sequencer_edit.cc | 6 +++--- .../blender/editors/space_sequencer/sequencer_select.cc | 6 +++--- .../editors/space_view3d/view3d_navigate_view_roll.cc | 2 +- source/blender/editors/space_view3d/view3d_view.cc | 6 ++++-- .../editors/transform/transform_convert_sequencer.cc | 2 +- source/blender/editors/transform/transform_ops.cc | 6 +++--- source/blender/makesdna/DNA_scene_types.h | 2 +- source/blender/makesrna/intern/rna_wm.cc | 4 ++-- source/blender/python/intern/bpy.cc | 1 - 22 files changed, 39 insertions(+), 37 deletions(-) diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc index 31cc66f96d7..e44c3e74c34 100644 --- a/source/blender/editors/asset/intern/asset_ops.cc +++ b/source/blender/editors/asset/intern/asset_ops.cc @@ -909,7 +909,7 @@ static bool external_file_check_callback(BPathForeachPathData *bpath_data, /** * Do a check on any external files (.blend, textures, etc.) being used. - * The ASSET_OT_bundle_install operator only works on standalone .blend files + * The #ASSET_OT_bundle_install operator only works on standalone `.blend` files * (catalog definition files are fine, though). * * \return true when there are external files, false otherwise. diff --git a/source/blender/editors/include/UI_interface_c.hh b/source/blender/editors/include/UI_interface_c.hh index 153ac7c451d..1fff352076e 100644 --- a/source/blender/editors/include/UI_interface_c.hh +++ b/source/blender/editors/include/UI_interface_c.hh @@ -3472,7 +3472,7 @@ const uiStyle *UI_style_get(); /* use for fonts etc */ */ const uiStyle *UI_style_get_dpi(); -/* UI_OT_editsource helpers */ +/* #UI_OT_editsource helpers. */ bool UI_editsource_enable_check(); void UI_editsource_active_but_test(uiBut *but); /** diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_intern.hh b/source/blender/editors/interface/eyedroppers/eyedropper_intern.hh index 39e39e0d8b7..6c22420f793 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_intern.hh +++ b/source/blender/editors/interface/eyedroppers/eyedropper_intern.hh @@ -21,7 +21,7 @@ void eyedropper_draw_cursor_text_region(const int xy[2], const char *name); /** * Utility to retrieve a button representing a RNA property that is currently under the cursor. * - * This is to be used by any eyedroppers which fetch properties (e.g. UI_OT_eyedropper_driver). + * This is to be used by any eyedroppers which fetch properties (e.g. #UI_OT_eyedropper_driver). * Especially during modal operations (e.g. as with the eyedroppers), context cannot be relied * upon to provide this information, as it is not updated until the operator finishes. * diff --git a/source/blender/editors/interface/interface_layout.cc b/source/blender/editors/interface/interface_layout.cc index c8fa1c30ae2..12af62716b5 100644 --- a/source/blender/editors/interface/interface_layout.cc +++ b/source/blender/editors/interface/interface_layout.cc @@ -1096,7 +1096,7 @@ static uiBut *ui_item_with_label(uiLayout *layout, } } - /* BUTTONS_OT_file_browse calls UI_context_active_but_prop_get_filebrowser */ + /* #BUTTONS_OT_file_browse calls #UI_context_active_but_prop_get_filebrowser. */ uiDefIconButO(block, UI_BTYPE_BUT, subtype == PROP_DIRPATH ? "BUTTONS_OT_directory_browse" : diff --git a/source/blender/editors/interface/interface_ops.cc b/source/blender/editors/interface/interface_ops.cc index 1febbe34030..afdd8f1de37 100644 --- a/source/blender/editors/interface/interface_ops.cc +++ b/source/blender/editors/interface/interface_ops.cc @@ -66,7 +66,7 @@ /* for Copy As Driver */ #include "ED_keyframing.hh" -/* only for UI_OT_editsource */ +/* Only for #UI_OT_editsource. */ #include "BLI_ghash.h" #include "ED_screen.hh" diff --git a/source/blender/editors/object/object_data_transfer.cc b/source/blender/editors/object/object_data_transfer.cc index fafc5935e87..360dd235324 100644 --- a/source/blender/editors/object/object_data_transfer.cc +++ b/source/blender/editors/object/object_data_transfer.cc @@ -546,17 +546,18 @@ static wmOperatorStatus data_transfer_exec(bContext *C, wmOperator *op) #endif } -/* Used by both OBJECT_OT_data_transfer and OBJECT_OT_datalayout_transfer */ -/* Note this context poll is only really partial, - * it cannot check for all possible invalid cases. */ +/** Used by both #OBJECT_OT_data_transfer and #OBJECT_OT_datalayout_transfer. */ static bool data_transfer_poll(bContext *C) { + /* Note this context poll is only really partial, + * it cannot check for all possible invalid cases. */ + Object *ob = context_active_object(C); ID *data = static_cast((ob) ? ob->data : nullptr); return (ob != nullptr && ob->type == OB_MESH && data != nullptr); } -/* Used by both OBJECT_OT_data_transfer and OBJECT_OT_datalayout_transfer */ +/** Used by both #OBJECT_OT_data_transfer and #OBJECT_OT_datalayout_transfer. */ static bool data_transfer_poll_property(const bContext * /*C*/, wmOperator *op, const PropertyRNA *prop) diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc index de533b0e81c..1ba4e4ea7c4 100644 --- a/source/blender/editors/render/render_preview.cc +++ b/source/blender/editors/render/render_preview.cc @@ -1020,8 +1020,8 @@ static void action_preview_render(IconPreview *preview, IconPreviewSize *preview Depsgraph *depsgraph = preview->depsgraph; /* Not all code paths that lead to this function actually provide a depsgraph. - * The "Refresh Asset Preview" button (ED_OT_lib_id_generate_preview) does, - * but WM_OT_previews_ensure does not. */ + * The "Refresh Asset Preview" button (#ED_OT_lib_id_generate_preview) does, + * but #WM_OT_previews_ensure does not. */ BLI_assert(depsgraph != nullptr); BLI_assert(preview->scene == DEG_get_input_scene(depsgraph)); diff --git a/source/blender/editors/space_buttons/buttons_context.cc b/source/blender/editors/space_buttons/buttons_context.cc index bf8545551f9..f928e1f2bc4 100644 --- a/source/blender/editors/space_buttons/buttons_context.cc +++ b/source/blender/editors/space_buttons/buttons_context.cc @@ -863,7 +863,7 @@ int /*eContextResult*/ buttons_context(const bContext *C, { SpaceProperties *sbuts = CTX_wm_space_properties(C); if (sbuts && sbuts->path == nullptr) { - /* path is cleared for SCREEN_OT_redo_last, when global undo does a file-read which clears the + /* path is cleared for #SCREEN_OT_redo_last, when global undo does a file-read which clears the * path (see lib_link_workspace_layout_restore). */ buttons_context_compute(C, sbuts); } diff --git a/source/blender/editors/space_file/file_ops.cc b/source/blender/editors/space_file/file_ops.cc index a0b906ee4be..467ad494374 100644 --- a/source/blender/editors/space_file/file_ops.cc +++ b/source/blender/editors/space_file/file_ops.cc @@ -2141,7 +2141,7 @@ static std::string file_execute_get_description(bContext *C, SpaceFile *sfile = CTX_wm_space_file(C); if (sfile->op && sfile->op->type && sfile->op->type->description) { /* Return the description of the executed operator. Don't use get_description - * as that will return file details for WM_OT_open_mainfile. */ + * as that will return file details for #WM_OT_open_mainfile. */ return TIP_(sfile->op->type->description); } return {}; diff --git a/source/blender/editors/space_graph/graph_ops.cc b/source/blender/editors/space_graph/graph_ops.cc index 4b9208a16f4..be8fc45ad5b 100644 --- a/source/blender/editors/space_graph/graph_ops.cc +++ b/source/blender/editors/space_graph/graph_ops.cc @@ -39,7 +39,7 @@ /** \name Set Cursor * * The 'cursor' in the Graph Editor consists of two parts: - * 1) Current Frame Indicator (as per ANIM_OT_change_frame) + * 1) Current Frame Indicator (as per #ANIM_OT_change_frame) * 2) Value Indicator (stored per Graph Editor instance) * \{ */ @@ -67,9 +67,9 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op) sipo->cursorTime = frame; } else { - /* adjust the frame - * NOTE: sync this part of the code with ANIM_OT_change_frame - */ + /* Adjust the frame. + * NOTE: sync this part of the code with #ANIM_OT_change_frame. */ + /* 1) frame is rounded to the nearest int, since frames are ints */ scene->r.cfra = round_fl_to_int(frame); diff --git a/source/blender/editors/space_image/image_ops.cc b/source/blender/editors/space_image/image_ops.cc index 63b3f805766..cc15b932c24 100644 --- a/source/blender/editors/space_image/image_ops.cc +++ b/source/blender/editors/space_image/image_ops.cc @@ -339,7 +339,7 @@ bool space_image_main_region_poll(bContext *C) return false; } -/* For IMAGE_OT_curves_point_set to avoid sampling when in uv smooth mode or editmode */ +/** For #IMAGE_OT_curves_point_set to avoid sampling when in uv smooth mode or edit-mode. */ static bool space_image_main_area_not_uv_brush_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); diff --git a/source/blender/editors/space_node/node_ops.cc b/source/blender/editors/space_node/node_ops.cc index 4a443fb5e48..22ef0044025 100644 --- a/source/blender/editors/space_node/node_ops.cc +++ b/source/blender/editors/space_node/node_ops.cc @@ -153,7 +153,7 @@ void ED_operatormacros_node() mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); WM_operatortype_macro_define(ot, "NODE_OT_attach"); - /* NODE_OT_translate_attach with remove_on_cancel set to true. */ + /* `NODE_OT_translate_attach` with remove_on_cancel set to true. */ ot = WM_operatortype_append_macro("NODE_OT_translate_attach_remove_on_cancel", "Move and Attach", "Move nodes and attach to frame", diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc index a3c28998bb9..30456900b99 100644 --- a/source/blender/editors/space_outliner/outliner_edit.cc +++ b/source/blender/editors/space_outliner/outliner_edit.cc @@ -955,7 +955,7 @@ static wmOperatorStatus outliner_id_relocate_invoke(bContext *C, WM_operator_properties_free(&op_props); /* If the matching WM operator invoke was successful, it was added to modal handlers. This - * operator however is _not_ modal, and will memleak if it returns this status. */ + * operator however is _not_ modal, and will leak memory if it returns this status. */ return (ret == OPERATOR_RUNNING_MODAL) ? OPERATOR_FINISHED : ret; } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.cc b/source/blender/editors/space_sequencer/sequencer_edit.cc index a9ab2fc0a0a..d25e1ce8848 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.cc +++ b/source/blender/editors/space_sequencer/sequencer_edit.cc @@ -482,9 +482,9 @@ enum { struct SlipData { NumInput num_input; - /* Initial mouse position in viewspace. */ + /* Initial mouse position in view-space. */ float init_mouse_co[2]; - /* Mouse and virtual mouse-cursor x-values in regionspace. */ + /* Mouse and virtual mouse-cursor x-values in region-space. */ int prev_mval_x; float virtual_mval_x; /* Parsed offset (integer when in precision mode, float otherwise).*/ @@ -492,7 +492,7 @@ struct SlipData { VectorSet strips; bool precision; bool clamp; - /* Determines whether to show subframe offset in header. */ + /* Determines whether to show sub-frame offset in header. */ bool show_subframe; }; diff --git a/source/blender/editors/space_sequencer/sequencer_select.cc b/source/blender/editors/space_sequencer/sequencer_select.cc index ae94030e02f..952249f815c 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.cc +++ b/source/blender/editors/space_sequencer/sequencer_select.cc @@ -155,7 +155,7 @@ static void select_surrounding_handles(Scene *scene, Strip *test) /* XXX BRING B } } -/* Used for mouse selection in SEQUENCER_OT_select. */ +/* Used for mouse selection in #SEQUENCER_OT_select. */ static void select_active_side( const Scene *scene, ListBase *seqbase, int sel_side, int channel, int frame) { @@ -184,7 +184,7 @@ static void select_active_side( } } -/* Used for mouse selection in SEQUENCER_OT_select_side. */ +/* Used for mouse selection in #SEQUENCER_OT_select_side. */ static void select_active_side_range(const Scene *scene, ListBase *seqbase, const int sel_side, @@ -219,7 +219,7 @@ static void select_active_side_range(const Scene *scene, } } -/* Used alongside `select_linked_time` helper function in SEQUENCER_OT_select. */ +/* Used alongside `select_linked_time` helper function in #SEQUENCER_OT_select. */ static void select_linked_time_seq(const Scene *scene, const Strip *strip_source, const eStripHandle handle_clicked) diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_roll.cc b/source/blender/editors/space_view3d/view3d_navigate_view_roll.cc index 20187185f11..658b4e78f67 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_roll.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_roll.cc @@ -238,7 +238,7 @@ static wmOperatorStatus viewroll_invoke(bContext *C, wmOperator *op, const wmEve viewroll_exec(C, op); } else { - /* The equivalent functionality for orbiting the view: VIEW3D_OT_orbit & VIEW3D_OT_rotate are + /* The equivalent functionality for orbiting the view: #VIEW3D_OT_orbit & #VIEW3D_OT_rotate are * separate operators with different poll functions [which are only permissive for non-locked * views]. This operator however mixes modal-interaction & instant-stepping into the same * operator and its current poll function permissively finds the non-locked region in quad diff --git a/source/blender/editors/space_view3d/view3d_view.cc b/source/blender/editors/space_view3d/view3d_view.cc index 767e24cde12..0c30e758799 100644 --- a/source/blender/editors/space_view3d/view3d_view.cc +++ b/source/blender/editors/space_view3d/view3d_view.cc @@ -127,8 +127,10 @@ void VIEW3D_OT_camera_to_view(wmOperatorType *ot) /** \name Camera Fit Frame to Selected Operator * \{ */ -/* unlike VIEW3D_OT_view_selected this is for framing a render and not - * meant to take into account vertex/bone selection for eg. */ +/** + * Unlike #VIEW3D_OT_view_selected this is for framing a render and not + * meant to take into account vertex/bone selection for eg. + */ static wmOperatorStatus view3d_camera_to_view_selected_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); diff --git a/source/blender/editors/transform/transform_convert_sequencer.cc b/source/blender/editors/transform/transform_convert_sequencer.cc index 2bc2f59255a..0b394627f0a 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.cc +++ b/source/blender/editors/transform/transform_convert_sequencer.cc @@ -277,7 +277,7 @@ static void seq_transform_cancel(TransInfo *t, Span transformed_strips) for (Strip *strip : transformed_strips) { /* Handle pre-existing overlapping strips even when operator is canceled. - * This is necessary for SEQUENCER_OT_duplicate_move macro for example. */ + * This is necessary for #SEQUENCER_OT_duplicate_move macro for example. */ if (seq::transform_test_overlap(t->scene, seqbase, strip)) { seq::transform_seqbase_shuffle(seqbase, strip, t->scene); } diff --git a/source/blender/editors/transform/transform_ops.cc b/source/blender/editors/transform/transform_ops.cc index b5b4e12478e..bdd46fcb1be 100644 --- a/source/blender/editors/transform/transform_ops.cc +++ b/source/blender/editors/transform/transform_ops.cc @@ -341,9 +341,9 @@ static void TRANSFORM_OT_create_orientation(wmOperatorType *ot) #ifdef USE_LOOPSLIDE_HACK /** - * Special hack for MESH_OT_loopcut_slide so we get back to the selection mode - * Do this for all meshes in multi-object editmode so their selectmode is in sync for following - * operators + * Special hack for #MESH_OT_loopcut_slide so we get back to the selection mode + * Do this for all meshes in multi-object edit-mode so their select-mode is in sync + * for following operators */ static void transformops_loopsel_hack(bContext *C, wmOperator *op) { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 106b46fee0b..c209e543387 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -393,7 +393,7 @@ typedef enum eStereo3dInterlaceType { /** * Generic image format settings, - * this is used for #NodeImageFile and IMAGE_OT_save_as operator too. + * this is used for #NodeImageFile and #IMAGE_OT_save_as operator too. * * NOTE: its a bit strange that even though this is an image format struct * the imtype can still be used to select video formats. diff --git a/source/blender/makesrna/intern/rna_wm.cc b/source/blender/makesrna/intern/rna_wm.cc index 8e315bb8d86..c09acd3688b 100644 --- a/source/blender/makesrna/intern/rna_wm.cc +++ b/source/blender/makesrna/intern/rna_wm.cc @@ -1715,7 +1715,7 @@ static StructRNA *rna_Operator_register(Main *bmain, STRNCPY(temp_buffers.translation_context, BLT_I18NCONTEXT_OPERATOR_DEFAULT); } - /* Convert foo.bar to FOO_OT_bar + /* Convert foo.bar to `FOO_OT_bar` * allocate all strings at once. */ { const char *strings[] = { @@ -1889,7 +1889,7 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, STRNCPY(temp_buffers.translation_context, BLT_I18NCONTEXT_OPERATOR_DEFAULT); } - /* Convert foo.bar to FOO_OT_bar + /* Convert `foo.bar` to `FOO_OT_bar` * allocate all strings at once. */ { const char *strings[] = { diff --git a/source/blender/python/intern/bpy.cc b/source/blender/python/intern/bpy.cc index 55a667e42e2..af69722bed4 100644 --- a/source/blender/python/intern/bpy.cc +++ b/source/blender/python/intern/bpy.cc @@ -770,7 +770,6 @@ void BPy_init_modules(bContext *C) BPY_rna_types_finalize_external_types(bpy_types); PyModule_AddObject(mod, "props", BPY_rna_props()); - /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ PyModule_AddObject(mod, "ops", BPY_operator_module()); PyModule_AddObject(mod, "app", BPY_app_struct()); PyModule_AddObject(mod, "_utils_units", BPY_utils_units());