diff options
author | mano-wii <germano.costa@ig.com.br> | 2018-09-06 03:10:42 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2018-09-06 03:15:44 +0300 |
commit | 6d04e48539ce50f0de9cc73a36e7733aee608773 (patch) | |
tree | ff2784a4b1e31773610fedc78a3efda625a23bc6 /source/blender/python/gpu/gpu_py_api.c | |
parent | b0602483249d1184f2672cd5d5578955560335b5 (diff) |
Join the python modules `gpu` and `_gpu` into one.
Maybe it's still early to set the new drawing api for python.
But joining these two modules is an initial step.
```
>>> gpu.
matrix
select
types
```
```
>>> gpu.types.GPU
Batch(
OffScreen(
VertBuf(
VertFormat(
```
The creation of a new offscreen object is now done by the `GPUOffscreen.__new__` method.
Reviewers: campbellbarton, dfelinto
Reviewed By: campbellbarton, dfelinto
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D3667
Diffstat (limited to 'source/blender/python/gpu/gpu_py_api.c')
-rw-r--r-- | source/blender/python/gpu/gpu_py_api.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/source/blender/python/gpu/gpu_py_api.c b/source/blender/python/gpu/gpu_py_api.c index 53285b372d8..fc1e7390ffe 100644 --- a/source/blender/python/gpu/gpu_py_api.c +++ b/source/blender/python/gpu/gpu_py_api.c @@ -19,31 +19,44 @@ */ /** \file blender/python/gpu/gpu_py_api.c - * \ingroup pygpu + * \ingroup bpygpu * * Experimental Python API, not considered public yet (called '_gpu'), * we may re-expose as public later. + * + * - Use ``bpygpu_`` for local API. + * - Use ``BPyGPU`` for public API. */ #include <Python.h> -#include "GPU_batch.h" -#include "GPU_vertex_format.h" - -#include "gpu_py_api.h" -#include "gpu_py_types.h" - #include "BLI_utildefines.h" #include "../generic/python_utildefines.h" +#include "gpu_py_matrix.h" +#include "gpu_py_select.h" +#include "gpu_py_types.h" + +#include "gpu_py_api.h" /* own include */ + PyDoc_STRVAR(GPU_doc, -"This module provides access to gpu drawing functions." +"This module to provide functions concerning the GPU implementation in Blender." +"\n\n" +"Submodules:\n" +"\n" +".. toctree::\n" +" :maxdepth: 1\n" +"\n" +" gpu.types.rst\n" +" gpu.matrix.rst\n" +" gpu.select.rst\n" +"\n" ); static struct PyModuleDef GPU_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "_gpu", /* m_name */ - .m_doc = GPU_doc, /* m_doc */ + .m_name = "gpu", + .m_doc = GPU_doc, }; PyObject *BPyInit_gpu(void) @@ -54,10 +67,17 @@ PyObject *BPyInit_gpu(void) mod = PyModule_Create(&GPU_module_def); - /* _gpu.types */ PyModule_AddObject(mod, "types", (submodule = BPyInit_gpu_types())); PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); Py_INCREF(submodule); + PyModule_AddObject(mod, "matrix", (submodule = BPyInit_gpu_matrix())); + PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); + Py_INCREF(submodule); + + PyModule_AddObject(mod, "select", (submodule = BPyInit_gpu_select())); + PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); + Py_INCREF(submodule); + return mod; } |