diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-25 06:35:39 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-25 06:35:39 +0300 |
commit | d46647040d91c68bc8089b3c0b392d89a1bba4a6 (patch) | |
tree | be0098600d8c5b2a837390972c867d9a6865e087 /source/blender/python | |
parent | ceff1c2f65459b9eb6b12c3baff5f7af360ae738 (diff) |
PyDoc: fix generated output for gpu.shader
Inclining built-in shader descriptions used the wrong indentation level.
Link to the built-in shaders instead which avoids the indentation error
and de-duplicates the list which is already shown on the page.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/gpu/gpu_py_shader.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index 80c48e31510..d7369731a98 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -752,28 +752,27 @@ static PyObject *pygpu_shader_unbind(BPyGPUShader *UNUSED(self)) Py_RETURN_NONE; } -PyDoc_STRVAR(pygpu_shader_from_builtin_doc, - ".. function:: from_builtin(shader_name, config='DEFAULT')\n" - "\n" - " Shaders that are embedded in the blender internal code:\n" - "" PYDOC_BUILTIN_SHADER_DESCRIPTION - "\n" - " They all read the uniform ``mat4 ModelViewProjectionMatrix``,\n" - " which can be edited by the :mod:`gpu.matrix` module.\n" - "\n" - " You can also choose a shader configuration that uses clip_planes by setting the " - "``CLIPPED`` value to the config parameter. Note that in this case you also need to " - "manually set the value of ``mat4 ModelMatrix``.\n" - "\n" - " :param shader_name: One of the builtin shader names.\n" - " :type shader_name: str\n" - " :param config: One of these types of shader configuration:\n" - "\n" - " - ``DEFAULT``\n" - " - ``CLIPPED``\n" - " :type config: str\n" - " :return: Shader object corresponding to the given name.\n" - " :rtype: :class:`bpy.types.GPUShader`\n"); +PyDoc_STRVAR( + pygpu_shader_from_builtin_doc, + ".. function:: from_builtin(shader_name, config='DEFAULT')\n" + "\n" + " Shaders that are embedded in the blender internal code (see :ref:`built-in-shaders`).\n" + " They all read the uniform ``mat4 ModelViewProjectionMatrix``,\n" + " which can be edited by the :mod:`gpu.matrix` module.\n" + "\n" + " You can also choose a shader configuration that uses clip_planes by setting the " + "``CLIPPED`` value to the config parameter. Note that in this case you also need to " + "manually set the value of ``mat4 ModelMatrix``.\n" + "\n" + " :param shader_name: One of the builtin shader names.\n" + " :type shader_name: str\n" + " :param config: One of these types of shader configuration:\n" + "\n" + " - ``DEFAULT``\n" + " - ``CLIPPED``\n" + " :type config: str\n" + " :return: Shader object corresponding to the given name.\n" + " :rtype: :class:`bpy.types.GPUShader`\n"); static PyObject *pygpu_shader_from_builtin(PyObject *UNUSED(self), PyObject *args, PyObject *kwds) { BPYGPU_IS_INIT_OR_ERROR_OBJ; @@ -854,6 +853,8 @@ static struct PyMethodDef pygpu_shader_module__tp_methods[] = { PyDoc_STRVAR(pygpu_shader_module__tp_doc, "This module provides access to GPUShader internal functions.\n" "\n" + ".. _built-in-shaders:\n" + "\n" ".. rubric:: Built-in shaders\n" "\n" "All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.\n" |