Commit Graph

113 Commits

Author SHA1 Message Date
Campbell Barton
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Campbell Barton
42a6b2fd06 Cleanup: move public doc-strings into headers for 'python' 2021-12-02 22:53:44 +11:00
Campbell Barton
1d8648b13a Cleanup: repeated terms in code comments & error messages 2021-06-28 15:46:08 +10:00
Campbell Barton
f1e4903854 Cleanup: full sentences in comments, improve comment formatting 2021-06-26 21:50:48 +10:00
Clément Foucault
d39043b5ae Revert "Revert "BGL: Workaround broken bgl usage caused by GPU refactor""
This reverts commit f23bf4cb10.
2020-10-09 16:33:59 +02:00
Clément Foucault
f23bf4cb10 Revert "BGL: Workaround broken bgl usage caused by GPU refactor"
This reverts commit f12b0373f3.
2020-10-08 17:58:38 +02:00
Clément Foucault
f12b0373f3 BGL: Workaround broken bgl usage caused by GPU refactor
This directly adress the issues caused by rB536c2e0ec916.

Since the state tracking is done at a lower level, using the bgl
functions needs to be safegarded by the state manager.
The current workaround is to bypass `apply_state` when inside a
callback that used a `bgl` function.

Related to T80730.

This fix T81003.

Also this fix the default blend equation for callbacks.
Fixes T80169 T81289.
2020-10-08 16:36:17 +02:00
Clément Foucault
6432fa488a Cleanup: Remove GLEW dependencies outside of GL module 2020-09-12 15:51:21 +02:00
Campbell Barton
efa7aaa97f Cleanup: use const variables where possible in the Python API 2020-08-20 16:10:13 +10:00
Sybren A. Stüvel
3090b52f8c Cleanup: PyBGL, Clang-Tidy readability-function-size fixes
This addresses warnings from Clang-Tidy's `readability-function-size`
rule in the `source/blender/python` module.

It's just `BPyInit_bgl()` that's been split up into one or two smaller
functions per OpenGL version.

