Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <mano-wii>2022-04-21 18:40:30 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-04-21 18:52:38 +0300
commite2d8b6dc0633807b0f6864d6d0972e702813c33e (patch)
tree5627592b26a001eee8aef433302994d5e469a361 /source/blender/python
parentf807e6effe742f67b8507199c6bbda325c97e7dd (diff)
gpu.types.GPUBatch: warn about deprecated primitive types
As `GPU_PRIM_LINE_LOOP` is not supported on Vulkan or Metal and `GPU_PRIM_TRI_FAN` is not supported on Metal, they will be removed in future releases. So it is important to inform users that they are obsolete and may not be supported for a long time. Release Notes: https://wiki.blender.org/wiki/Reference/Release_Notes/3.2/Python_API Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D14679
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/gpu/gpu_py_batch.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c
index 232d4775746..02bcf80aa5d 100644
--- a/source/blender/python/gpu/gpu_py_batch.c
+++ b/source/blender/python/gpu/gpu_py_batch.c
@@ -82,6 +82,18 @@ static PyObject *pygpu_batch__tp_new(PyTypeObject *UNUSED(type), PyObject *args,
}
BLI_assert(prim_type.value_found != GPU_PRIM_NONE);
+ if (prim_type.value_found == GPU_PRIM_LINE_LOOP) {
+ PyErr_WarnEx(PyExc_DeprecationWarning,
+ "'LINE_LOOP' is deprecated. Please use 'LINE_STRIP' and close the segment.",
+ 1);
+ }
+ else if (prim_type.value_found == GPU_PRIM_TRI_FAN) {
+ PyErr_WarnEx(
+ PyExc_DeprecationWarning,
+ "'TRI_FAN' is deprecated. Please use 'TRI_STRIP' or 'TRIS' and try modifying your "
+ "vertices or indices to match the topology.",
+ 1);
+ }
if (py_vertbuf == NULL) {
PyErr_Format(PyExc_TypeError, exc_str_missing_arg, _keywords[1], 2);