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.
This commit is contained in:
Campbell Barton 2022-05-25 13:35:39 +10:00
parent ceff1c2f65
commit d46647040d
1 changed files with 23 additions and 22 deletions

View File

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