No functional changes.
2020-08-07 15:54:28 +02:00
Sybren A. Stüvel
3d48d99647 Cleanup: Python, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/python` module.

No functional changes.
2020-08-07 13:38:07 +02:00
Jacques Lucke
725973485a Clang Tidy: enable readability-non-const-parameter warning
Clang Tidy reported a couple of false positives. I disabled
those `NOLINTNEXTLINE`.

Differential Revision: https://developer.blender.org/D8199
2020-07-13 11:27:09 +02:00
Campbell Barton
2a6df7dfe5 Cleanup: use named unsigned types in the Python API 2020-02-20 15:40:05 +11:00
Campbell Barton
9a9f39e466 Cleanup: remove redundant 'char *' casts 2019-12-20 10:42:57 +11:00
Jacques Lucke
87ebc4ef4f Fix T70060: Add bgl wrapper for glVertexAttribIPointer 2019-09-19 12:54:37 +02:00
Brecht Van Lommel
5cfeba72f1 Python API: allow passing integer to some BGL functions instead of bgl.Buffer
These parameters can be both pointers and offsets into a bound buffer, so we
need to support both even if it's possible to cause crashes this way.
2019-04-18 14:28:37 +02:00
Campbell Barton
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton
dbc058301b Cleanup: trailing commas 2019-04-16 16:40:47 +02:00
Campbell Barton
25ec4b437f Cleanup: style, use braces for the Python API 2019-03-30 07:14:28 +11:00
Brecht Van Lommel
85915ae1aa Python API: allow passing None to some BGL functions instead of bgl.Buffer
Many OpenGL functions take NULL pointers, passing those was quite complicated
with some addons even using ctypes to manipulate internal bgl.Buffer pointers.
2019-03-26 19:56:43 +01:00
Campbell Barton
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
Campbell Barton
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton
f20dbc293f Cleanup: blank lines over doxy headers 2019-01-26 21:43:24 +11:00
Campbell Barton
8a61ea7296 Cleanup: add trailing commas
Prevents clang-format merging into a single line.
2019-01-19 13:58:35 +11:00
Campbell Barton
0373ff5e9c Cleanup: end bgl macros w/ semicolon
Needed for clang-format.
2019-01-10 12:38:11 +11:00
Campbell Barton
d022794cad Cleanup: rename checks for Python struct strings
Using 'format' prefix made this read as if t was for string formatting.

Use 'PyC_StructFmt' prefix instead since these values are compatible
with formatting from Python's 'struct' module.
2018-10-08 08:37:32 +11:00
mano-wii
91bfea5b05 CPython: py_capi_utils: use more descriptive names for format string utilities. 2018-10-07 12:21:09 -03:00
mano-wii
495a7128cb Cleanup: use the naming convention in py_capi_utils
And use inline functions instead of preprocessor directives.
2018-10-06 01:15:15 -03:00
mano-wii
0f55334413 Cleanup: use new format string utility 2018-10-06 00:13:54 -03:00
mano-wii
9682e43bf9 BGL: Wrap glBlitFramebuffer 2018-09-24 13:12:50 -03:00
Campbell Barton
5b64301834 Merge branch 'master' into blender2.8 2018-06-04 09:06:14 +02:00
Campbell Barton
7719c11006 Cleanup: strip trailing space in Python module 2018-06-04 08:54:40 +02:00
Germano
b107e77e46 BGL: Expose OpenGL API for FrameBuffers and RenderBuffers. 2018-04-14 02:25:18 -03:00
Antony Riakiotakis
4db67aab06 Fix OpenGL extension report in system info operator. 2017-10-23 22:22:22 +03:00
Campbell Barton
54f9a6e5da Merge branch 'master' into blender2.8 2017-10-18 16:40:31 +11:00
Germano
0a435d49ba Fix T53074: Use the pybuffer->itemsize to get the corresponding GLtype
It seems that `typestr` does not always define the final size of the element. And it varies by operating system.

Then use the `typestr` only to know the itemtype is `float` type or not.
2017-10-17 12:06:52 -02:00
Campbell Barton
ea606a7847 Merge branch 'master' into blender28 2017-10-06 21:25:33 +11:00
Campbell Barton
c454d816a9 Cleanup: style 2017-10-06 16:56:41 +11:00
Sergey Sharybin
7fdb9e168d Merge branch 'master' into blender2.8 2017-09-28 16:13:09 +05:00
Campbell Barton
1f18523edf Cleanup: switch fall-through warning 2017-09-28 13:41:54 +10:00
Germano
5c6e3ff497 bgl module: extend gl_buffer_type_from_py_format_char function to work with more string formats
Only basic types of character codes were being used
2017-09-27 16:07:06 -03:00
Campbell Barton
cc8c064f11 Merge branch 'master' into blender2.8 2017-09-28 03:05:46 +10:00
Campbell Barton
6c98859b77 Cleanup: warning 2017-09-28 02:04:58 +10:00
Germano
2de5e14f53 bgl module: Interpret a buffer as a bgl.Buffer
Differential Revision: https://developer.blender.org/D2857
2017-09-27 11:20:00 -03:00
Dalai Felinto
e5bf726f44 BGL: Remove deprecated enums
Note: The enums that are deprecated and supported are still there
2017-04-18 16:02:17 +02:00
Mike Erwin
b4157dedb0 OpenGL: remove packed imm mode functions from Python API
These are from the ARB_vertex_type_2_10_10_10_rev extension that became part of OpenGL 3.3.

So they are new, but only exist for compatibility with immediate mode, which is old.

Related to T49165 (general OpenGL upgrade)
2017-03-13 14:08:03 -04:00
Mike Erwin
0e40f1bac4 OpenGL: remove GLU functions from Python API
Part of T49042
2017-03-13 14:08:03 -04:00
Campbell Barton
c1f43c9dc6 Cleanup: warnings 2017-03-02 00:36:33 +11:00