diff --git a/build_files/build_environment/install_linux_packages.py b/build_files/build_environment/install_linux_packages.py index c596c20ad4a..30597bb3786 100755 --- a/build_files/build_environment/install_linux_packages.py +++ b/build_files/build_environment/install_linux_packages.py @@ -1032,8 +1032,8 @@ class PackageInstaller: @classmethod def version_match(cls, version, ref_version): """ - Return True if the `version` string falls into the version range covered by the `ref_version` string. - `version` should be at least as long as `ref_version` (in term of version number items). + Return True if the ``version`` string falls into the version range covered by the ``ref_version`` string. + ``version`` should be at least as long as ``ref_version`` (in term of version number items). E.g. 3.3.2: - matches 3.3 - matches 3.3.2 @@ -1162,12 +1162,12 @@ class PackageInstaller: def package_find(self, package, package_distro_name): """ Generic heuristics to try and find 'best matching version' for a given package. - For most packages it just ensures given package name version matches the exact version from the `package`, + For most packages it just ensures given package name version matches the exact version from the ``package``, or at least fits within the [version_min, version_mex[ range. But some, like e.g. python, llvm or boost, can have packages available for several versions, with complex naming (like 'python3.10', 'llvm-9-dev', etc.). This code attempts to find the best matching one possible, based on a set of 'possible names' - generated by the distro-specific `package_name_version_gen` generator. + generated by the distro-specific ``package_name_version_gen`` generator. """ # Check 'exact' version match on given name. if self.package_query_version_match(package_distro_name, package.version_short): @@ -1220,7 +1220,7 @@ class PackageInstaller: def packages_install(self, packages, parent_packages=()): """ Install all given packages and their sub-packages. - This call is recursive, parent_packages is a tuple of the ancestors of current `package`, in calling order + This call is recursive, parent_packages is a tuple of the ancestors of current ``package``, in calling order (grand-parent, parent). """ def package_info_name(package, parent_packages): diff --git a/doc/python_api/examples/bpy.props.5.py b/doc/python_api/examples/bpy.props.5.py index 61d06bb25c2..dfaa11a3ee5 100644 --- a/doc/python_api/examples/bpy.props.5.py +++ b/doc/python_api/examples/bpy.props.5.py @@ -4,7 +4,7 @@ Getter/Setter Example Getter/setter functions can be used for boolean, int, float, string and enum properties. If these callbacks are defined the property will not be stored in the ID properties -automatically. Instead, the `get` and `set` functions will be called when the property +automatically. Instead, the ``get`` and ``set`` functions will be called when the property is respectively read or written from the API. .. warning:: diff --git a/doc/python_api/examples/gpu.1.py b/doc/python_api/examples/gpu.1.py index 11da6a471d0..b28dee88538 100644 --- a/doc/python_api/examples/gpu.1.py +++ b/doc/python_api/examples/gpu.1.py @@ -7,7 +7,7 @@ A batch contains the necessary data to perform the drawing. That includes an obligatory *Vertex Buffer* and an optional *Index Buffer*, each of which is described in more detail in the following sections. A batch also defines a draw type. -Typical draw types are `POINTS`, `LINES` and `TRIS`. +Typical draw types are ``POINTS``, ``LINES`` and ``TRIS``. The draw type determines how the data will be interpreted and drawn. Vertex Buffers @@ -63,7 +63,7 @@ For instance, to draw a rectangle composed of two triangles, one could use an in ibo = gpu.types.GPUIndexBuf(type='TRIS', seq=indices) -Here the first tuple in `indices` describes which vertices should be used for the first triangle +Here the first tuple in ``indices`` describes which vertices should be used for the first triangle (same for the second tuple). Note how the diagonal vertices 1 and 2 are shared between both triangles. @@ -77,12 +77,12 @@ Typically multiple shaders are linked together into a *Program*. However, in the Blender Python API the term *Shader* refers to an OpenGL Program. Every :class:`gpu.types.GPUShader` consists of a vertex shader, a fragment shader and an optional geometry shader. For common drawing tasks there are some built-in shaders accessible from :class:`gpu.shader.from_builtin` -with an identifier such as `UNIFORM_COLOR` or `FLAT_COLOR`. +with an identifier such as ``UNIFORM_COLOR`` or ``FLAT_COLOR``. Every shader defines a set of attributes and uniforms that have to be set in order to use the shader. Attributes are properties that are set using a vertex buffer and can be different for individual vertices. Uniforms are properties that are constant per draw call. -They can be set using the `shader.uniform_*` functions after the shader has been bound. +They can be set using the ``shader.uniform_*`` functions after the shader has been bound. Batch Creation ++++++++++++++ @@ -109,7 +109,7 @@ In Blender Offscreen Rendering is done using the :class:`gpu.types.GPUOffScreen` .. warning:: - `GPUOffScreen` objects are bound to the OpenGL context they have been created in. + :class:`gpu.types.GPUOffScreen` objects are bound to the OpenGL context they have been created in. This means that once Blender discards this context (i.e. the window is closed), the offscreen instance will be freed. diff --git a/release/lts/lts_issue.py b/release/lts/lts_issue.py index 338e622ac88..290c40e2f2d 100644 --- a/release/lts/lts_issue.py +++ b/release/lts/lts_issue.py @@ -16,9 +16,9 @@ class ReleaseLogLine: * issue_id: (int or None) the extracted issue id associated with this log line. Can be None if the log line isn't associated with a issue. * commit_id: (str or None) the extracted commit id associated with this log - line. Only filled when no `issue_id` could be found. - * ref: (str) `issue_id` or `commit_id` of this line, including `T` for issues - or `D` for diffs. + line. Only filled when no ``issue_id`` could be found. + * ref: (str) ``issue_id`` or ``commit_id`` of this line, including ``T`` for issues + or ``D`` for diffs. * title: (str) title of this log line. When constructed this attribute is an empty string. The called needs to retrieve the title from the backend. diff --git a/scripts/modules/_bpy_internal/grease_pencil/stroke.py b/scripts/modules/_bpy_internal/grease_pencil/stroke.py index fb8b5388ae3..a86d2192e62 100644 --- a/scripts/modules/_bpy_internal/grease_pencil/stroke.py +++ b/scripts/modules/_bpy_internal/grease_pencil/stroke.py @@ -114,7 +114,7 @@ def def_prop_for_attribute(attr_name, type, default, doc): def DefAttributeGetterSetters(attributes_list): """ A class decorator that reads a list of attribute information & - creates properties on the class with `getters` & `setters`. + creates properties on the class with ``getters`` & ``setters``. """ def wrapper(cls): for prop_name, attr_name, type, default, doc in attributes_list: diff --git a/scripts/modules/bl_console_utils/autocomplete/complete_calltip.py b/scripts/modules/bl_console_utils/autocomplete/complete_calltip.py index f229b50d4b6..27d08d1eba1 100644 --- a/scripts/modules/bl_console_utils/autocomplete/complete_calltip.py +++ b/scripts/modules/bl_console_utils/autocomplete/complete_calltip.py @@ -73,7 +73,7 @@ def get_doc(obj): def get_argspec(func, *, strip_self=True, doc=None, source=None): """Get argument specifications. - :arg strip_self: strip `self` from argspec + :arg strip_self: strip ``self`` from argspec :type strip_self: bool :arg doc: doc string of func (optional) :type doc: str diff --git a/scripts/modules/bl_i18n_utils/utils.py b/scripts/modules/bl_i18n_utils/utils.py index 02535efbc7a..48171fb2f9a 100644 --- a/scripts/modules/bl_i18n_utils/utils.py +++ b/scripts/modules/bl_i18n_utils/utils.py @@ -1210,7 +1210,7 @@ class I18nMessages: """ Update or create a single PO file (specified by a filepath) from the given POT `I18nMessages` data. - Callback usable in a context where Blender specific modules (like `bpy`) are not available. + Callback usable in a context where Blender specific modules (like ``bpy``) are not available. """ import sys sys.stdout.reconfigure(encoding="utf-8") @@ -1230,7 +1230,7 @@ class I18nMessages: """ Cleanup a single PO file (specified by a filepath). - Callback usable in a context where Blender specific modules (like `bpy`) are not available. + Callback usable in a context where Blender specific modules (like ``bpy``) are not available. """ import sys sys.stdout.reconfigure(encoding="utf-8") @@ -1250,7 +1250,7 @@ class I18nMessages: """ Cleanup and write a single PO file (specified by a filepath) into the relevant Blender source 'compact' PO file. - Callback usable in a context where Blender specific modules (like `bpy`) are not available. + Callback usable in a context where Blender specific modules (like ``bpy``) are not available. """ import sys sys.stdout.reconfigure(encoding="utf-8") diff --git a/scripts/modules/bpy_extras/image_utils.py b/scripts/modules/bpy_extras/image_utils.py index 7ad0523f055..b6218d36c4e 100644 --- a/scripts/modules/bpy_extras/image_utils.py +++ b/scripts/modules/bpy_extras/image_utils.py @@ -52,7 +52,7 @@ def load_image( (based on file path). :type check_existing: bool :arg force_reload: If true, - force reloading of image (only useful when `check_existing` + force reloading of image (only useful when ``check_existing`` is also enabled). :type force_reload: bool :return: an image or None diff --git a/scripts/startup/bl_operators/file.py b/scripts/startup/bl_operators/file.py index 08c2cde1146..51ed5414d1b 100644 --- a/scripts/startup/bl_operators/file.py +++ b/scripts/startup/bl_operators/file.py @@ -29,7 +29,7 @@ class WM_OT_previews_batch_generate(Operator): type=OperatorFileListElement, options={'HIDDEN', 'SKIP_SAVE'}, name="", - description="Collection of file paths with common `directory` root", + description="Collection of file paths with common ``directory`` root", ) directory: StringProperty( @@ -37,7 +37,7 @@ class WM_OT_previews_batch_generate(Operator): subtype='FILE_PATH', options={'HIDDEN', 'SKIP_SAVE'}, name="", - description="Root path of all files listed in `files` collection", + description="Root path of all files listed in ``files`` collection", ) # Show only images/videos, and directories! diff --git a/source/blender/makesrna/intern/rna_ID.cc b/source/blender/makesrna/intern/rna_ID.cc index 2cbe9b89151..91aad03db17 100644 --- a/source/blender/makesrna/intern/rna_ID.cc +++ b/source/blender/makesrna/intern/rna_ID.cc @@ -2149,7 +2149,7 @@ static void rna_def_ID_override_library(BlenderRNA *brna) "view_layer", "ViewLayer", "", - "The view layer to operate in (same usage as the `scene` data, in case " + "The view layer to operate in (same usage as the ``scene`` data, in case " "it is not provided the scene's collection will be used instead)"); parm = RNA_def_pointer( func, diff --git a/source/blender/makesrna/intern/rna_armature.cc b/source/blender/makesrna/intern/rna_armature.cc index 74c8e584112..ae7fe5e6bfd 100644 --- a/source/blender/makesrna/intern/rna_armature.cc +++ b/source/blender/makesrna/intern/rna_armature.cc @@ -2031,8 +2031,8 @@ static void rna_def_armature_collections(BlenderRNA *brna, PropertyRNA *cprop) "collections, which may not be in the order you expect. Root collections are listed first, " "and siblings are always sequential. Apart from that, bone collections can be in any order, " "and thus incrementing or decrementing this index can make the active bone collection jump " - "around in unexpected ways. For a more predictable interface, use `active` or " - "`active_name`."); + "around in unexpected ways. For a more predictable interface, use ``active`` or " + "``active_name``."); RNA_def_property_int_funcs(prop, "rna_BoneCollections_active_index_get", "rna_BoneCollections_active_index_set", diff --git a/source/blender/makesrna/intern/rna_blendfile_import.cc b/source/blender/makesrna/intern/rna_blendfile_import.cc index 81bb5a5aec9..a95eadf66dc 100644 --- a/source/blender/makesrna/intern/rna_blendfile_import.cc +++ b/source/blender/makesrna/intern/rna_blendfile_import.cc @@ -377,8 +377,8 @@ static void rna_def_blendfile_import_item(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Imported ID", - "The imported ID. None until it has been linked or appended. May be " - "the same as `reusable_local_id` when appended"); + "The imported ID. None until it has been linked or appended. " + "May be the same as ``reusable_local_id`` when appended"); RNA_def_property_pointer_funcs( prop, "rna_BlendImportContextItem_id_get", nullptr, nullptr, nullptr); @@ -534,7 +534,7 @@ static void rna_def_blendfile_import_context(BlenderRNA *brna) "DONE", 0, "", - "All data has been imported and is available in the list of `import_items`"}, + "All data has been imported and is available in the list of ``import_items``"}, {0, nullptr, 0, nullptr, nullptr}, }; prop = RNA_def_property(srna, "process_stage", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_ui_api.cc b/source/blender/makesrna/intern/rna_ui_api.cc index 9c5102552a0..aee6a2201be 100644 --- a/source/blender/makesrna/intern/rna_ui_api.cc +++ b/source/blender/makesrna/intern/rna_ui_api.cc @@ -2372,7 +2372,7 @@ void RNA_api_ui_layout(StructRNA *srna) 0, "", "Name of a custom operator to invoke when starting to drag an item. Never " - "invoked together with the `active_operator` (if set), it's either the drag or " + "invoked together with the ``active_operator`` (if set), it's either the drag or " "the activate one"); parm = RNA_def_pointer( func, @@ -2427,7 +2427,7 @@ void RNA_api_ui_layout(StructRNA *srna) nullptr, 0, "", - "Identifier of the asset shelf to display (`bl_idname`)"); + "Identifier of the asset shelf to display (``bl_idname``)"); RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); parm = RNA_def_string( func, "name", nullptr, 0, "", "Optional name to indicate the active asset"); diff --git a/source/blender/python/gpu/gpu_py_api.cc b/source/blender/python/gpu/gpu_py_api.cc index cd7fdc9089a..5d14fcea179 100644 --- a/source/blender/python/gpu/gpu_py_api.cc +++ b/source/blender/python/gpu/gpu_py_api.cc @@ -34,7 +34,7 @@ PyDoc_STRVAR( /* Wrap. */ pygpu_doc, "This module provides Python wrappers for the GPU implementation in Blender.\n" - "Some higher level functions can be found in the `gpu_extras` module."); + "Some higher level functions can be found in the :mod:`gpu_extras` module."); static PyModuleDef pygpu_module_def = { /*m_base*/ PyModuleDef_HEAD_INIT, /*m_name*/ "gpu", diff --git a/source/blender/python/gpu/gpu_py_batch.cc b/source/blender/python/gpu/gpu_py_batch.cc index 0845472ebc9..4170052cf9b 100644 --- a/source/blender/python/gpu/gpu_py_batch.cc +++ b/source/blender/python/gpu/gpu_py_batch.cc @@ -317,8 +317,8 @@ PyDoc_STRVAR( pygpu_batch_draw_range_doc, ".. method:: draw_range(program, *, elem_start=0, elem_count=0)\n" "\n" - " Run the drawing program with the parameters assigned to the batch. Only draw\n" - " the `elem_count` elements of the index buffer starting at `elem_start` \n" + " Run the drawing program with the parameters assigned to the batch. " + "Only draw the ``elem_count`` elements of the index buffer starting at ``elem_start``.\n" "\n" " :arg program: Program that performs the drawing operations.\n" " :type program: :class:`gpu.types.GPUShader`\n" @@ -326,7 +326,7 @@ PyDoc_STRVAR( " will start from the first element of the index buffer.\n" " :type elem_start: int\n" " :arg elem_count: Number of elements of the index buffer to draw. When not\n" - " provided or set to 0 all elements from `elem_start` to the end of the\n" + " provided or set to 0 all elements from ``elem_start`` to the end of the\n" " index buffer will be drawn.\n" " :type elem_count: int\n"); static PyObject *pygpu_batch_draw_range(BPyGPUBatch *self, PyObject *args, PyObject *kw) diff --git a/source/blender/python/gpu/gpu_py_shader_create_info.cc b/source/blender/python/gpu/gpu_py_shader_create_info.cc index f548194d46c..16fa3780db6 100644 --- a/source/blender/python/gpu/gpu_py_shader_create_info.cc +++ b/source/blender/python/gpu/gpu_py_shader_create_info.cc @@ -247,7 +247,7 @@ PyDoc_STRVAR( pygpu_interface_info_smooth_doc, ".. method:: smooth(type, name)\n" "\n" - " Add an attribute with qualifier of type `smooth` to the interface block.\n" + " Add an attribute with qualifier of type *smooth* to the interface block.\n" "\n" " :arg type: One of these types:\n" "\n" PYDOC_TYPE_LIST @@ -273,7 +273,7 @@ PyDoc_STRVAR( pygpu_interface_info_flat_doc, ".. method:: flat(type, name)\n" "\n" - " Add an attribute with qualifier of type `flat` to the interface block.\n" + " Add an attribute with qualifier of type ``flat`` to the interface block.\n" "\n" " :arg type: One of these types:\n" "\n" PYDOC_TYPE_LIST @@ -299,7 +299,7 @@ PyDoc_STRVAR( pygpu_interface_info_no_perspective_doc, ".. method:: no_perspective(type, name)\n" "\n" - " Add an attribute with qualifier of type `no_perspective` to the interface block.\n" + " Add an attribute with qualifier of type ``no_perspective`` to the interface block.\n" "\n" " :arg type: One of these types:\n" "\n" PYDOC_TYPE_LIST @@ -638,12 +638,14 @@ PyDoc_STRVAR( pygpu_shader_info_uniform_buf_doc, ".. method:: uniform_buf(slot, type_name, name)\n" "\n" - " Specify a uniform variable whose type can be one of those declared in `typedef_source`.\n" + " Specify a uniform variable whose type can be one of those declared in " + ":meth:`gpu.types.GPUShaderCreateInfo.typedef_source`.\n" "\n" " :arg slot: The uniform variable index.\n" " :type slot: int\n" - " :arg type_name: Name of the data type. It can be a struct type defined in the source " - "passed through the :meth:`gpu.types.GPUShaderCreateInfo.typedef_source`.\n" + " :arg type_name: Name of the data type. " + "It can be a struct type defined in the source passed through the " + ":meth:`gpu.types.GPUShaderCreateInfo.typedef_source`.\n" " :type type_name: str\n" " :arg name: The uniform variable name.\n" " :type name: str\n"); diff --git a/source/blender/python/intern/bpy.cc b/source/blender/python/intern/bpy.cc index 7d6a08f0094..685874dfc43 100644 --- a/source/blender/python/intern/bpy.cc +++ b/source/blender/python/intern/bpy.cc @@ -452,7 +452,7 @@ PyDoc_STRVAR( ".. function:: unescape_identifier(string)\n" "\n" " Simple string un-escape function used for animation paths.\n" - " This performs the reverse of `escape_identifier`.\n" + " This performs the reverse of :func:`escape_identifier`.\n" "\n" " :arg string: text\n" " :type string: str\n" diff --git a/tests/performance/tests/sculpt.py b/tests/performance/tests/sculpt.py index 7822c0fdc50..2327ceca826 100644 --- a/tests/performance/tests/sculpt.py +++ b/tests/performance/tests/sculpt.py @@ -9,7 +9,7 @@ def set_view3d_context_override(context_override): """ Set context override to become the first viewport in the active workspace - The `context_override` is expected to be a copy of an actual current context + The ``context_override`` is expected to be a copy of an actual current context obtained by `context.copy()` """ diff --git a/tests/python/alembic_export_tests.py b/tests/python/alembic_export_tests.py index 5650c1071c0..e789e57210d 100644 --- a/tests/python/alembic_export_tests.py +++ b/tests/python/alembic_export_tests.py @@ -542,7 +542,7 @@ class InvisibleObjectExportTest(AbstractAlembicTest): This test only tests a small subset of the functionality that is required to export invisible objects. It just tests that the visibility property is written, and that it has the correct initial value. This is a limitation - caused by these tests relying on `abcls`. + caused by these tests relying on ``abcls``. """ @with_tempdir diff --git a/tests/python/bl_pyapi_prop_array.py b/tests/python/bl_pyapi_prop_array.py index 30262ae16bc..c0a06ed8a7b 100644 --- a/tests/python/bl_pyapi_prop_array.py +++ b/tests/python/bl_pyapi_prop_array.py @@ -21,7 +21,7 @@ id_type = bpy.types.Scene def seq_items_xform(data, xform_fn): """ - Recursively expand items using `xform_fn`. + Recursively expand items using ``xform_fn``. """ if hasattr(data, "__len__"): return tuple(seq_items_xform(v, xform_fn) for v in data) diff --git a/tests/python/view_layer/test_scene_write_read.py b/tests/python/view_layer/test_scene_write_read.py index 9d12dfbb22e..1f8d7f2e6d4 100644 --- a/tests/python/view_layer/test_scene_write_read.py +++ b/tests/python/view_layer/test_scene_write_read.py @@ -112,7 +112,7 @@ class UnitTesting(ViewLayerTesting): def test_scene_read_collections(self): """ See if read is working for scene collections - (run `test_scene_write_colections` first) + (run ``test_scene_write_colections`` first). """ import os @@ -129,7 +129,7 @@ class UnitTesting(ViewLayerTesting): def test_scene_read_layers(self): """ See if read is working for scene layers - (run `test_scene_write_layers` first) + (run ``test_scene_write_layers`` first). """ import os diff --git a/tests/utils/bl_run_operators_event_simulate.py b/tests/utils/bl_run_operators_event_simulate.py index fa5f01c66c7..fca474cc448 100644 --- a/tests/utils/bl_run_operators_event_simulate.py +++ b/tests/utils/bl_run_operators_event_simulate.py @@ -131,7 +131,7 @@ def find_main_area(ui_type=None): def gen_events_type_text(text): """ - Generate events to type in `text`. + Generate events to type in ``text``. """ for ch in text: kw_extra = {} diff --git a/tools/utils_maintenance/code_clean.py b/tools/utils_maintenance/code_clean.py index 9832245adfb..6f82b11a5d8 100755 --- a/tools/utils_maintenance/code_clean.py +++ b/tools/utils_maintenance/code_clean.py @@ -469,7 +469,7 @@ class edit_generators: class sizeof_fixed_array(EditGenerator): """ - Use fixed size array syntax with `sizeof`: + Use fixed size array syntax with ``sizeof``: Replace: sizeof(float) * 4 * 4 @@ -934,7 +934,7 @@ class edit_generators: class use_const_vars(EditGenerator): """ - Use `const` where possible: + Use ``const`` where possible: Replace: float abc[3] = {0, 1, 2}; @@ -1662,7 +1662,7 @@ def test_edit( verbose_edit_actions: bool, ) -> bool: """ - Return true if `data_test` has the same object output as `data`. + Return true if ``data_test`` has the same object output as ``data``. """ if os.path.exists(output): os.remove(output)