[Bf-blender-cvs] [1b575cbb75c] master: Cleanup: Pydoc strings

Aaron Carlisle noreply at git.blender.org
Mon Oct 12 00:24:11 CEST 2020


Commit: 1b575cbb75c3cfd402374a876c2e900f31dda791
Author: Aaron Carlisle
Date:   Sun Oct 11 18:19:42 2020 -0400
Branches: master
https://developer.blender.org/rB1b575cbb75c3cfd402374a876c2e900f31dda791

Cleanup: Pydoc strings

===================================================================

M	source/blender/python/gpu/gpu_py_batch.c
M	source/blender/python/gpu/gpu_py_offscreen.c
M	source/blender/python/gpu/gpu_py_shader.c
M	source/blender/python/gpu/gpu_py_vertex_format.c

===================================================================

diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c
index 60b78b51890..81d1cb7055d 100644
--- a/source/blender/python/gpu/gpu_py_batch.c
+++ b/source/blender/python/gpu/gpu_py_batch.c
@@ -172,8 +172,8 @@ PyDoc_STRVAR(
     "\n"
     "   Assign a shader to this batch that will be used for drawing when not overwritten later.\n"
     "   Note: This method has to be called in the draw context that the batch will be drawn in.\n"
-    "   This function does not need to be called when you always set the shader when calling "
-    "`batch.draw`.\n"
+    "   This function does not need to be called when you always\n"
+    "   set the shader when calling :meth:`gpu.types.GPUBatch.draw`.\n"
     "\n"
     "   :param program: The program/shader the batch will use in future draw calls.\n"
     "   :type program: :class:`gpu.types.GPUShader`\n");
diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c
index 31440dadd03..d6548834f2d 100644
--- a/source/blender/python/gpu/gpu_py_offscreen.c
+++ b/source/blender/python/gpu/gpu_py_offscreen.c
@@ -140,8 +140,8 @@ PyDoc_STRVAR(
     ".. method:: bind(save=True)\n"
     "\n"
     "   Bind the offscreen object.\n"
-    "   To make sure that the offscreen gets unbind whether an exception occurs or not, pack it "
-    "into a `with` statement.\n"
+    "   To make sure that the offscreen gets unbind whether an exception occurs or not,\n"
+    "   pack it into a `with` statement.\n"
     "\n"
     "   :arg save: Save the current OpenGL state, so that it can be restored when unbinding.\n"
     "   :type save: `bool`\n");
diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c
index 55753e91f14..7734c80abc4 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -231,15 +231,13 @@ PyDoc_STRVAR(bpygpu_shader_uniform_vector_float_doc,
              "   :type location: int\n"
              "   :param buffer:  The data that should be set. Can support the buffer protocol.\n"
              "   :type buffer: sequence of floats\n"
-             "   :param length: Size of the uniform data type:\n"
-             "\n"
+             "   :param length: Size of the uniform data type:\n\n"
              "      - 1: float\n"
              "      - 2: vec2 or float[2]\n"
              "      - 3: vec3 or float[3]\n"
              "      - 4: vec4 or float[4]\n"
              "      - 9: mat3\n"
              "      - 16: mat4\n"
-             "\n"
              "   :type length: int\n"
              "   :param count: Specifies the number of elements, vector or matrices that are to "
              "be modified.\n"
@@ -597,22 +595,20 @@ PyDoc_STRVAR(
     "   GPUShader combines multiple GLSL shaders into a program used for drawing.\n"
     "   It must contain a vertex and fragment shaders, with an optional geometry shader.\n"
     "\n"
-    "   The GLSL #version directive is automatically included at the top of shaders, and set to "
-    "330.\n"
-    "   Some preprocessor directives are automatically added according to the Operating System or "
-    "availability:\n"
-    "   ``GPU_ATI``, ``GPU_NVIDIA`` and ``GPU_INTEL``.\n"
+    "   The GLSL ``#version`` directive is automatically included at the top of shaders,\n"
+    "   and set to 330. Some preprocessor directives are automatically added according to\n"
+    "   the Operating System or availability: ``GPU_ATI``, ``GPU_NVIDIA`` and ``GPU_INTEL``.\n"
     "\n"
     "   The following extensions are enabled by default if supported by the GPU:\n"
-    "   ``GL_ARB_texture_gather``, ``GL_ARB_texture_cube_map_array`` and "
-    "``GL_ARB_shader_draw_parameters``.\n"
+    "   ``GL_ARB_texture_gather``, ``GL_ARB_texture_cube_map_array``\n"
+    "   and ``GL_ARB_shader_draw_parameters``.\n"
     "\n"
-    "   To debug shaders, use the ``--debug-gpu-shaders`` command line option "
-    "to see full GLSL shader compilation and linking errors.\n"
+    "   To debug shaders, use the ``--debug-gpu-shaders`` command line option\n"
+    "   to see full GLSL shader compilation and linking errors.\n"
     "\n"
-    "   For drawing user interface elements and gizmos, use "
-    "``fragOutput = blender_srgb_to_framebuffer_space(fragOutput)`` "
-    "to transform the output sRGB colors to the frame-buffer color-space."
+    "   For drawing user interface elements and gizmos, use\n"
+    "   ``fragOutput = blender_srgb_to_framebuffer_space(fragOutput)``\n"
+    "   to transform the output sRGB colors to the frame-buffer color-space.\n"
     "\n"
     "   :param vertexcode: Vertex shader code.\n"
     "   :type vertexcode: str\n"
@@ -655,19 +651,19 @@ PyDoc_STRVAR(bpygpu_shader_from_builtin_doc,
              ".. function:: from_builtin(shader_name)\n"
              "\n"
              "   Shaders that are embedded in the blender internal code.\n"
-             "   They all read the uniform 'mat4 ModelViewProjectionMatrix', which can be edited "
-             "by the 'gpu.matrix' module.\n"
-             "   For more details, you can check the shader code with the function "
-             "'gpu.shader.code_from_builtin';\n"
+             "   They all read the uniform ``mat4 ModelViewProjectionMatrix``,\n"
+             "   which can be edited by the :mod:`gpu.matrix` module.\n"
+             "   For more details, you can check the shader code with the\n"
+             "   :func:`gpu.shader.code_from_builtin` function.\n"
              "\n"
-             "   :param shader_name: One of these builtin shader names: {\n"
-             "       '2D_UNIFORM_COLOR',\n"
-             "       '2D_FLAT_COLOR',\n"
-             "       '2D_SMOOTH_COLOR',\n"
-             "       '2D_IMAGE',\n"
-             "       '3D_UNIFORM_COLOR',\n"
-             "       '3D_FLAT_COLOR',\n"
-             "       '3D_SMOOTH_COLOR'}\n"
+             "   :param shader_name: One of these builtin shader names:\n\n"
+             "      - ``2D_UNIFORM_COLOR``\n"
+             "      - ``2D_FLAT_COLOR``\n"
+             "      - ``2D_SMOOTH_COLOR``\n"
+             "      - ``2D_IMAGE``\n"
+             "      - ``3D_UNIFORM_COLOR``\n"
+             "      - ``3D_FLAT_COLOR``\n"
+             "      - ``3D_SMOOTH_COLOR``\n"
              "   :type shader_name: str\n"
              "   :return: Shader object corresponding to the given name.\n"
              "   :rtype: :class:`bpy.types.GPUShader`\n");
@@ -691,14 +687,14 @@ PyDoc_STRVAR(bpygpu_shader_code_from_builtin_doc,
              "\n"
              "   Exposes the internal shader code for query.\n"
              "\n"
-             "   :param shader_name: One of these builtin shader names: {\n"
-             "       '2D_UNIFORM_COLOR',\n"
-             "       '2D_FLAT_COLOR',\n"
-             "       '2D_SMOOTH_COLOR',\n"
-             "       '2D_IMAGE',\n"
-             "       '3D_UNIFORM_COLOR',\n"
-             "       '3D_FLAT_COLOR',\n"
-             "       '3D_SMOOTH_COLOR'}\n"
+             "   :param shader_name: One of these builtin shader names:\n\n"
+             "      - ``2D_UNIFORM_COLOR``\n"
+             "      - ``2D_FLAT_COLOR``\n"
+             "      - ``2D_SMOOTH_COLOR``\n"
+             "      - ``2D_IMAGE``\n"
+             "      - ``3D_UNIFORM_COLOR``\n"
+             "      - ``3D_FLAT_COLOR``\n"
+             "      - ``3D_SMOOTH_COLOR``\n"
              "   :type shader_name: str\n"
              "   :return: Vertex, fragment and geometry shader codes.\n"
              "   :rtype: dict\n");
diff --git a/source/blender/python/gpu/gpu_py_vertex_format.c b/source/blender/python/gpu/gpu_py_vertex_format.c
index 1cbcaba6bfb..2d45eadcfe3 100644
--- a/source/blender/python/gpu/gpu_py_vertex_format.c
+++ b/source/blender/python/gpu/gpu_py_vertex_format.c
@@ -168,14 +168,13 @@ PyDoc_STRVAR(
     "   :param comp_type: The data type that will be used store the value in memory.\n"
     "      Possible values are `I8`, `U8`, `I16`, `U16`, `I32`, `U32`, `F32` and `I10`.\n"
     "   :type comp_type: `str`\n"
-    "   :param len: How many individual values the attribute consists of (e.g. 2 for uv "
-    "coordinates).\n"
+    "   :param len: How many individual values the attribute consists of\n"
+    "      (e.g. 2 for uv coordinates).\n"
     "   :type len: int\n"
     "   :param fetch_mode: How values from memory will be converted when used in the shader.\n"
-    "      This is mainly useful for memory optimizations when you want to store values with "
-    "reduced precision.\n"
-    "      E.g. you can store a float in only 1 byte but it will be converted to a normal 4 byte "
-    "float when used.\n"
+    "      This is mainly useful for memory optimizations when you want to store values with\n"
+    "      reduced precision. E.g. you can store a float in only 1 byte but it will be\n"
+    "      converted to a normal 4 byte float when used.\n"
     "      Possible values are `FLOAT`, `INT`, `INT_TO_FLOAT_UNIT` and `INT_TO_FLOAT`.\n"
     "   :type fetch_mode: `str`\n");
 static PyObject *bpygpu_VertFormat_attr_add(BPyGPUVertFormat *self, PyObject *args, PyObject *kwds)



More information about the Bf-blender-cvs mailing list