diff options
author | Germano Cavalcante <mano-wii> | 2022-04-21 18:40:30 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-04-21 18:52:38 +0300 |
commit | e2d8b6dc0633807b0f6864d6d0972e702813c33e (patch) | |
tree | 5627592b26a001eee8aef433302994d5e469a361 /source/blender/python | |
parent | f807e6effe742f67b8507199c6bbda325c97e7dd (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.c | 12 |
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); |