Cleanup: Pydoc strings

This commit is contained in:
Aaron Carlisle 2020-10-11 18:19:42 -04:00
parent e8a2931299
commit 1b575cbb75
4 changed files with 40 additions and 45 deletions

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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)