Commit Graph

22 Commits

Author SHA1 Message Date
Falk David
4901f38400 Fix: GPU: Crash in pygpu_batch_draw
Introduced by `3d8854b021195fdb253c85133b1db350d3d4c753`.
`py_shader` could still be `nullptr` and needs to be checked.
2025-05-23 12:31:08 +02:00
Clément Foucault
3d8854b021 Fix #138823: GPU: Python: Incorrect color when using widelines
Add a deprecation warning and a helper to draw with
polyline shaders.

Pull Request: https://projects.blender.org/blender/blender/pulls/139216
2025-05-22 12:42:56 +02:00
Jeroen Bakker
41a69b76a6 Partial Fix #129592: Vulkan: Add support for line size
Add-ons can call a batch draw command for lines using a surface shader.
This is not intended and polylines shaders should be used. This PR
lighten this restriction to automatically replace the shader with the
correct polyline shader, similar to immediate mode.

This change is done inside the python wrapper as internally we should
use the correct polyline shader.

For point shaders we don't have a work around in place and that needs
more discussion. Therefore this is only a partial fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/138138
2025-05-01 15:44:40 +02:00
Campbell Barton
43af16a4c1 Cleanup: spelling in comments, correct comment block formatting
Also use doxygen comments more consistently.
2025-05-01 11:44:33 +10:00
Campbell Barton
e3d6051181 Cleanup: suppress cast-function-type warnings for CLANG
Extend the existing GCC pragma's and add the warning suppression
for Cycles & Freestyle.
2025-04-01 12:06:03 +11:00
Brecht Van Lommel
27accea53e Cleanup: Various clang-tidy warnings in python
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:18 +01:00
Germano Cavalcante
179f2a3cb1 PyGPU: Show error for unsupported POLYLINE shader configurations
In Blender 4.4 (since commit 00a8d006fe), polyline shaders stopped
using geometry shaders and now rely on SSBOs.

In C++, workarounds allow these shaders to function as before, albeit
with some limitations.

To address these known limitations, error messages are now raised when
a polyline shader is used with unsupported configurations.

Pull Request: https://projects.blender.org/blender/blender/pulls/131055
2024-12-11 20:39:25 +01:00
Germano Cavalcante
93e3da136f PyGPU: Rename 'program' to 'shader' in documentation for 'GPUBatch.draw'
Renaming 'program' to 'shader' makes the documentation clearer.
2024-12-11 20:39:24 +01:00
Campbell Barton
b00550916c PyDoc: correct use of single back-ticks 2024-11-03 21:50:33 +11:00
Bastien Montagne
c3247aa4f0 Refactor: Move BPY generic headers to proper C++ ones.
NOTE: `bgl.h` was left unchanged, as it is deprecated code anyway, and
its conversion to C++ does not seem immediately trivial.
2024-09-25 18:04:27 +02:00
Brecht Van Lommel
da9f586748 Fix #104061: Python GPU module unusable after too early import
Add-ons may attempt to load the GPU module in background mode when no GPU
context has been initialized yet. This would give an error on import.

If then later the GPU context does get initialized, for example for a
render engine, import would still fail as the module is cached.

This reverts commit d7f124f06f, and again
throws errors in methods and constructors instead of module import.

Pull Request: https://projects.blender.org/blender/blender/pulls/123395
2024-06-19 17:54:35 +02:00
Hans Goudey
893130e6fe Refactor: Remove unnecessary C wrapper for GPUBatch class
Similar to fe76d8c946

Pull Request: https://projects.blender.org/blender/blender/pulls/119898
2024-03-26 03:06:25 +01:00
Hans Goudey
1dc16f909d Cleanup: Move GPU Python headers to C++ 2024-03-23 10:06:45 -04:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00
Prakhar Singh Chouhan
4ce13fe198 Python: Add deprecation warnings to GPUBatch program usage
Calls to `gpu.types.GPUBatch.draw#program` without a program parameter,
or a None as value of the program parameter now raises a deprecation warning.

Implements #103978
2024-03-04 08:32:51 +01:00
Campbell Barton
7436b578dd Cleanup: force wrapping all uses of PyDoc_STRVAR
Without this, minor edits can re-indent the whole doc-string at a
different level, causing diffs to be unnecessary noisy.
2024-01-25 10:22:16 +11:00
Campbell Barton
a6837ac517 PyAPI: support building with the up-coming Python 3.12
- Account for new member in _PyArg_Parser.

- Many Python op-codes have been removed.
  For the moment these are disabled in is_opcode_secure.
  Some should be added back as intrinsics, noted in code-comments.
2023-08-30 14:08:56 +10:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
de391cf811 Cleanup: use nullptr instead of zero 2023-08-03 19:17:43 +10:00
Campbell Barton
d1aac3b08c Cleanup: various non-functional changes for C++ (python, makesrna)
- Remove redundant void, struct.
- Use function style casts.
2023-07-22 11:33:36 +10:00
Campbell Barton
056a7bbb5c Cleanup: ignore GCC cast-function-type warning for PyMethodDef's
PyMethodDef::ml_flags define the function signature making the warning
meaningless.
2023-07-22 11:13:55 +10:00
Jacques Lucke
ec05e5a3fc Python: move remaining python files to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110352
2023-07-21 19:41:03 +02:00