[Bf-blender-cvs] [72335d5e89d] master: Pydoc: Move builtin GPU shader information to code

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


Commit: 72335d5e89d9ecae5f08ab0d4076235a7f6b5f06
Author: Aaron Carlisle
Date:   Sun Oct 11 18:21:28 2020 -0400
Branches: master
https://developer.blender.org/rB72335d5e89d9ecae5f08ab0d4076235a7f6b5f06

Pydoc: Move builtin GPU shader information to code

This fixes a compile warning for sphinx.
This commit includes some reformating of the information.

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

D	doc/python_api/examples/gpu.shader.py
M	source/blender/python/gpu/gpu_py_shader.c

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

diff --git a/doc/python_api/examples/gpu.shader.py b/doc/python_api/examples/gpu.shader.py
deleted file mode 100644
index 3c72e70378c..00000000000
--- a/doc/python_api/examples/gpu.shader.py
+++ /dev/null
@@ -1,36 +0,0 @@
-"""
-Built-in shaders
-++++++++++++++++
-
-All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.
-The value of it can only be modified using the :class:`gpu.matrix` module.
-
-2D_UNIFORM_COLOR:
-   attributes: vec3 pos
-   uniforms: vec4 color
-
-2D_FLAT_COLOR:
-   attributes: vec3 pos, vec4 color
-   uniforms: -
-
-2D_SMOOTH_COLOR:
-   attributes: vec3 pos, vec4 color
-   uniforms: -
-
-2D_IMAGE:
-   attributes: vec3 pos, vec2 texCoord
-   uniforms: sampler2D image
-
-3D_UNIFORM_COLOR:
-   attributes: vec3 pos
-   uniforms: vec4 color
-
-3D_FLAT_COLOR:
-   attributes: vec3 pos, vec4 color
-   uniforms: -
-
-3D_SMOOTH_COLOR:
-   attributes: vec3 pos, vec4 color
-   uniforms: -
-
-"""
diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c
index 7734c80abc4..3748691c434 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -748,7 +748,34 @@ static struct PyMethodDef bpygpu_shader_module_methods[] = {
 };
 
 PyDoc_STRVAR(bpygpu_shader_module_doc,
-             "This module provides access to GPUShader internal functions.");
+             "This module provides access to GPUShader internal functions.\n"
+             "\n"
+             ".. rubric:: Built-in shaders\n"
+             "\n"
+             "All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.\n"
+             "The value of it can only be modified using the :class:`gpu.matrix` module.\n"
+             "\n"
+             "2D_UNIFORM_COLOR\n"
+             "   :Attributes: vec3 pos\n"
+             "   :Uniforms: vec4 color\n"
+             "2D_FLAT_COLOR\n"
+             "   :Attributes: vec3 pos, vec4 color\n"
+             "   :Uniforms: none\n"
+             "2D_SMOOTH_COLOR\n"
+             "   :Attributes: vec3 pos, vec4 color\n"
+             "   :Uniforms: none\n"
+             "2D_IMAGE\n"
+             "   :Attributes: vec3 pos, vec2 texCoord\n"
+             "   :Uniforms: sampler2D image\n"
+             "3D_UNIFORM_COLOR\n"
+             "   :Attributes: vec3 pos\n"
+             "   :Uniforms: vec4 color\n"
+             "3D_FLAT_COLOR\n"
+             "   :Attributes: vec3 pos, vec4 color\n"
+             "   :Uniforms: none\n"
+             "3D_SMOOTH_COLOR\n"
+             "   :Attributes: vec3 pos, vec4 color\n"
+             "   :Uniforms: none\n");
 static PyModuleDef BPyGPU_shader_module_def = {
     PyModuleDef_HEAD_INIT,
     .m_name = "gpu.shader",



More information about the Bf-blender-cvs mailing list